CLIM mail archive

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

Re: presentations in temporary windows



Hello,

I have another question concerning the described problem.
(CLIM 1.1, Allegro CL 4.1, Sun Sparc)

	> From SWM@STONY-BROOK.SCRC.Symbolics.COM Wed Nov 25 09:23:16
	1992
	> From: Scott McKay <SWM@STONY-BROOK.SCRC.Symbolics.COM>
	> Subject: presentations in temporary windows
	> To: Thomas.Ruedesheim@ap.mchp.sni.de, clim@BBN.COM
	> In-Reply-To: <9211241158.AA10935@sun3.ap.mchp.sni.de>
	> Content-Length: 1692
	> X-Lines: 42
	>
	>     Date: Tue, 24 Nov 1992 06:58 EST
	>     From: Thomas Ruedesheim
	<Thomas.Ruedesheim@ap.mchp.sni.de>
	>
	>     I need to display some information in temporary windows,
	which should
	>     allow the user to invoke further actions (e.g. by mouse
	gestures on
	>     presentations).  The temporary window should be closed
	when the user
	>     moves the pointer out of the window.  Commands and
	presentation actions
	>     are defined in the command table of *my-frame*.  I tried
	to implement
	>     this as follows:
	>
	> I don't personally think this is good user interface design.
	A
	> preferable technique would be to have an exit box to click
	on.  That's
	> just my opinion, although most modern UI toolkits have this
	behavior.
	>
	>        (with-menu (s (get-frame-pane *my-frame* 'interactor))
	>         (... do the output to stream s ...)
	>         (... give the window the right size and expose it
	...)
	>         (tracking-pointer (s)
	>            (... clauses ...))
	>        )
	>
	>     1. Is the WITH-MENU macro the right way to build
	temporary windows that
	>     allow user interaction via presentations?
	>
	> Yes, WITH-MENU is fine.
	>
	>     2. Is the TRACKING-POINTER macro the right way to
	dispatch user
	>     actions?
	>
	> That's fine, too.
	>
	>     3. If yes, which tracking-pointer clause would implement
	the
	>     pointer-out behavior?
	>
	> There is no such clause per se.  However, you can probably
	use the
	> :MULTIPLE-WINDOWS T option to TRACKING-POINTER, and then
	write a
	> :POINTER-MOTION clause that detects when the current window
	under the
	> pointer is different from the window S.


The POINTER-MOTION-CLAUSE in TRACKING-POINTER works fine to catch the
pointer
leaving the window, but the presentations on the window are not
mouse-sensitive
(e.g. for presentation actions).
Do I have to include PRESENTATION- and
PRESENTATION-BUTTON-PRESS-CLAUSES aswell?

	>
	> In CLIM 2.0, one would probably do this by subclassing
	CLIM-STREAM-PANE,
	> creating a window of that type, and writing a HANDLE-EVENT
	method on the
	> POINTER-EXIT-EVENT class for the new window type.
	>

To make it more clear, I include my WITH-TEMPORARY-WINDOW macro. I hope
it is
understandable.

(defmacro with-temporary-window ((stream-symbol associated-window
				  &key (width 400) (height 300)
				       (end-of-line-action :wrap)
				       (end-of-page-action :allow)
				       (label "Temporary MetalShop
				       Window")
				       (exit :any-char))
				 &body body)
  (let ((%stream (expr-var stream-symbol))
	(%win (expr-var associated-window))
	(%outer (gensym))
	(%exit (or (find exit '(:any-char :pointer-out)) :any-char))
	(%pointer-in (gensym))
	(%result (gensym))
	)
    `(let* (,@(unless (eql %stream stream-symbol) `((,%stream
    ,stream-symbol)))
	    ,@(unless (eql %win associated-window) `((,%win
	    ,associated-window)))
	    ,%pointer-in
	    ,%result)
       (clim::with-menu (,%stream ,%win)
	 (setf (clim::window-label ,%stream) ,label)
	 (clim::size-menu-appropriately ,%stream :right-margin ,width
	 :bottom-margin ,height)
	 (multiple-value-bind (x y)
	     (clim::pointer-position* (clim::stream-primary-pointer
	     ,%stream))
	   (clim::position-window-near-carefully ,%stream x y))
	 (clim::stream-set-pointer-position* ,%stream 50 50)
	 (clim::window-expose ,%stream)
	 (clim::with-input-focus (,%stream)
	   (clim::with-end-of-line-action (,end-of-line-action
	   ,%stream)
	     (clim::with-end-of-page-action (,end-of-page-action
	     ,%stream)
	       (block ,%outer
		 (let ((*standard-input* ,%stream)
		       (*standard-output* ,%stream)
		       (*query-io* ,%stream)
		       (*error-output* ,%stream)
		       (*trace-output* ,%stream))
		   (setq ,%result (progn ,@body))
		   (clim::stream-force-output ,%stream)
		   ,@(if (eq %exit :pointer-out)
			 `((clim::tracking-pointer
			    (,%stream :multiple-window t)
			    (:pointer-motion (window x y)
					     (or ,%pointer-in
						 (setf ,%pointer-in (eq
						 window ,%stream)))
					     (and ,%pointer-in
						  (not (eq window
						  ,%stream))
						  (return-from ,%outer
						  ,%result)))
			    )))
		   ,@(if (eq %exit :any-char)
			 `((format ,%stream "~&~%Press any character to
			 proceed.~%")
			   (read-char ,%stream)))
		   (return-from ,%outer ,%result))))))))))


================================================================================
Thomas Ruedesheim
c/o Siemens Nixdorf Informationssysteme AG
Carl-Wery-Str. 22
W-8000 Munich 83
Germany

Tel: +49 89 636-44806
Fax: +49 89 636-49646
Email: thomas.ruedesheim@ap.mchp.sni.de
================================================================================


0,,


Main Index | Thread Index