| Palette
Handler |
|||||
|
|||||
|
Description This utility implements Macintosh floating palettes with optional auto-sizing and re-sizing, triple-action function, optional palette menu(s), etc.The triple-action makes it possible to define many different types of tool behaviour, from simple tool selection to more involved toggle states. Palette items can be made to behave like radio buttons, checkboxes or normal buttons or any combination thereof. Two types of palette items are defined: text items and SICN items. You can easily add more.
Documentation The class PALETTE defines a windoid data type in which to put palette items. It takes all initargs that windoids take, with the following additions: :COLUMNS If non-NIL, the palette will be auto-sized to contain the indicated number of item columns. The sizes of the individual items/subviews will be taken into account when ordering them. When :COLUMNS is non-NIL, the positions of subviews are disregarded and may be omitted entirely. (SET-COLUMNS palette columns) may be used to resize a palette to a new number of columns. If NIL, the :VIEW-SIZE argument will be used to provide the size of the palette. Defaults to NIL. :OVERLAP Used when :COLUMNS is non-NIL. Indicates the number of pixels that items should overlap. Normally 0 for text items and 1 for framed items such as SICNs. Defaults to 0. :SHOW-ON-MENU If non-NIL, a string giving the name of a menu to which the name of the palette will be added (as given by :WINDOW-TITLE). The menu will be created if not already present on the menu bar. The menu item toggles the visibility of the palette. A tick mark indicates that a palette is visible. Palettes normally do not have a close box, but the :CLOSE-BOX-P argument may be used to provide one. When a palette is closed, it is removed from the menu. (The menu will not be removed when the last palette belonging to it is closed.) The menu may be any menu, but if it has to be created, two standard menu items are added: "Show all" and "Hide all". These two commands apply only to the palettes listed on the menu in question. Defaults to "Palettes". The special variable *PALETTES* contains a list of all active palettes. It may be read, but should not be modified by the user. The class PALETTE-ITEM defines
the basic behaviour for palette items (though it is perfectly OK to put anything
on a palette -- it need not be a PALETTE-ITEM). They are DIALOG-ITEMs and
take all the usual initargs in addition to the following:
Examples There is an extended example in the source file "Palettes.lisp". The example requires a resource file, which is included with the archive. It is not needed for normal operation of the palette utility. Acknowledgements The SICN palette items uses some code from Luke Hohmann's SICN routines, with extensive modifications and added functionality. |