UIObjectView.st
changeset 3555 1ac9575a6015
parent 3548 e0f85c2db0f9
child 3581 e8ae5a7267d8
equal deleted inserted replaced
3554:01fa81669da2 3555:1ac9575a6015
  1056 
  1056 
  1057     "/ container objects might want to rearrange their elements after a size change;
  1057     "/ container objects might want to rearrange their elements after a size change;
  1058     "/ therefore, we hide the handles while this is possibly done.
  1058     "/ therefore, we hide the handles while this is possibly done.
  1059     "/ however, to avoid flicker, we check for containers first.
  1059     "/ however, to avoid flicker, we check for containers first.
  1060     anyLayoutWrapper := anyTransparentBox := false.
  1060     anyLayoutWrapper := anyTransparentBox := false.
  1061     self forEach:object do:[:aViewOrComponent | 
  1061     object doIfNotNil:[:aViewOrComponent | 
  1062         aViewOrComponent isLayoutWrapper ifTrue:[ anyLayoutWrapper := true ].
  1062         aViewOrComponent isLayoutWrapper ifTrue:[ anyLayoutWrapper := true ].
  1063         aViewOrComponent isTransparentBox ifTrue:[ anyTransparentBox := true ].
  1063         aViewOrComponent isTransparentBox ifTrue:[ anyTransparentBox := true ].
  1064     ].
  1064     ].
  1065 
  1065 
  1066     (anyLayoutWrapper or:[anyTransparentBox]) ifTrue:[
  1066     (anyLayoutWrapper or:[anyTransparentBox]) ifTrue:[
  1083         Delay waitForSeconds:0.05.
  1083         Delay waitForSeconds:0.05.
  1084         [self sensor hasExposeEventFor:nil] whileTrue:[
  1084         [self sensor hasExposeEventFor:nil] whileTrue:[
  1085             self windowGroup processExposeEvents
  1085             self windowGroup processExposeEvents
  1086         ].
  1086         ].
  1087 
  1087 
  1088         self forEach:savedSelection do:[:aView |
  1088         savedSelection doIfNotNil:[:aView |
  1089             self recomputeShapeIfTransparentBox:aView.
  1089             self recomputeShapeIfTransparentBox:aView.
  1090         ].
  1090         ].
  1091 
  1091 
  1092         self setSelection:object withRedraw:true.
  1092         self setSelection:object withRedraw:true.
  1093     ].
  1093     ].
  1094 
  1094 
  1095     self layoutChanged.
  1095     self layoutChanged.
  1096     self setDefaultActions.
  1096     self setDefaultActions.
       
  1097 
       
  1098     "Modified: / 11-04-2018 / 18:18:08 / stefan"
  1097 !
  1099 !
  1098 
  1100 
  1099 layoutChanged
  1101 layoutChanged
  1100 !
  1102 !
  1101 
  1103 
  1581 
  1583 
  1582     self select:newSelection
  1584     self select:newSelection
  1583 !
  1585 !
  1584 
  1586 
  1585 selectionDo:aBlock
  1587 selectionDo:aBlock
  1586     "apply block to every selected object
  1588     "apply block to every selected object"
  1587     "
  1589 
  1588     self forEach:(self selection) do:aBlock
  1590     self selection doIfNotNil:aBlock
  1589 
  1591 
  1590 
  1592     "Modified: / 11-04-2018 / 18:18:32 / stefan"
  1591 !
  1593 !
  1592 
  1594 
  1593 showSelection
  1595 showSelection
  1594     "show the selection - draw handles"
  1596     "show the selection - draw handles"
  1595 
  1597 
  1794 
  1796 
  1795     doRedraw ifTrue:[
  1797     doRedraw ifTrue:[
  1796         self hideSelection.
  1798         self hideSelection.
  1797         selection := sel.
  1799         selection := sel.
  1798 
  1800 
  1799         self forEach:selection do:[:aView |
  1801         selection doIfNotNil:[:aView |
  1800             |superView|
  1802             |superView|
  1801 
  1803 
  1802             superView := aView superView. 
  1804             superView := aView superView. 
  1803             self recomputeShapeIfTransparentBox:superView.
  1805             self recomputeShapeIfTransparentBox:superView.
  1804         ].
  1806         ].
  1805         self showSelection.
  1807         self showSelection.
  1806     ] ifFalse:[
  1808     ] ifFalse:[
  1807         selection := sel
  1809         selection := sel
  1808     ]
  1810     ]
       
  1811 
       
  1812     "Modified: / 11-04-2018 / 18:18:50 / stefan"
  1809 !
  1813 !
  1810 
  1814 
  1811 showUnselected:something
  1815 showUnselected:something
  1812     "show a component or list of components unselected"
  1816     "show a component or list of components unselected"
  1813 
  1817 
  1817         ^ self
  1821         ^ self
  1818     ].
  1822     ].
  1819 
  1823 
  1820     damages := OrderedCollection new.
  1824     damages := OrderedCollection new.
  1821 
  1825 
  1822     self forEach:something do:[:v|
  1826     something doIfNotNil:[:v|
  1823         self handlesOf:v do:[:aDamage :wht|
  1827         self handlesOf:v do:[:aDamage :wht|
  1824             damages reverseDo:[:el|
  1828             damages reverseDo:[:el|
  1825                 (el intersects:aDamage) ifTrue:[
  1829                 (el intersects:aDamage) ifTrue:[
  1826                     damages removeIdentical:el.
  1830                     damages removeIdentical:el.
  1827 
  1831 
  1854         damages do:[:el| self invalidate:el ].
  1858         damages do:[:el| self invalidate:el ].
  1855         self repairDamage.
  1859         self repairDamage.
  1856     ] ensure:[
  1860     ] ensure:[
  1857         selection := savedSelection
  1861         selection := savedSelection
  1858     ].
  1862     ].
       
  1863 
       
  1864     "Modified: / 11-04-2018 / 18:19:11 / stefan"
  1859 ! !
  1865 ! !
  1860 
  1866 
  1861 !UIObjectView methodsFor:'testing'!
  1867 !UIObjectView methodsFor:'testing'!
  1862 
  1868 
  1863 hasSelection
  1869 hasSelection