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

Need help on the scriolling problem

Earlier someone posted a request for some code that handles
clicks in scroll bars on fred-windows.  That wasn't the exact
request, but I have faced a similar need, so I developed a 
simple text window.  The idea here is to mimic the effect
of a normal "text" window in other systems - give it scrolling,
but disable all clicks in the content region.

The most general way to do this is allow clicks based on 
controls.  Here is the code I generated, but it appears that
something is wrong with detecting the point when the mouse
is clicked in the scroll bars (ie. in a control).  I have
tried several permutations of this code (and eventually will
get it right....) but before I bash my head any further,
could someone take a look at this?  I fear I am missing 
something really stupid.  (Actually, what I am really missing
is the 1.2.2 function window-control-click-event-handler!)


  -- Luke

(defobject *soda-text-window* *fred-window*)

;;  METHOD: window-click-event-handler *soda-text-window*------------------
;;  DESCRIPTION : This function specializes the handling of clicks on a 
;;                text window so that only clicks in controls (ie. the
;;                scroll bars) are passed.
;;  NOTES       : 
;;  RETURNS     : 
;;  CALLS       :
;;  04/05/91  lhh  - Initial Version for SODA direct from GPCeditor
(defobfun (window-click-event-handler *soda-text-window*) (where)
  (declare (object-variable readln-start-position readln-stop-position))
  (cond ((do ((the-cntrl (rref wptr window.controllist)
                         (rref the-cntrl control.nextcontrol)))
             ((or (null the-cntrl)
                    ((rect (rref the-cntrl control.rect :storage :pointer)))
                    (point-in-rect-p rect where)))
         (usual-window-click-event-handler where))))