UIObjectView.st
changeset 2394 664ca922a80a
parent 2368 99f14af1d5ec
child 2398 bdefc2be920a
equal deleted inserted replaced
2393:f86eef5db779 2394:664ca922a80a
  1776 
  1776 
  1777 ! !
  1777 ! !
  1778 
  1778 
  1779 !UIObjectView methodsFor:'user actions-move'!
  1779 !UIObjectView methodsFor:'user actions-move'!
  1780 
  1780 
  1781 moveDo:aOneArgBlock
  1781 moveDo:aOneArgBlock 
  1782     "perform a move operation
  1782     "perform a move operation (with auto repeat)"
  1783     "
  1783 
  1784     |sensor tm|
  1784     |sensor tm|
  1785 
  1785 
  1786     self moveableSelection isNil ifTrue:[
  1786     self moveableSelection isNil ifTrue:[
  1787         ^ self
  1787         ^ self
  1788     ].
  1788     ].
  1789     sensor := self sensor.
  1789     sensor := self sensor.
  1790 
  1790 
  1791     tm := 0.15.
  1791     tm := ButtonController defaultInitialDelay.
  1792 
  1792 
  1793     self withSelectionHiddenDo:[
  1793     self withSelectionHiddenDo:[
  1794         self transaction:#move selectionDo:[:aView|self createUndoLayout:aView].
  1794         self transaction:#move selectionDo:[:aView|self createUndoLayout:aView].
  1795 
  1795 
  1796         [
  1796         [
  1797             self selectionDo:[:aView| aOneArgBlock value:aView ].
  1797             self selectionDo:[:aView| aOneArgBlock value:aView ].
  1798             Delay waitForSeconds:tm.
  1798             sensor leftButtonPressed ifTrue:[
  1799             tm := 0.02.
  1799                 self windowGroup processExposeEvents.
  1800             self layoutChanged.
  1800                 Delay waitForSeconds:tm.
       
  1801                 self windowGroup processExposeEvents.
       
  1802                 tm := ButtonController defaultRepeatDelay.
       
  1803                 self layoutChanged.
       
  1804             ].
  1801             sensor leftButtonPressed.
  1805             sensor leftButtonPressed.
  1802         ] whileTrue.
  1806         ] whileTrue.
  1803 
  1807 
  1804         "/ handle any expose events (for subcomponents) before
  1808         "/ handle any expose events (for subcomponents) before
  1805         "/ redrawing the handles.
  1809         "/ redrawing the handles.
  1806         Delay waitForSeconds:0.1.
  1810         Delay waitForSeconds:0.1.
  1807         [self sensor hasExposeEventFor:nil] whileTrue:[
  1811         self windowGroup processExposeEvents
  1808             self windowGroup processExposeEvents
       
  1809         ]
       
  1810     ].
  1812     ].
  1811 !
  1813 !
  1812 
  1814 
  1813 moveSelectionDown
  1815 moveSelectionDown
  1814     "move selection down
  1816     "move selection down