comparison src/xmenu.c @ 10757:2829c9840b0e

(xmenu_show, both versions): New arg for_click. (Fx_popup_menu): Compute it and pass it.
author Richard M. Stallman <rms@gnu.org>
date Wed, 15 Feb 1995 08:06:32 +0000
parents 7418dce6e52a
children 1745fca9370a
comparison
equal deleted inserted replaced
10756:f0cd1c0ac565 10757:2829c9840b0e
729 int i, j; 729 int i, j;
730 FRAME_PTR f; 730 FRAME_PTR f;
731 Lisp_Object x, y, window; 731 Lisp_Object x, y, window;
732 int keymaps = 0; 732 int keymaps = 0;
733 int menubarp = 0; 733 int menubarp = 0;
734 int for_click = 0;
734 struct gcpro gcpro1; 735 struct gcpro gcpro1;
735 736
736 if (! NILP (position)) 737 if (! NILP (position))
737 { 738 {
738 check_x (); 739 check_x ();
766 x = Fcar (tem); 767 x = Fcar (tem);
767 y = Fcar (Fcdr (tem)); 768 y = Fcar (Fcdr (tem));
768 } 769 }
769 else 770 else
770 { 771 {
772 for_click = 1;
771 tem = Fcar (Fcdr (position)); /* EVENT_START (position) */ 773 tem = Fcar (Fcdr (position)); /* EVENT_START (position) */
772 window = Fcar (tem); /* POSN_WINDOW (tem) */ 774 window = Fcar (tem); /* POSN_WINDOW (tem) */
773 tem = Fcar (Fcdr (Fcdr (tem))); /* POSN_WINDOW_POSN (tem) */ 775 tem = Fcar (Fcdr (Fcdr (tem))); /* POSN_WINDOW_POSN (tem) */
774 x = Fcar (tem); 776 x = Fcar (tem);
775 y = Fcdr (tem); 777 y = Fcdr (tem);
888 } 890 }
889 891
890 /* Display them in a menu. */ 892 /* Display them in a menu. */
891 BLOCK_INPUT; 893 BLOCK_INPUT;
892 894
893 selection = xmenu_show (f, xpos, ypos, menubarp, 895 selection = xmenu_show (f, xpos, ypos, menubarp, for_click,
894 keymaps, title, &error_name); 896 keymaps, title, &error_name);
895 UNBLOCK_INPUT; 897 UNBLOCK_INPUT;
896 898
897 discard_menu_items (); 899 discard_menu_items ();
898 900
1524 Both assume input is blocked by the caller. */ 1526 Both assume input is blocked by the caller. */
1525 1527
1526 /* F is the frame the menu is for. 1528 /* F is the frame the menu is for.
1527 X and Y are the frame-relative specified position, 1529 X and Y are the frame-relative specified position,
1528 relative to the inside upper left corner of the frame F. 1530 relative to the inside upper left corner of the frame F.
1529 MENUBARP is 1 if the click that asked for this menu came from the menu bar. 1531 MENUBARP is 1 if this menu came from the menu bar.
1532 FOR_CLICK if this menu was invoked for a mouse click.
1530 KEYMAPS is 1 if this menu was specified with keymaps; 1533 KEYMAPS is 1 if this menu was specified with keymaps;
1531 in that case, we return a list containing the chosen item's value 1534 in that case, we return a list containing the chosen item's value
1532 and perhaps also the pane's prefix. 1535 and perhaps also the pane's prefix.
1533 TITLE is the specified menu title. 1536 TITLE is the specified menu title.
1534 ERROR is a place to store an error message string in case of failure. 1537 ERROR is a place to store an error message string in case of failure.
1555 { 1558 {
1556 menu_item_selection = (Lisp_Object *) client_data; 1559 menu_item_selection = (Lisp_Object *) client_data;
1557 } 1560 }
1558 1561
1559 static Lisp_Object 1562 static Lisp_Object
1560 xmenu_show (f, x, y, menubarp, keymaps, title, error) 1563 xmenu_show (f, x, y, menubarp, for_click, keymaps, title, error)
1561 FRAME_PTR f; 1564 FRAME_PTR f;
1562 int x; 1565 int x;
1563 int y; 1566 int y;
1564 int menubarp; /* This arg is unused in Xt version. */ 1567 int menubarp; /* This arg is unused in Xt version. */
1568 int for_click;
1565 int keymaps; 1569 int keymaps;
1566 Lisp_Object title; 1570 Lisp_Object title;
1567 char **error; 1571 char **error;
1568 { 1572 {
1569 int i; 1573 int i;
2073 return Qnil; 2077 return Qnil;
2074 } 2078 }
2075 #else /* not USE_X_TOOLKIT */ 2079 #else /* not USE_X_TOOLKIT */
2076 2080
2077 static Lisp_Object 2081 static Lisp_Object
2078 xmenu_show (f, x, y, menubarp, keymaps, title, error) 2082 xmenu_show (f, x, y, menubarp, for_click, keymaps, title, error)
2079 FRAME_PTR f; 2083 FRAME_PTR f;
2080 int x, y; 2084 int x, y;
2085 int menubarp;
2086 int for_click;
2081 int keymaps; 2087 int keymaps;
2082 int menubarp;
2083 Lisp_Object title; 2088 Lisp_Object title;
2084 char **error; 2089 char **error;
2085 { 2090 {
2086 Window root; 2091 Window root;
2087 XMenu *menu; 2092 XMenu *menu;