Mercurial > emacs
comparison src/w32menu.c @ 62668:d126643d7af1
(Fx_popup_dialog): Add a third boolean argument to select frame title
("Question"/"Information").
(w32_dialog_show): Use it.
author | Nick Roberts <nickrob@snap.net.nz> |
---|---|
date | Tue, 24 May 2005 08:38:58 +0000 |
parents | 357d9738b63e |
children | 5ba03d610746 |
comparison
equal
deleted
inserted
replaced
62667:a91959a64d6f | 62668:d126643d7af1 |
---|---|
858 The return value is VALUE from the chosen item. | 858 The return value is VALUE from the chosen item. |
859 | 859 |
860 An ITEM may also be just a string--that makes a nonselectable item. | 860 An ITEM may also be just a string--that makes a nonselectable item. |
861 An ITEM may also be nil--that means to put all preceding items | 861 An ITEM may also be nil--that means to put all preceding items |
862 on the left of the dialog box and all following items on the right. | 862 on the left of the dialog box and all following items on the right. |
863 \(By default, approximately half appear on each side.) */) | 863 \(By default, approximately half appear on each side.) |
864 (position, contents) | 864 |
865 Lisp_Object position, contents; | 865 If HEADER is non-nil, the frame title for the box is "Information", |
866 otherwise it is "Question". */) | |
867 (position, contents, header) | |
868 Lisp_Object position, contents, header; | |
866 { | 869 { |
867 FRAME_PTR f = NULL; | 870 FRAME_PTR f = NULL; |
868 Lisp_Object window; | 871 Lisp_Object window; |
869 | 872 |
870 check_w32 (); | 873 check_w32 (); |
947 | 950 |
948 list_of_panes (Fcons (contents, Qnil)); | 951 list_of_panes (Fcons (contents, Qnil)); |
949 | 952 |
950 /* Display them in a dialog box. */ | 953 /* Display them in a dialog box. */ |
951 BLOCK_INPUT; | 954 BLOCK_INPUT; |
952 selection = w32_dialog_show (f, 0, title, &error_name); | 955 selection = w32_dialog_show (f, 0, title, header, &error_name); |
953 UNBLOCK_INPUT; | 956 UNBLOCK_INPUT; |
954 | 957 |
955 discard_menu_items (); | 958 discard_menu_items (); |
956 | 959 |
957 if (error_name) error (error_name); | 960 if (error_name) error (error_name); |
1993 static char * button_names [] = { | 1996 static char * button_names [] = { |
1994 "button1", "button2", "button3", "button4", "button5", | 1997 "button1", "button2", "button3", "button4", "button5", |
1995 "button6", "button7", "button8", "button9", "button10" }; | 1998 "button6", "button7", "button8", "button9", "button10" }; |
1996 | 1999 |
1997 static Lisp_Object | 2000 static Lisp_Object |
1998 w32_dialog_show (f, keymaps, title, error) | 2001 w32_dialog_show (f, keymaps, title, header, error) |
1999 FRAME_PTR f; | 2002 FRAME_PTR f; |
2000 int keymaps; | 2003 int keymaps; |
2001 Lisp_Object title; | 2004 Lisp_Object title, header; |
2002 char **error; | 2005 char **error; |
2003 { | 2006 { |
2004 int i, nb_buttons=0; | 2007 int i, nb_buttons=0; |
2005 char dialog_name[6]; | 2008 char dialog_name[6]; |
2006 int menu_item_selection; | 2009 int menu_item_selection; |
2097 | 2100 |
2098 wv = xmalloc_widget_value (); | 2101 wv = xmalloc_widget_value (); |
2099 wv->name = dialog_name; | 2102 wv->name = dialog_name; |
2100 wv->help = Qnil; | 2103 wv->help = Qnil; |
2101 | 2104 |
2105 /* Frame title: 'Q' = Question, 'I' = Information. | |
2106 Can also have 'E' = Error if, one day, we want | |
2107 a popup for errors. */ | |
2108 if (NILP(header)) | |
2109 dialog_name[0] = 'Q'; | |
2110 else | |
2111 dialog_name[0] = 'I'; | |
2112 | |
2102 /* Dialog boxes use a really stupid name encoding | 2113 /* Dialog boxes use a really stupid name encoding |
2103 which specifies how many buttons to use | 2114 which specifies how many buttons to use |
2104 and how many buttons are on the right. | 2115 and how many buttons are on the right. */ |
2105 The Q means something also. */ | |
2106 dialog_name[0] = 'Q'; | |
2107 dialog_name[1] = '0' + nb_buttons; | 2116 dialog_name[1] = '0' + nb_buttons; |
2108 dialog_name[2] = 'B'; | 2117 dialog_name[2] = 'B'; |
2109 dialog_name[3] = 'R'; | 2118 dialog_name[3] = 'R'; |
2110 /* Number of buttons to put on the right. */ | 2119 /* Number of buttons to put on the right. */ |
2111 dialog_name[4] = '0' + nb_buttons - left_count; | 2120 dialog_name[4] = '0' + nb_buttons - left_count; |