CLIM mail archive
[Prev][Next][Index][Thread]
ordered-menu-items
Date: Wed, 4 Nov 1992 20:05+0200
From: Brian Anderson <bha@atc.boeing.com>
OK, I have placed my ordered menu item hack on cambridge.apple.com
under clim-1/ordered-menu-items.lisp.
I would appreciate any feedback or enhancements.
Thanks for your contributions, Brian.
[...]
Ideas on enhancements.
o extend layout syntax to allow style specifications (such as
the menu items text style, highlighting mechanisms, etc.)
o define column (row?) "headings" that are not mouse sensitive
There could also be a more general mechanism. In the ctv-menu
extensions on the library (written by Peter Karp, Mabry Tyson, David
Wilkins and Scott McKay), I added to the menu-item definition (the long
form) a :no-select option that is nil by default. When the user
specifies it as T, the menu item is not mouse sensitive. This is
similar to symbolics' DW behaviour.
Then in your code, you just look for that option and present the item as
either 'clim::menu-item or as 'clim::string (CLIM gods: isn't there
something better than this? String will usually be ok, but i would have
preferred a clim::non-sensitive-presentation-type, which is different
from 'null because null prints as "None", which is not what I want. Did
I miss something?).
For example (look at the "Note by Keunen" mark below):
[...]
(multiple-value-bind (item gesture)
(clim::menu-choose-from-drawer
menu-window
'clim::menu-item
#'(lambda(stream type)
(dolist (menu-item item-list)
(format stream " ")
(clim:with-text-style ((or (getf (cdr menu-item) :style)
nil)
stream)
;; Print the current item. If we print "" this
;; causes the CLIM window to grow much bigger with
;; lots of white space at the borders, so we
;; print " " in place of "".
(clim:present
(format nil "~A" (if (string-equal "" (car menu-item))
" "
(car menu-item) ))
;; Note by Keunen (4-Nov-92 12:49:50) : modified for :no-select
(if (getf (cdr menu-item) :no-select)
'string
type)
;;type
:stream stream) )
(format stream " ~%"))
)
:x-position x
:y-position y)
(declare (ignore gesture))
(getf (cdr (assoc item item-list :test #'equal))
:value)
)
--
Never trust a pretty header: use keunen@nrb.be to reply
--
Keunen Vincent Network Research Belgium
R&D, Software Engineer Parc Industriel des Hauts-Sarts
keunen@nrb.be 2e Avenue, 65
tel: +32 41 407282 B-4040 Herstal
fax: +32 41 481170 Belgium
0,,
Follow-Ups:
References:
Main Index |
Thread Index