UIObjectView.st
changeset 132 8649766ce095
parent 131 715b3dbba87d
child 134 d5ab85ec27fd
equal deleted inserted replaced
131:715b3dbba87d 132:8649766ce095
   307 
   307 
   308 exposeX:x y:y width:w height:h
   308 exposeX:x y:y width:w height:h
   309     "handle an expose event from device; redraw selection
   309     "handle an expose event from device; redraw selection
   310     "
   310     "
   311     super exposeX:x y:y width:w height:h.
   311     super exposeX:x y:y width:w height:h.
   312     self selectionDo:[:v | self showSelected:v]
   312 
       
   313 "
       
   314 catch expose events for all subviews associated with
       
   315 a selected instance
       
   316 "
       
   317 
       
   318     self selectionDo:[:aComponent |
       
   319         aComponent withAllSubViewsDo:[:v |
       
   320             self sensor flushExposeEventsFor:v.
       
   321             v exposeX:0 y:0 width:9999 height:9999.
       
   322         ].
       
   323 
       
   324         self showSelected:aComponent
       
   325     ]
   313 
   326 
   314 !
   327 !
   315 
   328 
   316 keyPress:key x:x y:y
   329 keyPress:key x:x y:y
   317     "any key pressed
   330     "any key pressed
   874 !
   887 !
   875 
   888 
   876 showSelected:aComponent
   889 showSelected:aComponent
   877     "show object selected
   890     "show object selected
   878     "
   891     "
   879     |wasClipped delta oldPaint|
   892     |wasClipped delta|
   880 
   893 
   881     self paint:Color black.
   894     self paint:Color black.
   882 
   895 
   883     (wasClipped := clipChildren) ifTrue:[
   896     (wasClipped := clipChildren) ifTrue:[
   884         self clippedByChildren:(clipChildren := false). 
   897         self clippedByChildren:(clipChildren := false). 
   890     ].
   903     ].
   891 
   904 
   892     wasClipped ifTrue:[
   905     wasClipped ifTrue:[
   893         self clippedByChildren:(clipChildren := true).
   906         self clippedByChildren:(clipChildren := true).
   894     ].
   907     ].
   895     self paint:oldPaint.
   908 
   896 !
   909 !
   897 
   910 
   898 showUnselected:aComponent
   911 showUnselected:aComponent
   899     "show object unselected
   912     "show object unselected
   900     "
   913     "
   901     |wasClipped delta r oldPaint|
   914     |wasClipped delta r|
   902 
   915 
   903     (wasClipped := clipChildren) ifTrue:[
   916     (wasClipped := clipChildren) ifTrue:[
   904         self clippedByChildren:(clipChildren := false). 
   917         self clippedByChildren:(clipChildren := false). 
   905     ].
   918     ].
   906 
   919 
   924             absOrg := anotherComponent originRelativeTo:self.
   937             absOrg := anotherComponent originRelativeTo:self.
   925             absFrame := absOrg extent:(anotherComponent extent).
   938             absFrame := absOrg extent:(anotherComponent extent).
   926             (absFrame intersects:r) ifTrue:[
   939             (absFrame intersects:r) ifTrue:[
   927                 anotherComponent withAllSubViewsDo:[:v |
   940                 anotherComponent withAllSubViewsDo:[:v |
   928                     v shown ifTrue:[
   941                     v shown ifTrue:[
   929                         v clear.
   942                         v fill:v viewBackground.
   930                         v exposeX:0 y:0 width:9999 height:9999.
   943                         v exposeX:0 y:0 width:9999 height:9999.
   931                     ]
   944                     ]
   932                 ]
   945                 ]
   933             ]
   946             ]
   934         ]
   947         ]