UIObjectView.st
changeset 2538 ded6eb784054
parent 2536 408cba0cbef4
child 2548 c3ee3b652ef7
equal deleted inserted replaced
2537:12e3b32befe4 2538:ded6eb784054
   482 
   482 
   483 addObjectWithoutRedraw:anObject
   483 addObjectWithoutRedraw:anObject
   484     "add the argument, anObject to the contents - with redraw"
   484     "add the argument, anObject to the contents - with redraw"
   485 
   485 
   486     self shouldNotImplement
   486     self shouldNotImplement
       
   487 ! !
       
   488 
       
   489 !UIObjectView methodsFor:'enumerating'!
       
   490 
       
   491 contentsDo:aBlock
       
   492     self subViews do:aBlock.
       
   493     self components do:aBlock.
   487 ! !
   494 ! !
   488 
   495 
   489 !UIObjectView methodsFor:'event handling'!
   496 !UIObjectView methodsFor:'event handling'!
   490 
   497 
   491 doublePressed:pressPoint
   498 doublePressed:pressPoint
   932         ].
   939         ].
   933     ].
   940     ].
   934 
   941 
   935     viewOperatedUpon isNil ifTrue:[
   942     viewOperatedUpon isNil ifTrue:[
   936         clickedView isNil ifTrue:[
   943         clickedView isNil ifTrue:[
       
   944             "/ clicked outside - start a rectangle drag.
   937             self select:nil.
   945             self select:nil.
       
   946             self startRectangleDrag:aPoint.
   938             ^ self.
   947             ^ self.
   939         ].
   948         ].
   940 
   949 
   941         (self canChangeLayoutOfView:clickedView) ifFalse:[
   950         (self canChangeLayoutOfView:clickedView) ifFalse:[
   942             self select:clickedView.
   951             self select:clickedView.
  1838     anObject notNil ifTrue:[
  1847     anObject notNil ifTrue:[
  1839 	self selectionDo:[:el| el == anObject ifTrue:[^ true]]
  1848 	self selectionDo:[:el| el == anObject ifTrue:[^ true]]
  1840     ].
  1849     ].
  1841   ^ false
  1850   ^ false
  1842 
  1851 
       
  1852 !
       
  1853 
       
  1854 object:anObject isContainedIn:aRectangle
       
  1855     ^ anObject bounds isContainedIn:aRectangle
  1843 ! !
  1856 ! !
  1844 
  1857 
  1845 !UIObjectView methodsFor:'transaction'!
  1858 !UIObjectView methodsFor:'transaction'!
  1846 
  1859 
  1847 createUndoLayout:aView
  1860 createUndoLayout:aView
  2157 
  2170 
  2158     self moveDo:[:aView|
  2171     self moveDo:[:aView|
  2159         aligning ifTrue:[
  2172         aligning ifTrue:[
  2160             n := ((aView computeOrigin x) \\ gridX).
  2173             n := ((aView computeOrigin x) \\ gridX).
  2161             n == 0 ifTrue:[n := gridX].
  2174             n == 0 ifTrue:[n := gridX].
  2162             n := n negated.
       
  2163         ] ifFalse:[
  2175         ] ifFalse:[
  2164             n := -1.
  2176             n := 1.
  2165             self sensor shiftDown ifTrue:[
  2177             self sensor shiftDown ifTrue:[
  2166                 n := -8.    
  2178                 n := 8.    
  2167             ].
  2179             ].
  2168         ].
  2180         ].
  2169         n := n * howMany.
  2181         n := n * howMany.
  2170         self shiftLayout:aView horizontal:n
  2182         self shiftLayout:aView horizontal:n negated
  2171     ]
  2183     ]
  2172 !
  2184 !
  2173 
  2185 
  2174 moveSelectionRight
  2186 moveSelectionRight
  2175     "move the selection to the right"
  2187     "move the selection to the right"
  2186                     ifFalse:[gridX := 1].
  2198                     ifFalse:[gridX := 1].
  2187 
  2199 
  2188     self moveDo:[:aView|
  2200     self moveDo:[:aView|
  2189         aligning ifTrue:[
  2201         aligning ifTrue:[
  2190             n := ((aView computeCorner x) \\ gridX).
  2202             n := ((aView computeCorner x) \\ gridX).
  2191 
  2203             n == 0 ifTrue:[n := gridX].
  2192             n ~~ 0 ifTrue:[n := n negated]
       
  2193                   ifFalse:[n := gridX]
       
  2194         ] ifFalse:[
  2204         ] ifFalse:[
  2195             n := 1.
  2205             n := 1.
  2196             self sensor shiftDown ifTrue:[
  2206             self sensor shiftDown ifTrue:[
  2197                 n := 8.    
  2207                 n := 8.    
  2198             ].
  2208             ].