comparison src/dialog.c @ 412:697ef44129c6 r21-2-14

Import from CVS: tag r21-2-14
author cvs
date Mon, 13 Aug 2007 11:20:41 +0200
parents 2f8bb876ab1d
children
comparison
equal deleted inserted replaced
411:12e008d41344 412:697ef44129c6
18 along with XEmacs; see the file COPYING. If not, write to 18 along with XEmacs; see the file COPYING. If not, write to
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */ 20 Boston, MA 02111-1307, USA. */
21 21
22 /* Synched up with: Not in FSF. */ 22 /* Synched up with: Not in FSF. */
23
24 /* #### There ain't nothin' here because dialog boxes have not been
25 properly abstracted yet. */
23 26
24 #include <config.h> 27 #include <config.h>
25 #include "lisp.h" 28 #include "lisp.h"
26 #include "frame.h" 29 #include "frame.h"
27 #include "device.h" 30 #include "device.h"
43 46
44 The name is the string to display on the button; it is filtered through the 47 The name is the string to display on the button; it is filtered through the
45 resource database, so it is possible for resources to override what string 48 resource database, so it is possible for resources to override what string
46 is actually displayed. 49 is actually displayed.
47 50
48 Accelerators can be indicated in the string by putting the sequence
49 "%_" before the character corresponding to the key that will invoke
50 the button. Uppercase and lowercase accelerators are equivalent. The
51 sequence "%%" is also special, and is translated into a single %.
52
53 If the `callback' of a button is a symbol, then it must name a command. 51 If the `callback' of a button is a symbol, then it must name a command.
54 It will be invoked with `call-interactively'. If it is a list, then it is 52 It will be invoked with `call-interactively'. If it is a list, then it is
55 evaluated with `eval'. 53 evaluated with `eval'.
56 54
57 One (and only one) of the buttons may be `nil'. This marker means that all 55 One (and only one) of the buttons may be `nil'. This marker means that all
58 following buttons should be flushright instead of flushleft. 56 following buttons should be flushright instead of flushleft.
59 57
60 Though the keyword/value syntax is supported for dialog boxes just as in 58 Though the keyword/value syntax is supported for dialog boxes just as in
61 popup menus, the only keyword which is both meaningful and fully implemented 59 popup menus, the only keyword which is both meaningful and fully implemented
62 for dialog box buttons is `:active'. */ 60 for dialog box buttons is `:active'.
61 */
63 (dbox_desc)) 62 (dbox_desc))
64 { 63 {
65 struct frame *f = selected_frame (); 64 struct frame *f = selected_frame ();
66 struct device *d = XDEVICE (f->device); 65 struct device *d = XDEVICE (f->device);
67 66
71 if (SYMBOLP (dbox_desc)) 70 if (SYMBOLP (dbox_desc))
72 dbox_desc = Fsymbol_value (dbox_desc); 71 dbox_desc = Fsymbol_value (dbox_desc);
73 CHECK_CONS (dbox_desc); 72 CHECK_CONS (dbox_desc);
74 CHECK_STRING (XCAR (dbox_desc)); 73 CHECK_STRING (XCAR (dbox_desc));
75 if (!CONSP (XCDR (dbox_desc))) 74 if (!CONSP (XCDR (dbox_desc)))
76 signal_simple_error ("Dialog descriptor must supply at least one button", 75 signal_simple_error ("Dialog descriptor must supply at least one button", dbox_desc);
77 dbox_desc);
78 76
79 DEVMETH (d, popup_dialog_box, (f, dbox_desc)); 77 DEVMETH (d, popup_dialog_box, (f, dbox_desc));
80 78
81 return Qnil; 79 return Qnil;
82 } 80 }