comparison man/widget.texi @ 136:b980b6286996 r20-2b2

Import from CVS: tag r20-2b2
author cvs
date Mon, 13 Aug 2007 09:31:12 +0200
parents 34a5b81f86ba
children 538048ae2ab8
comparison
equal deleted inserted replaced
135:4636a6841cd6 136:b980b6286996
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.89 16 Version: 1.84
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::
29 * Widget Wishlist.:: 27 * Widget Wishlist.::
30 @end menu 28 @end menu
31 29
32 @node Introduction, User Interface, Top, Top 30 @node Introduction, User Interface, Top, Top
33 @comment node-name, next, previous, up 31 @comment node-name, next, previous, up
229 usually created by the @code{link} widget. 227 usually created by the @code{link} widget.
230 @item The @samp{@b{[ ]}} and @samp{@b{[X]}} buttons. 228 @item The @samp{@b{[ ]}} and @samp{@b{[X]}} buttons.
231 Activating one of these will convert it to the other. This is useful 229 Activating one of these will convert it to the other. This is useful
232 for implementing multiple-choice fields. You can create it wit 230 for implementing multiple-choice fields. You can create it wit
233 @item The @samp{@b{( )}} and @samp{@b{(*)}} buttons. 231 @item The @samp{@b{( )}} and @samp{@b{(*)}} buttons.
234 Only one radio button in a @code{radio-button-choice} widget can be 232 Only one radio button in a @code{radio-button-choice} widget can be selected at any
235 selected at any time. When you push one of the unselected radio 233 time. When you push one of the unselected radio buttons, it will be
236 buttons, it will be selected and the previous selected radio button will 234 selected and the previous selected radio button will become unselected.
237 become unselected.
238 @item The @samp{@b{[Apply Form]}} @samp{@b{[Reset Form]}} buttons. 235 @item The @samp{@b{[Apply Form]}} @samp{@b{[Reset Form]}} buttons.
239 These are explicit buttons made with the @code{push-button} widget. The main 236 These are explicit buttons made with the @code{push-button} widget. The main
240 difference from the @code{link} widget is that the buttons are will be 237 difference from the @code{link} widget is that the buttons are will be
241 displayed as GUI buttons when possible. 238 displayed as GUI buttons when possible.
242 enough. 239 enough.
586 * choice-item:: 583 * choice-item::
587 * toggle:: 584 * toggle::
588 * checkbox:: 585 * checkbox::
589 * checklist:: 586 * checklist::
590 * editable-list:: 587 * editable-list::
591 * group::
592 @end menu 588 @end menu
593 589
594 @node link, url-link, Basic Types, Basic Types 590 @node link, url-link, Basic Types, Basic Types
595 @comment node-name, next, previous, up 591 @comment node-name, next, previous, up
596 @subsection The @code{link} Widget 592 @subsection The @code{link} Widget
923 Replace with the checkbox. 919 Replace with the checkbox.
924 @item %% 920 @item %%
925 Insert a literal @samp{%}. 921 Insert a literal @samp{%}.
926 @end table 922 @end table
927 923
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
935 @item button-args 924 @item button-args
936 A list of keywords to pass to the checkboxes. Useful for setting 925 A list of keywords to pass to the checkboxes. Useful for setting
937 e.g. the @samp{:help-echo} for each checkbox. 926 e.g. the @samp{:help-echo} for each checkbox.
938 927
939 @item :buttons 928 @item :buttons
944 933
945 @item :args 934 @item :args
946 The list of types. 935 The list of types.
947 @end table 936 @end table
948 937
949 @node editable-list, group, checklist, Basic Types 938 @node editable-list, , checklist, Basic Types
950 @comment node-name, next, previous, up 939 @comment node-name, next, previous, up
951 @subsection The @code{editable-list} Widget 940 @subsection The @code{editable-list} Widget
952 941
953 Syntax: 942 Syntax:
954 943
955 @example 944 @example
956 TYPE ::= (editable-list [KEYWORD ARGUMENT]... TYPE) 945 TYPE ::= (editable-list [KEYWORD ARGUMENT]... TYPE)
957 @end example 946 @end example
958 947
959 The value is a list, where each member represents one widget of type 948 The value is a list, where each member represent one widget of type
960 @var{type}. 949 @var{type}.
961 950
962 The following extra properties are recognized. 951 The following extra properties are recognized.
963 952
964 @table @code 953 @table @code
996 @item :args 985 @item :args
997 List whose car is the type of the list elements. 986 List whose car is the type of the list elements.
998 987
999 @end table 988 @end table
1000 989
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
1015 @node Sexp Types, Widget Properties, Basic Types, Top 990 @node Sexp Types, Widget Properties, Basic Types, Top
1016 @comment 991 @comment
1017 @section Sexp Types 992 @section Sexp Types
1018 993
1019 A number of widgets for editing s-expressions (lisp types) are also 994 A number of widgets for editing s-expressions (lisp types) are also
1020 available. These basically fall in the following categories. 995 available. These basically fall in three categories: @dfn{atoms},
996 @dfn{composite types}, and @dfn{generic}.
1021 997
1022 @menu 998 @menu
1023 * constants::
1024 * generic:: 999 * generic::
1025 * atoms:: 1000 * atoms::
1026 * composite:: 1001 * composite::
1027 @end menu 1002 @end menu
1028 1003
1029 @node constants, generic, Sexp Types, Sexp Types 1004 @node generic, atoms, Sexp Types, Sexp Types
1030 @comment node-name, next, previous, up 1005 @comment node-name, next, previous, up
1031 @subsection The Constant Widgets. 1006 @subsection The Generic Widget.
1032 1007
1033 The @code{const} widget can contain any lisp expression, but the user is 1008 The @code{const} and @code{sexp} widgets can contain any lisp
1009 expression. In the case of the @code{const} widget the user is
1034 prohibited from editing edit it, which is mainly useful as a component 1010 prohibited from editing edit it, which is mainly useful as a component
1035 of one of the composite widgets. 1011 of one of the composite widgets.
1036 1012
1037 The syntax for the @code{const} widget is 1013 The syntax for the generic widgets is
1038 1014
1039 @example 1015 @example
1040 TYPE ::= (const [KEYWORD ARGUMENT]... [ VALUE ]) 1016 TYPE ::= (const [KEYWORD ARGUMENT]... [ VALUE ])
1041 @end example 1017 @end example
1042 1018
1045 1021
1046 @deffn Widget const 1022 @deffn Widget const
1047 This will display any valid s-expression in an immutable part of the 1023 This will display any valid s-expression in an immutable part of the
1048 buffer. 1024 buffer.
1049 @end deffn 1025 @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
1077 1026
1078 @deffn Widget sexp 1027 @deffn Widget sexp
1079 This will allow you to edit any valid s-expression in an editable buffer 1028 This will allow you to edit any valid s-expression in an editable buffer
1080 field. 1029 field.
1081 1030
1165 The value of a @code{cons} widget is a cons-cell where the car is the 1114 The value of a @code{cons} widget is a cons-cell where the car is the
1166 value of the first component and the cdr is the value of the second 1115 value of the first component and the cdr is the value of the second
1167 component. There must be exactly two components. 1116 component. There must be exactly two components.
1168 @end deffn 1117 @end deffn
1169 1118
1170 @deffn Widget list 1119 @deffn Widget lisp
1171 The value of a @code{list} widget is a list containing the value of 1120 The value of a @code{lisp} widget is a list containing the value of
1172 each of its component. 1121 each of its component.
1173 @end deffn 1122 @end deffn
1174 1123
1175 @deffn Widget vector 1124 @deffn Widget vector
1176 The value of a @code{vector} widget is a vector containing the value of 1125 The value of a @code{vector} widget is a vector containing the value of
1307 ancestors have been deactivated. Do not attempt to set the 1256 ancestors have been deactivated. Do not attempt to set the
1308 @code{:inactive} keyword directly. Use the @code{:activate} 1257 @code{:inactive} keyword directly. Use the @code{:activate}
1309 @code{:deactivated} keywords instead. 1258 @code{:deactivated} keywords instead.
1310 1259
1311 1260
1312 @node Defining New Widgets, Widget Browser, Widget Properties, Top 1261 @node Defining New Widgets, Widget Wishlist., Widget Properties, Top
1313 @comment node-name, next, previous, up 1262 @comment node-name, next, previous, up
1314 @section Defining New Widgets 1263 @section Defining New Widgets
1315 1264
1316 You can define specialized widgets with @code{define-widget}. It allows 1265 You can define specialized widgets with @code{define-widget}. It allows
1317 you to create a shorthand for more complex widgets, including specifying 1266 you to create a shorthand for more complex widgets, including specifying
1411 1360
1412 It provides most of the functionality that is referred to as ``by 1361 It provides most of the functionality that is referred to as ``by
1413 default'' in this text. 1362 default'' in this text.
1414 @end deffn 1363 @end deffn
1415 1364
1416 @node Widget Browser, Widget Minor Mode, Defining New Widgets, Top 1365 @node Widget Wishlist., , 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
1458 @comment node-name, next, previous, up 1366 @comment node-name, next, previous, up
1459 @section Wishlist. 1367 @section Wishlist.
1460 1368
1461 @itemize @bullet 1369 @itemize @bullet
1462 @item 1370 @item
1480 The functions used in many widgets, like 1388 The functions used in many widgets, like
1481 @code{widget-item-convert-widget}, should not have names that are 1389 @code{widget-item-convert-widget}, should not have names that are
1482 specific to the first widget where I happended to use them. 1390 specific to the first widget where I happended to use them.
1483 1391
1484 @item 1392 @item
1485 Finish @code{:tab-order}. 1393 Flag to make @code{widget-move} skip a specified button.
1486 1394
1487 @item 1395 @item
1488 Document `helper' functions for defining new widgets. 1396 Document `helper' functions for defining new widgets.
1489 1397
1490 @item 1398 @item
1512 stuff. 1420 stuff.
1513 1421
1514 Perhaps the correct model is delegation? 1422 Perhaps the correct model is delegation?
1515 1423
1516 @item 1424 @item
1425 Document @code{widget-browse}.
1426
1427 @item
1517 Make indentation work with glyphs and propertional fonts. 1428 Make indentation work with glyphs and propertional fonts.
1518 1429
1519 @item 1430 @item
1520 Add commands to show overview of object and class hierarchies to the 1431 Add object and class hierarchies to the browser.
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.
1538 1432
1539 @end itemize 1433 @end itemize
1540 1434
1541 @contents 1435 @contents
1542 @bye 1436 @bye