[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: specializing menu-item appearance



On Wed Dec  1, Kardan Kaveh asks"
 Is there an equivalent of view-draw-contents for menu-items?
There is a view-draw-contents method for a pop-up-menu (see library/
pop-up-menu.lisp.

Kardan wants to change the font of a menu and specify keyboard equivalents.
The interface tools (ift) package allows you to create a menu easily.
If you want to add command key equivalents, examine the following code fragment
defining the *file-menu* with the standard menu items. You don't
need to redefine the view-draw-contents. The apple interface guidelines
sppecify that the menu font should be Chicago 12 for the menu-bar menus.


mark

(MAKE-INSTANCE 'MENU
  :MENU-TITLE
  "File"
  :MENU-ITEMS
  (LIST (MAKE-INSTANCE 'MENU-ITEM
          :MENU-ITEM-TITLE
          "New"
          :MENU-ITEM-ACTION
          'FRED
          :COMMAND-KEY
          #\N)
        (MAKE-INSTANCE 'MENU-ITEM
          :MENU-ITEM-TITLE
          "Open"
          :MENU-ITEM-ACTION
          'EDIT-SELECT-FILE
          :COMMAND-KEY
          #\O)
        (MAKE-INSTANCE 'MENU-ITEM
          :MENU-ITEM-TITLE
          "Open Selection"
          :MENU-ITEM-ACTION
          'CCL::OPEN-SELECTED-FILE
          :DISABLED
          T
          :COMMAND-KEY
          #\D)
        (MAKE-INSTANCE 'MENU-ITEM :MENU-ITEM-TITLE "-" :DISABLED T)
        (MAKE-INSTANCE 'WINDOW-MENU-ITEM
          :MENU-ITEM-TITLE
          "Close"
          :COMMAND-KEY
          #\W
          :MENU-ITEM-ACTION
          'WINDOW-CLOSE)
        (MAKE-INSTANCE 'WINDOW-MENU-ITEM
          :MENU-ITEM-TITLE
          "Save"
          :COMMAND-KEY
          #\S
          :MENU-ITEM-ACTION
          'WINDOW-SAVE)
        (MAKE-INSTANCE 'WINDOW-MENU-ITEM
          :MENU-ITEM-TITLE
          "Save As"
          :MENU-ITEM-ACTION
          'WINDOW-SAVE-AS)
        (MAKE-INSTANCE 'WINDOW-MENU-ITEM
          :MENU-ITEM-TITLE
          "Save Copy As"
          :MENU-ITEM-ACTION
          'WINDOW-SAVE-COPY-AS)
        (MAKE-INSTANCE 'WINDOW-MENU-ITEM
          :MENU-ITEM-TITLE
          "Revert"
          :DISABLED
          T
          :COMMAND-KEY
          #\R
          :MENU-ITEM-ACTION
          'WINDOW-REVERT)
        (MAKE-INSTANCE 'MENU-ITEM :MENU-ITEM-TITLE "-" :DISABLED T)
        (MAKE-INSTANCE 'MENU-ITEM
          :MENU-ITEM-TITLE
          "Page Setup"
          :MENU-ITEM-ACTION
          'CCL::PRINT-STYLE-DIALOG)
        (MAKE-INSTANCE 'WINDOW-MENU-ITEM
          :MENU-ITEM-TITLE
          "Print"
          :COMMAND-KEY
          #\P
          :MENU-ITEM-ACTION
          'WINDOW-HARDCOPY)
        (MAKE-INSTANCE 'MENU-ITEM :MENU-ITEM-TITLE "-" :DISABLED T)
        (MAKE-INSTANCE 'MENU-ITEM
          :MENU-ITEM-TITLE
          "Quit"
          :MENU-ITEM-ACTION
          'CCL::CONFIRMED-QUIT
          :COMMAND-KEY
          #\Q)))