[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Anthony@ALDERAAN.SCRC.Symbolics.COM: 1Command Menu handlers and Program Frameworks ...0]
Date: Wed, 28 Oct 87 13:27 EST
From: Steve Anthony <Anthony@ALDERAAN.SCRC.Symbolics.COM>
Subject: Command Menu handlers and Program Frameworks ...
Date: Mon, 26 Oct 87 19:43 EDT
From: Richard Billington <Buff@cis.upenn.edu>
First, a user wanted to be able to specify the documentation on the mouse
line for commands he was specifying. I can find no straight-forward way
of doing that, so ...
[hack deleted]
This is a bug in Genera 7.1 that has been fixed for the next release.
You will be able to specify (for example):
Sorry for the inconvienience.
[rest deleted]
Now that you mention it, there's another bug with the mouse
documentation line. DW:TRACKING-MOUSE generates the mouse documentation
line by using (send window :set-highlighted-presentation NIL "doc").
However, if you're trying to control what is and what isn't highlighted,
this is a big loss. The behavior one sees is quite odd: whenever the
user moves his mouse over an item, the highlighting box appears for just
an instant and then flutters away into never-never land. Below you'll
find a couple hacks that avoid this bug:
(defmethod2 (:set-highlighted-presentation dynamic-pop-up-window)
0 (ignore &optional documentation shifts more-documentation)
3;; Stub to avoid grossness of DW:TRACKING-MOUSE, which always
0 3;; sets this presentation to NIL to display the appropriate
0 3;; documentation.
0 3;;
;; Gleaned from disassembled code... if you have the source, you
;; might want to make appropriate changes.
0 (let ((update? nil))
(when documentation
(setq update? (string-equal dw::who-line-documentation-string
documentation))
(setq dw::who-line-documentation-string documentation))
(when shifts
(setq dw::who-line-documentation-last-shifts shifts))
(when more-documentation
(setq update? (string-equal dw::who-line-more-documentation-string
more-documentation))
(setq dw::who-line-more-documentation-string more-documentation))
(when update? (setq tv:*mouse-documentation-needs-update* t))
nil))
;;; Highlighting functions for use in DW:TRACKING-MOUSE
(defun2 my-presentation-highlighter0 (p window)
(let ((blinker (send window :highlighting-blinker))
(boxes (dw::presentation-mouse-sensitive-boxes p window t)))
(when boxes
(send blinker :set-boxes boxes)
(send blinker :set-visibility :on))))
(defun2 my-presentation-un-highlighter0 (p window)
(declare (ignore p))
(send (send window :highlighting-blinker) :set-visibility nil))
3;;; Sample use of DW:TRACKING-MOUSE. LAST-PRESENT is a state variable
;;; used to keep the value of the last highlighted presentation.
;;; Dynamic windows are supposed to do this for you, but they don't work
;;; with dw::tracking-mouse.
0(dw::tracking-mouse (win :whostate "Vector Choose")
(2:presentation0 (p)
(return-from track-mouse nil))
(without-interrupts
3;; Clear the old one if necessary
0 (cond ((my-presentation-equal p last-present))
((and last-present
(eql 'delta-vector
(dw:presentation-type last-present)))
(my-presentation-un-highlighter last-present win)))
3;; Highlight the new one if necessary
0 (cond ((my-presentation-equal p last-present))
((and p (eql 'delta-vector (dw:presentation-type p)))
(my-presentation-highlighter p win)))
3;; Store p as the last presentation that we've processed
0 (setq last-present p))))
(:who-line-documentation-string
<code to generate a documentation string>)
[rest deleted]
)