/[cl-menusystem]/cl-menusystem/DOCUMENTATION
ViewVC logotype

Contents of /cl-menusystem/DOCUMENTATION

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (show annotations) (vendor branch)
Tue Sep 23 23:53:00 2003 UTC (10 years, 6 months ago) by bmastenbrook
Branch: MAIN, cl-menusystem
CVS Tags: start, HEAD
Changes since 1.1: +0 -0 lines
Initial import
1 cl-menusystem documentation as of 2003/09/10:
2
3 This is a prelimary attempt at documenting some of the functions that
4 would be more commonly used from cl-menusystem.
5
6 PACKAGE cl-menusystem:
7 Contains most of the functions that a user of cl-menusystem will need
8 to use.
9
10 PACKAGE cl-menusystem-sys:
11 Interfaces to the display system of the host.
12
13 MACRO make-menu (description help &rest menu-items:
14 Constructs a new menu with the given description and help, where
15 menu-items is a list of instances of menu, menu-action, inputable, or
16 presentable.
17
18 MACRO defmenu (name description help &rest menu-items)
19 Expands to (defvar name (make-menu description help menu-items))
20
21 MACRO make-menu-action (description help lambda-args &body lambda-form
22 Makes an instance of menu-action, which can be thought of as menu
23 entry that when invoked executes the body of lambda-form. The new
24 menu-action will have description and help as supplied here. The
25 lambda-args must be a list of precisely one symbol, which will be
26 bound to a restart during execution of lambda-form. Invoking this
27 restart will exit out of the menu that this menu-action is invoked
28 from. If a value is supplied to the restart it will be used as the
29 return value of the menu.
30
31 FUNCTION do-menu (menu-object output-device input-device)
32 Invoke and run the menu supplied using output-device and
33 input-device. During execution of the menu the special variables
34 *menu-output* and *menu-input* are bound to the supplied
35 output-device and input-device respectively. It is important to note
36 that the menu does not provide an "exit menu" option; you must
37 construct one using make-menu-action that invokes the supplied
38 restart. do-menu returns any value passed to that restart if supplied
39 or nil otherwise.
40
41 MACRO make-state-presentable (description &body forms)
42 This macro returns an instance of state-presentable which displays
43 the result of executing forms using the "~A" format control keyword.
44
45 FUNCTION request-one-line-string (output-device input-device
46 description &optional extended-help &key valid-test)
47 Requests a one line string from the given output and input devices,
48 possibly displaying description and extended-help. If valid-test is
49 supplied then this test will be applied to the input. valid-test must
50 be a lambda of one argument, a given value of the string. If the
51 return value of valid-test is nil it should return a second value
52 indicating why the input is not valid.
53
54 FUNCTION request-integer (output-device input-device description
55 &optional extended-help &key valid-test)
56 Requests an integer from the given output and input devices, possibly
57 displaying description and extended-help. If valid-test is supplied
58 then this test will be applied to the input (after checking to see if
59 the input is an integer is done.) valid-test must be a lambda of one
60 argument, a given integer value. If the return value of valid-test is
61 nil it should return a second value indicating why the input is not
62 valid.
63
64 MACRO make-preference-menu (var &key description extended-help type
65 present-form default-values valid-test convert-function)
66 Constructs a preference menu for the given variable (passed
67 unquoted). The description, type, present-form, and valid-test key
68 arguments must be supplied. The type argument must be a valid type for
69 a supplied request- function supplied as a key symbol (due to package
70 requirements) that will be used as the type for the input. (For
71 instance, input of a pathname should be done as a :one-line-string.)
72 present-form must be a function of zero arguments that returns a
73 string representing the current value of the
74 preference. default-values is a list of lists of two values - one a
75 string that will be used to name this value and the other a value for
76 the preference. valid-test is a lambda that will be called on the
77 input representation (eg string value) and will be used to determine
78 if the input is valid. (If this function returns nil it must return a
79 second value indicating why the input is invalid.) convert-function
80 must be a lambda of one argument that takes a valid input (for example
81 a string for a pathname) and returns it in the form it will be stored
82 in (eg converting a string into a pathname).

  ViewVC Help
Powered by ViewVC 1.1.5