diff -r e6adfb28e3bc -r 177cfa66f2b8 SimpleView.st --- a/SimpleView.st Wed Jun 05 17:01:43 1996 +0200 +++ b/SimpleView.st Wed Jun 05 17:15:23 1996 +0200 @@ -1202,10 +1202,36 @@ !SimpleView methodsFor:'ST-80 compatibility'! +bounds + ^ self origin corner:self corner + + "Created: 4.6.1996 / 21:23:27 / cg" +! + +bounds:aRectangle + self origin:aRectangle origin corner:aRectangle corner + + "Created: 4.6.1996 / 21:44:27 / cg" +! + checkForEvents (shown and:[windowGroup notNil]) ifTrue:[windowGroup processEvents]. ! +container + "return my container" + + ^ superView + + "Created: 5.6.1996 / 01:08:36 / cg" +! + +displayOn:aGC + self redraw + + "Created: 4.6.1996 / 21:25:59 / cg" +! + sensor "return the views sensor" @@ -2321,15 +2347,26 @@ topView "return the topView - thats the one with no superview" - |v| + |v next| v := self. [v notNil] whileTrue:[ - v superView isNil ifTrue:[^ v]. - v := v superView + (next := v container) isNil ifTrue:[^ v]. + v := next ]. ^ nil + + "Modified: 5.6.1996 / 01:09:12 / cg" +! + +view + "return my view - for real views, thats the receiver. + For wrappers, its the real view that contains it" + + ^ self + + "Created: 4.6.1996 / 21:32:11 / cg" ! ! !SimpleView methodsFor:'accessing-menus'! @@ -2560,7 +2597,11 @@ ! model + "return nil - simpleViews have no model (only providing geometric)" + ^ nil + + "Modified: 5.6.1996 / 14:17:29 / cg" ! windowGroup @@ -3722,26 +3763,46 @@ in which subviews are notified (possibly reducing redraw activity)" subViews notNil ifTrue:[ - (how isNil "false" - or:[how == #smaller]) ifTrue:[ - subViews do:[:view | - view superViewChangedSize - ] - ] ifFalse:[ - "doing it reverse speeds up resizing - usually subviews - are created from top-left to bottom-right; therefore - bottom-right views will be moved/resized first, then top-left ones; - this avoids multiple redraws of subviews" - - subViews reverseDo:[:view | - view superViewChangedSize - ] - ] + (how isNil "false" + or:[how == #smaller]) ifTrue:[ + subViews do:[:view | + view superViewChangedSize + ] + ] ifFalse:[ + "doing it reverse speeds up resizing - usually subviews + are created from top-left to bottom-right; therefore + bottom-right views will be moved/resized first, then top-left ones; + this avoids multiple redraws of subviews" + + subViews reverseDo:[:view | + view superViewChangedSize + ] + ] + ]. + + components notNil ifTrue:[ + (how isNil "false" + or:[how == #smaller]) ifTrue:[ + components do:[:view | + view containerChangedSize + ] + ] ifFalse:[ + "doing it reverse speeds up resizing - usually subviews + are created from top-left to bottom-right; therefore + bottom-right views will be moved/resized first, then top-left ones; + this avoids multiple redraws of subviews" + + components reverseDo:[:view | + view containerChangedSize + ] + ] ]. self changed:#sizeOfView with:how. superView notNil ifTrue:[ - superView subViewChangedSize + superView subViewChangedSize ] + + "Modified: 4.6.1996 / 19:31:22 / cg" ! subViewChangedSize @@ -4682,6 +4743,12 @@ "Modified: 5.6.1996 / 14:25:35 / cg" ! +isWrapper + ^ false + + "Created: 5.6.1996 / 01:05:06 / cg" +! + preferredBounds "ST-80 compatibility." @@ -4762,11 +4829,11 @@ This does not make the view visible (needs a #map for that)" drawableId isNil ifTrue:[ - " - make certain that superview is created also - " - superView notNil ifTrue:[ - superView create. + " + make certain that superview is created also + " + superView notNil ifTrue:[ + superView view create. "/ "and put my controller into the superviews controller list" "/ controller notNil ifTrue:[ @@ -4774,34 +4841,36 @@ "/ controller manager:(superView controller manager) "/ ] "/ ] - ] ifFalse:[ - "/ - "/ if the display is not already dispatching events, - "/ this starts the event process. - "/ - device startDispatch - ]. - - cursor notNil ifTrue:[ - cursor := cursor on:device. - ]. - - self physicalCreate. - - viewBackground notNil ifTrue:[ - self setViewBackground - ]. - - self initializeMiddleButtonMenu. - self initEvents. - - " - this is the first create, - force sizechange messages to be sent to the view - " - extentChanged := true. - originChanged := true + ] ifFalse:[ + "/ + "/ if the display is not already dispatching events, + "/ this starts the event process. + "/ + device startDispatch + ]. + + cursor notNil ifTrue:[ + cursor := cursor on:device. + ]. + + self physicalCreate. + + viewBackground notNil ifTrue:[ + self setViewBackground + ]. + + self initializeMiddleButtonMenu. + self initEvents. + + " + this is the first create, + force sizechange messages to be sent to the view + " + extentChanged := true. + originChanged := true ] + + "Modified: 4.6.1996 / 21:32:55 / cg" ! createWithAllSubViews @@ -4951,7 +5020,9 @@ "common code for create & recreate: physically create (but do not map) the view on the device." - "associate colors to device" + |sv| + + sv := superView isNil ifTrue:[superView] ifFalse:[superView view]. drawableId := device createWindowFor:self @@ -4960,7 +5031,7 @@ minExtent:nil maxExtent:nil borderWidth:borderWidth - subViewOf:superView + subViewOf:sv onTop:(self isPopUpView) inputOnly:(self isInputOnly) label:nil @@ -4995,7 +5066,7 @@ device setSaveUnder:true in:drawableId ]. - "Modified: 1.6.1996 / 13:22:39 / cg" + "Modified: 4.6.1996 / 21:35:32 / cg" ! realize @@ -5010,12 +5081,18 @@ "realize all my subviews" subViews notNil ifTrue:[ - subViews do:[:subView | - subView realize - ] + subViews do:[:subView | + subView realize + ] + ]. + components notNil ifTrue:[ + components do:[:component | + component realize + ] ]. "Modified: 5.9.1995 / 23:30:47 / claus" + "Modified: 4.6.1996 / 21:26:54 / cg" ! realizeInGroup @@ -5079,7 +5156,7 @@ self sizeChanged:nil. "/ new 29-aug-1995 ]. - subViews notNil ifTrue:[ + (subViews notNil or:[components notNil]) ifTrue:[ (realized not or:[groupChange]) ifTrue:[ self realizeAllSubViews. ]. @@ -5098,7 +5175,7 @@ controller startUp ] - "Modified: 8.5.1996 / 09:31:20 / cg" + "Modified: 5.6.1996 / 01:02:01 / cg" ! recreate @@ -6261,6 +6338,6 @@ !SimpleView class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.120 1996-06-05 15:01:43 cg Exp $' + ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.121 1996-06-05 15:15:23 cg Exp $' ! ! SimpleView initialize!