diff options
| author | Karoly Lorentey | 2005-09-04 03:48:17 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2005-09-04 03:48:17 +0000 |
| commit | fbf349734468d48b421c3d03074bb66dfcf3115b (patch) | |
| tree | 0a7d1ee844b6c591a5a499d23e35931945106e5a /src/macmenu.c | |
| parent | f0caabd962b662cccbea472995d86af718cc8d0b (diff) | |
| parent | 4b5fa40e1f1ba3cafde672863a0331311d1c2695 (diff) | |
| download | emacs-fbf349734468d48b421c3d03074bb66dfcf3115b.tar.gz emacs-fbf349734468d48b421c3d03074bb66dfcf3115b.zip | |
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Patches applied:
* lorentey@elte.hu--2004/emacs--cvs-trunk--0--base-0
tag of miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-474
* lorentey@elte.hu--2004/emacs--cvs-trunk--0--patch-1
Add CVS metadata files.
* lorentey@elte.hu--2004/emacs--cvs-trunk--0--patch-2
Update from CVS.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-393
Diffstat (limited to 'src/macmenu.c')
| -rw-r--r-- | src/macmenu.c | 60 |
1 files changed, 38 insertions, 22 deletions
diff --git a/src/macmenu.c b/src/macmenu.c index ab266f6f0b5..a68ff04e405 100644 --- a/src/macmenu.c +++ b/src/macmenu.c | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | /* Menu support for GNU Emacs on the for Mac OS. | 1 | /* Menu support for GNU Emacs on the for Mac OS. |
| 2 | Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc. | 2 | Copyright (C) 2000, 2001, 2002, 2003, 2004, |
| 3 | 2005 Free Software Foundation, Inc. | ||
| 3 | 4 | ||
| 4 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 5 | 6 | ||
| @@ -611,37 +612,48 @@ cleanup_popup_menu (arg) | |||
| 611 | 612 | ||
| 612 | DEFUN ("x-popup-menu", Fx_popup_menu, Sx_popup_menu, 2, 2, 0, | 613 | DEFUN ("x-popup-menu", Fx_popup_menu, Sx_popup_menu, 2, 2, 0, |
| 613 | doc: /* Pop up a deck-of-cards menu and return user's selection. | 614 | doc: /* Pop up a deck-of-cards menu and return user's selection. |
| 614 | POSITION is a position specification. This is either a mouse button | 615 | POSITION is a position specification. This is either a mouse button event |
| 615 | event or a list ((XOFFSET YOFFSET) WINDOW) where XOFFSET and YOFFSET | 616 | or a list ((XOFFSET YOFFSET) WINDOW) |
| 616 | are positions in pixels from the top left corner of WINDOW's frame | 617 | where XOFFSET and YOFFSET are positions in pixels from the top left |
| 617 | \(WINDOW may be a frame object instead of a window). This controls the | 618 | corner of WINDOW. (WINDOW may be a window or a frame object.) |
| 618 | position of the center of the first line in the first pane of the | 619 | This controls the position of the top left of the menu as a whole. |
| 619 | menu, not the top left of the menu as a whole. If POSITION is t, it | 620 | If POSITION is t, it means to use the current mouse position. |
| 620 | means to use the current mouse position. | ||
| 621 | 621 | ||
| 622 | MENU is a specifier for a menu. For the simplest case, MENU is a keymap. | 622 | MENU is a specifier for a menu. For the simplest case, MENU is a keymap. |
| 623 | The menu items come from key bindings that have a menu string as well as | 623 | The menu items come from key bindings that have a menu string as well as |
| 624 | a definition; actually, the \"definition\" in such a key binding looks like | 624 | a definition; actually, the "definition" in such a key binding looks like |
| 625 | \(STRING . REAL-DEFINITION). To give the menu a title, put a string into | 625 | \(STRING . REAL-DEFINITION). To give the menu a title, put a string into |
| 626 | the keymap as a top-level element. | 626 | the keymap as a top-level element. |
| 627 | 627 | ||
| 628 | If REAL-DEFINITION is nil, that puts a nonselectable string in the menu. | 628 | If REAL-DEFINITION is nil, that puts a nonselectable string in the menu. |
| 629 | Otherwise, REAL-DEFINITION should be a valid key binding definition. | 629 | Otherwise, REAL-DEFINITION should be a valid key binding definition. |
| 630 | 630 | ||
| 631 | You can also use a list of keymaps as MENU. Then each keymap makes a | 631 | You can also use a list of keymaps as MENU. |
| 632 | separate pane. When MENU is a keymap or a list of keymaps, the return | 632 | Then each keymap makes a separate pane. |
| 633 | value is a list of events. | ||
| 634 | 633 | ||
| 635 | Alternatively, you can specify a menu of multiple panes with a list of | 634 | When MENU is a keymap or a list of keymaps, the return value is the |
| 636 | the form (TITLE PANE1 PANE2...), where each pane is a list of | 635 | list of events corresponding to the user's choice. Note that |
| 637 | form (TITLE ITEM1 ITEM2...). | 636 | `x-popup-menu' does not actually execute the command bound to that |
| 638 | Each ITEM is normally a cons cell (STRING . VALUE); but a string can | 637 | sequence of events. |
| 639 | appear as an item--that makes a nonselectable line in the menu. | 638 | |
| 639 | Alternatively, you can specify a menu of multiple panes | ||
| 640 | with a list of the form (TITLE PANE1 PANE2...), | ||
| 641 | where each pane is a list of form (TITLE ITEM1 ITEM2...). | ||
| 642 | Each ITEM is normally a cons cell (STRING . VALUE); | ||
| 643 | but a string can appear as an item--that makes a nonselectable line | ||
| 644 | in the menu. | ||
| 640 | With this form of menu, the return value is VALUE from the chosen item. | 645 | With this form of menu, the return value is VALUE from the chosen item. |
| 641 | 646 | ||
| 642 | If POSITION is nil, don't display the menu at all, just precalculate the | 647 | If POSITION is nil, don't display the menu at all, just precalculate the |
| 643 | cached information about equivalent key sequences. */) | 648 | cached information about equivalent key sequences. |
| 644 | (position, menu) | 649 | |
| 650 | If the user gets rid of the menu without making a valid choice, for | ||
| 651 | instance by clicking the mouse away from a valid choice or by typing | ||
| 652 | keyboard input, then this normally results in a quit and | ||
| 653 | `x-popup-menu' does not return. But if POSITION is a mouse button | ||
| 654 | event (indicating that the user invoked the menu with the mouse) then | ||
| 655 | no quit occurs and `x-popup-menu' returns nil. */) | ||
| 656 | (position, menu) | ||
| 645 | Lisp_Object position, menu; | 657 | Lisp_Object position, menu; |
| 646 | { | 658 | { |
| 647 | Lisp_Object keymap, tem; | 659 | Lisp_Object keymap, tem; |
| @@ -840,7 +852,7 @@ If POSITION is t, it means to use the frame the mouse is on. | |||
| 840 | The dialog box appears in the middle of the specified frame. | 852 | The dialog box appears in the middle of the specified frame. |
| 841 | 853 | ||
| 842 | CONTENTS specifies the alternatives to display in the dialog box. | 854 | CONTENTS specifies the alternatives to display in the dialog box. |
| 843 | It is a list of the form (TITLE ITEM1 ITEM2...). | 855 | It is a list of the form (DIALOG ITEM1 ITEM2...). |
| 844 | Each ITEM is a cons cell (STRING . VALUE). | 856 | Each ITEM is a cons cell (STRING . VALUE). |
| 845 | The return value is VALUE from the chosen item. | 857 | The return value is VALUE from the chosen item. |
| 846 | 858 | ||
| @@ -850,8 +862,12 @@ on the left of the dialog box and all following items on the right. | |||
| 850 | \(By default, approximately half appear on each side.) | 862 | \(By default, approximately half appear on each side.) |
| 851 | 863 | ||
| 852 | If HEADER is non-nil, the frame title for the box is "Information", | 864 | If HEADER is non-nil, the frame title for the box is "Information", |
| 853 | otherwise it is "Question". */) | 865 | otherwise it is "Question". |
| 854 | (position, contents, header) | 866 | |
| 867 | If the user gets rid of the dialog box without making a valid choice, | ||
| 868 | for instance using the window manager, then this produces a quit and | ||
| 869 | `x-popup-dialog' does not return. */) | ||
| 870 | (position, contents, header) | ||
| 855 | Lisp_Object position, contents, header; | 871 | Lisp_Object position, contents, header; |
| 856 | { | 872 | { |
| 857 | FRAME_PTR f = NULL; | 873 | FRAME_PTR f = NULL; |