UIObjectView.st
changeset 2203 919b6f0753fa
parent 2041 80ddafc474fb
child 2205 0582767018d7
equal deleted inserted replaced
2202:b465c7e48050 2203:919b6f0753fa
     7  inclusion of the above copyright notice.   This software may not
     7  inclusion of the above copyright notice.   This software may not
     8  be provided or otherwise made available to, or used by, any
     8  be provided or otherwise made available to, or used by, any
     9  other person.  No title to or ownership of the software is
     9  other person.  No title to or ownership of the software is
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
    12 
       
    13 
       
    14 
       
    15 "{ Package: 'stx:libtool2' }"
    12 "{ Package: 'stx:libtool2' }"
    16 
    13 
    17 ObjectView subclass:#UIObjectView
    14 ObjectView subclass:#UIObjectView
    18 	instanceVariableNames:'saveSelection undoHistory copiedExtent copiedLayout resizeData
    15 	instanceVariableNames:'saveSelection undoHistory copiedExtent copiedLayout resizeData
    19 		clipChildren selectionHiddenLevel gridParameters
    16 		clipChildren selectionHiddenLevel gridParameters
   567 processEvent:anEvent
   564 processEvent:anEvent
   568     "catch expose events for components, and redraw its handles after
   565     "catch expose events for components, and redraw its handles after
   569      the redraw when this happens.
   566      the redraw when this happens.
   570      Return true, if I have eaten the event"
   567      Return true, if I have eaten the event"
   571 
   568 
   572     |evView x y p|
   569     |evView p|
   573 
   570 
   574     self testMode ifTrue:[^ false].
   571     self testMode ifTrue:[^ false].
   575 
   572 
   576     evView := anEvent view.
   573     evView := anEvent view.
   577     (evView isNil or:[evView == self]) ifTrue:[
   574     (evView isNil or:[evView == self]) ifTrue:[
   595 
   592 
   596     (anEvent isButtonEvent or:[anEvent isKeyEvent])  ifFalse:[
   593     (anEvent isButtonEvent or:[anEvent isKeyEvent])  ifFalse:[
   597         ^ true
   594         ^ true
   598     ].
   595     ].
   599 
   596 
   600     x := anEvent x.
   597     anEvent isButtonMotionEvent ifTrue:[
   601     y := anEvent y.
   598         "/ use current point - layout of underlaying view might change
   602     p := device translatePoint:(x@y) fromView:evView toView:self.
   599         "/ and computation dependent on origin is wrong
       
   600         p := self sensor mousePoint.
       
   601         p := device translatePoint:p fromView:nil toView:self.
       
   602     ] ifFalse:[
       
   603         p := Point x:(anEvent x) y:(anEvent y).
       
   604         p := device translatePoint:p fromView:evView toView:self.
       
   605     ].
   603 
   606 
   604     "/ patch the event
   607     "/ patch the event
   605     anEvent x:p x.
   608     anEvent x:p x.
   606     anEvent y:p y.
   609     anEvent y:p y.
   607     anEvent view:self.
   610     anEvent view:self.