SimpleView.st
changeset 7622 c75552e285e5
parent 7618 50ccaeb61be1
child 7626 b6c8623c5226
--- a/SimpleView.st	Thu Oct 13 19:17:39 2016 +0200
+++ b/SimpleView.st	Fri Oct 14 13:44:39 2016 +0200
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
@@ -4403,22 +4401,22 @@
 
     self hiddenOnRealize:false.
     realized ifFalse:[
-	superView isNil ifTrue:[                "/ I am a topView
-	    self drawableId isNil ifTrue:[
-		"this once was:
-		   self realize.
-		 but we don't want Topviews to realize implicitly.
-		 BTW. the code doesn't work anyway"
-	    ] ifFalse:[
-		self remap.
-	    ].
-	] ifFalse:[
-	    (superView realized          "/ superview already shown
-	    or:[superView id notNil])    "/ superview already created
-	    ifTrue:[
-		self realize
-	    ]
-	].
+        superView isNil ifTrue:[                "/ I am a topView
+            self drawableId isNil ifTrue:[
+                "this once was:
+                   self realize.
+                 but we don't want Topviews to realize implicitly.
+                 BTW. the code doesn't work anyway"
+            ] ifFalse:[
+                self remap.
+            ].
+        ] ifFalse:[
+            (superView realized          "/ superview already shown
+            or:[superView id notNil])    "/ superview already created
+            ifTrue:[
+                self realize
+            ]
+        ].
     ]
 
     "
@@ -4492,12 +4490,13 @@
      be mapped (i.e. shown) automatically when the superview is realized.
      The hiddenOnRealize flag is useful to create views which are
      to be made visible conditionally or later.
+     Notice: if there is a visibilityChanne, this static flag is ignored.
      For ST-80 compatibility, please use #beVisible / #beInvisible."
 
     aBoolean ifTrue:[
-	flagBits := flagBits bitOr:FlagHiddenOnRealize
+        flagBits := flagBits bitOr:FlagHiddenOnRealize
     ] ifFalse:[
-	flagBits := flagBits bitClear:FlagHiddenOnRealize
+        flagBits := flagBits bitClear:FlagHiddenOnRealize
     ].
 
     "Modified: 17.6.1997 / 11:23:26 / cg"
@@ -4527,10 +4526,14 @@
     "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."
-
-    ^ flagBits bitTest:FlagHiddenOnRealize.
-
+     to be made visible conditionally or later.
+     Notice: if there is a visibilityChanne, the static flag is ignored."
+
+    visibilityChannel isNil ifTrue:[
+        ^ flagBits bitTest:FlagHiddenOnRealize.
+    ].
+    ^ visibilityChannel value not
+    
     "Created: 17.6.1997 / 11:21:42 / cg"
 !
 
@@ -9955,11 +9958,11 @@
     self fetchDeviceResources.
 
     self drawableId isNil ifTrue:[
-	self create.
-	self drawableId isNil ifTrue:[
-	    ('SimpleView [warning]: could not create view: ' , self class name) errorPrintCR.
-	    ^ self
-	]
+        self create.
+        self drawableId isNil ifTrue:[
+            ('SimpleView [warning]: could not create view: ' , self class name) errorPrintCR.
+            ^ self
+        ]
     ].
 
     self isBeingDestroyed:false. "/ in case a view gets rerealized
@@ -9968,85 +9971,84 @@
     (windowGroup notNil
      and:[superView isNil
      and:[windowGroup isForModalSubview]]) ifTrue:[
-	keep := true.
+        keep := true.
     ] ifFalse:[
-	keep := keepGroupAsIs
+        keep := keepGroupAsIs
     ].
 
     keep ifFalse:[
-	"
-	 put myself into superviews windowgroup if there is a superview
-	 This is the default behavior, which may be suppressed by
-	 passing true as keepGroupAsIs-argument.
-	 (it may be useful to assign a separate windowGroup to
-	  a childView to have it execute independent of the parent
-	  -> an example is found in the fileBrowsers kill-button)
-	"
-	superView notNil ifTrue:[
-	    superGroup := superView windowGroup.
-	    (windowGroup notNil and:[superGroup ~~ windowGroup]) ifTrue:[
-		"
-		 mhmh - seems that the windowgroup has changed ....
-		"
+        "
+         put myself into superviews windowgroup if there is a superview
+         This is the default behavior, which may be suppressed by
+         passing true as keepGroupAsIs-argument.
+         (it may be useful to assign a separate windowGroup to
+          a childView to have it execute independent of the parent
+          -> an example is found in the fileBrowsers kill-button)
+        "
+        superView notNil ifTrue:[
+            superGroup := superView windowGroup.
+            (windowGroup notNil and:[superGroup ~~ windowGroup]) ifTrue:[
+                "
+                 mhmh - seems that the windowgroup has changed ....
+                "
 "/                'oops - wgroup change on realize' printNL.
-		groupChange := true.
-
-		"/
-		"/ recursively change the windowGroup of
-		"/ myself and all of my children
-		"/
-		self windowGroup:superGroup.
-	    ] ifFalse:[
-		windowGroup isNil ifTrue:[
-		    "/
-		    "/ only change the group of myself -
-		    "/ subviews will fetch it when realized.
-		    "/
-		    windowGroup := superGroup.
-		    superGroup notNil ifTrue:[superGroup addView:self].
-		]
-	    ].
-	].
+                groupChange := true.
+
+                "/
+                "/ recursively change the windowGroup of
+                "/ myself and all of my children
+                "/
+                self windowGroup:superGroup.
+            ] ifFalse:[
+                windowGroup isNil ifTrue:[
+                    "/
+                    "/ only change the group of myself -
+                    "/ subviews will fetch it when realized.
+                    "/
+                    windowGroup := superGroup.
+                    superGroup notNil ifTrue:[superGroup addView:self].
+                ]
+            ].
+        ].
     ].
 
     (self originOrExtentChanged) ifTrue:[
-	self fixSize.
-	self sizeChanged:nil.
+        self fixSize.
+        self sizeChanged:nil.
     ].
     position notNil ifTrue:[
-	self origin:position.
+        self origin:position.
     ].
 
     (subViews notNil or:[components notNil]) ifTrue:[
-	(realized not or:[groupChange]) ifTrue:[
-	    self isHiddenOnRealize ifFalse:[
-		self realizeAllSubViews.
-	    ].
-	].
+        (realized not or:[groupChange]) ifTrue:[
+            self isHiddenOnRealize ifFalse:[
+                self realizeAllSubViews.
+            ].
+        ].
     ].
 
     self preRealize.
 
     iconified ifTrue:[
-	realized ifFalse:[
-	    self mapIconified
-	]
+        realized ifFalse:[
+            self mapIconified
+        ]
     ] ifFalse:[
-	(self isHiddenOnRealize not
-	 and:[visibilityChannel isNil or:[visibilityChannel value]]) ifTrue:[
-	    self setInnerClip.
-
-	    realized ifFalse:[
-		"
-		 now, make the view visible
-		"
-		self mapAt:position
-	    ]
-	]
+        self isHiddenOnRealize ifFalse:[
+            self setInnerClip.
+
+            realized ifFalse:[
+                "
+                 now, make the view visible
+                "
+                self mapAt:position
+            ]
+        ]
     ].
 
     controller notNil ifTrue:[
-	controller startUp
+        controller startUp
     ].
 
     self postRealize