Mercurial > hg > xemacs-beta
comparison man/widget.texi @ 134:34a5b81f86ba r20-2b1
Import from CVS: tag r20-2b1
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:30:11 +0200 |
parents | 9b50b4588a93 |
children | b980b6286996 |
comparison
equal
deleted
inserted
replaced
133:b27e67717092 | 134:34a5b81f86ba |
---|---|
11 | 11 |
12 @node Top, Introduction, (dir), (dir) | 12 @node Top, Introduction, (dir), (dir) |
13 @comment node-name, next, previous, up | 13 @comment node-name, next, previous, up |
14 @top The Emacs Widget Library | 14 @top The Emacs Widget Library |
15 | 15 |
16 Version: 1.84 | 16 Version: 1.89 |
17 | 17 |
18 @menu | 18 @menu |
19 * Introduction:: | 19 * Introduction:: |
20 * User Interface:: | 20 * User Interface:: |
21 * Programming Example:: | 21 * Programming Example:: |
22 * Setting Up the Buffer:: | 22 * Setting Up the Buffer:: |
23 * Basic Types:: | 23 * Basic Types:: |
24 * Sexp Types:: | 24 * Sexp Types:: |
25 * Widget Properties:: | 25 * Widget Properties:: |
26 * Defining New Widgets:: | 26 * Defining New Widgets:: |
27 * Widget Browser:: | |
28 * Widget Minor Mode:: | |
27 * Widget Wishlist.:: | 29 * Widget Wishlist.:: |
28 @end menu | 30 @end menu |
29 | 31 |
30 @node Introduction, User Interface, Top, Top | 32 @node Introduction, User Interface, Top, Top |
31 @comment node-name, next, previous, up | 33 @comment node-name, next, previous, up |
227 usually created by the @code{link} widget. | 229 usually created by the @code{link} widget. |
228 @item The @samp{@b{[ ]}} and @samp{@b{[X]}} buttons. | 230 @item The @samp{@b{[ ]}} and @samp{@b{[X]}} buttons. |
229 Activating one of these will convert it to the other. This is useful | 231 Activating one of these will convert it to the other. This is useful |
230 for implementing multiple-choice fields. You can create it wit | 232 for implementing multiple-choice fields. You can create it wit |
231 @item The @samp{@b{( )}} and @samp{@b{(*)}} buttons. | 233 @item The @samp{@b{( )}} and @samp{@b{(*)}} buttons. |
232 Only one radio button in a @code{radio-button-choice} widget can be selected at any | 234 Only one radio button in a @code{radio-button-choice} widget can be |
233 time. When you push one of the unselected radio buttons, it will be | 235 selected at any time. When you push one of the unselected radio |
234 selected and the previous selected radio button will become unselected. | 236 buttons, it will be selected and the previous selected radio button will |
237 become unselected. | |
235 @item The @samp{@b{[Apply Form]}} @samp{@b{[Reset Form]}} buttons. | 238 @item The @samp{@b{[Apply Form]}} @samp{@b{[Reset Form]}} buttons. |
236 These are explicit buttons made with the @code{push-button} widget. The main | 239 These are explicit buttons made with the @code{push-button} widget. The main |
237 difference from the @code{link} widget is that the buttons are will be | 240 difference from the @code{link} widget is that the buttons are will be |
238 displayed as GUI buttons when possible. | 241 displayed as GUI buttons when possible. |
239 enough. | 242 enough. |
583 * choice-item:: | 586 * choice-item:: |
584 * toggle:: | 587 * toggle:: |
585 * checkbox:: | 588 * checkbox:: |
586 * checklist:: | 589 * checklist:: |
587 * editable-list:: | 590 * editable-list:: |
591 * group:: | |
588 @end menu | 592 @end menu |
589 | 593 |
590 @node link, url-link, Basic Types, Basic Types | 594 @node link, url-link, Basic Types, Basic Types |
591 @comment node-name, next, previous, up | 595 @comment node-name, next, previous, up |
592 @subsection The @code{link} Widget | 596 @subsection The @code{link} Widget |
919 Replace with the checkbox. | 923 Replace with the checkbox. |
920 @item %% | 924 @item %% |
921 Insert a literal @samp{%}. | 925 Insert a literal @samp{%}. |
922 @end table | 926 @end table |
923 | 927 |
928 @item :greedy | |
929 Usually, a checklist will only match if the items are in the exact | |
930 sequence given in the specification. By setting @code{:greedy} to | |
931 non-nil, it will allow the items to come in any sequence. However, if | |
932 you extract the value they will be in the sequence given in the | |
933 checklist. I.e. the original sequence is forgotten. | |
934 | |
924 @item button-args | 935 @item button-args |
925 A list of keywords to pass to the checkboxes. Useful for setting | 936 A list of keywords to pass to the checkboxes. Useful for setting |
926 e.g. the @samp{:help-echo} for each checkbox. | 937 e.g. the @samp{:help-echo} for each checkbox. |
927 | 938 |
928 @item :buttons | 939 @item :buttons |
933 | 944 |
934 @item :args | 945 @item :args |
935 The list of types. | 946 The list of types. |
936 @end table | 947 @end table |
937 | 948 |
938 @node editable-list, , checklist, Basic Types | 949 @node editable-list, group, checklist, Basic Types |
939 @comment node-name, next, previous, up | 950 @comment node-name, next, previous, up |
940 @subsection The @code{editable-list} Widget | 951 @subsection The @code{editable-list} Widget |
941 | 952 |
942 Syntax: | 953 Syntax: |
943 | 954 |
944 @example | 955 @example |
945 TYPE ::= (editable-list [KEYWORD ARGUMENT]... TYPE) | 956 TYPE ::= (editable-list [KEYWORD ARGUMENT]... TYPE) |
946 @end example | 957 @end example |
947 | 958 |
948 The value is a list, where each member represent one widget of type | 959 The value is a list, where each member represents one widget of type |
949 @var{type}. | 960 @var{type}. |
950 | 961 |
951 The following extra properties are recognized. | 962 The following extra properties are recognized. |
952 | 963 |
953 @table @code | 964 @table @code |
985 @item :args | 996 @item :args |
986 List whose car is the type of the list elements. | 997 List whose car is the type of the list elements. |
987 | 998 |
988 @end table | 999 @end table |
989 | 1000 |
1001 @node group, , editable-list, Basic Types | |
1002 @comment node-name, next, previous, up | |
1003 @subsection The @code{group} Widget | |
1004 | |
1005 This widget simply group other widget together. | |
1006 | |
1007 Syntax: | |
1008 | |
1009 @example | |
1010 TYPE ::= (group [KEYWORD ARGUMENT]... TYPE...) | |
1011 @end example | |
1012 | |
1013 The value is a list, with one member for each @var{type}. | |
1014 | |
990 @node Sexp Types, Widget Properties, Basic Types, Top | 1015 @node Sexp Types, Widget Properties, Basic Types, Top |
991 @comment | 1016 @comment |
992 @section Sexp Types | 1017 @section Sexp Types |
993 | 1018 |
994 A number of widgets for editing s-expressions (lisp types) are also | 1019 A number of widgets for editing s-expressions (lisp types) are also |
995 available. These basically fall in three categories: @dfn{atoms}, | 1020 available. These basically fall in the following categories. |
996 @dfn{composite types}, and @dfn{generic}. | |
997 | 1021 |
998 @menu | 1022 @menu |
1023 * constants:: | |
999 * generic:: | 1024 * generic:: |
1000 * atoms:: | 1025 * atoms:: |
1001 * composite:: | 1026 * composite:: |
1002 @end menu | 1027 @end menu |
1003 | 1028 |
1004 @node generic, atoms, Sexp Types, Sexp Types | 1029 @node constants, generic, Sexp Types, Sexp Types |
1005 @comment node-name, next, previous, up | 1030 @comment node-name, next, previous, up |
1006 @subsection The Generic Widget. | 1031 @subsection The Constant Widgets. |
1007 | 1032 |
1008 The @code{const} and @code{sexp} widgets can contain any lisp | 1033 The @code{const} widget can contain any lisp expression, but the user is |
1009 expression. In the case of the @code{const} widget the user is | |
1010 prohibited from editing edit it, which is mainly useful as a component | 1034 prohibited from editing edit it, which is mainly useful as a component |
1011 of one of the composite widgets. | 1035 of one of the composite widgets. |
1012 | 1036 |
1013 The syntax for the generic widgets is | 1037 The syntax for the @code{const} widget is |
1014 | 1038 |
1015 @example | 1039 @example |
1016 TYPE ::= (const [KEYWORD ARGUMENT]... [ VALUE ]) | 1040 TYPE ::= (const [KEYWORD ARGUMENT]... [ VALUE ]) |
1017 @end example | 1041 @end example |
1018 | 1042 |
1021 | 1045 |
1022 @deffn Widget const | 1046 @deffn Widget const |
1023 This will display any valid s-expression in an immutable part of the | 1047 This will display any valid s-expression in an immutable part of the |
1024 buffer. | 1048 buffer. |
1025 @end deffn | 1049 @end deffn |
1050 | |
1051 There are two variations of the @code{const} widget, namely | |
1052 @code{variable-item} and @code{function-item}. These should contain a | |
1053 symbol with a variable or function binding. The major difference from | |
1054 the @code{const} widget is that they will allow the user to see the | |
1055 variable or function documentation for the symbol. | |
1056 | |
1057 @deffn Widget variable-item | |
1058 An immutable symbol that is bound as a variable. | |
1059 @end deffn | |
1060 | |
1061 @deffn Widget function-item | |
1062 An immutable symbol that is bound as a function. | |
1063 @end deffn | |
1064 | |
1065 @node generic, atoms, constants, Sexp Types | |
1066 @comment node-name, next, previous, up | |
1067 @subsection Generic Sexp Widget. | |
1068 | |
1069 The @code{sexp} widget can contain any lisp expression, and allows the | |
1070 user to edit it inline in the buffer. | |
1071 | |
1072 The syntax for the @code{const} widget is | |
1073 | |
1074 @example | |
1075 TYPE ::= (const [KEYWORD ARGUMENT]... [ VALUE ]) | |
1076 @end example | |
1026 | 1077 |
1027 @deffn Widget sexp | 1078 @deffn Widget sexp |
1028 This will allow you to edit any valid s-expression in an editable buffer | 1079 This will allow you to edit any valid s-expression in an editable buffer |
1029 field. | 1080 field. |
1030 | 1081 |
1114 The value of a @code{cons} widget is a cons-cell where the car is the | 1165 The value of a @code{cons} widget is a cons-cell where the car is the |
1115 value of the first component and the cdr is the value of the second | 1166 value of the first component and the cdr is the value of the second |
1116 component. There must be exactly two components. | 1167 component. There must be exactly two components. |
1117 @end deffn | 1168 @end deffn |
1118 | 1169 |
1119 @deffn Widget lisp | 1170 @deffn Widget list |
1120 The value of a @code{lisp} widget is a list containing the value of | 1171 The value of a @code{list} widget is a list containing the value of |
1121 each of its component. | 1172 each of its component. |
1122 @end deffn | 1173 @end deffn |
1123 | 1174 |
1124 @deffn Widget vector | 1175 @deffn Widget vector |
1125 The value of a @code{vector} widget is a vector containing the value of | 1176 The value of a @code{vector} widget is a vector containing the value of |
1256 ancestors have been deactivated. Do not attempt to set the | 1307 ancestors have been deactivated. Do not attempt to set the |
1257 @code{:inactive} keyword directly. Use the @code{:activate} | 1308 @code{:inactive} keyword directly. Use the @code{:activate} |
1258 @code{:deactivated} keywords instead. | 1309 @code{:deactivated} keywords instead. |
1259 | 1310 |
1260 | 1311 |
1261 @node Defining New Widgets, Widget Wishlist., Widget Properties, Top | 1312 @node Defining New Widgets, Widget Browser, Widget Properties, Top |
1262 @comment node-name, next, previous, up | 1313 @comment node-name, next, previous, up |
1263 @section Defining New Widgets | 1314 @section Defining New Widgets |
1264 | 1315 |
1265 You can define specialized widgets with @code{define-widget}. It allows | 1316 You can define specialized widgets with @code{define-widget}. It allows |
1266 you to create a shorthand for more complex widgets, including specifying | 1317 you to create a shorthand for more complex widgets, including specifying |
1360 | 1411 |
1361 It provides most of the functionality that is referred to as ``by | 1412 It provides most of the functionality that is referred to as ``by |
1362 default'' in this text. | 1413 default'' in this text. |
1363 @end deffn | 1414 @end deffn |
1364 | 1415 |
1365 @node Widget Wishlist., , Defining New Widgets, Top | 1416 @node Widget Browser, Widget Minor Mode, Defining New Widgets, Top |
1417 @comment node-name, next, previous, up | |
1418 @section Widget Browser | |
1419 | |
1420 There is a separate package to browse widgets. This is intended to help | |
1421 programmers who want to examine the content of a widget. The browser | |
1422 shows the value of each keyword, but uses links for certain keywords | |
1423 such as `:parent', which avoids printing cyclic structures. | |
1424 | |
1425 @deffn Command widget-browse WIDGET | |
1426 Create a widget browser for WIDGET. | |
1427 When called interactively, prompt for WIDGET. | |
1428 @end deffn | |
1429 | |
1430 @deffn Command widget-browse-other-window WIDGET | |
1431 Create a widget browser for WIDGET and show it in another window. | |
1432 When called interactively, prompt for WIDGET. | |
1433 @end deffn | |
1434 | |
1435 @deffn Command widget-browse-at POS | |
1436 Create a widget browser for the widget at POS. | |
1437 When called interactively, use the position of point. | |
1438 @end deffn | |
1439 | |
1440 @node Widget Minor Mode, Widget Wishlist., Widget Browser, Top | |
1441 @comment node-name, next, previous, up | |
1442 @section Widget Minor Mode | |
1443 | |
1444 There is a minor mode for manipulating widgets in major modes that | |
1445 doesn't provide any support for widgets themselves. This is mostly | |
1446 intended to be useful for programmers doing experiments. | |
1447 | |
1448 @deffn Command widget-minor-mode | |
1449 Togle minor mode for traversing widgets. | |
1450 With arg, turn widget mode on if and only if arg is positive. | |
1451 @end deffn | |
1452 | |
1453 @defvar widget-minor-mode-keymap | |
1454 Keymap used in @code{widget-minor-mode}. | |
1455 @end defvar | |
1456 | |
1457 @node Widget Wishlist., , Widget Minor Mode, Top | |
1366 @comment node-name, next, previous, up | 1458 @comment node-name, next, previous, up |
1367 @section Wishlist. | 1459 @section Wishlist. |
1368 | 1460 |
1369 @itemize @bullet | 1461 @itemize @bullet |
1370 @item | 1462 @item |
1388 The functions used in many widgets, like | 1480 The functions used in many widgets, like |
1389 @code{widget-item-convert-widget}, should not have names that are | 1481 @code{widget-item-convert-widget}, should not have names that are |
1390 specific to the first widget where I happended to use them. | 1482 specific to the first widget where I happended to use them. |
1391 | 1483 |
1392 @item | 1484 @item |
1393 Flag to make @code{widget-move} skip a specified button. | 1485 Finish @code{:tab-order}. |
1394 | 1486 |
1395 @item | 1487 @item |
1396 Document `helper' functions for defining new widgets. | 1488 Document `helper' functions for defining new widgets. |
1397 | 1489 |
1398 @item | 1490 @item |
1420 stuff. | 1512 stuff. |
1421 | 1513 |
1422 Perhaps the correct model is delegation? | 1514 Perhaps the correct model is delegation? |
1423 | 1515 |
1424 @item | 1516 @item |
1425 Document @code{widget-browse}. | |
1426 | |
1427 @item | |
1428 Make indentation work with glyphs and propertional fonts. | 1517 Make indentation work with glyphs and propertional fonts. |
1429 | 1518 |
1430 @item | 1519 @item |
1431 Add object and class hierarchies to the browser. | 1520 Add commands to show overview of object and class hierarchies to the |
1521 browser. | |
1522 | |
1523 @item | |
1524 Find a way to disable mouse highlight for inactive widgets. | |
1525 | |
1526 @item | |
1527 Add @code{property-list} widget. | |
1528 | |
1529 @item | |
1530 Add @code{association-list} widget. | |
1531 | |
1532 @item | |
1533 Add @code{key-binding} widget. | |
1534 | |
1535 @item | |
1536 Find clean way to implement variable length list. | |
1537 See @code{TeX-printer-list} for an explanation. | |
1432 | 1538 |
1433 @end itemize | 1539 @end itemize |
1434 | 1540 |
1435 @contents | 1541 @contents |
1436 @bye | 1542 @bye |