Changes between Initial Version and Version 1 of EasyGuiMenus

08/30/08 06:45:28 (9 years ago)



  • EasyGuiMenus

    v1 v1  
     1= Menus = 
     3Menus allow the user to view or choose from a list of choices and commands. Each menu has one or more menu items associated with it. A menu item may also be a submenu, sometimes called a hierarchical menu. 
     5{{{menu-item (view view-action-mixin view-text-mixin) [class]}}} 
     7An abstract class representing menu items. A menu item can have a view-action which is invoked when the item is selected, and a view-text which is the name of the menu item. Additional initargs: 
     9'':menu-item-updater'' -- intializes the function call to update the menu item, see set-menu-item-updater. 
     11'':menu-item-key'' -- initializes the menu items command key equivalent, see set-menu-item-key. 
     13'':menu-item-check'' -- initializes the check mark of the menu item, see set-menu-item-check. 
     15'':menu-item-style'' -- initializes the font style in which the item text appears, see set-menu-item-style. 
     17''TODO: can also set the font family.'' 
     19''TODO: can also have icons.'' 
     21''TODO: menu items are not first class objects in Carbon. I guess we'll just return ''nil'' from view-ref. Also will need some hack for getting the item info through command handler so can find the menu-item object.'' 
     23{{{(set-menu-item-updater menu-item updater) [method]}}} 
     25Sets the menu item's updater function to ''updater'', which must be either ''nil'' or a funcallable object (function or symbol). If non-''nil'', it is invoked with one argument, the menu item, to allow it to be adjusted in the current program context (e.g. enabled/disabled) before it is displayed. 
     27{{{(menu-item-updater menu-item updater) [method]}}} 
     29Returns the menu item's updater function. 
     31{{{(set-menu-item-key menu-item key) [method]}}} 
     33Sets the keyboard equivalent for the menu item to key (which may be ''nil'' to remove the keyboard equivalent). 
     35{{{(menu-item-key menu-item) [method]}}} 
     37Returns the keyboard equivalent of the menu item. 
     39{{{(set-menu-item-check menu-item check) [method]}}} 
     41Sets the check mark character that appears next to the menu item text. If check is ''nil'', no check mark appears. If check is ''t'', then a standard check-mark symbol is used.  Otherwise it should be a character to be used as the check mark. 
     43{{{(menu-item-check menu-item) [method]}}} 
     45Returns the check mark character that appears next to the menu item text, or ''t'' if the standard check-mark symbol is used, or ''nil'' if no check mark appears. 
     47{{{(set-menu-item-style menu-item style) [method]}}} 
     49Sets the style in which the item text appears, one of :normal or :plain, :bold, :italic, :shadow, :outline, :underline, :condense, and :extend. 
     51{{{(menu-item-style menu-item) [method]}}} 
     53Returns the style in which the item text appears, one of - :normal, :bold, :italic, :shadow, :outline, :underline, :condense, and :extend. 
     55{{{separator-menu-item (menu-item) [class]}}} 
     57A permanently disabled menu item consisting of a long line, used as a separator. 
     59''TODO: window-menu-item (menu-item) [class] ? '' 
     61''TODO: font-menu-item (menu-item) [class] ? '' 
     63{{{menu (menu-item view-nib-mixin) [class]}}} 
     65The class of menus. Additional initargs: 
     67'':menu-items'' -- initializes the menu's menu items, see set-menu-items. 
     69{{{(set-menu-items menu items) [method]}}} 
     71Sets the menu items associated with menu to ''items'', which must be a sequence of menu-item's. 
     73{{{(menu-items menu) [method]}}} 
     75Returns a freshly consed list of menu-item's associated with menu. 
     77{{{(set-menubar menu) [method]}}} 
     79Sets the root menu, also known as the menubar, to menu. 
     81{{{(menubar) [method]}}} 
     83Returns the menu object that is the current menubar.