diff options
| author | Nick Roberts | 2005-05-24 08:42:23 +0000 |
|---|---|---|
| committer | Nick Roberts | 2005-05-24 08:42:23 +0000 |
| commit | 3f2975360cb2d43c48e113581dd1b8a0f8af7c0f (patch) | |
| tree | 5a4648b52baa6ecb6f5181a1d9aded4759199559 /src/macmenu.c | |
| parent | d23928c7042801a5b2bcfb3359c0ca9b338d5e08 (diff) | |
| download | emacs-3f2975360cb2d43c48e113581dd1b8a0f8af7c0f.tar.gz emacs-3f2975360cb2d43c48e113581dd1b8a0f8af7c0f.zip | |
(Fx_popup_dialog): Add a third boolean argument to select frame title
("Question"/"Information").
(mac_dialog_show): Use it.
Diffstat (limited to 'src/macmenu.c')
| -rw-r--r-- | src/macmenu.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/macmenu.c b/src/macmenu.c index eb870176f12..b2c7242c04e 100644 --- a/src/macmenu.c +++ b/src/macmenu.c | |||
| @@ -838,9 +838,12 @@ The return value is VALUE from the chosen item. | |||
| 838 | An ITEM may also be just a string--that makes a nonselectable item. | 838 | An ITEM may also be just a string--that makes a nonselectable item. |
| 839 | An ITEM may also be nil--that means to put all preceding items | 839 | An ITEM may also be nil--that means to put all preceding items |
| 840 | on the left of the dialog box and all following items on the right. | 840 | on the left of the dialog box and all following items on the right. |
| 841 | \(By default, approximately half appear on each side.) */) | 841 | \(By default, approximately half appear on each side.) |
| 842 | (position, contents) | 842 | |
| 843 | Lisp_Object position, contents; | 843 | If HEADER is non-nil, the frame title for the box is "Information", |
| 844 | otherwise it is "Question". */) | ||
| 845 | (position, contents, header) | ||
| 846 | Lisp_Object position, contents, header; | ||
| 844 | { | 847 | { |
| 845 | FRAME_PTR f = NULL; | 848 | FRAME_PTR f = NULL; |
| 846 | Lisp_Object window; | 849 | Lisp_Object window; |
| @@ -927,7 +930,7 @@ on the left of the dialog box and all following items on the right. | |||
| 927 | 930 | ||
| 928 | /* Display them in a dialog box. */ | 931 | /* Display them in a dialog box. */ |
| 929 | BLOCK_INPUT; | 932 | BLOCK_INPUT; |
| 930 | selection = mac_dialog_show (f, 0, title, &error_name); | 933 | selection = mac_dialog_show (f, 0, title, header, &error_name); |
| 931 | UNBLOCK_INPUT; | 934 | UNBLOCK_INPUT; |
| 932 | 935 | ||
| 933 | discard_menu_items (); | 936 | discard_menu_items (); |
| @@ -2046,10 +2049,10 @@ static char * button_names [] = { | |||
| 2046 | "button6", "button7", "button8", "button9", "button10" }; | 2049 | "button6", "button7", "button8", "button9", "button10" }; |
| 2047 | 2050 | ||
| 2048 | static Lisp_Object | 2051 | static Lisp_Object |
| 2049 | mac_dialog_show (f, keymaps, title, error) | 2052 | mac_dialog_show (f, keymaps, title, header, error) |
| 2050 | FRAME_PTR f; | 2053 | FRAME_PTR f; |
| 2051 | int keymaps; | 2054 | int keymaps; |
| 2052 | Lisp_Object title; | 2055 | Lisp_Object title, header; |
| 2053 | char **error; | 2056 | char **error; |
| 2054 | { | 2057 | { |
| 2055 | int i, nb_buttons=0; | 2058 | int i, nb_buttons=0; |
| @@ -2152,11 +2155,17 @@ mac_dialog_show (f, keymaps, title, error) | |||
| 2152 | wv->name = dialog_name; | 2155 | wv->name = dialog_name; |
| 2153 | wv->help = Qnil; | 2156 | wv->help = Qnil; |
| 2154 | 2157 | ||
| 2158 | /* Frame title: 'Q' = Question, 'I' = Information. | ||
| 2159 | Can also have 'E' = Error if, one day, we want | ||
| 2160 | a popup for errors. */ | ||
| 2161 | if (NILP(header)) | ||
| 2162 | dialog_name[0] = 'Q'; | ||
| 2163 | else | ||
| 2164 | dialog_name[0] = 'I'; | ||
| 2165 | |||
| 2155 | /* Dialog boxes use a really stupid name encoding | 2166 | /* Dialog boxes use a really stupid name encoding |
| 2156 | which specifies how many buttons to use | 2167 | which specifies how many buttons to use |
| 2157 | and how many buttons are on the right. | 2168 | and how many buttons are on the right. */ |
| 2158 | The Q means something also. */ | ||
| 2159 | dialog_name[0] = 'Q'; | ||
| 2160 | dialog_name[1] = '0' + nb_buttons; | 2169 | dialog_name[1] = '0' + nb_buttons; |
| 2161 | dialog_name[2] = 'B'; | 2170 | dialog_name[2] = 'B'; |
| 2162 | dialog_name[3] = 'R'; | 2171 | dialog_name[3] = 'R'; |