Merge jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Sat, 16 Jan 2016 10:16:43 +0000
branchjv
changeset 7099 b19d8c33b045
parent 7098 7eb84645bfe8 (current diff)
parent 7095 945d260fb1b3 (diff)
child 7102 626befbd8a4b
Merge
SimpleView.st
--- a/.hgtags	Fri Jan 15 13:11:20 2016 +0000
+++ b/.hgtags	Sat Jan 16 10:16:43 2016 +0000
@@ -50,6 +50,7 @@
 90d5d8df3101e2e30513934bfba018d13c12ed3f expecco_1_7_1rc2
 90d5d8df3101e2e30513934bfba018d13c12ed3f expecco_1_7_1rc3
 90d5d8df3101e2e30513934bfba018d13c12ed3f expecco_1_7_1rc4
+913efc76315ab770900fef2e629b8537ff790fc7 expecco_ALM_1_9_7
 972d6dc09e15b28ae4ee87d0a53621a5f9efc76c rel5_4_6
 9e899aca859714fcc316a27d2c46429e38133f2d expecco_1_5_0
 a01df3cdda2d6c7b6f0d3e43087dd8457af168e1 expeccoNET_1_6_0_0
--- a/SimpleView.st	Fri Jan 15 13:11:20 2016 +0000
+++ b/SimpleView.st	Sat Jan 16 10:16:43 2016 +0000
@@ -30,7 +30,7 @@
 		FlagRequestFocusOnPointerEnter
 		FlagDoNotRequestFocusOnPointerEnter FlagNativeWidget
 		FlagIsUnmappedModalBox FlagIsMDIChild FlagHiddenOnRealize
-		FlagHasExplicitExtent FlagTakeFocusWhenMapped'
+		FlagHasExplicitExtent FlagTakeFocusWhenMapped FlagBeingDestroyed'
 	poolDictionaries:''
 	category:'Views-Basic'
 !
@@ -771,31 +771,32 @@
 
 initialize
     DefaultStyle isNil ifTrue:[
-	Font initialize.
-	Form initialize.
-	Color initialize.
+        Font initialize.
+        Form initialize.
+        Color initialize.
     ].
     self == SimpleView ifTrue:[
-	Smalltalk addDependent:self   "/ to get language changes
+        Smalltalk addDependent:self   "/ to get language changes
     ].
 
     ReturnFocusWhenClosingModalBoxes := false.
 
-    FlagOriginChanged                   := 2r0000000000001.
-    FlagExtentChanged                   := 2r0000000000010.
-    FlagCornerChanged                   := 2r0000000000100.
-
-    FlagCanTab                          := 2r0000000001000.
-    FlagExtentChangedBeforeCreated      := 2r0000000010000.
-    FlagRequestFocusOnPointerEnter      := 2r0000000100000.
-    FlagDoNotRequestFocusOnPointerEnter := 2r0000001000000.
-    FlagNativeWidget                    := 2r0000010000000.
-    FlagIsUnmappedModalBox              := 2r0000100000000.
-    FlagIsMDIChild                      := 2r0001000000000.
-
-    FlagHiddenOnRealize                 := 2r0010000000000.
-    FlagHasExplicitExtent               := 2r0100000000000.
-    FlagTakeFocusWhenMapped             := 2r1000000000000.
+    FlagOriginChanged                   := 2r00000000000001.
+    FlagExtentChanged                   := 2r00000000000010.
+    FlagCornerChanged                   := 2r00000000000100.
+
+    FlagCanTab                          := 2r00000000001000.
+    FlagExtentChangedBeforeCreated      := 2r00000000010000.
+    FlagRequestFocusOnPointerEnter      := 2r00000000100000.
+    FlagDoNotRequestFocusOnPointerEnter := 2r00000001000000.
+    FlagNativeWidget                    := 2r00000010000000.
+    FlagIsUnmappedModalBox              := 2r00000100000000.
+    FlagIsMDIChild                      := 2r00001000000000.
+
+    FlagHiddenOnRealize                 := 2r00010000000000.
+    FlagHasExplicitExtent               := 2r00100000000000.
+    FlagTakeFocusWhenMapped             := 2r01000000000000.
+    FlagBeingDestroyed                  := 2r10000000000000.
 
     "Modified: / 09-12-2010 / 10:32:01 / cg"
 !
@@ -4460,13 +4461,32 @@
     "Modified: 17.6.1997 / 11:23:26 / cg"
 !
 
+isBeingDestroyed
+    "a flag which is set, when the view is being destroyed.
+     Can be checked to avoid some resizing and other layout reorganizations
+     (especially in panels), which otherwise occur while subviews are removed."
+
+    ^ flagBits bitTest:FlagBeingDestroyed.
+!
+
+isBeingDestroyed:aBoolean
+    "a flag which is set, when the view is being destroyed.
+     Can be checked to avoid some resizing and other layout reorganizations
+     (especially in panels), which otherwise occur while subviews are removed."
+
+    aBoolean ifTrue:[
+        flagBits := flagBits bitOr:FlagBeingDestroyed
+    ] ifFalse:[
+        flagBits := flagBits bitClear:FlagBeingDestroyed
+    ].
+!
+
 isHiddenOnRealize
     "return true, if the receiver will NOT be mapped when realized.
      False otherwise.
      The hiddenOnRealize flag is useful to create views which are
      to be made visible conditionally or later."
 
-    "/ ^ hiddenOnRealize
     ^ flagBits bitTest:FlagHiddenOnRealize.
 
     "Created: 17.6.1997 / 11:21:42 / cg"
@@ -7590,12 +7610,13 @@
     "unmap & destroy - make me invisible, destroy subviews then
      make me unknown to the device"
 
+    self isBeingDestroyed:true.
     realized ifTrue:[
-	self unmap.
+        self unmap.
     ].
     shown ifTrue:[
-	shown := false.
-	self changed:#visibility.
+        shown := false.
+        self changed:#visibility.
     ].
 
 "/    controller notNil ifTrue:[
@@ -7604,11 +7625,11 @@
 "/    ].
 
     subViews notNil ifTrue:[
-	self destroySubViews.
+        self destroySubViews.
     ].
     superView notNil ifTrue:[
-	superView removeSubView:self.
-	superView := nil
+        superView removeSubView:self.
+        superView := nil
     ].
     super destroy.
 
@@ -7619,13 +7640,13 @@
 "/    ].
 
     controller notNil ifTrue:[
-	controller release.
-	controller := nil.
+        controller release.
+        controller := nil.
     ].
 
     windowGroup notNil ifTrue:[
-	windowGroup removeView:self.
-	windowGroup := nil
+        windowGroup removeView:self.
+        windowGroup := nil
     ].
 
     self noticeOfWindowClose.
@@ -9805,6 +9826,7 @@
      realizing is done very late (after layout is fixed) to avoid
      visible rearranging of windows on the screen"
 
+    self isBeingDestroyed:false. "/ in case a view gets rerealized
     self realizeKeepingGroup:false at:nil iconified:false
 
     "Modified: 24.7.1997 / 13:14:28 / cg"
@@ -9871,6 +9893,7 @@
         ]
     ].
 
+    self isBeingDestroyed:false. "/ in case a view gets rerealized
     groupChange := false.
 
     (windowGroup notNil