--- a/SimpleView.st Mon Jan 24 17:34:12 2000 +0100
+++ b/SimpleView.st Tue Jan 25 11:58:33 2000 +0100
@@ -1,6 +1,6 @@
"
COPYRIGHT (c) 1989 by Claus Gittinger
- All Rights Reserved
+ All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
@@ -65,7 +65,7 @@
copyright
"
COPYRIGHT (c) 1989 by Claus Gittinger
- All Rights Reserved
+ All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
@@ -93,133 +93,133 @@
[Instance variables:]
- superView <View> my superview i.e. the view I am in
-
- subViews <Collection> the collection of subviews
-
- components <Collection> collection of gadgets (will be merged with subViews, soon)
-
- borderColor <Color> color of border
-
- borderWidth <Number> borderWidth in pixels (device dep.)
-
- viewShape <Form> shape of view & border (if device supports it)
-
- top <Number> actual top coordinate (pixels) in superview
-
- left <Number> actual left coordinate (pixels) in superview
-
- extendChanged <Boolean> true if extend changed during setup
-
- originChanged <Boolean> true if origin changed during setup
-
- relativeOrigin <Number> relative origin in percent within superview
-
- relativeExtent <Number> relative extent in percent within superview
-
- relativeCorner <Number> relative corner in percent within superview
-
- originRule <Block> rule to compute origin if superview changes size
-
- extentRule <Block> rule to compute extent if superview changes size
-
- cornerRule <Block> rule to compute corner if superview changes size
-
- insets <Array> array with top, left, bottom & right insets (or nil)
-
- layout <LayoutObject> not yet implemented - will replace the above layout
- variables.
-
- shown <Boolean> true if visible (false if iconified, unmapped or covered)
-
- hiddenOnRealize <Boolean> dont show automatically when superview is realized
-
- name <String> my name (future use for resources)
-
- level <Number> 3D level relative to superview
-
- margin <Number> convenient margin
-
- innerClipRect <Rectangle> convenient inner clip (minus margin)
-
- shadowColor <Color> color used to draw 3D shadowed edges
-
- lightColor <Color> color used to draw 3D lighted edges
-
- bitGravity <nil | Symbol> gravity of contents (if device supports it)
-
- viewGravity <nil | Symbol> gravity of view (if device supports it)
-
- controller <nil | Controller> the controller (if any)
-
- windowGroup <WindowGroup> the windowGroup
+ superView <View> my superview i.e. the view I am in
+
+ subViews <Collection> the collection of subviews
+
+ components <Collection> collection of gadgets (will be merged with subViews, soon)
+
+ borderColor <Color> color of border
+
+ borderWidth <Number> borderWidth in pixels (device dep.)
+
+ viewShape <Form> shape of view & border (if device supports it)
+
+ top <Number> actual top coordinate (pixels) in superview
+
+ left <Number> actual left coordinate (pixels) in superview
+
+ extendChanged <Boolean> true if extend changed during setup
+
+ originChanged <Boolean> true if origin changed during setup
+
+ relativeOrigin <Number> relative origin in percent within superview
+
+ relativeExtent <Number> relative extent in percent within superview
+
+ relativeCorner <Number> relative corner in percent within superview
+
+ originRule <Block> rule to compute origin if superview changes size
+
+ extentRule <Block> rule to compute extent if superview changes size
+
+ cornerRule <Block> rule to compute corner if superview changes size
+
+ insets <Array> array with top, left, bottom & right insets (or nil)
+
+ layout <LayoutObject> not yet implemented - will replace the above layout
+ variables.
+
+ shown <Boolean> true if visible (false if iconified, unmapped or covered)
+
+ hiddenOnRealize <Boolean> dont show automatically when superview is realized
+
+ name <String> my name (future use for resources)
+
+ level <Number> 3D level relative to superview
+
+ margin <Number> convenient margin
+
+ innerClipRect <Rectangle> convenient inner clip (minus margin)
+
+ shadowColor <Color> color used to draw 3D shadowed edges
+
+ lightColor <Color> color used to draw 3D lighted edges
+
+ bitGravity <nil | Symbol> gravity of contents (if device supports it)
+
+ viewGravity <nil | Symbol> gravity of view (if device supports it)
+
+ controller <nil | Controller> the controller (if any)
+
+ windowGroup <WindowGroup> the windowGroup
[Class variables:]
- Grey <Color> the color grey - its used so often
-
- ViewSpacing <Number> preferred spacing between views; 1mm
-
- CentPoint <Point> 100 @ 100 - its used so often
-
- StyleSheet <ResourcePack> contains all view-style specifics
-
- ReturnFocusWhenClosingModalBoxes if true, a closing modalBox returns
- <Boolean> the keyboard focus to the view which was
- active when the box was opened.
- If false (the default), it is left to
- window manager to assign a new focus.
- If running on olwm/olvwm (which requires an
- explicit click to reassign a focus), it is
- better to turn this on in a private.rc file.
+ Grey <Color> the color grey - its used so often
+
+ ViewSpacing <Number> preferred spacing between views; 1mm
+
+ CentPoint <Point> 100 @ 100 - its used so often
+
+ StyleSheet <ResourcePack> contains all view-style specifics
+
+ ReturnFocusWhenClosingModalBoxes if true, a closing modalBox returns
+ <Boolean> the keyboard focus to the view which was
+ active when the box was opened.
+ If false (the default), it is left to
+ window manager to assign a new focus.
+ If running on olwm/olvwm (which requires an
+ explicit click to reassign a focus), it is
+ better to turn this on in a private.rc file.
[styleSheet parameters:]
- popupShadow <Boolean> if true, popupViews show a shadow below
-
- popupLevel <nil | Integer> 3D level
-
- borderWidth <nil | Integer> borderWidth (ignored in 3D styles)
-
- borderColor <nil | Color> borderColor (ignored in 3D styles)
-
- viewBackground <nil | Color> views background
-
- shadowColor <nil | Color> color for shadow edges (ignored in 2D styles)
-
- lightColor <nil | Color> color for light edges (ignored in 2D styles)
-
- font <nil | Font> font to use
+ popupShadow <Boolean> if true, popupViews show a shadow below
+
+ popupLevel <nil | Integer> 3D level
+
+ borderWidth <nil | Integer> borderWidth (ignored in 3D styles)
+
+ borderColor <nil | Color> borderColor (ignored in 3D styles)
+
+ viewBackground <nil | Color> views background
+
+ shadowColor <nil | Color> color for shadow edges (ignored in 2D styles)
+
+ lightColor <nil | Color> color for light edges (ignored in 2D styles)
+
+ font <nil | Font> font to use
TODO:
- get rid of relativeOrigin, relativeCorner, originRule, extentRule,
- and insets; replace by a single object which defines the size
- (mhmh - ST-80 seems to call this LayoutFrame ?)
- -> be prepared for a change here in the near future and ONLY use
- access methods to get those instance variables' values
-
- get rid of 3D level & margin, move it to extra wrappers
- (although this will make view setup more complicated, it will remove
- complexity from the internals of view. Also, it will allow for more
- varieties of borders.)
+ get rid of relativeOrigin, relativeCorner, originRule, extentRule,
+ and insets; replace by a single object which defines the size
+ (mhmh - ST-80 seems to call this LayoutFrame ?)
+ -> be prepared for a change here in the near future and ONLY use
+ access methods to get those instance variables' values
+
+ get rid of 3D level & margin, move it to extra wrappers
+ (although this will make view setup more complicated, it will remove
+ complexity from the internals of view. Also, it will allow for more
+ varieties of borders.)
- add components (could also call them gadgets or lightweight views)
- - views are expensive in terms of X resources. This would make all
- framing/edge and panel helper views become cheap ST objects, instead
- of views.
+ add components (could also call them gadgets or lightweight views)
+ - views are expensive in terms of X resources. This would make all
+ framing/edge and panel helper views become cheap ST objects, instead
+ of views.
[see also:]
- StandardSystemView DialogBox
- WindowGroup WindowEvent
- Layout
- ( introduction to view programming :html: programming/viewintro.html )
+ StandardSystemView DialogBox
+ WindowGroup WindowEvent
+ Layout
+ ( introduction to view programming :html: programming/viewintro.html )
[author:]
- Claus Gittinger
+ Claus Gittinger
"
!
@@ -229,50 +229,50 @@
to make the individual subviews visible)
a subView in a topView:
- [exBegin]
- |top v|
-
- top := StandardSystemView new.
- v := View new.
- v origin:0.25 @ 0.25 corner:0.75 @ 0.75.
- top addSubView:v.
- top open
- [exEnd]
+ [exBegin]
+ |top v|
+
+ top := StandardSystemView new.
+ v := View new.
+ v origin:0.25 @ 0.25 corner:0.75 @ 0.75.
+ top addSubView:v.
+ top open
+ [exEnd]
the same, a bit more compact:
- [exBegin]
- |top v|
-
- top := StandardSystemView new.
- v := View origin:0.25 @ 0.25 corner:0.75 @ 0.75 in:top.
- top open
- [exEnd]
+ [exBegin]
+ |top v|
+
+ top := StandardSystemView new.
+ v := View origin:0.25 @ 0.25 corner:0.75 @ 0.75 in:top.
+ top open
+ [exEnd]
fixed position/size:
- [exBegin]
+ [exBegin]
|top v1 v2|
top := StandardSystemView new.
top extent:300@300.
v1 := View origin:10@10
- corner:50@50
- in:top.
+ corner:50@50
+ in:top.
v2 := View origin:60@10
- corner:150@100
- in:top.
+ corner:150@100
+ in:top.
v1 viewBackground:(Color red).
v2 viewBackground:(Color yellow).
top open
- [exEnd]
+ [exEnd]
same, using ST-80 way of bulding up view hierarchies
(recommended, if you plan to port applications later)
- [exBegin]
+ [exBegin]
|top v1 v2|
top := StandardSystemView new.
@@ -294,10 +294,10 @@
v2 viewBackground:(Color yellow).
top open
- [exEnd]
+ [exEnd]
fixed origin, variable size:
- [exBegin]
+ [exBegin]
|top v1 v2|
top := StandardSystemView new.
@@ -316,11 +316,11 @@
top add:v2.
top open
- [exEnd]
+ [exEnd]
fixed origin, variable size,
bottomInset for constant distance from bottom:
- [exBegin]
+ [exBegin]
|top v1 v2|
top := StandardSystemView new.
@@ -341,10 +341,10 @@
top add:v2.
top open
- [exEnd]
+ [exEnd]
variable origin, variable size,
- [exBegin]
+ [exBegin]
|top v1 v2|
top := StandardSystemView new.
@@ -363,11 +363,11 @@
top add:v2.
top open
- [exEnd]
+ [exEnd]
variable origin, variable size,
insets for some constant distance
- [exBegin]
+ [exBegin]
|top v1 v2|
top := StandardSystemView new.
@@ -388,11 +388,11 @@
top add:v2.
top open
- [exEnd]
+ [exEnd]
using layout objects (ST-80 style):
fully specifying the frame
- [exBegin]
+ [exBegin]
|top v1 v2|
top := StandardSystemView new.
@@ -405,21 +405,21 @@
v2 viewBackground:(Color yellow).
top add:v1 in:(LayoutFrame new
- leftFraction:0.25;
- rightFraction:0.75;
- topFraction:0.0;
- bottomFraction:0.5).
+ leftFraction:0.25;
+ rightFraction:0.75;
+ topFraction:0.0;
+ bottomFraction:0.5).
top add:v2 in:(LayoutFrame new
- leftFraction:0.5;
- rightFraction:1.0;
- topFraction:0.5;
- bottomFraction:0.75).
+ leftFraction:0.5;
+ rightFraction:1.0;
+ topFraction:0.5;
+ bottomFraction:0.75).
top open
- [exEnd]
+ [exEnd]
another one, with offsets:
- [exBegin]
+ [exBegin]
|top v1 v2|
top := StandardSystemView new.
@@ -432,22 +432,22 @@
v2 viewBackground:(Color yellow).
top add:v1 in:(LayoutFrame new
- leftFraction:0.0 offset:10;
- rightFraction:1.0 offset:-10;
- topFraction:0.0 offset:10;
- bottomFraction:0.5).
+ leftFraction:0.0 offset:10;
+ rightFraction:1.0 offset:-10;
+ topFraction:0.0 offset:10;
+ bottomFraction:0.5).
top add:v2 in:(LayoutFrame new
- leftFraction:0.0 offset:30;
- rightFraction:1.0 offset:-30;
- topFraction:0.5 offset:10;
- bottomFraction:0.75).
+ leftFraction:0.0 offset:30;
+ rightFraction:1.0 offset:-30;
+ topFraction:0.5 offset:10;
+ bottomFraction:0.75).
top open
- [exEnd]
+ [exEnd]
specifying origin only. Extent is views preferred
(notice, that plain views have some defaultExtent of 100@100)
- [exBegin]
+ [exBegin]
|top v1 v2|
top := StandardSystemView new.
@@ -460,17 +460,17 @@
v2 viewBackground:(Color yellow).
top add:v1 in:(LayoutOrigin new
- leftFraction:0.25;
- topFraction:0.0).
+ leftFraction:0.25;
+ topFraction:0.0).
top add:v2 in:(LayoutOrigin new
- leftFraction:0.5;
- topFraction:0.5).
+ leftFraction:0.5;
+ topFraction:0.5).
top open
- [exEnd]
+ [exEnd]
same example, using buttons which compute their preferredBounds:
- [exBegin]
+ [exBegin]
|top v1 v2|
top := StandardSystemView new.
@@ -483,27 +483,27 @@
v2 backgroundColor:(Color yellow).
top add:v1 in:(LayoutOrigin new
- leftFraction:0.25;
- topFraction:0.0).
+ leftFraction:0.25;
+ topFraction:0.0).
top add:v2 in:(LayoutOrigin new
- leftFraction:0.5;
- topFraction:0.5).
+ leftFraction:0.5;
+ topFraction:0.5).
top open
- [exEnd]
+ [exEnd]
"
!
layoutComputation
"
Due to historic reasons, there are 2 mechanisms to resize a view:
- - (old, to be eliminated mechanism)
- based upon info found in
- relativeOrigin / relativeCorner / relativeExtent
- originRule / cornerRule / extentRule
-
- - (new, will migrate to that one)
- letting a layoutObject compute things
+ - (old, to be eliminated mechanism)
+ based upon info found in
+ relativeOrigin / relativeCorner / relativeExtent
+ originRule / cornerRule / extentRule
+
+ - (new, will migrate to that one)
+ letting a layoutObject compute things
Actually, the old mechanism is just as powerful, as the new (layoutObject
based) mechanism; with the help of block=rules, you can compute whatever
@@ -520,13 +520,13 @@
Notice, that a view recomputes its size whenever its superview
changes size. This is done via:
- sizeChanged
- -> allSubviews: superViewChangedSize
+ sizeChanged
+ -> allSubviews: superViewChangedSize
If the geometry computation as performed in superViewChangedSize
is not powerful enough for your application, you can either:
- - redefine superViewChangedSize
- - create a special layoutObject which computes a new layout.
+ - redefine superViewChangedSize
+ - create a special layoutObject which computes a new layout.
"
!
@@ -535,11 +535,11 @@
Due to historic reasons, there are multiple mechanisms for popupMenu
definition:
- - static menus
-
- - dynamic menus from the view
-
- - dynamic menus from the model / menuHolder
+ - static menus
+
+ - dynamic menus from the view
+
+ - dynamic menus from the model / menuHolder
static menus
@@ -550,35 +550,35 @@
It can be defined at initialization time or redefined any time later.
The menu is defined with:
- someView middleButtonMenu:<aPopUpMenu>
+ someView middleButtonMenu:<aPopUpMenu>
Compatibility note:
- static menus should no longer be used - their operation
- is incompatible with ST-80 and ST/X's dynamic menus.
- Do not use them if you care for compatibility.
+ static menus should no longer be used - their operation
+ is incompatible with ST-80 and ST/X's dynamic menus.
+ Do not use them if you care for compatibility.
Also, they do not care for any menuPerformers or menuHolders.
(instead, they use a receiver instance variable, which gets the messages).
example:
- |top v1 v2|
-
- top := StandardSystemView new.
- top extent:300@300.
-
- v1 := View origin:0.0@0.0 corner:0.5@1.0 in:top.
- v1 viewBackground:Color red.
-
- v2 := View origin:0.5@0.0 corner:1.0@1.0 in:top.
- v2 viewBackground:Color yellow.
-
- v1 middleButtonMenu:(
- PopUpMenu
- labels:#('foo' 'bar')
- selectors:#(foo bar)
- receiver:v1
- ).
+ |top v1 v2|
+
+ top := StandardSystemView new.
+ top extent:300@300.
+
+ v1 := View origin:0.0@0.0 corner:0.5@1.0 in:top.
+ v1 viewBackground:Color red.
+
+ v2 := View origin:0.5@0.0 corner:1.0@1.0 in:top.
+ v2 viewBackground:Color yellow.
+
+ v1 middleButtonMenu:(
+ PopUpMenu
+ labels:#('foo' 'bar')
+ selectors:#(foo bar)
+ receiver:v1
+ ).
- top open.
+ top open.
@@ -604,42 +604,42 @@
to the view IFF the model would not respond to the menu message.
(this allows mixing of menu messages for the view AND the model).
- |top v1 v2 holder|
-
- holder := Plug new.
- holder respondTo:#menu1
- with:[
- v1 menuMessage:#otherMenu1.
- PopUpMenu
- labels:#('foo' 'bar')
- selectors:#(foo bar).
- ].
- holder respondTo:#otherMenu1
- with:[
- v1 menuMessage:#menu1.
- PopUpMenu
- labels:#('other foo' 'other bar')
- selectors:#(foo bar).
- ].
- holder respondTo:#menu2
- with:[ PopUpMenu
- labels:#('copy' 'bar2')
- selectors:#(copySelection bar2)
- ].
-
- top := StandardSystemView new.
- top extent:300@300.
-
- v1 := View origin:0.0@0.0 corner:0.5@1.0 in:top.
- v1 viewBackground:Color red.
-
- v2 := TextView origin:0.5@0.0 corner:1.0@1.0 in:top.
- v2 contents:'pop me up'.
-
- v1 model:holder; menuMessage:#menu1.
- v2 menuHolder:holder; menuMessage:#menu2.
-
- top open.
+ |top v1 v2 holder|
+
+ holder := Plug new.
+ holder respondTo:#menu1
+ with:[
+ v1 menuMessage:#otherMenu1.
+ PopUpMenu
+ labels:#('foo' 'bar')
+ selectors:#(foo bar).
+ ].
+ holder respondTo:#otherMenu1
+ with:[
+ v1 menuMessage:#menu1.
+ PopUpMenu
+ labels:#('other foo' 'other bar')
+ selectors:#(foo bar).
+ ].
+ holder respondTo:#menu2
+ with:[ PopUpMenu
+ labels:#('copy' 'bar2')
+ selectors:#(copySelection bar2)
+ ].
+
+ top := StandardSystemView new.
+ top extent:300@300.
+
+ v1 := View origin:0.0@0.0 corner:0.5@1.0 in:top.
+ v1 viewBackground:Color red.
+
+ v2 := TextView origin:0.5@0.0 corner:1.0@1.0 in:top.
+ v2 contents:'pop me up'.
+
+ v1 model:holder; menuMessage:#menu1.
+ v2 menuHolder:holder; menuMessage:#menu2.
+
+ top open.
an additional goody is the possibility, to change the menuPerformer (textViews only).
If defined, that one will get the menus message (instead of the model/view).
@@ -652,31 +652,31 @@
- it could be forwarded to the view, though.
This could be useful to intercept/filter things).
- |top v menuProvider menuExecutor |
-
- menuProvider := Plug new.
- menuProvider respondTo:#menu
- with:[ PopUpMenu
- labels:#('copy' 'foo')
- selectors:#(copySelection foo)
- ].
-
- menuExecutor := Plug new.
- menuExecutor respondTo:#copySelection
- with:[Transcript showCR:'copy function'].
- menuExecutor respondTo:#foo
- with:[Transcript showCR:'foo function'].
-
- top := StandardSystemView new.
- top extent:300@300.
-
- v := TextView origin:0.0@0.0 corner:1.0@1.0 in:top.
- v contents:'pop me up'.
-
- v menuHolder:menuProvider; menuMessage:#menu.
- v menuPerformer:menuExecutor.
-
- top open.
+ |top v menuProvider menuExecutor |
+
+ menuProvider := Plug new.
+ menuProvider respondTo:#menu
+ with:[ PopUpMenu
+ labels:#('copy' 'foo')
+ selectors:#(copySelection foo)
+ ].
+
+ menuExecutor := Plug new.
+ menuExecutor respondTo:#copySelection
+ with:[Transcript showCR:'copy function'].
+ menuExecutor respondTo:#foo
+ with:[Transcript showCR:'foo function'].
+
+ top := StandardSystemView new.
+ top extent:300@300.
+
+ v := TextView origin:0.0@0.0 corner:1.0@1.0 in:top.
+ v contents:'pop me up'.
+
+ v menuHolder:menuProvider; menuMessage:#menu.
+ v menuPerformer:menuExecutor.
+
+ top open.
"
! !
@@ -684,13 +684,13 @@
initialize
DefaultStyle isNil ifTrue:[
- Font initialize.
- Form initialize.
- Color initialize.
-
- self == SimpleView ifTrue:[
- Smalltalk addDependent:self "/ to get language changes
- ]
+ Font initialize.
+ Form initialize.
+ Color initialize.
+
+ self == SimpleView ifTrue:[
+ Smalltalk addDependent:self "/ to get language changes
+ ]
].
ReturnFocusWhenClosingModalBoxes := false.
@@ -699,7 +699,7 @@
postAutoload
(Screen notNil and:[Screen current notNil]) ifTrue:[
- self updateStyleCache.
+ self updateStyleCache.
]
! !
@@ -709,21 +709,21 @@
"create a new view with given extent"
^ self origin:nil extent:extent borderWidth:nil
- font:nil label:nil in:nil
+ font:nil label:nil in:nil
!
extent:extent in:aView
"create a new view as a subview of aView with given extent"
^ self origin:nil extent:extent borderWidth:nil
- font:nil label:nil in:aView
+ font:nil label:nil in:aView
!
extent:extent label:label
"create a new view with given extent and label"
^ self origin:nil extent:extent borderWidth:nil
- font:nil label:label in:nil
+ font:nil label:label in:nil
!
in:aView
@@ -738,10 +738,10 @@
newView := self basicNew.
aView notNil ifTrue:[
- newView device:(aView graphicsDevice).
+ newView device:(aView graphicsDevice).
"/ newView container:aView.
] ifFalse:[
- newView device:Screen current
+ newView device:Screen current
].
newView initialize.
aView notNil ifTrue:[aView addSubView:newView].
@@ -754,14 +754,14 @@
"create a new view with given label"
^ self origin:nil extent:nil borderWidth:nil
- font:nil label:label in:nil
+ font:nil label:label in:nil
!
label:label in:aView
"create a new view as subview of aView with given label"
^ self origin:nil extent:nil borderWidth:nil
- font:nil label:label in:aView
+ font:nil label:label in:aView
!
model:aModel
@@ -793,9 +793,9 @@
|device|
anotherView notNil ifTrue:[
- device := anotherView graphicsDevice.
+ device := anotherView graphicsDevice.
] ifFalse:[
- device := Screen current.
+ device := Screen current.
].
^ self onDevice:device
@@ -806,19 +806,19 @@
"create a new view with given origin and extent"
^ self origin:origin corner:corner borderWidth:nil
- font:nil label:nil in:nil
+ font:nil label:nil in:nil
!
origin:anOrigin corner:aCorner borderWidth:bw font:aFont label:aLabel in:aView
|newView|
aView notNil ifTrue:[
- newView := self basicNew.
- newView device:(aView graphicsDevice).
- newView initialize.
- aView addSubView:newView.
+ newView := self basicNew.
+ newView device:(aView graphicsDevice).
+ newView initialize.
+ aView addSubView:newView.
] ifFalse:[
- newView := self onDevice:Screen current
+ newView := self onDevice:Screen current
].
bw notNil ifTrue:[newView borderWidth:bw].
anOrigin notNil ifTrue:[newView origin:anOrigin].
@@ -834,40 +834,40 @@
"create a new view as a subview of aView with given origin and extent"
^ self origin:origin corner:corner borderWidth:bw
- font:nil label:nil in:aView
+ font:nil label:nil in:aView
!
origin:origin corner:corner in:aView
"create a new view as a subview of aView with given origin and extent"
^ self origin:origin corner:corner borderWidth:nil
- font:nil label:nil in:aView
+ font:nil label:nil in:aView
!
origin:origin extent:extent
"create a new view with given origin and extent"
^ self origin:origin extent:extent borderWidth:nil
- font:nil label:nil in:nil
+ font:nil label:nil in:nil
!
origin:origin extent:extent borderWidth:bw
"create a new view with given origin, extent and borderWidth"
^ self origin:origin extent:extent borderWidth:bw
- font:nil label:nil in:nil
+ font:nil label:nil in:nil
!
origin:anOrigin extent:anExtent borderWidth:bw font:aFont label:aLabel in:aView
|newView|
aView notNil ifTrue:[
- newView := self basicNew.
- newView device:(aView graphicsDevice).
- newView initialize.
- aView addSubView:newView.
+ newView := self basicNew.
+ newView device:(aView graphicsDevice).
+ newView initialize.
+ aView addSubView:newView.
] ifFalse:[
- newView := self onDevice:Screen current
+ newView := self onDevice:Screen current
].
bw notNil ifTrue:[newView borderWidth:bw].
anExtent notNil ifTrue:[newView extent:anExtent].
@@ -884,36 +884,36 @@
and borderWidth"
^ self origin:origin extent:extent borderWidth:bw
- font:nil label:nil in:aView
+ font:nil label:nil in:aView
!
origin:origin extent:extent font:aFont label:label
^ self origin:origin extent:extent borderWidth:nil
- font:nil label:label in:nil
+ font:nil label:label in:nil
!
origin:origin extent:extent font:aFont label:label in:aView
^ self origin:origin extent:extent borderWidth:nil
- font:aFont label:label in:aView
+ font:aFont label:label in:aView
!
origin:origin extent:extent in:aView
"create a new view as a subview of aView with given origin and extent"
^ self origin:origin extent:extent borderWidth:nil
- font:nil label:nil in:aView
+ font:nil label:nil in:aView
!
origin:origin extent:extent label:label
"create a new view with given origin, extent and label"
^ self origin:origin extent:extent borderWidth:nil
- font:nil label:label in:nil
+ font:nil label:label in:nil
!
origin:anOrigin extent:anExtent
- label:aLabel icon:aForm
- minExtent:minExtent maxExtent:maxExtent
+ label:aLabel icon:aForm
+ minExtent:minExtent maxExtent:maxExtent
|newView|
newView := self onDevice:Screen current.
@@ -930,15 +930,15 @@
"create a new view as a subview of aView with given origin"
^ self origin:origin extent:nil borderWidth:nil
- font:nil label:nil in:aView
+ font:nil label:nil in:aView
! !
!SimpleView class methodsFor:'change & update'!
update:something with:aParameter from:changedObject
something == #Language ifTrue:[
- "flush resources on language changes"
- self flushAllClassResources
+ "flush resources on language changes"
+ self flushAllClassResources
]
"Created: 15.6.1996 / 15:23:04 / cg"
@@ -963,19 +963,19 @@
DefaultFont notNil ifTrue:[^ DefaultFont].
DefaultFont isNil ifTrue:[
- self == SimpleView ifFalse:[
- f := self superclass defaultFont.
- ] ifTrue:[
- f := super defaultFont
- ].
+ self == SimpleView ifFalse:[
+ f := self superclass defaultFont.
+ ] ifTrue:[
+ f := super defaultFont
+ ].
].
f notNil ifTrue:[
- DefaultFont := f.
- f := f onDevice:(Screen current).
- f notNil ifTrue:[
- DefaultFont := f.
- ]
+ DefaultFont := f.
+ f := f onDevice:(Screen current).
+ f notNil ifTrue:[
+ DefaultFont := f.
+ ]
].
^ DefaultFont
@@ -989,10 +989,10 @@
DefaultFont := aFont.
aFont notNil ifTrue:[
- f := aFont onDevice:(Screen current).
- f notNil ifTrue:[
- DefaultFont := f.
- ]
+ f := aFont onDevice:(Screen current).
+ f notNil ifTrue:[
+ DefaultFont := f.
+ ]
]
"Modified: 18.3.1996 / 12:56:20 / cg"
@@ -1013,7 +1013,7 @@
DefaultStyle := aStyle.
(Screen notNil and:[Screen current notNil]) ifTrue:[
- self readStyleSheetAndUpdateAllStyleCaches.
+ self readStyleSheetAndUpdateAllStyleCaches.
].
"
@@ -1046,15 +1046,15 @@
StyleSheet := ViewStyle fromFile:(DefaultStyle , '.style').
StyleSheet fileReadFailed ifTrue:[
- ('***** WARNING: no styleSheet for ' , DefaultStyle , '-style.') errorPrintCR.
- DefaultStyle ~~ #normal ifTrue:[
- DefaultStyle := #normal.
- StyleSheet := ViewStyle fromFile:(DefaultStyle , '.style').
+ ('***** WARNING: no styleSheet for ' , DefaultStyle , '-style.') errorPrintCR.
+ DefaultStyle ~~ #normal ifTrue:[
+ DefaultStyle := #normal.
+ StyleSheet := ViewStyle fromFile:(DefaultStyle , '.style').
- StyleSheet fileReadFailed ifTrue:[
- '***** WARNING: not even a styleSheet for normal-style (using defaults).' errorPrintCR.
- ]
- ]
+ StyleSheet fileReadFailed ifTrue:[
+ '***** WARNING: not even a styleSheet for normal-style (using defaults).' errorPrintCR.
+ ]
+ ]
].
"Created: / 15.9.1998 / 22:03:06 / cg"
@@ -1065,8 +1065,8 @@
Needed after a style change or when a style file has been changed"
DefaultStyle notNil ifTrue:[
- self readStyleSheet.
- self updateAllStyleCaches
+ self readStyleSheet.
+ self updateAllStyleCaches
]
"Created: / 15.9.1998 / 22:03:59 / cg"
@@ -1104,13 +1104,13 @@
defStyle := OperatingSystem getEnvironment:'STX_VIEWSTYLE'.
defStyle notNil ifTrue:[
- DefaultStyle := defStyle asSymbol.
+ DefaultStyle := defStyle asSymbol.
] ifFalse:[
- OperatingSystem isMSWINDOWSlike ifTrue:[
- DefaultStyle := #mswindows95
- ] ifFalse:[
- DefaultStyle := #motif
- ]
+ OperatingSystem isMSWINDOWSlike ifTrue:[
+ DefaultStyle := #mswindows95
+ ] ifFalse:[
+ DefaultStyle := #motif
+ ]
].
!
@@ -1147,10 +1147,10 @@
self changed:#style.
SimpleView updateStyleCache.
SimpleView allSubclassesDo:[:aClass |
- aClass defaultFont:nil.
- (aClass class implements:#updateStyleCache) ifTrue:[
- aClass updateStyleCache
- ].
+ aClass defaultFont:nil.
+ (aClass class implements:#updateStyleCache) ifTrue:[
+ aClass updateStyleCache
+ ].
]
"
@@ -1169,8 +1169,8 @@
anyway."
<resource: #style (#viewSpacing #font #borderWidth #borderColor
- #viewBackground #shadowColor #lightColor
- #focusColor #focusBorderWidth)>
+ #viewBackground #shadowColor #lightColor
+ #focusColor #focusBorderWidth)>
|bgGrey currentScreen|
@@ -1179,68 +1179,68 @@
and keep the values in fast class variables
"
StyleSheet isNil ifTrue:[
- self setDefaultStyle.
- StyleSheet := ViewStyle fromFile:(DefaultStyle , '.style').
+ self setDefaultStyle.
+ StyleSheet := ViewStyle fromFile:(DefaultStyle , '.style').
].
currentScreen := Screen current.
Grey := StyleSheet viewGrey.
Grey isNil ifTrue:[
- Grey := Color grey
+ Grey := Color grey
].
Grey := Grey onDevice:currentScreen.
StyleSheet fileReadFailed ifTrue:[
- bgGrey := White
+ bgGrey := White
] ifFalse:[
- currentScreen hasGrayscales ifTrue:[
- bgGrey := Grey
- ] ifFalse:[
- bgGrey := White
- ]
+ currentScreen hasGrayscales ifTrue:[
+ bgGrey := Grey
+ ] ifFalse:[
+ bgGrey := White
+ ]
].
bgGrey := bgGrey onDevice:currentScreen.
ViewSpacing := StyleSheet at:#viewSpacing.
ViewSpacing isNil ifTrue:[
- ViewSpacing := currentScreen defaultStyleValueFor:#viewSpacing.
+ ViewSpacing := currentScreen defaultStyleValueFor:#viewSpacing.
].
DefaultBorderColor := StyleSheet colorAt:#borderColor.
DefaultBorderColor isNil ifTrue:[
- DefaultBorderColor := currentScreen defaultStyleValueFor:#borderColor
+ DefaultBorderColor := currentScreen defaultStyleValueFor:#borderColor
].
StyleSheet fileReadFailed ifTrue:[
- DefaultBorderWidth := 1.
- DefaultShadowColor := Black.
- DefaultLightColor := White.
- DefaultFocusColor := Black.
- DefaultFocusBorderWidth := 2.
- DefaultViewBackgroundColor := White.
+ DefaultBorderWidth := 1.
+ DefaultShadowColor := Black.
+ DefaultLightColor := White.
+ DefaultFocusColor := Black.
+ DefaultFocusBorderWidth := 2.
+ DefaultViewBackgroundColor := White.
] ifFalse:[
- DefaultBorderWidth := StyleSheet at:#borderWidth default:0.
- DefaultViewBackgroundColor := StyleSheet colorAt:#viewBackground default:bgGrey.
- DefaultShadowColor := StyleSheet colorAt:#shadowColor.
- DefaultLightColor := StyleSheet colorAt:#lightColor.
- DefaultFocusColor := StyleSheet colorAt:#focusColor default:Color red.
- DefaultFocusBorderWidth := StyleSheet at:'focusBorderWidth' default:2.
+ DefaultBorderWidth := StyleSheet at:#borderWidth default:0.
+ DefaultViewBackgroundColor := StyleSheet colorAt:#viewBackground default:bgGrey.
+ DefaultShadowColor := StyleSheet colorAt:#shadowColor.
+ DefaultLightColor := StyleSheet colorAt:#lightColor.
+ DefaultFocusColor := StyleSheet colorAt:#focusColor default:Color red.
+ DefaultFocusBorderWidth := StyleSheet at:'focusBorderWidth' default:2.
].
self == SimpleView ifTrue:[
- DefaultFont := StyleSheet at:#font.
- DefaultFont isNil ifTrue:[
- DefaultFont := Font family:'courier' face:'medium' style:'roman' size:12.
- ].
- DefaultFont := DefaultFont onDevice:currentScreen.
+ DefaultFont := StyleSheet at:#font.
+ DefaultFont isNil ifTrue:[
+ DefaultFont := Font family:'courier' face:'medium' style:'roman' size:12.
+ ].
+ DefaultFont := DefaultFont onDevice:currentScreen.
] ifFalse:[
- DefaultFont := nil
+ DefaultFont := nil
].
DefaultViewBackgroundColor isNil ifTrue:[
- 'SimpleView [warning]: bad viewBackground in style - using white' errorPrintCR.
- DefaultViewBackgroundColor := White
+ 'SimpleView [warning]: bad viewBackground in style - using white' errorPrintCR.
+ DefaultViewBackgroundColor := White
].
"Modified: / 29.4.1997 / 11:16:52 / dq"
@@ -1262,7 +1262,7 @@
and return it"
ClassResources isNil ifTrue:[
- ClassResources := ResourcePack for:self.
+ ClassResources := ResourcePack for:self.
].
^ ClassResources
!
@@ -1280,20 +1280,20 @@
ResourcePack flushCachedResourcePacks.
SimpleView flushClassResources.
SimpleView allSubclasses do:[:aClass |
- aClass flushClassResources.
+ aClass flushClassResources.
]
"
View flushAllClassResources
"
"to change the language:
- Language := #english.
- Smalltalk changed:#Language.
- View flushAllClassResources
+ Language := #english.
+ Smalltalk changed:#Language.
+ View flushAllClassResources
or:
- Language := #german.
- Smalltalk changed:#Language.
- View flushAllClassResources
+ Language := #german.
+ Smalltalk changed:#Language.
+ View flushAllClassResources
"
!
@@ -1334,7 +1334,7 @@
explicitExtent := true.
self pixelOrigin:aRectangle origin
- corner:aRectangle corner
+ corner:aRectangle corner
"Created: 4.6.1996 / 21:44:27 / cg"
"Modified: 10.1.1997 / 19:46:36 / cg"
@@ -1471,16 +1471,16 @@
in myself and recursively in all of my subviews"
viewBackground ~~ something ifTrue:[
- self viewBackground:something.
- shown ifTrue:[
- self invalidate
- ].
+ self viewBackground:something.
+ shown ifTrue:[
+ self invalidate
+ ].
].
subViews notNil ifTrue:[
- subViews do:[:v|
- v allViewBackground:something
- ]
+ subViews do:[:v|
+ v allViewBackground:something
+ ]
]
"Created: 17.7.1996 / 14:59:08 / cg"
@@ -1511,7 +1511,7 @@
"return my borderColor"
(superView notNil and:[superView isBorderedWrapper]) ifTrue:[
- ^ superView borderColor
+ ^ superView borderColor
].
^ borderColor
@@ -1525,14 +1525,14 @@
"/ backward compatibility
"/ superView will be renamed to container soon.
(superView notNil and:[superView isBorderedWrapper]) ifTrue:[
- ^ superView borderColor:aColor
+ ^ superView borderColor:aColor
].
(aColor ~~ borderColor) ifTrue:[
- borderColor := aColor.
- drawableId notNil ifTrue:[
- self setBorderColor
- ]
+ borderColor := aColor.
+ drawableId notNil ifTrue:[
+ self setBorderColor
+ ]
]
"Modified: 5.6.1996 / 14:11:50 / cg"
@@ -1542,18 +1542,18 @@
"set the borderShape to aForm"
aForm isNil ifTrue:[
- viewShape := nil.
- drawableId notNil ifTrue:[
- device setWindowBorderShape:nil in:drawableId
- ]
+ viewShape := nil.
+ drawableId notNil ifTrue:[
+ device setWindowBorderShape:nil in:drawableId
+ ]
] ifFalse:[
- viewShape isNil ifTrue:[
- viewShape := ArbitraryViewShape new
- ].
- viewShape borderShapeForm:aForm.
- drawableId notNil ifTrue:[
- device setWindowBorderShape:(aForm id) in:drawableId
- ]
+ viewShape isNil ifTrue:[
+ viewShape := ArbitraryViewShape new
+ ].
+ viewShape borderShapeForm:aForm.
+ drawableId notNil ifTrue:[
+ device setWindowBorderShape:(aForm id) in:drawableId
+ ]
]
"Modified: 18.9.1997 / 11:09:40 / cg"
@@ -1563,7 +1563,7 @@
"return my borderWidth"
(superView notNil and:[superView isBorderedWrapper]) ifTrue:[
- ^ superView borderWidth
+ ^ superView borderWidth
].
^ borderWidth
@@ -1579,22 +1579,22 @@
"/ backward compatibility
"/ superView will be renamed to container soon.
(superView notNil and:[superView isBorderedWrapper]) ifTrue:[
- ^ superView borderWidth:aNumber
+ ^ superView borderWidth:aNumber
].
(aNumber ~~ borderWidth) ifTrue:[
- bd := aNumber.
- (device supportsWindowBorder:bd) ifFalse:[
- bd > 1 ifTrue:[
- (device supportsWindowBorder:(bd := 1)) ifFalse:[
- ^ self
- ].
- ]
- ].
- borderWidth := bd.
- drawableId notNil ifTrue:[
- device setWindowBorderWidth:aNumber in:drawableId
- ]
+ bd := aNumber.
+ (device supportsWindowBorder:bd) ifFalse:[
+ bd > 1 ifTrue:[
+ (device supportsWindowBorder:(bd := 1)) ifFalse:[
+ ^ self
+ ].
+ ]
+ ].
+ borderWidth := bd.
+ drawableId notNil ifTrue:[
+ device setWindowBorderWidth:aNumber in:drawableId
+ ]
]
"Modified: 5.6.1996 / 14:12:05 / cg"
@@ -1614,7 +1614,7 @@
"return my level relative to superView (3D)"
(superView notNil and:[superView isBorderedWrapper]) ifTrue:[
- ^ superView level
+ ^ superView level
].
^ level
@@ -1630,36 +1630,36 @@
"/ backward compatibility
"/ superView will be renamed to container soon.
(superView notNil and:[superView isBorderedWrapper]) ifTrue:[
- ^ superView level:aNumber
+ ^ superView level:aNumber
].
(aNumber ~~ level and:[aNumber notNil]) ifTrue:[
- self is3D ifTrue:[
- level := aNumber.
- oldMargin := margin.
- margin := level abs.
-
- realized ifTrue:[
- margin ~~ oldMargin ifTrue:[
- (margin > oldMargin) ifTrue:[
- how := #smaller
- ] ifFalse:[
- how := #larger
- ].
- self sizeChanged:how.
- self setInnerClip.
- ].
- shown ifTrue:[
- margin ~~ oldMargin ifTrue:[
- self clear.
- self redrawX:margin y:margin
- width:width-(margin*2)
- height:height-(margin*2)
- ].
- self redrawEdges.
- ]
- ]
- ]
+ self is3D ifTrue:[
+ level := aNumber.
+ oldMargin := margin.
+ margin := level abs.
+
+ realized ifTrue:[
+ margin ~~ oldMargin ifTrue:[
+ (margin > oldMargin) ifTrue:[
+ how := #smaller
+ ] ifFalse:[
+ how := #larger
+ ].
+ self sizeChanged:how.
+ self setInnerClip.
+ ].
+ shown ifTrue:[
+ margin ~~ oldMargin ifTrue:[
+ self clear.
+ self redrawX:margin y:margin
+ width:width-(margin*2)
+ height:height-(margin*2)
+ ].
+ self redrawEdges.
+ ]
+ ]
+ ]
]
"Modified: 5.6.1996 / 14:12:17 / cg"
@@ -1697,17 +1697,17 @@
"/ debug check only:
something isNil ifTrue:[
- self halt:'invalid viewBackground argument'.
- ^ self
+ self halt:'invalid viewBackground argument'.
+ ^ self
].
something isColor ifTrue:[
- device hasGrayscales ifTrue:[
- avgColor := something averageColorIn:(0@0 corner:7@7).
-
- shadowColor := avgColor darkened "on:device".
- lightColor := avgColor lightened "on:device".
- ]
+ device hasGrayscales ifTrue:[
+ avgColor := something averageColorIn:(0@0 corner:7@7).
+
+ shadowColor := avgColor darkened "on:device".
+ lightColor := avgColor lightened "on:device".
+ ]
].
super viewBackground:something
@@ -1718,19 +1718,19 @@
"set the viewShape to aForm"
aForm isNil ifTrue:[
- viewShape := nil.
- drawableId notNil ifTrue:[
- device setWindowShape:nil in:drawableId
- ]
+ viewShape := nil.
+ drawableId notNil ifTrue:[
+ device setWindowShape:nil in:drawableId
+ ]
] ifFalse:[
- viewShape isNil ifTrue:[
- viewShape := ArbitraryViewShape new
- ].
-
- viewShape viewShapeForm:aForm.
- drawableId notNil ifTrue:[
- device setWindowShape:(aForm id) in:drawableId
- ]
+ viewShape isNil ifTrue:[
+ viewShape := ArbitraryViewShape new
+ ].
+
+ viewShape viewShapeForm:aForm.
+ drawableId notNil ifTrue:[
+ device setWindowShape:(aForm id) in:drawableId
+ ]
]
"Modified: 18.9.1997 / 11:11:04 / cg"
@@ -1751,25 +1751,25 @@
oldChannel == newChannel ifTrue:[^ self].
oldChannel notNil ifTrue:[
- changeSelector isNil ifTrue:[
- oldChannel removeDependent:self
- ] ifFalse:[
- oldChannel retractInterestsFor:self.
- ].
- oldValue := oldChannel value.
+ changeSelector isNil ifTrue:[
+ oldChannel removeDependent:self
+ ] ifFalse:[
+ oldChannel retractInterestsFor:self.
+ ].
+ oldValue := oldChannel value.
].
newChannel notNil ifTrue:[
- changeSelector isNil ifTrue:[
- newChannel addDependent:self.
- newChannel value ~~ oldValue ifTrue:[
- self update:#value with:nil from:newChannel.
- ]
- ] ifFalse:[
- newChannel onChangeSend:changeSelector to:self.
- newChannel value ~~ oldValue ifTrue:[
- self perform:changeSelector.
- ]
- ]
+ changeSelector isNil ifTrue:[
+ newChannel addDependent:self.
+ newChannel value ~~ oldValue ifTrue:[
+ self update:#value with:nil from:newChannel.
+ ]
+ ] ifFalse:[
+ newChannel onChangeSend:changeSelector to:self.
+ newChannel value ~~ oldValue ifTrue:[
+ self perform:changeSelector.
+ ]
+ ]
].
^ newChannel
@@ -1824,7 +1824,7 @@
negative makes it larger."
insets isNil ifTrue:[
- insets := Array new:4.
+ insets := Array new:4.
].
insets atAllPut:aNumber.
@@ -1832,7 +1832,7 @@
"/ drawableId isNil ifTrue:[
"/ originChanged := true
"/ ] ifFalse:[
- self containerChangedSize.
+ self containerChangedSize.
"/ ]
"Modified: 19.7.1996 / 17:30:18 / cg"
@@ -1864,7 +1864,7 @@
negative to the bottom (becomes larger)"
insets isNil ifTrue:[
- insets := Array with:0 with:0 with:0 with:0
+ insets := Array with:0 with:0 with:0 with:0
].
insets at:4 put:aNumber.
@@ -1872,7 +1872,7 @@
"/ drawableId isNil ifTrue:[
"/ originChanged := true
"/ ] ifFalse:[
- self containerChangedSize
+ self containerChangedSize
"/ ]
"Modified: 19.7.1996 / 17:30:22 / cg"
@@ -1902,39 +1902,39 @@
slowly migrating to use layoutObjects ...
"
layout notNil ifTrue:[
- superView isNil ifTrue:[^ self preferredBounds corner].
- ^ (layout rectangleRelativeTo:(superView viewRectangle)
- preferred:[self preferredBounds]) corner rounded
+ superView isNil ifTrue:[^ self preferredBounds corner].
+ ^ (layout rectangleRelativeTo:(superView viewRectangle)
+ preferred:[self preferredBounds]) corner rounded
].
(cornerRule notNil) ifTrue:[
- newCorner := cornerRule value.
- "
- allow return of relative values ...
- "
- x := newCorner x.
- y := newCorner y.
- x isNil ifTrue:[x := self corner x].
- y isNil ifTrue:[y := self corner y].
- ((x isInteger not) or:[y isInteger not]) ifTrue:[
- newCorner := self cornerFromRelativeCorner:x@y
- ]
+ newCorner := cornerRule value.
+ "
+ allow return of relative values ...
+ "
+ x := newCorner x.
+ y := newCorner y.
+ x isNil ifTrue:[x := self corner x].
+ y isNil ifTrue:[y := self corner y].
+ ((x isInteger not) or:[y isInteger not]) ifTrue:[
+ newCorner := self cornerFromRelativeCorner:x@y
+ ]
] ifFalse:[
- (relativeCorner notNil) ifTrue:[
- newCorner := self cornerFromRelativeCorner:relativeCorner
- ] ifFalse:[
- org := self computeOrigin.
- (extentRule notNil) ifTrue:[
- newExt := extentRule value
- ] ifFalse:[
- (relativeExtent notNil) ifTrue:[
- newExt := self extentFromRelativeExtent:relativeExtent
- ] ifFalse:[
- newExt := self extent.
- ]
- ].
- newCorner := org + newExt
- ]
+ (relativeCorner notNil) ifTrue:[
+ newCorner := self cornerFromRelativeCorner:relativeCorner
+ ] ifFalse:[
+ org := self computeOrigin.
+ (extentRule notNil) ifTrue:[
+ newExt := extentRule value
+ ] ifFalse:[
+ (relativeExtent notNil) ifTrue:[
+ newExt := self extentFromRelativeExtent:relativeExtent
+ ] ifFalse:[
+ newExt := self extent.
+ ]
+ ].
+ newCorner := org + newExt
+ ]
].
^ newCorner
@@ -1955,51 +1955,51 @@
slowly migrating to use layoutObjects ...
"
layout notNil ifTrue:[
- ^ (layout rectangleRelativeTo:(superView viewRectangle)
- preferred:[self preferredBounds]) extent rounded
+ ^ (layout rectangleRelativeTo:(superView viewRectangle)
+ preferred:[self preferredBounds]) extent rounded
].
(cornerRule notNil) ifTrue:[
- newCorner := cornerRule value.
- "
- allow return of relative values ...
- "
- x := newCorner x.
- y := newCorner y.
- x isNil ifTrue:[x := self corner x].
- y isNil ifTrue:[y := self corner y].
- ((x isInteger not) or:[y isInteger not]) ifTrue:[
- newCorner := self cornerFromRelativeCorner:x@y
- ]
+ newCorner := cornerRule value.
+ "
+ allow return of relative values ...
+ "
+ x := newCorner x.
+ y := newCorner y.
+ x isNil ifTrue:[x := self corner x].
+ y isNil ifTrue:[y := self corner y].
+ ((x isInteger not) or:[y isInteger not]) ifTrue:[
+ newCorner := self cornerFromRelativeCorner:x@y
+ ]
] ifFalse:[
- (relativeCorner notNil) ifTrue:[
- newCorner := self cornerFromRelativeCorner:relativeCorner
- ] ifFalse:[
- (extentRule notNil) ifTrue:[
- newExt := extentRule value.
- "
- allow return of relative values ...
- "
- x := newExt x.
- y := newExt y.
- x isNil ifTrue:[x := width].
- y isNil ifTrue:[y := height].
- ((x isInteger not) or:[y isInteger not]) ifTrue:[
- newExt := self extentFromRelativeExtent:x@y
- ]
- ] ifFalse:[
- (relativeExtent notNil) ifTrue:[
- newExt := self extentFromRelativeExtent:relativeExtent
- ] ifFalse:[
- newExt := (width @ height).
- ].
- ].
- ].
+ (relativeCorner notNil) ifTrue:[
+ newCorner := self cornerFromRelativeCorner:relativeCorner
+ ] ifFalse:[
+ (extentRule notNil) ifTrue:[
+ newExt := extentRule value.
+ "
+ allow return of relative values ...
+ "
+ x := newExt x.
+ y := newExt y.
+ x isNil ifTrue:[x := width].
+ y isNil ifTrue:[y := height].
+ ((x isInteger not) or:[y isInteger not]) ifTrue:[
+ newExt := self extentFromRelativeExtent:x@y
+ ]
+ ] ifFalse:[
+ (relativeExtent notNil) ifTrue:[
+ newExt := self extentFromRelativeExtent:relativeExtent
+ ] ifFalse:[
+ newExt := (width @ height).
+ ].
+ ].
+ ].
].
newCorner notNil ifTrue:[
- newOrg := self computeOrigin.
- ^ newCorner - newOrg.
+ newOrg := self computeOrigin.
+ ^ newCorner - newOrg.
].
^ newExt.
!
@@ -2016,29 +2016,29 @@
slowly migrating to use layoutObjects ...
"
layout notNil ifTrue:[
- superView isNil ifTrue:[^ 0@0].
- ^ (layout rectangleRelativeTo:(superView viewRectangle)
- preferred:[self preferredBounds]) origin rounded
+ superView isNil ifTrue:[^ 0@0].
+ ^ (layout rectangleRelativeTo:(superView viewRectangle)
+ preferred:[self preferredBounds]) origin rounded
].
(originRule notNil) ifTrue:[
- newOrg := originRule value.
- "
- allow return of relative values ...
- "
- x := newOrg x.
- y := newOrg y.
- x isNil ifTrue:[x := self origin x].
- y isNil ifTrue:[y := self origin y].
- ((x isInteger not) or:[y isInteger not]) ifTrue:[
- newOrg := self originFromRelativeOrigin:x@y.
- ]
+ newOrg := originRule value.
+ "
+ allow return of relative values ...
+ "
+ x := newOrg x.
+ y := newOrg y.
+ x isNil ifTrue:[x := self origin x].
+ y isNil ifTrue:[y := self origin y].
+ ((x isInteger not) or:[y isInteger not]) ifTrue:[
+ newOrg := self originFromRelativeOrigin:x@y.
+ ]
] ifFalse:[
- (relativeOrigin notNil) ifTrue:[
- newOrg := self originFromRelativeOrigin:relativeOrigin.
- ] ifFalse:[
- ^ (left @ top).
- ].
+ (relativeOrigin notNil) ifTrue:[
+ newOrg := self originFromRelativeOrigin:relativeOrigin.
+ ] ifFalse:[
+ ^ (left @ top).
+ ].
].
^ newOrg
!
@@ -2055,10 +2055,10 @@
corner:corner
"set the views corner;
the corner argument may be:
- a point
- where integer fields mean 'pixel-values'
- and float values mean 'relative-to-superview'
- and nil means 'take current value';
+ a point
+ where integer fields mean 'pixel-values'
+ and float values mean 'relative-to-superview'
+ and nil means 'take current value';
or a block returning a point which is interpreted as above.
Please migrate to use layoutObjects, if possible."
@@ -2067,31 +2067,31 @@
explicitExtent := true.
corner isBlock ifTrue:[
- cornerRule := corner.
- drawableId notNil ifTrue:[
- pixelCorner := corner value
- ] ifFalse:[
- extentChanged := true
- ]
+ cornerRule := corner.
+ drawableId notNil ifTrue:[
+ pixelCorner := corner value
+ ] ifFalse:[
+ extentChanged := true
+ ]
] ifFalse:[
- x := corner x.
- y := corner y.
- x isNil ifTrue:[x := self corner x].
- y isNil ifTrue:[y := self corner y].
- c := x @ y.
- ((x isInteger not) or:[y isInteger not]) ifTrue:[
- relativeCorner := c.
- pixelCorner := self cornerFromRelativeCorner.
- pixelCorner isNil ifTrue:[
- extentChanged := true
- ]
- ] ifFalse:[
- pixelCorner := c
- ]
+ x := corner x.
+ y := corner y.
+ x isNil ifTrue:[x := self corner x].
+ y isNil ifTrue:[y := self corner y].
+ c := x @ y.
+ ((x isInteger not) or:[y isInteger not]) ifTrue:[
+ relativeCorner := c.
+ pixelCorner := self cornerFromRelativeCorner.
+ pixelCorner isNil ifTrue:[
+ extentChanged := true
+ ]
+ ] ifFalse:[
+ pixelCorner := c
+ ]
].
pixelCorner notNil ifTrue:[
- self pixelCorner:pixelCorner
+ self pixelCorner:pixelCorner
]
"Modified: 15.7.1996 / 09:51:06 / cg"
@@ -2106,49 +2106,49 @@
extent:extent
"set the views extent;
extent may be:
- a point
- where integer fields mean 'pixel-values'
- and float values mean 'relative-to-superview'
- and nil means 'leave current value';
+ a point
+ where integer fields mean 'pixel-values'
+ and float values mean 'relative-to-superview'
+ and nil means 'leave current value';
or a block returning a point which is interpreted as above.
Be careful when using relative extents: rounding errors may
accumulate. Better use origin/corner.
Best: migrate to use layour objects.
Notice: this sets the views explicitExtent flag, which prevents it normally
- from resizing itself to its preferredExtent.
- See initialExtent: for a variation."
+ from resizing itself to its preferredExtent.
+ See initialExtent: for a variation."
|w h pixelExtent e|
explicitExtent := true.
extent isBlock ifTrue:[
- extentRule := extent.
- drawableId notNil ifTrue:[
- pixelExtent := extent value
- ] ifFalse:[
- extentChanged := true
- ]
+ extentRule := extent.
+ drawableId notNil ifTrue:[
+ pixelExtent := extent value
+ ] ifFalse:[
+ extentChanged := true
+ ]
] ifFalse:[
- w := extent x.
- h := extent y.
- w isNil ifTrue:[w := width].
- h isNil ifTrue:[h := height].
- e := w@h.
- ((w isInteger not) or:[h isInteger not]) ifTrue:[
- relativeExtent := e.
- pixelExtent := self extentFromRelativeExtent.
- pixelExtent isNil ifTrue:[
- extentChanged := true
- ]
- ] ifFalse:[
- relativeExtent := nil.
- pixelExtent := e
- ]
+ w := extent x.
+ h := extent y.
+ w isNil ifTrue:[w := width].
+ h isNil ifTrue:[h := height].
+ e := w@h.
+ ((w isInteger not) or:[h isInteger not]) ifTrue:[
+ relativeExtent := e.
+ pixelExtent := self extentFromRelativeExtent.
+ pixelExtent isNil ifTrue:[
+ extentChanged := true
+ ]
+ ] ifFalse:[
+ relativeExtent := nil.
+ pixelExtent := e
+ ]
].
pixelExtent notNil ifTrue:[
- self pixelExtent:pixelExtent
+ self pixelExtent:pixelExtent
]
"Modified: 15.7.1996 / 09:51:21 / cg"
@@ -2199,7 +2199,7 @@
positive makes it smaller, negative makes it larger"
insets isNil ifTrue:[
- insets := Array with:0 with:0 with:0 with:0
+ insets := Array with:0 with:0 with:0 with:0
].
insets at:1 put:aNumber.
insets at:3 put:aNumber.
@@ -2208,7 +2208,7 @@
"/ drawableId isNil ifTrue:[
"/ originChanged := true
"/ ] ifFalse:[
- self containerChangedSize.
+ self containerChangedSize.
"/ ]
"Modified: 19.7.1996 / 17:30:25 / cg"
@@ -2306,9 +2306,9 @@
layout := aLayoutObject.
superView isNil ifTrue:[
- originChanged := cornerChanged := extentChanged := true
+ originChanged := cornerChanged := extentChanged := true
] ifFalse:[
- self containerChangedSize.
+ self containerChangedSize.
]
"Modified: 19.9.1995 / 16:17:25 / claus"
@@ -2347,7 +2347,7 @@
negative to the left (becomes larger)"
insets isNil ifTrue:[
- insets := Array with:0 with:0 with:0 with:0
+ insets := Array with:0 with:0 with:0 with:0
].
insets at:1 put:aNumber.
@@ -2355,7 +2355,7 @@
"/ drawableId isNil ifTrue:[
"/ originChanged := true
"/ ] ifFalse:[
- self containerChangedSize.
+ self containerChangedSize.
"/ ]
"Modified: 19.7.1996 / 17:30:30 / cg"
@@ -2372,19 +2372,19 @@
newLeft := left.
((top + height) > (devBot := device usableHeight)) ifTrue:[
- newTop := devBot - height
+ newTop := devBot - height
].
((left + width) > (devRight := device usableWidth)) ifTrue:[
- newLeft := devRight - width
+ newLeft := devRight - width
].
(newTop < 0) ifTrue:[
- newTop := 0.
+ newTop := 0.
].
(newLeft < 0) ifTrue:[
- newLeft := 0
+ newLeft := 0
].
((newTop ~~ top) or:[newLeft ~~ left]) ifTrue:[
- self origin:newLeft @ newTop
+ self origin:newLeft @ newTop
]
!
@@ -2398,30 +2398,30 @@
].
device supportsArbitraryShapedViews ifTrue:[
- extent := self extent.
-
- w := extent x.
- h := extent y.
- borderForm := Form width:w height:h.
- borderForm fill:(Color colorId:0).
- shapeForm := Form width:w height:h.
- shapeForm fill:(Color colorId:0).
-
- borderForm foreground:(Color colorId:1).
- borderForm fillArcX:0 y:0
- width:w
- height:h
- from:0
- angle:360.
-
- shapeForm foreground:(Color colorId:1).
- shapeForm fillArcX:bw y:bw
- width:(w - (bw * 2))
- height:(h - (bw * 2))
- from:0
- angle:360.
- self borderShape:borderForm.
- self viewShape:shapeForm
+ extent := self extent.
+
+ w := extent x.
+ h := extent y.
+ borderForm := Form width:w height:h.
+ borderForm fill:(Color colorId:0).
+ shapeForm := Form width:w height:h.
+ shapeForm fill:(Color colorId:0).
+
+ borderForm foreground:(Color colorId:1).
+ borderForm fillArcX:0 y:0
+ width:w
+ height:h
+ from:0
+ angle:360.
+
+ shapeForm foreground:(Color colorId:1).
+ shapeForm fillArcX:bw y:bw
+ width:(w - (bw * 2))
+ height:(h - (bw * 2))
+ from:0
+ angle:360.
+ self borderShape:borderForm.
+ self viewShape:shapeForm
]
!
@@ -2447,42 +2447,42 @@
origin:origin
"set the views origin;
origin may be:
- a point
- where integer fields mean 'pixel-values'
- and float values mean 'relative-to-superview'
- and nil means 'take current value';
+ a point
+ where integer fields mean 'pixel-values'
+ and float values mean 'relative-to-superview'
+ and nil means 'take current value';
or a block returning a point which is interpreted as above.
Please migrate to use layout objects."
|newLeft newTop pixelOrigin o|
origin isBlock ifTrue:[
- originRule := origin.
- drawableId notNil ifTrue:[
- pixelOrigin := origin value
- ] ifFalse:[
- originChanged := true
- ]
+ originRule := origin.
+ drawableId notNil ifTrue:[
+ pixelOrigin := origin value
+ ] ifFalse:[
+ originChanged := true
+ ]
] ifFalse:[
- o := origin.
- newLeft := origin x.
- newTop := origin y.
- newLeft isNil ifTrue:[newLeft := left].
- newTop isNil ifTrue:[newTop := top].
- o := newLeft @ newTop.
- ((newLeft isInteger not) or:[newTop isInteger not]) ifTrue:[
- relativeOrigin := o.
- pixelOrigin := self originFromRelativeOrigin.
- pixelOrigin isNil ifTrue:[
- originChanged := true
- ]
- ] ifFalse:[
- relativeOrigin := nil.
- pixelOrigin := o
- ]
+ o := origin.
+ newLeft := origin x.
+ newTop := origin y.
+ newLeft isNil ifTrue:[newLeft := left].
+ newTop isNil ifTrue:[newTop := top].
+ o := newLeft @ newTop.
+ ((newLeft isInteger not) or:[newTop isInteger not]) ifTrue:[
+ relativeOrigin := o.
+ pixelOrigin := self originFromRelativeOrigin.
+ pixelOrigin isNil ifTrue:[
+ originChanged := true
+ ]
+ ] ifFalse:[
+ relativeOrigin := nil.
+ pixelOrigin := o
+ ]
].
pixelOrigin notNil ifTrue:[
- self pixelOrigin:pixelOrigin
+ self pixelOrigin:pixelOrigin
].
"Modified: 19.4.1996 / 15:12:36 / cg"
@@ -2498,21 +2498,21 @@
"do it as one operation if possible"
origin isBlock ifFalse:[
- corner isBlock ifFalse:[
- newLeft := origin x.
- newLeft isInteger ifTrue:[
- newTop := origin y.
- newTop isInteger ifTrue:[
- newRight := corner x.
- newRight isInteger ifTrue:[
- newBot := corner y.
- newBot isInteger ifTrue:[
- self pixelOrigin:origin corner:corner
- ]
- ]
- ]
- ]
- ]
+ corner isBlock ifFalse:[
+ newLeft := origin x.
+ newLeft isInteger ifTrue:[
+ newTop := origin y.
+ newTop isInteger ifTrue:[
+ newRight := corner x.
+ newRight isInteger ifTrue:[
+ newBot := corner y.
+ newBot isInteger ifTrue:[
+ self pixelOrigin:origin corner:corner
+ ]
+ ]
+ ]
+ ]
+ ]
].
self origin:origin.
self corner:corner
@@ -2530,21 +2530,21 @@
"do it as one operation if possible"
origin isBlock ifFalse:[
- extent isBlock ifFalse:[
- newLeft := origin x.
- newLeft isInteger ifTrue:[
- newTop := origin y.
- newTop isInteger ifTrue:[
- newWidth := extent x.
- newWidth isInteger ifTrue:[
- newHeight := extent y.
- newHeight isInteger ifTrue:[
- self pixelOrigin:origin extent:extent
- ]
- ]
- ]
- ]
- ]
+ extent isBlock ifFalse:[
+ newLeft := origin x.
+ newLeft isInteger ifTrue:[
+ newTop := origin y.
+ newTop isInteger ifTrue:[
+ newWidth := extent x.
+ newWidth isInteger ifTrue:[
+ newHeight := extent y.
+ newHeight isInteger ifTrue:[
+ self pixelOrigin:origin extent:extent
+ ]
+ ]
+ ]
+ ]
+ ]
].
self extent:extent.
self origin:origin
@@ -2566,17 +2566,17 @@
sumX := 0.
sumY := 0.
[currentView notNil] whileTrue:[
- (currentView == aView) ifTrue:[
- ^ (sumX @ sumY)
- ].
- bw := currentView borderWidth.
- sumX := sumX + (currentView left) + bw.
- sumY := sumY + (currentView top) + bw.
- currentView := currentView superView
+ (currentView == aView) ifTrue:[
+ ^ (sumX @ sumY)
+ ].
+ bw := currentView borderWidth.
+ sumX := sumX + (currentView left) + bw.
+ sumY := sumY + (currentView top) + bw.
+ currentView := currentView superView
].
(aView isNil or:[aView == device rootView]) ifTrue:[
- "return relative to screen ..."
- ^ (sumX @ sumY)
+ "return relative to screen ..."
+ ^ (sumX @ sumY)
].
^ nil
@@ -2674,7 +2674,7 @@
negative to the right (becomes larger)"
insets isNil ifTrue:[
- insets := Array with:0 with:0 with:0 with:0
+ insets := Array with:0 with:0 with:0 with:0
].
insets at:3 put:aNumber.
@@ -2682,7 +2682,7 @@
"/ drawableId isNil ifTrue:[
"/ originChanged := true
"/ ] ifFalse:[
- self containerChangedSize.
+ self containerChangedSize.
"/ ]
"Modified: 19.7.1996 / 17:30:32 / cg"
@@ -2733,7 +2733,7 @@
negative to the top (becomes larger)"
insets isNil ifTrue:[
- insets := Array with:0 with:0 with:0 with:0
+ insets := Array with:0 with:0 with:0 with:0
].
insets at:2 put:aNumber.
@@ -2741,7 +2741,7 @@
"/ drawableId isNil ifTrue:[
"/ originChanged := true
"/ ] ifFalse:[
- self containerChangedSize.
+ self containerChangedSize.
"/ ]
"Modified: 19.7.1996 / 17:30:45 / cg"
@@ -2752,7 +2752,7 @@
positive makes it smaller, negative makes it larger"
insets isNil ifTrue:[
- insets := Array with:0 with:0 with:0 with:0
+ insets := Array with:0 with:0 with:0 with:0
].
insets at:2 put:aNumber.
insets at:4 put:aNumber.
@@ -2761,7 +2761,7 @@
"/ drawableId isNil ifTrue:[
"/ originChanged := true
"/ ] ifFalse:[
- self containerChangedSize.
+ self containerChangedSize.
"/ ]
"Modified: 19.7.1996 / 17:30:50 / cg"
@@ -2822,9 +2822,9 @@
"set my container (i.e. superView) to be aContainer"
(superView notNil and:[superView ~~ aContainer]) ifTrue:[
- "/ actually, this is worth an exception
- ('View [warning]: ' , self printString , ' already has a container') errorPrintCR.
- superView removeComponent:self.
+ "/ actually, this is worth an exception
+ ('View [warning]: ' , self printString , ' already has a container') errorPrintCR.
+ superView removeComponent:self.
].
superView := aContainer
@@ -2865,9 +2865,9 @@
subViews := aListOfViews.
subViews notNil ifTrue:[
- subViews do:[:view |
- view container:self
- ]
+ subViews do:[:view |
+ view container:self
+ ]
]
"Modified: 9.5.1996 / 00:42:28 / cg"
@@ -2904,8 +2904,8 @@
v := self.
[v notNil] whileTrue:[
- (next := v container) isNil ifTrue:[^ v].
- v := next
+ (next := v container) isNil ifTrue:[^ v].
+ v := next
].
^ nil
@@ -2964,22 +2964,22 @@
menuHolder := self menuHolder.
menuHolder notNil ifTrue:[
- sym := self menuMessage.
- sym notNil ifTrue:[
- "
- mhmh - for backward compatibility, try to ask
- the model first, then use the views menu.
- "
- (menuHolder respondsTo:sym) ifFalse:[
- (self respondsTo:sym) ifTrue:[
- menuHolder := self
- ]
- ].
- "
- ask the menuHolder for the menu
- "
- theMenu := menuHolder perform:sym.
- ].
+ sym := self menuMessage.
+ sym notNil ifTrue:[
+ "
+ mhmh - for backward compatibility, try to ask
+ the model first, then use the views menu.
+ "
+ (menuHolder respondsTo:sym) ifFalse:[
+ (self respondsTo:sym) ifTrue:[
+ menuHolder := self
+ ]
+ ].
+ "
+ ask the menuHolder for the menu
+ "
+ theMenu := menuHolder perform:sym.
+ ].
].
^ theMenu
@@ -2999,10 +2999,10 @@
when the view is resized."
bitGravity ~~ gravity ifTrue:[
- bitGravity := gravity.
- drawableId notNil ifTrue:[
- device setBitGravity:gravity in:drawableId
- ]
+ bitGravity := gravity.
+ drawableId notNil ifTrue:[
+ device setBitGravity:gravity in:drawableId
+ ]
]
!
@@ -3014,53 +3014,53 @@
|x y w h|
aRectangle isNil ifTrue:[
- clipRect isNil ifTrue:[^ self].
- gcId notNil ifTrue:[
- device noClipIn:drawableId gc:gcId
- ]
+ clipRect isNil ifTrue:[^ self].
+ gcId notNil ifTrue:[
+ device noClipIn:drawableId gc:gcId
+ ]
] ifFalse:[
- clipRect notNil ifTrue:[
- (clipRect = aRectangle) ifTrue:[^ self]
- ].
- gcId notNil ifTrue:[
- x := aRectangle left.
- y := aRectangle top.
- w := aRectangle width.
- h := aRectangle height.
- transformation notNil ifTrue:[
- x := transformation applyToX:x.
- y := transformation applyToY:y.
- w := transformation applyScaleX:w.
- h := transformation applyScaleY:h.
- ].
- (x isMemberOf:SmallInteger) ifFalse:[
- w := w + (x - x truncated).
- x := x truncated
- ].
- (y isMemberOf:SmallInteger) ifFalse:[
- h := h + (y - y truncated).
- y := y truncated
- ].
- (w isMemberOf:SmallInteger) ifFalse:[
- w := w truncated + 1
- ].
- (h isMemberOf:SmallInteger) ifFalse:[
- h := h truncated + 1
- ].
- x < margin ifTrue:[
- x := margin.
- ].
- y < margin ifTrue:[
- y := margin.
- ].
- x + w - 1 >= (width-margin) ifTrue:[
- w := width - margin - x
- ].
- y + h - 1 >= (height-margin) ifTrue:[
- h := height - margin - y
- ].
- device setClipX:x y:y width:w height:h in:drawableId gc:gcId
- ]
+ clipRect notNil ifTrue:[
+ (clipRect = aRectangle) ifTrue:[^ self]
+ ].
+ gcId notNil ifTrue:[
+ x := aRectangle left.
+ y := aRectangle top.
+ w := aRectangle width.
+ h := aRectangle height.
+ transformation notNil ifTrue:[
+ x := transformation applyToX:x.
+ y := transformation applyToY:y.
+ w := transformation applyScaleX:w.
+ h := transformation applyScaleY:h.
+ ].
+ (x isMemberOf:SmallInteger) ifFalse:[
+ w := w + (x - x truncated).
+ x := x truncated
+ ].
+ (y isMemberOf:SmallInteger) ifFalse:[
+ h := h + (y - y truncated).
+ y := y truncated
+ ].
+ (w isMemberOf:SmallInteger) ifFalse:[
+ w := w truncated + 1
+ ].
+ (h isMemberOf:SmallInteger) ifFalse:[
+ h := h truncated + 1
+ ].
+ x < margin ifTrue:[
+ x := margin.
+ ].
+ y < margin ifTrue:[
+ y := margin.
+ ].
+ x + w - 1 >= (width-margin) ifTrue:[
+ w := width - margin - x
+ ].
+ y + h - 1 >= (height-margin) ifTrue:[
+ h := height - margin - y
+ ].
+ device setClipX:x y:y width:w height:h in:drawableId gc:gcId
+ ]
].
clipRect := aRectangle
@@ -3072,7 +3072,7 @@
"return my full name to be used for resource-access"
superView notNil ifTrue:[
- ^ superView fullName , '.' , name
+ ^ superView fullName , '.' , name
].
^ name
!
@@ -3117,10 +3117,10 @@
when the superView is resized."
viewGravity ~~ gravity ifTrue:[
- viewGravity := gravity.
- drawableId notNil ifTrue:[
- device setWindowGravity:gravity in:drawableId
- ]
+ viewGravity := gravity.
+ drawableId notNil ifTrue:[
+ device setWindowGravity:gravity in:drawableId
+ ]
]
! !
@@ -3131,7 +3131,7 @@
or nil, if there is no application"
superView notNil ifTrue:[
- ^ superView application
+ ^ superView application
].
^ nil
@@ -3172,26 +3172,26 @@
aWindowSpecOrSpecSymbol isNil ifTrue:[^ self].
(builder := aBuilder) isNil ifTrue:[
- "/ problem: anApplication could have no builder
- "/ or anApplication could be a non-appModel (theoretically - only providing a spec)
- notAnAppModel := false.
- builder := anApplication perform:#builder ifNotUnderstood:[notAnAppModel := true. nil].
- builder isNil ifTrue:[
- notAnAppModel ifTrue:[
- builder := UIBuilder new.
- ] ifFalse:[
- anApplication createBuilder.
- builder := anApplication builder
- ]
- ]
+ "/ problem: anApplication could have no builder
+ "/ or anApplication could be a non-appModel (theoretically - only providing a spec)
+ notAnAppModel := false.
+ builder := anApplication perform:#builder ifNotUnderstood:[notAnAppModel := true. nil].
+ builder isNil ifTrue:[
+ notAnAppModel ifTrue:[
+ builder := UIBuilder new.
+ ] ifFalse:[
+ anApplication createBuilder.
+ builder := anApplication builder
+ ]
+ ]
].
(subSpec := aWindowSpecOrSpecSymbol) isSymbol ifTrue:[
- anApplication isNil ifTrue:[^ self].
- subSpec := anApplication class interfaceSpecFor:aWindowSpecOrSpecSymbol.
- subSpec isNil ifTrue:[
- ^ self
- ].
+ anApplication isNil ifTrue:[^ self].
+ subSpec := anApplication class interfaceSpecFor:aWindowSpecOrSpecSymbol.
+ subSpec isNil ifTrue:[
+ ^ self
+ ].
].
builder buildFromSpec:subSpec in:self.
!
@@ -3210,7 +3210,7 @@
controller := aController.
controller notNil ifTrue:[
- controller view:self.
+ controller view:self.
]
"Modified: / 31.10.1997 / 19:58:33 / cg"
@@ -3228,7 +3228,7 @@
"return the views sensor"
windowGroup notNil ifTrue:[
- ^ windowGroup sensor.
+ ^ windowGroup sensor.
].
^ nil
@@ -3262,18 +3262,18 @@
If I am currently in a group, remove me from it it."
windowGroup notNil ifTrue:[
- windowGroup removeView:self.
- windowGroup := nil
+ windowGroup removeView:self.
+ windowGroup := nil
].
windowGroup := newGroup.
newGroup notNil ifTrue:[
- newGroup addView:self.
+ newGroup addView:self.
].
subViews notNil ifTrue:[
- subViews do:[:aSubview |
- aSubview windowGroup:newGroup
- ]
+ subViews do:[:aSubview |
+ aSubview windowGroup:newGroup
+ ]
].
"Modified: 20.8.1997 / 13:26:37 / cg"
@@ -3286,7 +3286,7 @@
components isNil ifTrue:[^ 0].
^ components inject:0 into:[:maxSoFar :sub
- | (sub bottom) max:maxSoFar].
+ | (sub bottom) max:maxSoFar].
"Created: 26.5.1996 / 12:44:05 / cg"
"Modified: 26.5.1996 / 12:56:39 / cg"
@@ -3297,7 +3297,7 @@
components isNil ifTrue:[^ 0].
^ components inject:0 into:[:maxSoFar :sub
- | (sub right) max:maxSoFar].
+ | (sub right) max:maxSoFar].
"Modified: 26.5.1996 / 12:56:39 / cg"
"Created: 26.5.1996 / 13:02:19 / cg"
@@ -3329,12 +3329,12 @@
p := aPoint negated.
transformation isNil ifTrue:[
- transformation := WindowingTransformation scale:1 translation:p
+ transformation := WindowingTransformation scale:1 translation:p
] ifFalse:[
- transformation translation:p
+ transformation translation:p
].
clipRect notNil ifTrue:[
- self setInnerClip.
+ self setInnerClip.
].
!
@@ -3344,7 +3344,7 @@
(i.e. the origin of the visible part of the contents)."
transformation isNil ifTrue:[
- ^ 0@0
+ ^ 0@0
].
^ transformation translation negated
!
@@ -3355,10 +3355,10 @@
transformation isNil ifTrue:[
- ^ Rectangle left:0 top:0 width:width height:height.
+ ^ Rectangle left:0 top:0 width:width height:height.
].
^ Rectangle origin:(transformation translation negated)
- extent:((width @ height) scaledBy:(transformation scale)).
+ extent:((width @ height) scaledBy:(transformation scale)).
"Created: 12.7.1996 / 11:57:04 / stefan"
!
@@ -3387,11 +3387,11 @@
self hiddenOnRealize:true.
realized ifTrue:[
- (superView isNil "/ I am a topView
- or:[superView realized]) "/ superview already shown
- ifTrue:[
- self unmap
- ]
+ (superView isNil "/ I am a topView
+ or:[superView realized]) "/ superview already shown
+ ifTrue:[
+ self unmap
+ ]
]
"Modified: 3.4.1997 / 21:20:40 / cg"
@@ -3409,19 +3409,19 @@
self hiddenOnRealize:false.
realized ifFalse:[
- superView isNil "/ I am a topView
- ifTrue:[
- drawableId isNil ifTrue:[
- self realize.
- ] ifFalse:[
- self remap.
- ].
- ] ifFalse:[
- superView realized "/ superview already shown
- ifTrue:[
- self realize
- ]
- ].
+ superView isNil "/ I am a topView
+ ifTrue:[
+ drawableId isNil ifTrue:[
+ self realize.
+ ] ifFalse:[
+ self remap.
+ ].
+ ] ifFalse:[
+ superView realized "/ superview already shown
+ ifTrue:[
+ self realize
+ ]
+ ].
]
"
@@ -3512,9 +3512,9 @@
"make the view visible or invisible"
aBoolean ifTrue:[
- self beVisible
+ self beVisible
] ifFalse:[
- self beInvisible
+ self beInvisible
]
"Created: / 27.10.1997 / 04:23:04 / cg"
@@ -3595,12 +3595,12 @@
|l wrapper|
aComponentOrCollection isCollection ifTrue:[
- wrapper := View new.
- aComponentOrCollection do:[:aComponent |
- wrapper add:aComponent
- ]
+ wrapper := View new.
+ aComponentOrCollection do:[:aComponent |
+ wrapper add:aComponent
+ ]
] ifFalse:[
- wrapper := aComponentOrCollection
+ wrapper := aComponentOrCollection
].
l := aRectangleOrLayoutFrame asLayout.
@@ -3621,16 +3621,16 @@
Dont use this right now for non-views"
aComponent isView ifTrue:[
- self addSubView:aComponent
+ self addSubView:aComponent
] ifFalse:[
- components isNil ifTrue:[
- components := OrderedCollection new
- ].
- components add:aComponent.
- aComponent container:self.
- shown ifTrue:[
- aComponent displayOn:self
- ]
+ components isNil ifTrue:[
+ components := OrderedCollection new
+ ].
+ components add:aComponent.
+ aComponent container:self.
+ shown ifTrue:[
+ aComponent displayOn:self
+ ]
]
"Modified: 13.5.1996 / 21:19:51 / cg"
@@ -3640,13 +3640,13 @@
"add a view to the collection of subviews"
subViews isNil ifTrue:[
- subViews := OrderedCollection with:newView
+ subViews := OrderedCollection with:newView
] ifFalse:[
- (subViews includesIdentical:newView) ifTrue:[
- self error:'trying to add a view twice' mayProceed:true.
- ^ self.
- ].
- subViews add:newView.
+ (subViews includesIdentical:newView) ifTrue:[
+ self error:'trying to add a view twice' mayProceed:true.
+ ^ self.
+ ].
+ subViews add:newView.
].
self setContainerIn:newView.
@@ -3659,17 +3659,17 @@
element at some defined place."
subViews isNil ifTrue:[
- subViews := OrderedCollection with:newView
+ subViews := OrderedCollection with:newView
] ifFalse:[
- (subViews includesIdentical:newView) ifTrue:[
- self error:'trying to add a view twice' mayProceed:true.
- ^ self.
- ].
- aView isNil ifTrue:[
- subViews add:newView
- ] ifFalse:[
- subViews add:newView after:aView.
- ]
+ (subViews includesIdentical:newView) ifTrue:[
+ self error:'trying to add a view twice' mayProceed:true.
+ ^ self.
+ ].
+ aView isNil ifTrue:[
+ subViews add:newView
+ ] ifFalse:[
+ subViews add:newView after:aView.
+ ]
].
self setContainerIn:newView.
@@ -3682,17 +3682,17 @@
element at some defined place."
subViews isNil ifTrue:[
- subViews := OrderedCollection with:newView
+ subViews := OrderedCollection with:newView
] ifFalse:[
- (subViews includesIdentical:newView) ifTrue:[
- self error:'trying to add a view twice' mayProceed:true.
- ^ self.
- ].
- aView isNil ifTrue:[
- subViews addFirst:newView
- ] ifFalse:[
- subViews add:newView before:aView.
- ]
+ (subViews includesIdentical:newView) ifTrue:[
+ self error:'trying to add a view twice' mayProceed:true.
+ ^ self.
+ ].
+ aView isNil ifTrue:[
+ subViews addFirst:newView
+ ] ifFalse:[
+ subViews add:newView before:aView.
+ ]
].
self setContainerIn:newView.
@@ -3710,13 +3710,13 @@
"add a view to the front of the collection of subviews"
subViews isNil ifTrue:[
- subViews := OrderedCollection with:newView
+ subViews := OrderedCollection with:newView
] ifFalse:[
- (subViews includesIdentical:newView) ifTrue:[
- self error:'trying to add a view twice' mayProceed:true.
- ^ self.
- ].
- subViews addFirst:newView.
+ (subViews includesIdentical:newView) ifTrue:[
+ self error:'trying to add a view twice' mayProceed:true.
+ ^ self.
+ ].
+ subViews addFirst:newView.
].
self setContainerIn:newView.
@@ -3730,14 +3730,14 @@
aComponent origin:0.0@0.0 corner:1.0@1.0.
aComponent isView ifTrue:[
- self addSubView:aComponent
+ self addSubView:aComponent
] ifFalse:[
- components := OrderedCollection with:aComponent.
- aComponent container:self.
-
- shown ifTrue:[
- aComponent displayOn:self
- ]
+ components := OrderedCollection with:aComponent.
+ aComponent container:self.
+
+ shown ifTrue:[
+ aComponent displayOn:self
+ ]
]
"Modified: 13.5.1996 / 21:20:29 / cg"
@@ -3747,15 +3747,15 @@
"remove all subviews"
subViews notNil ifTrue:[
- subViews copy do:[:aSubView |
- aSubView destroy.
- ].
-
- "/ paranoia ;-)
- subViews size ~~ 0 ifTrue:[
- (self class name , ' >>View [warning]: some subView(s) did not destroy: ' , subViews printString) infoPrintCR.
- subViews := nil
- ].
+ subViews copy do:[:aSubView |
+ aSubView destroy.
+ ].
+
+ "/ paranoia ;-)
+ subViews size ~~ 0 ifTrue:[
+ (self class name , ' >>View [warning]: some subView(s) did not destroy: ' , subViews printString) infoPrintCR.
+ subViews := nil
+ ].
]
"Modified: 5.9.1995 / 22:35:36 / claus"
@@ -3767,11 +3767,11 @@
Dont use this right now for non-views"
aComponent isView ifTrue:[
- self removeSubView:aComponent
+ self removeSubView:aComponent
] ifFalse:[
- components isNil ifTrue:[^self].
- components remove:aComponent ifAbsent:[].
- aComponent parent:nil
+ components isNil ifTrue:[^self].
+ components remove:aComponent ifAbsent:[].
+ aComponent parent:nil
]
!
@@ -3779,10 +3779,10 @@
"remove a view from the collection of subviews"
subViews notNil ifTrue:[
- subViews remove:aView ifAbsent:[nil].
- (subViews size == 0) ifTrue:[
- subViews := nil
- ]
+ subViews remove:aView ifAbsent:[nil].
+ (subViews size == 0) ifTrue:[
+ subViews := nil
+ ]
]
!
@@ -3797,10 +3797,10 @@
aView container:self.
(aView graphicsDevice ~~ device) ifTrue:[
- 'SimpleView [warning]: subview (' errorPrint. aView class name errorPrint.
- ') has different device than me (' errorPrint.
- self class name errorPrint. ').' errorPrintCR.
- aView device:device
+ 'SimpleView [warning]: subview (' errorPrint. aView class name errorPrint.
+ ') has different device than me (' errorPrint.
+ self class name errorPrint. ').' errorPrintCR.
+ aView device:device
]
"Created: 9.5.1996 / 00:46:59 / cg"
@@ -3823,8 +3823,8 @@
"an update request"
aspect == #sizeOfView ifTrue:[
- "one of the views we depend on changed its size"
- ^ self containerChangedSize.
+ "one of the views we depend on changed its size"
+ ^ self containerChangedSize.
].
^super update:aspect with:aParameter from:changedObject
@@ -3845,50 +3845,50 @@
ok := true.
bitmaps := #('wheel1' 'wheel2' 'wheel3' 'wheel4')
- collect:[:name |
- |f|
-
- f := Smalltalk imageFromFileNamed:(name , '.xbm') forClass:self class.
- f isNil ifTrue:[
- ('SimpleView [warning]: no bitmap file: ' , name , '.xbm') errorPrintCR.
- ok := false
- ].
- f
- ].
+ collect:[:name |
+ |f|
+
+ f := Smalltalk imageFromFileNamed:(name , '.xbm') forClass:self class.
+ f isNil ifTrue:[
+ ('SimpleView [warning]: no bitmap file: ' , name , '.xbm') errorPrintCR.
+ ok := false
+ ].
+ f
+ ].
mask := Smalltalk imageFromFileNamed:'wheelm.xbm' forClass:self class.
mask isNil ifTrue:[
- ('SimpleView [warning]: no bitmap file: wheelm.xbm') errorPrintCR.
- ok := false
+ ('SimpleView [warning]: no bitmap file: wheelm.xbm') errorPrintCR.
+ ok := false
].
ok ifFalse:[
- self cursor:Cursor wait.
- aBlock valueNowOrOnUnwindDo:[
- self cursor:oldCursor
- ]
+ self cursor:Cursor wait.
+ aBlock valueNowOrOnUnwindDo:[
+ self cursor:oldCursor
+ ]
] ifTrue:[
- cursors := bitmaps collect:[:form | (Cursor sourceForm:form
- maskForm:mask
- hotX:8
- hotY:8) onDevice:device].
-
- process := [
- Delay waitForSeconds:0.25.
- [true] whileTrue:[
- cursors do:[:curs |
- self cursor:curs.
- Delay waitForSeconds:0.05
- ]
- ]
- ] fork.
-
- Processor activeProcess priority:7.
- aBlock valueNowOrOnUnwindDo:[
- Processor activeProcess priority:8.
- process terminate.
- self cursor:oldCursor
- ]
+ cursors := bitmaps collect:[:form | (Cursor sourceForm:form
+ maskForm:mask
+ hotX:8
+ hotY:8) onDevice:device].
+
+ process := [
+ Delay waitForSeconds:0.25.
+ [true] whileTrue:[
+ cursors do:[:curs |
+ self cursor:curs.
+ Delay waitForSeconds:0.05
+ ]
+ ]
+ ] fork.
+
+ Processor activeProcess priority:7.
+ aBlock valueNowOrOnUnwindDo:[
+ Processor activeProcess priority:8.
+ process terminate.
+ self cursor:oldCursor
+ ]
].
"
@@ -3907,31 +3907,31 @@
wasBlocked := OperatingSystem blockInterrupts.
[
- |deps|
-
- deps := dependents.
- "/
- "/ store the very first dependent directly in
- "/ the dependents instVar
- "/
- (deps isNil and:[anObject isCollection not]) ifTrue:[
- dependents := anObject
- ] ifFalse:[
- "/
- "/ store more dependents in the dependents collection
- "/
- deps isCollection ifTrue:[
- deps add:anObject
- ] ifFalse:[
- deps == anObject ifFalse:[
- dependents := (IdentitySet with:dependents with:anObject)
- ]
- ]
- ]
+ |deps|
+
+ deps := dependents.
+ "/
+ "/ store the very first dependent directly in
+ "/ the dependents instVar
+ "/
+ (deps isNil and:[anObject isCollection not]) ifTrue:[
+ dependents := anObject
+ ] ifFalse:[
+ "/
+ "/ store more dependents in the dependents collection
+ "/
+ deps isCollection ifTrue:[
+ deps add:anObject
+ ] ifFalse:[
+ deps == anObject ifFalse:[
+ dependents := (IdentitySet with:dependents with:anObject)
+ ]
+ ]
+ ]
] valueNowOrOnUnwindDo:[
- wasBlocked ifFalse:[
- OperatingSystem unblockInterrupts
- ]
+ wasBlocked ifFalse:[
+ OperatingSystem unblockInterrupts
+ ]
]
"Modified: 8.1.1997 / 23:40:30 / cg"
@@ -3943,7 +3943,7 @@
dependents isNil ifTrue:[^ #()].
dependents isCollection ifTrue:[
- ^ dependents
+ ^ dependents
].
^ IdentitySet with:dependents
@@ -3957,11 +3957,11 @@
|dep|
aCollection size == 1 ifTrue:[
- dep := aCollection first.
- dep isCollection ifFalse:[
- dependents := aCollection first.
- ^ self
- ]
+ dep := aCollection first.
+ dep isCollection ifFalse:[
+ dependents := aCollection first.
+ ^ self
+ ]
].
dependents := aCollection
@@ -3976,11 +3976,11 @@
deps := dependents.
deps notNil ifTrue:[
- deps isCollection ifTrue:[
- deps do:aBlock
- ] ifFalse:[
- aBlock value:deps
- ]
+ deps isCollection ifTrue:[
+ deps do:aBlock
+ ] ifFalse:[
+ aBlock value:deps
+ ]
]
"Created: 11.6.1997 / 13:10:51 / cg"
@@ -4007,31 +4007,31 @@
wasBlocked := OperatingSystem blockInterrupts.
[
- |deps sz dep|
-
- deps := dependents.
- deps notNil ifTrue:[
- deps isCollection ifTrue:[
- deps remove:anObject ifAbsent:[].
- (sz := deps size) == 0 ifTrue:[
- dependents := nil
- ] ifFalse:[
- sz == 1 ifTrue:[
- (dep := deps first) isCollection ifFalse:[
- dependents := dep
- ]
- ]
- ]
- ] ifFalse:[
- deps == anObject ifTrue:[
- dependents := nil
- ]
- ]
- ]
+ |deps sz dep|
+
+ deps := dependents.
+ deps notNil ifTrue:[
+ deps isCollection ifTrue:[
+ deps remove:anObject ifAbsent:[].
+ (sz := deps size) == 0 ifTrue:[
+ dependents := nil
+ ] ifFalse:[
+ sz == 1 ifTrue:[
+ (dep := deps first) isCollection ifFalse:[
+ dependents := dep
+ ]
+ ]
+ ]
+ ] ifFalse:[
+ deps == anObject ifTrue:[
+ dependents := nil
+ ]
+ ]
+ ]
] valueNowOrOnUnwindDo:[
- wasBlocked ifFalse:[
- OperatingSystem unblockInterrupts
- ]
+ wasBlocked ifFalse:[
+ OperatingSystem unblockInterrupts
+ ]
]
"Modified: 8.1.1997 / 23:41:39 / cg"
@@ -4091,7 +4091,7 @@
|app|
(app := self application) notNil ifTrue:[
- ^ app canDrop:aCollectionOfDropObjects in:self
+ ^ app canDrop:aCollectionOfDropObjects in:self
].
^ false
@@ -4107,7 +4107,7 @@
|app|
(app := self application) notNil ifTrue:[
- ^ app drop:aCollectionOfDropObjects in:self at:aPoint
+ ^ app drop:aCollectionOfDropObjects in:self at:aPoint
].
self subclassResponsibility
@@ -4120,11 +4120,11 @@
"draw bottom 3D edge into window frame"
self drawBottomEdgeLevel:level
- shadow:shadowColor
- light:lightColor
- halfShadow:nil
- halfLight:nil
- style:nil.
+ shadow:shadowColor
+ light:lightColor
+ halfShadow:nil
+ halfLight:nil
+ style:nil.
!
drawBottomEdgeLevel:level shadow:shadowColor light:lightColor halfShadow:halfShadowColor halfLight:halfLightColor style:edgeStyle
@@ -4136,28 +4136,28 @@
count == 0 ifTrue:[^ self].
(count < 0) ifTrue:[
- botFg := lightColor.
- count := count negated
+ botFg := lightColor.
+ count := count negated
] ifFalse:[
- ((edgeStyle == #soft) and:[level > 1]) ifTrue:[
- botFg := halfShadowColor
- ] ifFalse:[
- botFg := shadowColor
- ].
+ ((edgeStyle == #soft) and:[level > 1]) ifTrue:[
+ botFg := halfShadowColor
+ ] ifFalse:[
+ botFg := shadowColor
+ ].
].
super paint:botFg.
super lineWidth:0.
r := width - 1.
0 to:(count - 1) do:[:i |
- b := height - 1 - i.
- super displayDeviceLineFromX:i y:b toX:(r - i) y:b
+ b := height - 1 - i.
+ super displayDeviceLineFromX:i y:b toX:(r - i) y:b
].
((edgeStyle == #soft) and:[level > 1]) ifTrue:[
- b := height - 1.
- super paint:shadowColor.
- super displayDeviceLineFromX:1 y:b toX:r y:b.
+ b := height - 1.
+ super paint:shadowColor.
+ super displayDeviceLineFromX:1 y:b toX:r y:b.
].
self edgeDrawn:#bottom.
@@ -4169,33 +4169,33 @@
"draw all of my 3D edges"
self drawEdgesForX:0 y:0 width:width height:height level:level
- shadow:shadowColor
- light:lightColor
- halfShadow:nil
- halfLight:nil
- style:nil
+ shadow:shadowColor
+ light:lightColor
+ halfShadow:nil
+ halfLight:nil
+ style:nil
!
drawEdgesForX:x y:y width:w height:h level:l
"draw 3D edges into a rectangle"
self drawEdgesForX:x y:y width:w height:h level:l
- shadow:shadowColor
- light:lightColor
- halfShadow:nil
- halfLight:nil
- style:nil
+ shadow:shadowColor
+ light:lightColor
+ halfShadow:nil
+ halfLight:nil
+ style:nil
!
drawLeftEdge
"draw left 3D edge into window frame"
self drawLeftEdgeLevel:level
- shadow:shadowColor
- light:lightColor
- halfShadow:nil
- halfLight:nil
- style:nil.
+ shadow:shadowColor
+ light:lightColor
+ halfShadow:nil
+ halfLight:nil
+ style:nil.
!
drawLeftEdgeLevel:level shadow:shadowColor light:lightColor halfShadow:halfShadowColor halfLight:halfLightColor style:edgeStyle
@@ -4206,33 +4206,33 @@
count == 0 ifTrue:[^ self].
(count < 0) ifTrue:[
- leftFg := shadowColor.
- leftHalfFg := halfShadowColor.
- count := count negated.
+ leftFg := shadowColor.
+ leftHalfFg := halfShadowColor.
+ count := count negated.
] ifFalse:[
- leftFg := lightColor.
- leftHalfFg := halfLightColor.
+ leftFg := lightColor.
+ leftHalfFg := halfLightColor.
].
leftHalfFg isNil ifTrue:[
- leftHalfFg := leftFg
+ leftHalfFg := leftFg
].
((edgeStyle == #soft) and:[level > 0]) ifTrue:[
- paint := leftHalfFg
+ paint := leftHalfFg
] ifFalse:[
- paint := leftFg
+ paint := leftFg
].
super paint:paint.
super lineWidth:0.
b := height - 1.
0 to:(count - 1) do:[:i |
- super displayDeviceLineFromX:i y:i toX:i y:(b - i)
+ super displayDeviceLineFromX:i y:i toX:i y:(b - i)
].
((edgeStyle == #soft) and:[level > 2]) ifTrue:[
- super paint:(device blackColor).
- super displayDeviceLineFromX:0 y:0 toX:0 y:b.
+ super paint:(device blackColor).
+ super displayDeviceLineFromX:0 y:0 toX:0 y:b.
].
self edgeDrawn:#left.
@@ -4244,11 +4244,11 @@
"draw right 3D edge into window frame"
self drawRightEdgeLevel:level
- shadow:shadowColor
- light:lightColor
- halfShadow:nil
- halfLight:nil
- style:nil.
+ shadow:shadowColor
+ light:lightColor
+ halfShadow:nil
+ halfLight:nil
+ style:nil.
!
drawRightEdgeLevel:level shadow:shadowColor light:lightColor halfShadow:halfShadowColor halfLight:halfLightColor style:edgeStyle
@@ -4260,27 +4260,27 @@
count == 0 ifTrue:[^ self].
(count < 0) ifTrue:[
- rightFg := lightColor.
- count := count negated
+ rightFg := lightColor.
+ count := count negated
] ifFalse:[
- ((edgeStyle == #soft) and:[level > 1]) ifTrue:[
- rightFg := halfShadowColor
- ] ifFalse:[
- rightFg := shadowColor
- ].
+ ((edgeStyle == #soft) and:[level > 1]) ifTrue:[
+ rightFg := halfShadowColor
+ ] ifFalse:[
+ rightFg := shadowColor
+ ].
].
super paint:rightFg.
super lineWidth:0.
b := height - 1.
0 to:(count - 1) do:[:i |
- r := width - 1 - i.
- super displayDeviceLineFromX:r y:i toX:r y:(b - i)
+ r := width - 1 - i.
+ super displayDeviceLineFromX:r y:i toX:r y:(b - i)
].
((edgeStyle == #soft) and:[level > 1]) ifTrue:[
- r := width - 1.
- super paint:shadowColor.
- super displayDeviceLineFromX:r y:1 toX:r y:b.
+ r := width - 1.
+ super paint:shadowColor.
+ super displayDeviceLineFromX:r y:1 toX:r y:b.
].
self edgeDrawn:#right.
@@ -4292,11 +4292,11 @@
"draw top 3D edge into window frame"
self drawTopEdgeLevel:level
- shadow:shadowColor
- light:lightColor
- halfShadow:nil
- halfLight:nil
- style:nil.
+ shadow:shadowColor
+ light:lightColor
+ halfShadow:nil
+ halfLight:nil
+ style:nil.
!
drawTopEdgeLevel:level shadow:shadowColor light:lightColor halfShadow:halfShadowColor halfLight:halfLightColor style:edgeStyle
@@ -4307,32 +4307,32 @@
count == 0 ifTrue:[^ self].
(count < 0) ifTrue:[
- topFg := shadowColor.
- topHalfFg := halfShadowColor.
- count := count negated
+ topFg := shadowColor.
+ topHalfFg := halfShadowColor.
+ count := count negated
] ifFalse:[
- topFg := lightColor.
- topHalfFg := halfLightColor.
+ topFg := lightColor.
+ topHalfFg := halfLightColor.
].
topHalfFg isNil ifTrue:[
- topHalfFg := topFg
+ topHalfFg := topFg
].
((edgeStyle == #soft) and:[level > 0]) ifTrue:[
- paint := topHalfFg
+ paint := topHalfFg
] ifFalse:[
- paint := topFg
+ paint := topFg
].
super paint:paint.
super lineWidth:0.
r := width - 1.
0 to:(count - 1) do:[:i |
- super displayDeviceLineFromX:i y:i toX:(r - i) y:i
+ super displayDeviceLineFromX:i y:i toX:(r - i) y:i
].
((edgeStyle == #soft) and:[level > 2]) ifTrue:[
- super paint:(device blackColor).
- super displayDeviceLineFromX:0 y:0 toX:r y:0.
+ super paint:(device blackColor).
+ super displayDeviceLineFromX:0 y:0 toX:r y:0.
].
self edgeDrawn:#top.
@@ -4344,11 +4344,11 @@
"redraw my edges (if any)"
(level ~~ 0) ifTrue:[
- shown ifTrue:[
- self clippingRectangle:nil.
- self drawEdges.
- self deviceClippingRectangle:innerClipRect
- ]
+ shown ifTrue:[
+ self clippingRectangle:nil.
+ self drawEdges.
+ self deviceClippingRectangle:innerClipRect
+ ]
]
"Modified: / 25.5.1999 / 14:50:25 / cg"
@@ -4360,9 +4360,9 @@
"evaluate aBlock for all subviews (recursively)"
subViews notNil ifTrue:[
- subViews do:[:aSubview |
- aSubview withAllSubViewsDo:aBlock
- ]
+ subViews do:[:aSubview |
+ aSubview withAllSubViewsDo:aBlock
+ ]
]
"Modified: 12.2.1997 / 12:23:38 / cg"
@@ -4375,12 +4375,12 @@
|aView|
(subViews notNil and:[subViews size >= anIndex]) ifTrue:[
- aView := subViews remove:aSubView ifAbsent:nil.
-
- aView notNil ifTrue:[
- subViews add:aView beforeIndex:anIndex.
- ^ true
- ]
+ aView := subViews remove:aSubView ifAbsent:nil.
+
+ aView notNil ifTrue:[
+ subViews add:aView beforeIndex:anIndex.
+ ^ true
+ ]
].
^ false
!
@@ -4401,11 +4401,11 @@
v := self.
[v notNil] whileTrue:[
- (v canDrop:aCollectionOfDropObjects) ifTrue:[
- v drop:aCollectionOfDropObjects at:nil.
- ^ self.
- ].
- v := v superView
+ (v canDrop:aCollectionOfDropObjects) ifTrue:[
+ v drop:aCollectionOfDropObjects at:nil.
+ ^ self.
+ ].
+ v := v superView
]
"Modified: 11.4.1997 / 12:41:16 / cg"
@@ -4415,10 +4415,10 @@
"button was pressed - check my components for a hit."
components notNil ifTrue:[
- self componentsContainingX:x y:y do:[:comp :cx :cy |
- comp buttonPress:button x:cx y:cy.
- ^ self
- ]
+ self componentsContainingX:x y:y do:[:comp :cx :cy |
+ comp buttonPress:button x:cx y:cy.
+ ^ self
+ ]
].
super buttonPress:button x:x y:y
@@ -4430,10 +4430,10 @@
"button was released - check my components for a hit."
components notNil ifTrue:[
- self componentsContainingX:x y:y do:[:comp :cx :cy |
- comp buttonRelease:button x:cx y:cy.
- ^ self
- ]
+ self componentsContainingX:x y:y do:[:comp :cx :cy |
+ comp buttonRelease:button x:cx y:cy.
+ ^ self
+ ]
].
super buttonRelease:button x:x y:y
@@ -4468,64 +4468,64 @@
(superView isNil
and:[drawableId notNil]) ifTrue:[
- "/ have to be careful - some window managers (motif) wrap another
- "/ view around and the reported origin is relative to that.
- "/ not relative to the screen.
- p := device translatePoint:0@0 from:drawableId to:device rootWindowId.
- p := p + self borderWidth.
- left := p x.
- top := p y.
+ "/ have to be careful - some window managers (motif) wrap another
+ "/ view around and the reported origin is relative to that.
+ "/ not relative to the screen.
+ p := device translatePoint:0@0 from:drawableId to:device rootWindowId.
+ p := p + self borderWidth.
+ left := p x.
+ top := p y.
].
((width ~~ newWidth) or:[height ~~ newHeight]) ifTrue:[
- realized ifFalse:[
- width := newWidth.
- height := newHeight.
- extentChanged := true.
- ^ self
- ].
-
- ((newWidth <= width) and:[newHeight <= height]) ifTrue:[
- how := #smaller
- ] ifFalse:[
- ((newWidth >= width) and:[newHeight >= height]) ifTrue:[
- how := #larger
- ]
- ].
-
- level ~~ 0 ifTrue:[
- mustRedrawBottomEdge := newHeight < height.
- mustRedrawRightEdge := newWidth < width.
- anyEdge := mustRedrawBottomEdge or:[mustRedrawRightEdge]
- ] ifFalse:[
- anyEdge := false
- ].
-
- width := newWidth.
- height := newHeight.
-
- "recompute inner-clip if needed"
- self setInnerClip.
-
- "
- must first process pending exposes;
- otherwise, those may be drawn at a wrong position
- "
+ realized ifFalse:[
+ width := newWidth.
+ height := newHeight.
+ extentChanged := true.
+ ^ self
+ ].
+
+ ((newWidth <= width) and:[newHeight <= height]) ifTrue:[
+ how := #smaller
+ ] ifFalse:[
+ ((newWidth >= width) and:[newHeight >= height]) ifTrue:[
+ how := #larger
+ ]
+ ].
+
+ level ~~ 0 ifTrue:[
+ mustRedrawBottomEdge := newHeight < height.
+ mustRedrawRightEdge := newWidth < width.
+ anyEdge := mustRedrawBottomEdge or:[mustRedrawRightEdge]
+ ] ifFalse:[
+ anyEdge := false
+ ].
+
+ width := newWidth.
+ height := newHeight.
+
+ "recompute inner-clip if needed"
+ self setInnerClip.
+
+ "
+ must first process pending exposes;
+ otherwise, those may be drawn at a wrong position
+ "
"/ claus: no; expose events are in the same queue as configure events;
"/ which is exactly for that reason ...
"/ windowGroup notNil ifTrue:[
"/ windowGroup processExposeEvents
"/ ].
- self sizeChanged:how.
-
- (anyEdge and:[shown]) ifTrue:[
- mustRedrawBottomEdge ifTrue:[
- self invalidateDeviceRectangle:((0 @ (height-1-margin)) extent:width@margin) repairNow:false.
- ].
- mustRedrawRightEdge ifTrue:[
- self invalidateDeviceRectangle:((width-1-margin)@0 extent:margin@height) repairNow:false.
- ].
+ self sizeChanged:how.
+
+ (anyEdge and:[shown]) ifTrue:[
+ mustRedrawBottomEdge ifTrue:[
+ self invalidateDeviceRectangle:((0 @ (height-1-margin)) extent:width@margin) repairNow:false.
+ ].
+ mustRedrawRightEdge ifTrue:[
+ self invalidateDeviceRectangle:((width-1-margin)@0 extent:margin@height) repairNow:false.
+ ].
"/ OLD code:
"/ self clippingRectangle:nil.
"/ mustRedrawBottomEdge ifTrue:[
@@ -4535,7 +4535,7 @@
"/ self drawRightEdge
"/ ].
"/ self deviceClippingRectangle:innerClipRect
- ]
+ ]
]
"Modified: / 25.5.1999 / 14:47:18 / cg"
@@ -4556,38 +4556,38 @@
slowly migrating to use layoutObjects ...
"
layout isNil ifTrue:[
- newOrg := self computeOrigin.
- newExt := self computeExtent.
+ newOrg := self computeOrigin.
+ newExt := self computeExtent.
] ifFalse:[
- r := (layout rectangleRelativeTo:(superView viewRectangle)
- preferred:[self preferredBounds]).
- newOrg := r origin rounded.
- newExt := r extent rounded.
+ r := (layout rectangleRelativeTo:(superView viewRectangle)
+ preferred:[self preferredBounds]).
+ newOrg := r origin rounded.
+ newExt := r extent rounded.
"/ newOrg printNL.
"/ newExt printNL.
].
newOrg notNil ifTrue:[
- ((newOrg x == oldLeft) and:[newOrg y == oldTop]) ifTrue:[
- newOrg := nil
- ]
+ ((newOrg x == oldLeft) and:[newOrg y == oldTop]) ifTrue:[
+ newOrg := nil
+ ]
].
newExt notNil ifTrue:[
- ((newExt x == width) and:[newExt y == height]) ifTrue:[
- newExt := nil
- ]
+ ((newExt x == width) and:[newExt y == height]) ifTrue:[
+ newExt := nil
+ ]
].
newExt isNil ifTrue:[
- newOrg notNil ifTrue:[
- self pixelOrigin:newOrg
- ]
+ newOrg notNil ifTrue:[
+ self pixelOrigin:newOrg
+ ]
] ifFalse:[
- newOrg isNil ifTrue:[
- self pixelExtent:newExt
- ] ifFalse:[
- self pixelOrigin:newOrg extent:newExt
- ]
+ newOrg isNil ifTrue:[
+ self pixelExtent:newExt
+ ] ifFalse:[
+ self pixelOrigin:newOrg extent:newExt
+ ]
]
"Modified: 19.7.1996 / 17:32:50 / cg"
@@ -4602,7 +4602,7 @@
"/ my subviews (they remember this in the shown instVar)
realized ifTrue:[
- shown ifFalse:[
+ shown ifFalse:[
"/ old:
"/ shown := true.
"/ subViews notNil ifTrue:[
@@ -4612,8 +4612,8 @@
"/ ]
"/ which is equivalent to:
- self mapped.
- ]
+ self mapped.
+ ]
].
"Modified: 30.5.1996 / 11:41:02 / cg"
@@ -4628,9 +4628,9 @@
"/ my subviews (they remember this in the shown instVar)
realized ifTrue:[
- shown ifTrue:[
- self unmapped
- ]
+ shown ifTrue:[
+ self unmapped
+ ]
]
"Modified: 30.5.1996 / 11:41:25 / cg"
@@ -4656,21 +4656,21 @@
|dropObjects|
dropType == #file ifTrue:[
- dropObjects := Array with:(DropObject newFile:dropValue)
+ dropObjects := Array with:(DropObject newFile:dropValue)
] ifFalse:[
- dropType == #directory ifTrue:[
- dropObjects := Array with:(DropObject newFile:dropValue)
- ] ifFalse:[
- dropType == #files ifTrue:[
- dropObjects := (dropValue collect:[:fn | DropObject newFile:fn])
- ] ifFalse:[
- dropType == #text ifTrue:[
- dropObjects := Array with:(DropObject newText:dropValue)
- ] ifFalse:[
- dropObjects := Array with:(DropObject new:dropValue)
- ]
- ]
- ]
+ dropType == #directory ifTrue:[
+ dropObjects := Array with:(DropObject newFile:dropValue)
+ ] ifFalse:[
+ dropType == #files ifTrue:[
+ dropObjects := (dropValue collect:[:fn | DropObject newFile:fn])
+ ] ifFalse:[
+ dropType == #text ifTrue:[
+ dropObjects := Array with:(DropObject newText:dropValue)
+ ] ifFalse:[
+ dropObjects := Array with:(DropObject new:dropValue)
+ ]
+ ]
+ ]
].
self alienDrop:dropObjects
@@ -4695,116 +4695,116 @@
check if there is a need to draw an edge (i.e. if margin is hit)
"
(margin ~~ 0) ifTrue:[
- leftEdge := false.
- topEdge := false.
- rightEdge := false.
- botEdge := false.
- transformation notNil ifTrue:[
- "
- need device coordinates for this test
- "
- nx := transformation applyToX:nx.
- ny := transformation applyToY:ny.
- nw := transformation applyScaleX:nw.
- nh := transformation applyScaleY:nh.
- ].
- "
- adjust expose rectangle, to exclude the margin.
- Care for rounding errors ...
- "
- (nx isMemberOf:SmallInteger) ifFalse:[
- old := nx.
- nx := nx truncated.
- nw := nw + (nx - old).
- ].
- (ny isMemberOf:SmallInteger) ifFalse:[
- old := ny.
- ny := ny truncated.
- nh := nh + (ny - old).
- ].
- (nw isMemberOf:SmallInteger) ifFalse:[
- nw := nw truncated + 1
- ].
- (nh isMemberOf:SmallInteger) ifFalse:[
- nh := nh truncated + 1
- ].
-
- dx := nx.
- dy := ny.
- dw := nw.
- dh := nh.
-
- (nx < margin) ifTrue:[
- old := nx.
- nx := margin.
- nw := nw - (nx - old).
- leftEdge := anyEdge := true.
- ].
- ((nx + nw - 1) >= (width - margin)) ifTrue:[
- nw := (width - margin - nx).
- rightEdge := anyEdge := true.
- ].
- (ny < margin) ifTrue:[
- old := ny.
- ny := margin.
- nh := nh - (ny - old).
- topEdge := anyEdge := true.
- ].
- ((ny + nh - 1) >= (height - margin)) ifTrue:[
- nh := (height - margin - ny).
- botEdge := anyEdge := true.
- ].
- transformation notNil ifTrue:[
- "
- need logical coordinates for redraw
- "
- nx := transformation applyInverseToX:nx.
- ny := transformation applyInverseToY:ny.
- nw := transformation applyInverseScaleX:nw.
- nh := transformation applyInverseScaleY:nh.
- ].
+ leftEdge := false.
+ topEdge := false.
+ rightEdge := false.
+ botEdge := false.
+ transformation notNil ifTrue:[
+ "
+ need device coordinates for this test
+ "
+ nx := transformation applyToX:nx.
+ ny := transformation applyToY:ny.
+ nw := transformation applyScaleX:nw.
+ nh := transformation applyScaleY:nh.
+ ].
+ "
+ adjust expose rectangle, to exclude the margin.
+ Care for rounding errors ...
+ "
+ (nx isMemberOf:SmallInteger) ifFalse:[
+ old := nx.
+ nx := nx truncated.
+ nw := nw + (nx - old).
+ ].
+ (ny isMemberOf:SmallInteger) ifFalse:[
+ old := ny.
+ ny := ny truncated.
+ nh := nh + (ny - old).
+ ].
+ (nw isMemberOf:SmallInteger) ifFalse:[
+ nw := nw truncated + 1
+ ].
+ (nh isMemberOf:SmallInteger) ifFalse:[
+ nh := nh truncated + 1
+ ].
+
+ dx := nx.
+ dy := ny.
+ dw := nw.
+ dh := nh.
+
+ (nx < margin) ifTrue:[
+ old := nx.
+ nx := margin.
+ nw := nw - (nx - old).
+ leftEdge := anyEdge := true.
+ ].
+ ((nx + nw - 1) >= (width - margin)) ifTrue:[
+ nw := (width - margin - nx).
+ rightEdge := anyEdge := true.
+ ].
+ (ny < margin) ifTrue:[
+ old := ny.
+ ny := margin.
+ nh := nh - (ny - old).
+ topEdge := anyEdge := true.
+ ].
+ ((ny + nh - 1) >= (height - margin)) ifTrue:[
+ nh := (height - margin - ny).
+ botEdge := anyEdge := true.
+ ].
+ transformation notNil ifTrue:[
+ "
+ need logical coordinates for redraw
+ "
+ nx := transformation applyInverseToX:nx.
+ ny := transformation applyInverseToY:ny.
+ nw := transformation applyInverseScaleX:nw.
+ nh := transformation applyInverseScaleY:nh.
+ ].
].
(nw > 0 and:[nh > 0]) ifTrue:[
- "
- redraw inside area
- "
- self clippingRectangle:(Rectangle left:nx top:ny width:nw height:nh).
-
- device supportsAnyViewBackgroundPixmaps ifFalse:[
- "/ workaround: non-existing bg-pixmap support (win95)
-
- viewBackground isImageOrForm ifTrue:[
- (device supportsViewBackgroundPixmap:viewBackground) ifFalse:[
- self fillRectangleWithViewBackgroundX:nx y:ny width:nw height:nh
- ]
- ].
- ].
-
- self redrawX:nx y:ny width:nw height:nh.
+ "
+ redraw inside area
+ "
+ self clippingRectangle:(Rectangle left:nx top:ny width:nw height:nh).
+
+ device supportsAnyViewBackgroundPixmaps ifFalse:[
+ "/ workaround: non-existing bg-pixmap support (win95)
+
+ viewBackground isImageOrForm ifTrue:[
+ (device supportsViewBackgroundPixmap:viewBackground) ifFalse:[
+ self fillRectangleWithViewBackgroundX:nx y:ny width:nw height:nh
+ ]
+ ].
+ ].
+
+ self redrawX:nx y:ny width:nw height:nh.
].
"
redraw edge(s)
"
anyEdge ifTrue:[
- self deviceClippingRectangle:nil.
- (topEdge and:[leftEdge and:[botEdge and:[rightEdge]]]) ifTrue:[
- self drawEdges
- ] ifFalse:[
- topEdge ifTrue:[
- self drawTopEdge
- ].
- leftEdge ifTrue:[
- self drawLeftEdge
- ].
- botEdge ifTrue:[
- self drawBottomEdge
- ].
- rightEdge ifTrue:[
- self drawRightEdge
- ]
- ].
+ self deviceClippingRectangle:nil.
+ (topEdge and:[leftEdge and:[botEdge and:[rightEdge]]]) ifTrue:[
+ self drawEdges
+ ] ifFalse:[
+ topEdge ifTrue:[
+ self drawTopEdge
+ ].
+ leftEdge ifTrue:[
+ self drawLeftEdge
+ ].
+ botEdge ifTrue:[
+ self drawBottomEdge
+ ].
+ rightEdge ifTrue:[
+ self drawRightEdge
+ ]
+ ].
].
self deviceClippingRectangle:innerClipRect.
@@ -4826,7 +4826,7 @@
"notification from the windowGroup that I got the keyboardFocus."
delegate notNil ifTrue:[
- delegate perform:#hasKeyboardFocus: with:aBoolean ifNotUnderstood:nil
+ delegate perform:#hasKeyboardFocus: with:aBoolean ifNotUnderstood:nil
].
^ self
!
@@ -4839,37 +4839,37 @@
<resource: #keyboard ( #Menu ) >
components notNil ifTrue:[
- components notNil ifTrue:[
- self componentsContainingX:x y:y do:[:comp :cx :cy |
- comp keyPress:key x:cx y:cy.
- ^ self
- ]
- ].
+ components notNil ifTrue:[
+ self componentsContainingX:x y:y do:[:comp :cx :cy |
+ comp keyPress:key x:cx y:cy.
+ ^ self
+ ]
+ ].
].
key == #Menu ifTrue:[
- ^ self activateMenu.
+ ^ self activateMenu.
].
x isNil ifTrue:[
- "/ already redelegated, but nowhere handled
- superView notNil ifTrue:[
- superView keyPress:key x:nil y:nil.
- ].
- ^ self
+ "/ already redelegated, but nowhere handled
+ superView notNil ifTrue:[
+ superView keyPress:key x:nil y:nil.
+ ].
+ ^ self
].
superView notNil ifTrue:[
- superView
- dispatchEvent:#keyPress:x:y:
- arguments:(Array with:key with:0 with:0)
+ superView
+ dispatchEvent:#keyPress:x:y:
+ arguments:(Array with:key with:0 with:0)
"/ WindowEvent
"/ sendEvent:#keyPress:x:y:
"/ arguments:(Array with:key with:0 with:0)
"/ view:superView
] ifFalse:[
- super keyPress:key x:x y:y
+ super keyPress:key x:x y:y
]
"Modified: / 20.5.1998 / 22:55:08 / cg"
@@ -4881,12 +4881,12 @@
Otherwise, do whatever my superclass would do."
components notNil ifTrue:[
- components notNil ifTrue:[
- self componentsContainingX:x y:y do:[:comp :cx :cy |
- comp keyRelease:key x:cx y:cy.
- ^ self
- ]
- ].
+ components notNil ifTrue:[
+ self componentsContainingX:x y:y do:[:comp :cx :cy |
+ comp keyRelease:key x:cx y:cy.
+ ^ self
+ ]
+ ].
].
super keyRelease:key x:x y:y
@@ -4902,9 +4902,9 @@
"
the old code was:
- realized := true.
- shown := true.
- ...
+ realized := true.
+ shown := true.
+ ...
this created a race condition, if the view was
realized and shortly after unrealized - before the mapped event
@@ -4915,31 +4915,31 @@
realized ifTrue:[
- "/ currently, the 'shown ifFalse:' optimization is
- "/ not ok, since 'shown' is also modified by visibilityChanges.
- "/ Also, when remapped, X11 only sends a mapped event for the topView.
- "/ Therefore, synthetically generate those #superViewMapped messages
- "/ in any case.
-
- shown := true.
- "
- backed views will not get expose events - have
- to force a redraw here to get things drawn into
- backing store.
- "
- backed ifTrue:[
- self redrawX:0 y:0 width:width height:height
- ].
-
- "/ tell my subViews ...
- subViews notNil ifTrue:[
- subViews do:[:v | v mapped
+ "/ currently, the 'shown ifFalse:' optimization is
+ "/ not ok, since 'shown' is also modified by visibilityChanges.
+ "/ Also, when remapped, X11 only sends a mapped event for the topView.
+ "/ Therefore, synthetically generate those #superViewMapped messages
+ "/ in any case.
+
+ shown := true.
+ "
+ backed views will not get expose events - have
+ to force a redraw here to get things drawn into
+ backing store.
+ "
+ backed ifTrue:[
+ self redrawX:0 y:0 width:width height:height
+ ].
+
+ "/ tell my subViews ...
+ subViews notNil ifTrue:[
+ subViews do:[:v | v mapped
"/ v shown ifFalse:[
"/ v mapped
"/ ]
- ]
- ].
- self changed:#visibility.
+ ]
+ ].
+ self changed:#visibility.
]
"Modified: 25.2.1997 / 22:41:34 / cg"
@@ -4960,33 +4960,33 @@
pageScroll := false.
(sensor := self sensor) notNil ifTrue:[
- sensor ctrlDown ifTrue:[
- pageScroll := true
- ]
+ sensor ctrlDown ifTrue:[
+ pageScroll := true
+ ]
].
pageScroll ifFalse:[
- (sensor isNil or:[sensor shiftDown]) ifFalse:[
- hCont := self heightOfContents.
- hCont > (self innerHeight * 3) ifTrue:[
- factor := (hCont // self innerHeight) min:4.
- amountToScroll := amountToScroll * factor.
- ]
- ]
+ (sensor isNil or:[sensor shiftDown]) ifFalse:[
+ hCont := self heightOfContents.
+ hCont > (self innerHeight * 3) ifTrue:[
+ factor := (hCont // self innerHeight) min:4.
+ amountToScroll := amountToScroll * factor.
+ ]
+ ]
].
amount > 0 ifTrue:[
- pageScroll ifTrue:[
- self pageUp
- ] ifFalse:[
- self scrollUp:amountToScroll
- ]
+ pageScroll ifTrue:[
+ self pageUp
+ ] ifFalse:[
+ self scrollUp:amountToScroll
+ ]
] ifFalse:[
- pageScroll ifTrue:[
- self pageDown
- ] ifFalse:[
- self scrollDown:amountToScroll
- ]
+ pageScroll ifTrue:[
+ self pageDown
+ ] ifFalse:[
+ self scrollDown:amountToScroll
+ ]
].
"Modified: / 21.5.1999 / 19:58:42 / cg"
@@ -4996,7 +4996,7 @@
"mouse pointer entered - request the keyboard focus (sometimes)"
self wantsFocusWithPointerEnter ifTrue:[
- self requestFocus.
+ self requestFocus.
].
!
@@ -5035,49 +5035,49 @@
|subViews|
(subViews := self subViews) notNil ifTrue:[
- (how isNil "false"
- or:[how == #smaller]) ifTrue:[
- subViews do:[:view |
- view notNil ifTrue:[
- 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"
-
- subViews reverseDo:[:view |
- view notNil ifTrue:[
- view containerChangedSize
- ]
- ]
- ]
+ (how isNil "false"
+ or:[how == #smaller]) ifTrue:[
+ subViews do:[:view |
+ view notNil ifTrue:[
+ 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"
+
+ subViews reverseDo:[:view |
+ view notNil ifTrue:[
+ view containerChangedSize
+ ]
+ ]
+ ]
].
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
- ]
- ]
+ (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: / 2.4.1998 / 13:59:59 / cg"
@@ -5121,10 +5121,10 @@
shown := false.
subViews notNil ifTrue:[
- subViews do:[:v |
- v containerUnmapped
- ].
- self changed:#visibility.
+ subViews do:[:v |
+ v containerUnmapped
+ ].
+ self changed:#visibility.
]
"Modified: 25.2.1997 / 22:40:52 / cg"
@@ -5136,9 +5136,9 @@
Using this knowledge avoids useless redraw in obsucred views."
how == #fullyObscured ifTrue:[
- shown := false
+ shown := false
] ifFalse:[
- shown := true.
+ shown := true.
]
!
@@ -5202,9 +5202,9 @@
|sensor|
(sensor := self sensor) notNil ifTrue:[
- sensor pushUserEvent:aSelector for:self withArguments:args
+ sensor pushUserEvent:aSelector for:self withArguments:args
] ifFalse:[
- self perform:aSelector withArguments:args
+ self perform:aSelector withArguments:args
]
"
@@ -5232,11 +5232,11 @@
"set widget tabable or not
"
aBool == true ifTrue:[
- self objectAttributeAt:#tabable put:true
+ self objectAttributeAt:#tabable put:true
] ifFalse:[
- (self objectAttributeAt:#tabable) == true ifTrue:[
- self objectAttributeAt:#tabable put:false
- ]
+ (self objectAttributeAt:#tabable) == true ifTrue:[
+ self objectAttributeAt:#tabable put:false
+ ]
].
!
@@ -5249,7 +5249,7 @@
active - i.e. if the user tabbed into a widget)"
windowGroup notNil ifTrue:[
- ^ windowGroup focusRequestFrom:self
+ ^ windowGroup focusRequestFrom:self
].
^ true
!
@@ -5263,26 +5263,26 @@
|delta clrId bd|
explicit ifTrue:[
- (drawableId notNil and:[superView notNil]) ifTrue:[
- (styleSheet at:#'focus.showBorder' default:true) ifTrue:[
- (device supportsWindowBorder:(bd := DefaultFocusBorderWidth)) ifFalse:[
- (device supportsWindowBorder:(bd := 1)) ifFalse:[
- bd := 0.
- ]
- ].
- delta := bd - borderWidth.
- delta ~~ 0 ifTrue:[
- device moveWindow:drawableId x:left-delta y:top-delta.
- device setWindowBorderWidth:bd in:drawableId.
- ].
-
- clrId := (DefaultFocusColor onDevice:device) colorId.
- clrId isNil ifTrue:[
- clrId := device blackpixel
- ].
- device setWindowBorderColor:clrId in:drawableId.
- ]
- ]
+ (drawableId notNil and:[superView notNil]) ifTrue:[
+ (styleSheet at:#'focus.showBorder' default:true) ifTrue:[
+ (device supportsWindowBorder:(bd := DefaultFocusBorderWidth)) ifFalse:[
+ (device supportsWindowBorder:(bd := 1)) ifFalse:[
+ bd := 0.
+ ]
+ ].
+ delta := bd - borderWidth.
+ delta ~~ 0 ifTrue:[
+ device moveWindow:drawableId x:left-delta y:top-delta.
+ device setWindowBorderWidth:bd in:drawableId.
+ ].
+
+ clrId := (DefaultFocusColor onDevice:device) colorId.
+ clrId isNil ifTrue:[
+ clrId := device blackpixel
+ ].
+ device setWindowBorderColor:clrId in:drawableId.
+ ]
+ ]
] ifFalse:[
"/ superView notNil ifTrue:[
"/ superView showFocus:explicit
@@ -5301,21 +5301,21 @@
|delta bd|
explicit ifTrue:[
- (drawableId notNil and:[superView notNil]) ifTrue:[
- (styleSheet at:#'focus.showBorder' default:true) ifTrue:[
- (device supportsWindowBorder:(bd := borderWidth)) ifFalse:[
- (device supportsWindowBorder:(bd := 1)) ifFalse:[
- bd := 0.
- ]
- ].
- delta := DefaultFocusBorderWidth - bd.
- delta ~~ 0 ifTrue:[
- device setWindowBorderWidth:bd in:drawableId.
- device moveWindow:drawableId x:left y:top.
- ].
- self setBorderColor.
- ]
- ]
+ (drawableId notNil and:[superView notNil]) ifTrue:[
+ (styleSheet at:#'focus.showBorder' default:true) ifTrue:[
+ (device supportsWindowBorder:(bd := borderWidth)) ifFalse:[
+ (device supportsWindowBorder:(bd := 1)) ifFalse:[
+ bd := 0.
+ ]
+ ].
+ delta := DefaultFocusBorderWidth - bd.
+ delta ~~ 0 ifTrue:[
+ device setWindowBorderWidth:bd in:drawableId.
+ device moveWindow:drawableId x:left y:top.
+ ].
+ self setBorderColor.
+ ]
+ ]
]
"Modified: / 17.9.1998 / 15:08:02 / cg"
@@ -5327,8 +5327,8 @@
to return false"
(self class == SimpleView) ifTrue:[
- "/ a pure filler/geometric layout view
- ^ false
+ "/ a pure filler/geometric layout view
+ ^ false
].
^ true
!
@@ -5393,8 +5393,8 @@
"/ ].
aCursorOrNil notNil ifTrue:[
- cursor := (aCursorOrNil onDevice:device).
- ^ device grabPointerInView:self withCursor:cursor
+ cursor := (aCursorOrNil onDevice:device).
+ ^ device grabPointerInView:self withCursor:cursor
].
^ device grabPointerInView:self
!
@@ -5405,14 +5405,14 @@
|sensor|
device activeKeyboardGrab == self ifTrue:[
- (sensor := self sensor) notNil ifTrue:[
- "/ make certain all X events have been received
- device sync.
- "/ now all events have been received.
- "/ now, flush all pointer events
- sensor flushKeyboardFor:self
- ].
- device ungrabKeyboard.
+ (sensor := self sensor) notNil ifTrue:[
+ "/ make certain all X events have been received
+ device sync.
+ "/ now all events have been received.
+ "/ now, flush all pointer events
+ sensor flushKeyboardFor:self
+ ].
+ device ungrabKeyboard.
].
!
@@ -5423,14 +5423,14 @@
|sensor|
device activePointerGrab == self ifTrue:[
- (sensor := self sensor) notNil ifTrue:[
- "/ make certain all X events have been received
- device sync.
- "/ now all events have been received.
- "/ now, flush all pointer events
- sensor flushMotionEventsFor:self
- ].
- device ungrabPointer.
+ (sensor := self sensor) notNil ifTrue:[
+ "/ make certain all X events have been received
+ device sync.
+ "/ now all events have been received.
+ "/ now, flush all pointer events
+ sensor flushMotionEventsFor:self
+ ].
+ device ungrabPointer.
]
! !
@@ -5483,7 +5483,7 @@
make me unknown to the device"
realized ifTrue:[
- self unmap.
+ self unmap.
"/ "make it go away immediately
"/ - also, this hides the subview killing"
"/
@@ -5498,11 +5498,11 @@
"/ ].
subViews notNil ifTrue:[
- self destroySubViews.
+ self destroySubViews.
].
superView notNil ifTrue:[
- superView removeSubView:self.
- superView := nil
+ superView removeSubView:self.
+ superView := nil
].
super destroy.
@@ -5511,13 +5511,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
].
"Modified: / 3.5.1996 / 23:49:24 / stefan"
@@ -5542,23 +5542,23 @@
viewBackground := DefaultViewBackgroundColor.
DefaultLightColor notNil ifTrue:[
- lightColor := DefaultLightColor.
+ lightColor := DefaultLightColor.
] ifFalse:[
- device hasGrayscales ifTrue:[
- DefaultLightColor := lightColor := viewBackground lightened.
- ] ifFalse:[
- "
- this seems strange: on B&W screens, we create the light color
- darker than normal viewBackground (White) -
- to make the boundary of the view visible
- "
- lightColor := Color gray:50
- ]
+ device hasGrayscales ifTrue:[
+ DefaultLightColor := lightColor := viewBackground lightened.
+ ] ifFalse:[
+ "
+ this seems strange: on B&W screens, we create the light color
+ darker than normal viewBackground (White) -
+ to make the boundary of the view visible
+ "
+ lightColor := Color gray:50
+ ]
].
DefaultShadowColor notNil ifTrue:[
- shadowColor := DefaultShadowColor.
+ shadowColor := DefaultShadowColor.
] ifFalse:[
- shadowColor := Black
+ shadowColor := Black
].
lightColor := lightColor.
@@ -5578,12 +5578,12 @@
and keep the values in fast class variables
"
StyleSheet isNil ifTrue:[
- DefaultStyle isNil ifTrue:[
- "/ the very-very first time (no styleSheet yet)
- View setDefaultStyle. "/ View defaultStyle:#normal.
- View defaultStyle:DefaultStyle.
- ].
- self class updateStyleCache
+ DefaultStyle isNil ifTrue:[
+ "/ the very-very first time (no styleSheet yet)
+ View setDefaultStyle. "/ View defaultStyle:#normal.
+ View defaultStyle:DefaultStyle.
+ ].
+ self class updateStyleCache
].
styleSheet := StyleSheet.
@@ -5631,8 +5631,8 @@
controllerClass := self defaultControllerClass.
controllerClass notNil ifTrue:[
- controller := controllerClass new.
- controller view:self.
+ controller := controllerClass new.
+ controller view:self.
].
"Modified: / 1.10.1998 / 14:31:05 / cg"
@@ -5650,7 +5650,7 @@
prepareForReinit
super prepareForReinit.
windowGroup notNil ifTrue:[
- windowGroup reinitialize
+ windowGroup reinitialize
]
!
@@ -5661,10 +5661,10 @@
self initStyle.
drawableId notNil ifTrue:[
- "force a change"
- t := borderWidth. borderWidth := nil. self borderWidth:t.
- t := viewBackground. viewBackground := nil. self viewBackground:t.
- self clear. self invalidate.
+ "force a change"
+ t := borderWidth. borderWidth := nil. self borderWidth:t.
+ t := viewBackground. viewBackground := nil. self viewBackground:t.
+ self clear. self invalidate.
].
"Modified: / 18.9.1998 / 21:15:33 / cg"
@@ -5677,16 +5677,16 @@
"if I have already been reinited - return"
drawableId notNil ifTrue:[
- ^ self
+ ^ self
].
"
superView must be there, first
"
superView notNil ifTrue:[
- (sv := superView view) id isNil ifTrue:[
- sv reinitialize
- ]
+ (sv := superView view) id isNil ifTrue:[
+ sv reinitialize
+ ]
].
"reinit cursor"
@@ -5698,16 +5698,16 @@
"if I was mapped, do it again"
realized ifTrue:[
- "only remap if I have a superview - otherwise, I might be
- a hidden iconView or menu ..."
- superView notNil ifTrue:[
+ "only remap if I have a superview - otherwise, I might be
+ a hidden iconView or menu ..."
+ superView notNil ifTrue:[
"/ shown ifTrue:[
- device
- mapView:self id:drawableId iconified:false
- atX:left y:top width:width height:height
- minExtent:(self minExtent) maxExtent:(self maxExtent)
+ device
+ mapView:self id:drawableId iconified:false
+ atX:left y:top width:width height:height
+ minExtent:(self minExtent) maxExtent:(self maxExtent)
"/ ].
- ].
+ ].
].
"restore controller"
@@ -5725,80 +5725,80 @@
and handled in the superClass (static menus are a historic leftOver).
Otherwise, the follwing steps are performed:
- - ask the receiver for the menu (via #yellowButtonMenu)
- - ask the receiver for the menuPerformer.
- - startUp the menu - it is supposed to return an actionSelector
- - if the menuPerformer responds to the selector,
- send it to the performer;
- otherwise send it to the view (the receiver)
- This is funny, it allows additional menuItems to be added
- AND still get the views copy/cut/paste functionality.
- Without this, you had to redefine and forward all of those
- messages in the performer."
+ - ask the receiver for the menu (via #yellowButtonMenu)
+ - ask the receiver for the menuPerformer.
+ - startUp the menu - it is supposed to return an actionSelector
+ - if the menuPerformer responds to the selector,
+ send it to the performer;
+ otherwise send it to the view (the receiver)
+ This is funny, it allows additional menuItems to be added
+ AND still get the views copy/cut/paste functionality.
+ Without this, you had to redefine and forward all of those
+ messages in the performer."
|menu menuPerformer actionSelector prevReceiver wg|
middleButtonMenu isNil ifTrue:[
- "
- try ST-80 style menus first:
- if there is a model, and a menuMessage is defined,
- ask model for the menu and launch that if non-nil.
- "
- menu := self yellowButtonMenu.
- menu notNil ifTrue:[
-
- "/ could be a spec ...
- menu isArray ifTrue:[
- menu := menu decodeAsLiteralArray
- ].
-
- "
- got one, launch the menu. It is supposed
- to return an actionSelector.
- "
- menuPerformer := self menuPerformer value.
-
- "
- a temporary kludge:
- pass myself as receiver, the menuPerformer as performer;
- the menu will send its messages to either the
- menuPerformer or me (its receiver).
- This allows for the ST-80 behavior, where some messages
- go to the model, others to the view
- (copy/cut/paste).
- "
- (prevReceiver := menu receiver) isNil ifTrue:[
- "/ kludge for oldStyle menus (MenuView/PopUpMenu)
- "/ not req'd for real Menus
-
- (menu respondsTo:#menuPerformer:) ifTrue:[
- menu receiver:self. "/ really ?
- menu menuPerformer:menuPerformer.
- ] ifFalse:[
- "/ new style menu
- menu receiver:menuPerformer.
- ]
- ].
-
- "/
- "/ startup the menu - this returns a selector
- "/
- actionSelector := menu startUp.
-
- "/ before doing anything else, redraw expose area from
- "/ the menu (in case the action changes my state)
- (wg := self windowGroup) notNil ifTrue:[
- wg processExposeEvents.
- ].
-
- actionSelector notNil ifTrue:[
- self dispatchMenuSelection:actionSelector.
- ].
-
- menu receiver:prevReceiver.
-
- ^ self
- ].
+ "
+ try ST-80 style menus first:
+ if there is a model, and a menuMessage is defined,
+ ask model for the menu and launch that if non-nil.
+ "
+ menu := self yellowButtonMenu.
+ menu notNil ifTrue:[
+
+ "/ could be a spec ...
+ menu isArray ifTrue:[
+ menu := menu decodeAsLiteralArray
+ ].
+
+ "
+ got one, launch the menu. It is supposed
+ to return an actionSelector.
+ "
+ menuPerformer := self menuPerformer value.
+
+ "
+ a temporary kludge:
+ pass myself as receiver, the menuPerformer as performer;
+ the menu will send its messages to either the
+ menuPerformer or me (its receiver).
+ This allows for the ST-80 behavior, where some messages
+ go to the model, others to the view
+ (copy/cut/paste).
+ "
+ (prevReceiver := menu receiver) isNil ifTrue:[
+ "/ kludge for oldStyle menus (MenuView/PopUpMenu)
+ "/ not req'd for real Menus
+
+ (menu respondsTo:#menuPerformer:) ifTrue:[
+ menu receiver:self. "/ really ?
+ menu menuPerformer:menuPerformer.
+ ] ifFalse:[
+ "/ new style menu
+ menu receiver:menuPerformer.
+ ]
+ ].
+
+ "/
+ "/ startup the menu - this returns a selector
+ "/
+ actionSelector := menu startUp.
+
+ "/ before doing anything else, redraw expose area from
+ "/ the menu (in case the action changes my state)
+ (wg := self windowGroup) notNil ifTrue:[
+ wg processExposeEvents.
+ ].
+
+ actionSelector notNil ifTrue:[
+ self dispatchMenuSelection:actionSelector.
+ ].
+
+ menu receiver:prevReceiver.
+
+ ^ self
+ ].
].
"/
@@ -5822,8 +5822,8 @@
mhmh - kludge for selectors with argument
"
(menuSelection isMemberOf:Array) ifTrue:[
- actionArg1 := menuSelection at:2.
- actionSelector := menuSelection at:1.
+ actionArg1 := menuSelection at:2.
+ actionSelector := menuSelection at:1.
].
menuPerformer := self menuPerformer.
@@ -5834,26 +5834,26 @@
Simulate this behavior, by looking what the model responds to.
"
actionSelector isSymbol ifTrue:[
- (menuPerformer respondsTo:actionSelector) ifFalse:[
- ((app := self application) respondsTo:actionSelector) ifTrue:[
- menuPerformer := app.
- actionArg1 := self model.
- actionArg2 := self controller.
- ] ifFalse:[
- (self respondsTo:actionSelector) ifTrue:[
- menuPerformer := self
- ]
- ]
- ].
- actionSelector numArgs ~~ 0 ifTrue:[
- actionSelector numArgs ~~ 1 ifTrue:[
- menuPerformer perform:actionSelector with:actionArg1 with:actionArg2
- ] ifFalse:[
- menuPerformer perform:actionSelector with:actionArg1
- ]
- ] ifFalse:[
- menuPerformer perform:actionSelector
- ]
+ (menuPerformer respondsTo:actionSelector) ifFalse:[
+ ((app := self application) respondsTo:actionSelector) ifTrue:[
+ menuPerformer := app.
+ actionArg1 := self model.
+ actionArg2 := self controller.
+ ] ifFalse:[
+ (self respondsTo:actionSelector) ifTrue:[
+ menuPerformer := self
+ ]
+ ]
+ ].
+ actionSelector numArgs ~~ 0 ifTrue:[
+ actionSelector numArgs ~~ 1 ifTrue:[
+ menuPerformer perform:actionSelector with:actionArg1 with:actionArg2
+ ] ifFalse:[
+ menuPerformer perform:actionSelector with:actionArg1
+ ]
+ ] ifFalse:[
+ menuPerformer perform:actionSelector
+ ]
].
"Created: / 20.6.1997 / 11:47:42 / cg"
@@ -5864,16 +5864,16 @@
componentsContainingX:x y:y do:aBlock
components notNil ifTrue:[
- components do:[:aComponent |
- |thisFrame|
-
- thisFrame := aComponent bounds.
- (thisFrame containsPointX:x y:y) ifTrue:[
- aBlock value:aComponent
- value:x - thisFrame left
- value:y - thisFrame top.
- ]
- ]
+ components do:[:aComponent |
+ |thisFrame|
+
+ thisFrame := aComponent bounds.
+ (thisFrame containsPointX:x y:y) ifTrue:[
+ aBlock value:aComponent
+ value:x - thisFrame left
+ value:y - thisFrame top.
+ ]
+ ]
].
"Created: 8.5.1996 / 23:40:59 / cg"
@@ -5885,24 +5885,24 @@
|m2 nX nY nW nH|
(margin ~~ 0) ifTrue:[
- m2 := margin + margin.
- nX := nY := margin.
- nW := width - m2.
- nH := height - m2.
+ m2 := margin + margin.
+ nX := nY := margin.
+ nW := width - m2.
+ nH := height - m2.
"/ transformation notNil ifTrue:[
"/ nX := transformation applyInverseToX:nX.
"/ nY := transformation applyInverseToY:nY.
"/ nW := transformation applyInverseScaleX:nW.
"/ nH := transformation applyInverseScaleY:nH.
"/ ].
- innerClipRect := Rectangle
- left:nX
- top:nY
- width:nW
- height:nH
+ innerClipRect := Rectangle
+ left:nX
+ top:nY
+ width:nW
+ height:nH
] ifFalse:[
- "no clipping"
- innerClipRect := nil
+ "no clipping"
+ innerClipRect := nil
]
"Modified: / 22.5.1999 / 16:50:58 / cg"
@@ -5923,10 +5923,10 @@
bw := borderWidth ? 0.
insets isNil ifTrue:[
- bw == 0 ifTrue:[
- ^ p
- ].
- ^ (p x - bw) @ (p y - bw)
+ bw == 0 ifTrue:[
+ ^ p
+ ].
+ ^ (p x - bw) @ (p y - bw)
].
r := (insets at:3) + bw.
b := (insets at:4) + bw.
@@ -5939,7 +5939,7 @@
"/ b := bottomInset + bw
"/ ].
((r ~~ 0) or:[b ~~ 0]) ifTrue:[
- ^ (p x - r) @ (p y - b)
+ ^ (p x - r) @ (p y - b)
].
^ p
@@ -5958,50 +5958,50 @@
|rel newX newY inRect bw2 i|
superView isNil ifTrue:[
- inRect := 0@0 extent:device extent
+ inRect := 0@0 extent:device extent
] ifFalse:[
- inRect := superView viewRectangle.
+ inRect := superView viewRectangle.
].
bw2 := borderWidth * 2.
rel := aPoint x.
rel isInteger ifFalse:[
- newX := (rel * (inRect width + bw2)) asInteger + inRect left.
- (borderWidth ~~ 0) ifTrue:[
- newX := newX - borderWidth
- ].
+ newX := (rel * (inRect width + bw2)) asInteger + inRect left.
+ (borderWidth ~~ 0) ifTrue:[
+ newX := newX - borderWidth
+ ].
] ifTrue:[
- newX := rel
+ newX := rel
].
rel := aPoint y.
rel isInteger ifFalse:[
- newY := (rel * (inRect height + bw2)) asInteger + inRect top.
- (borderWidth ~~ 0) ifTrue:[
- newY := newY - borderWidth
- ].
+ newY := (rel * (inRect height + bw2)) asInteger + inRect top.
+ (borderWidth ~~ 0) ifTrue:[
+ newY := newY - borderWidth
+ ].
] ifTrue:[
- newY := rel
+ newY := rel
].
insets notNil ifTrue:[
- i := insets at:1. "top"
- (i ~~ 0) ifTrue:[
- newX := newX - i
- ].
- i := insets at:3. "left"
- (i ~~ 0) ifTrue:[
- newX := newX - i
- ].
- i := insets at:2. "right"
- (i ~~ 0) ifTrue:[
- newY := newY - i
- ].
- i := insets at:4. "bottom"
- (i ~~ 0) ifTrue:[
- newY := newY - i
- ].
+ i := insets at:1. "top"
+ (i ~~ 0) ifTrue:[
+ newX := newX - i
+ ].
+ i := insets at:3. "left"
+ (i ~~ 0) ifTrue:[
+ newX := newX - i
+ ].
+ i := insets at:2. "right"
+ (i ~~ 0) ifTrue:[
+ newY := newY - i
+ ].
+ i := insets at:4. "bottom"
+ (i ~~ 0) ifTrue:[
+ newY := newY - i
+ ].
].
^ newX @ newY
!
@@ -6020,7 +6020,7 @@
p := self pointFromRelative:aPoint.
insets isNil ifTrue:[
- ^ p
+ ^ p
].
l := insets at:1.
t := insets at:2.
@@ -6033,7 +6033,7 @@
"/ t := topInset
"/ ].
((l ~~ 0) or:[t ~~ 0]) ifTrue:[
- ^ (p x + l) @ (p y + t)
+ ^ (p x + l) @ (p y + t)
].
^ p
!
@@ -6072,25 +6072,25 @@
newLeft := origin x.
newTop := origin y.
((newTop ~~ top) or:[newLeft ~~ left]) ifTrue:[
- top := newTop.
- left := newLeft.
-
- "
- if the receiver is visible, or is a topView, perform the
- operation right away - otherwise, simply remember that the
- origin has changed - will tell the display once we get realized
- "
+ top := newTop.
+ left := newLeft.
+
+ "
+ if the receiver is visible, or is a topView, perform the
+ operation right away - otherwise, simply remember that the
+ origin has changed - will tell the display once we get realized
+ "
"/ (shown
"/ or:[superView isNil and:[drawableId notNil]]) ifTrue:[
- "/ no, have to do it if drawableId is there
- "/ (otherwise, we could not move unmapped views around ...
- "/
- drawableId notNil ifTrue:[
- device moveWindow:drawableId x:left y:top
- ] ifFalse:[
- originChanged := true
- ]
+ "/ no, have to do it if drawableId is there
+ "/ (otherwise, we could not move unmapped views around ...
+ "/
+ drawableId notNil ifTrue:[
+ device moveWindow:drawableId x:left y:top
+ ] ifFalse:[
+ originChanged := true
+ ]
]
!
@@ -6125,137 +6125,137 @@
a dimension <= 0 ... (although I think that 0 maks sense ...)
"
newWidth < 1 ifTrue:[
- newWidth := 1.
+ newWidth := 1.
].
newHeight < 1 ifTrue:[
- newHeight := 1
+ newHeight := 1
].
((newWidth == width) and:[newHeight == height]) ifTrue:[
- sameOrigin ifTrue:[^ self].
- ^ self pixelOrigin:origin
+ sameOrigin ifTrue:[^ self].
+ ^ self pixelOrigin:origin
].
top := newTop.
left := newLeft.
"/ shown ifTrue:[ "4-nov-94 actually correct,"
drawableId notNil ifTrue:[ "but theres a bug in menus when resized while hidden"
- mustRedrawBottomEdge := (level ~~ 0) and:[newHeight < height].
- mustRedrawRightEdge := (level ~~ 0) and:[newWidth < width].
-
- ((newHeight <= height) and:[newWidth <= width]) ifTrue:[
- how := #smaller
- ] ifFalse:[
- ((newHeight >= height) and:[newWidth >= width]) ifTrue:[
- how := #larger
- ]
- ].
-
- mustRepaintRight := false.
- mustRepaintBottom := false.
-
- oldWidth := width.
- oldHeight := height.
-
- shown ifTrue:[
- (level ~~ 0) ifTrue:[
- "clear the old edges"
-
- newWidth > width ifTrue:[
- self clippingRectangle:nil.
- self paint:viewBackground.
- self fillDeviceRectangleX:(width - margin)
- y:0
- width:margin
- height:height.
- mustRepaintRight := true.
- ].
- newHeight > height ifTrue:[
- self clippingRectangle:nil.
- self paint:viewBackground.
- self fillDeviceRectangleX:0
- y:(height - margin)
- width:width
- height:margin.
- mustRepaintBottom := true.
- ]
- ]
- ].
-
- width := newWidth.
- height := newHeight.
-
- self setInnerClip.
-
- "if view becomes smaller, send sizeChanged first"
- (how == #smaller) ifTrue:[
- self sizeChanged:how
- ].
-
- "have to tell X, when extent of view is changed"
- sameOrigin ifTrue:[
- device resizeWindow:drawableId width:width height:height.
-
- ] ifFalse:[
- "claus: some xservers seem to do better when resizing
- first ...."
+ mustRedrawBottomEdge := (level ~~ 0) and:[newHeight < height].
+ mustRedrawRightEdge := (level ~~ 0) and:[newWidth < width].
+
+ ((newHeight <= height) and:[newWidth <= width]) ifTrue:[
+ how := #smaller
+ ] ifFalse:[
+ ((newHeight >= height) and:[newWidth >= width]) ifTrue:[
+ how := #larger
+ ]
+ ].
+
+ mustRepaintRight := false.
+ mustRepaintBottom := false.
+
+ oldWidth := width.
+ oldHeight := height.
+
+ shown ifTrue:[
+ (level ~~ 0) ifTrue:[
+ "clear the old edges"
+
+ newWidth > width ifTrue:[
+ self clippingRectangle:nil.
+ self paint:viewBackground.
+ self fillDeviceRectangleX:(width - margin)
+ y:0
+ width:margin
+ height:height.
+ mustRepaintRight := true.
+ ].
+ newHeight > height ifTrue:[
+ self clippingRectangle:nil.
+ self paint:viewBackground.
+ self fillDeviceRectangleX:0
+ y:(height - margin)
+ width:width
+ height:margin.
+ mustRepaintBottom := true.
+ ]
+ ]
+ ].
+
+ width := newWidth.
+ height := newHeight.
+
+ self setInnerClip.
+
+ "if view becomes smaller, send sizeChanged first"
+ (how == #smaller) ifTrue:[
+ self sizeChanged:how
+ ].
+
+ "have to tell X, when extent of view is changed"
+ sameOrigin ifTrue:[
+ device resizeWindow:drawableId width:width height:height.
+
+ ] ifFalse:[
+ "claus: some xservers seem to do better when resizing
+ first ...."
"
- (how == #smaller) ifTrue:[
- device resizeWindow:drawableId width:width height:height.
- device moveWindow:drawableId x:left y:top
- ] ifFalse:[
- device moveResizeWindow:drawableId x:left y:top width:width height:height
- ].
+ (how == #smaller) ifTrue:[
+ device resizeWindow:drawableId width:width height:height.
+ device moveWindow:drawableId x:left y:top
+ ] ifFalse:[
+ device moveResizeWindow:drawableId x:left y:top width:width height:height
+ ].
"
- device moveResizeWindow:drawableId x:left y:top
- width:width height:height.
- ].
-
- "if view becomes bigger, send sizeChanged after"
- (how ~~ #smaller) ifTrue:[
- self sizeChanged:how
- ].
-
- shown ifTrue:[
- (mustRedrawBottomEdge or:[mustRedrawRightEdge]) ifTrue:[
- self deviceClippingRectangle:nil.
- mustRedrawBottomEdge ifTrue:[
- self drawBottomEdge
- ].
- mustRedrawRightEdge ifTrue:[
- self drawRightEdge
- ].
- self deviceClippingRectangle:innerClipRect
- ].
- ].
-
- mustRepaintRight ifTrue:[
- self invalidateDeviceRectangle:(((oldWidth - margin) @ 0)
- extent:margin@height)
- repairNow:false.
+ device moveResizeWindow:drawableId x:left y:top
+ width:width height:height.
+ ].
+
+ "if view becomes bigger, send sizeChanged after"
+ (how ~~ #smaller) ifTrue:[
+ self sizeChanged:how
+ ].
+
+ shown ifTrue:[
+ (mustRedrawBottomEdge or:[mustRedrawRightEdge]) ifTrue:[
+ self deviceClippingRectangle:nil.
+ mustRedrawBottomEdge ifTrue:[
+ self drawBottomEdge
+ ].
+ mustRedrawRightEdge ifTrue:[
+ self drawRightEdge
+ ].
+ self deviceClippingRectangle:innerClipRect
+ ].
+ ].
+
+ mustRepaintRight ifTrue:[
+ self invalidateDeviceRectangle:(((oldWidth - margin) @ 0)
+ extent:margin@height)
+ repairNow:false.
"/ self redrawDeviceX:(oldWidth - margin)
"/ y:0
"/ width:margin
"/ height:height.
- ].
- mustRepaintBottom ifTrue:[
- self invalidateDeviceRectangle:((0 @ (oldHeight - margin))
- extent:width@margin)
- repairNow:false.
+ ].
+ mustRepaintBottom ifTrue:[
+ self invalidateDeviceRectangle:((0 @ (oldHeight - margin))
+ extent:width@margin)
+ repairNow:false.
"/ self redrawDeviceX:0
"/ y:(oldHeight - margin)
"/ width:width
"/ height:margin.
- ].
+ ].
] ifFalse:[
- "otherwise memorize the need for a sizeChanged message"
-
- width := newWidth.
- height := newHeight.
- sameOrigin ifFalse:[
- originChanged := true.
- ].
- extentChanged := true
+ "otherwise memorize the need for a sizeChanged message"
+
+ width := newWidth.
+ height := newHeight.
+ sameOrigin ifFalse:[
+ originChanged := true.
+ ].
+ extentChanged := true
]
"Modified: / 25.5.1999 / 14:49:56 / cg"
@@ -6269,39 +6269,39 @@
bw := borderWidth ? 0.
superView isNil ifTrue:[
- superWidth := device width + bw.
- superHeight := device height + bw.
- superLeft := superTop := 0.
+ superWidth := device width + bw.
+ superHeight := device height + bw.
+ superLeft := superTop := 0.
] ifFalse:[
- inRect := superView viewRectangle.
- superWidth := inRect width.
- superHeight := inRect height.
- superLeft := inRect left.
- superTop := inRect top.
+ inRect := superView viewRectangle.
+ superWidth := inRect width.
+ superHeight := inRect height.
+ superLeft := inRect left.
+ superTop := inRect top.
].
rel := p x.
rel isInteger ifTrue:[
- newX := rel
+ newX := rel
] ifFalse:[
- newX := (rel * superWidth) asInteger + superLeft.
- (bw ~~ 0) ifTrue:[
- rel ~= 1.0 ifTrue:[
- newX := newX - bw
- ]
- ]
+ newX := (rel * superWidth) asInteger + superLeft.
+ (bw ~~ 0) ifTrue:[
+ rel ~= 1.0 ifTrue:[
+ newX := newX - bw
+ ]
+ ]
].
rel := p y.
rel isInteger ifTrue:[
- newY := rel
+ newY := rel
] ifFalse:[
- newY := (rel * superHeight) asInteger + superTop.
- (bw ~~ 0) ifTrue:[
- rel ~= 1.0 ifTrue:[
- newY := newY - bw
- ]
- ]
+ newY := (rel * superHeight) asInteger + superTop.
+ (bw ~~ 0) ifTrue:[
+ rel ~= 1.0 ifTrue:[
+ newY := newY - bw
+ ]
+ ]
].
^ newX @ newY
@@ -6314,18 +6314,18 @@
|id dither|
drawableId notNil ifTrue:[
- borderColor := borderColor onDevice:device.
- id := borderColor colorId.
- id notNil ifTrue:[
- device setWindowBorderColor:id in:drawableId
- ] ifFalse:[
- dither := borderColor ditherForm.
- dither notNil ifTrue:[
- device setWindowBorderPixmap:(dither id) in:drawableId
- ] ifFalse:[
- 'SimpleView [warning]: bad borderColor' errorPrintCR
- ]
- ]
+ borderColor := borderColor onDevice:device.
+ id := borderColor colorId.
+ id notNil ifTrue:[
+ device setWindowBorderColor:id in:drawableId
+ ] ifFalse:[
+ dither := borderColor ditherForm.
+ dither notNil ifTrue:[
+ device setWindowBorderPixmap:(dither id) in:drawableId
+ ] ifFalse:[
+ 'SimpleView [warning]: bad borderColor' errorPrintCR
+ ]
+ ]
]
"Modified: 10.1.1997 / 18:06:34 / cg"
@@ -6344,10 +6344,10 @@
|form|
(form := viewShape borderShapeForm) notNil ifTrue:[
- device setWindowBorderShape:(form id) in:drawableId
+ device setWindowBorderShape:(form id) in:drawableId
].
(form := viewShape viewShapeForm) notNil ifTrue:[
- device setWindowShape:(form id) in:drawableId
+ device setWindowShape:(form id) in:drawableId
].
"Created: 18.9.1997 / 11:09:00 / cg"
@@ -6399,11 +6399,11 @@
(focusView := windowGroup focusView) == self ifTrue:[^ true].
focusView notNil ifTrue:[
- "mhmh - is there a delegation to me ?"
- (delegate := focusView delegate) notNil ifTrue:[
- delegate == self ifTrue:[^ true].
- ^ delegate delegatesTo:self
- ]
+ "mhmh - is there a delegation to me ?"
+ (delegate := focusView delegate) notNil ifTrue:[
+ delegate == self ifTrue:[^ true].
+ ^ delegate delegatesTo:self
+ ]
].
^ false
!
@@ -6525,45 +6525,45 @@
"/ If I have an explicit preferredExtent ..
preferredExtent notNil ifTrue:[
- ^ preferredExtent
+ ^ preferredExtent
].
"/ mhmh - if I have subViews, collect their
"/ preferred bounds ...
subViews notNil ifTrue:[
- maxX := maxY := 0.
- subViews do:[:aSubView |
- |org corn|
-
- org := aSubView computeOrigin.
- corn := org + aSubView preferredExtent.
- maxX := maxX max:corn x.
- maxY := maxY max:corn y.
- ]
+ maxX := maxY := 0.
+ subViews do:[:aSubView |
+ |org corn|
+
+ org := aSubView computeOrigin.
+ corn := org + aSubView preferredExtent.
+ maxX := maxX max:corn x.
+ maxY := maxY max:corn y.
+ ]
].
"/ mhmh - if I have components, collect their
"/ preferred bounds ...
components notNil ifTrue:[
- maxX isNil ifTrue:[
- maxX := maxY := 0.
- ].
- components do:[:aComponent |
- |bounds org corn|
-
- bounds := aComponent preferredBounds.
- corn := bounds corner.
- maxX := maxX max:corn x.
- maxY := maxY max:corn y.
- ]
+ maxX isNil ifTrue:[
+ maxX := maxY := 0.
+ ].
+ components do:[:aComponent |
+ |bounds org corn|
+
+ bounds := aComponent preferredBounds.
+ corn := bounds corner.
+ maxX := maxX max:corn x.
+ maxY := maxY max:corn y.
+ ]
].
"/ nothing found - return the actual size
maxX isNil ifTrue:[
- ^ self extent.
+ ^ self extent.
].
^ maxX @ maxY.
@@ -6606,7 +6606,7 @@
Actually, its a historical leftover"
windowGroup notNil ifTrue:[
- ^ windowGroup sensor hasButtonMotionEventFor:self
+ ^ windowGroup sensor hasButtonMotionEventFor:self
].
^ super buttonMotionEventPending
@@ -6631,7 +6631,7 @@
((myClass := self class) == View
or:[myClass == SimpleView]) ifTrue:[
- ^ ViewSpec "/ CompositeSpecCollection
+ ^ ViewSpec "/ CompositeSpecCollection
].
"/ try: appending 'Spec' to my classes name
@@ -6639,10 +6639,10 @@
myName := self class name.
cls := Smalltalk classNamed:(myName , 'Spec').
cls notNil ifTrue:[
- cls isLoaded ifFalse:[
- cls autoload
- ].
- (cls notNil and:[cls isSubclassOf:UISpecification]) ifTrue:[^ cls].
+ cls isLoaded ifFalse:[
+ cls autoload
+ ].
+ (cls notNil and:[cls isSubclassOf:UISpecification]) ifTrue:[^ cls].
].
(myName endsWith:'View') ifTrue:[
@@ -6653,14 +6653,14 @@
"/ ].
"/ (cls notNil and:[cls isSubclassOf:UISpecification]) ifTrue:[^ cls].
- "/ try with 'View' replaced by 'Spec'
- cls := Smalltalk classNamed:((myName copyWithoutLast:4) , 'View').
- cls notNil ifTrue:[
- cls isLoaded ifFalse:[
- cls autoload
- ].
- (cls notNil and:[cls isSubclassOf:UISpecification]) ifTrue:[^ cls].
- ]
+ "/ try with 'View' replaced by 'Spec'
+ cls := Smalltalk classNamed:((myName copyWithoutLast:4) , 'View').
+ cls notNil ifTrue:[
+ cls isLoaded ifFalse:[
+ cls autoload
+ ].
+ (cls notNil and:[cls isSubclassOf:UISpecification]) ifTrue:[^ cls].
+ ]
].
"/ fallBack for all others
@@ -6679,7 +6679,7 @@
"return a symbol describing my style"
self isPopUpView ifTrue:[
- ^ #popUp
+ ^ #popUp
].
^ #normal
@@ -6695,11 +6695,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 view 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:[
@@ -6707,37 +6707,37 @@
"/ 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 onDevice:device.
- ].
-
- explicitExtent ~~ true ifTrue:[
- self resize
- ].
-
- 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 onDevice:device.
+ ].
+
+ explicitExtent ~~ true ifTrue:[
+ self resize
+ ].
+
+ 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: 28.3.1997 / 13:50:17 / cg"
@@ -6748,7 +6748,7 @@
drawableId isNil ifTrue:[self create].
subViews notNil ifTrue:[
- subViews do:[:subView | subView createWithAllSubViews]
+ subViews do:[:subView | subView createWithAllSubViews]
]
!
@@ -6782,14 +6782,14 @@
slowly migrating to use layoutObjects ...
"
layout notNil ifTrue:[
- (originChanged or:[extentChanged or:[cornerChanged]]) ifTrue:[
- r := (layout rectangleRelativeTo:(superView viewRectangle)
- preferred:[self preferredBounds]).
- org := r origin rounded.
- ext := r extent rounded.
- self pixelOrigin:org extent:ext.
- ].
- ^ self.
+ (originChanged or:[extentChanged or:[cornerChanged]]) ifTrue:[
+ r := (layout rectangleRelativeTo:(superView viewRectangle)
+ preferred:[self preferredBounds]).
+ org := r origin rounded.
+ ext := r extent rounded.
+ self pixelOrigin:org extent:ext.
+ ].
+ ^ self.
].
"if the extent is not the one we created the window with ..."
@@ -6801,20 +6801,20 @@
originChanged ifTrue:[
"/ org := self computeOrigin.
"/ self pixelOrigin:org.
- originRule notNil ifTrue:[
- self pixelOrigin:self computeOrigin
- ] ifFalse:[
- relativeOrigin notNil ifTrue:[
- self originFromRelativeOrigin:relativeOrigin
- ] ifFalse:[
- shown ifTrue:[
- device moveWindow:drawableId x:left y:top.
- ] ifFalse:[
- self pixelOrigin:left@top
- ].
- ].
- ].
- originChanged := false
+ originRule notNil ifTrue:[
+ self pixelOrigin:self computeOrigin
+ ] ifFalse:[
+ relativeOrigin notNil ifTrue:[
+ self originFromRelativeOrigin:relativeOrigin
+ ] ifFalse:[
+ shown ifTrue:[
+ device moveWindow:drawableId x:left y:top.
+ ] ifFalse:[
+ self pixelOrigin:left@top
+ ].
+ ].
+ ].
+ originChanged := false
]
"Modified: 18.6.1996 / 21:44:03 / cg"
@@ -6837,16 +6837,16 @@
device flush.
masterGroup notNil ifTrue:[
- "
- this is a kludge for IRIS and others which do not provide backingstore:
- when we hide a modalbox (such as a searchbox) which covered
- a scrollbar, the scrollbars bitblt-method will copy from the
- not-yet redrawn area - effectively clearing the scroller.
- We need a short delay here, since at this time, the expose event has
- not yet arrived.
- "
- Delay waitForSeconds:0.05.
- masterGroup processExposeEvents
+ "
+ this is a kludge for IRIS and others which do not provide backingstore:
+ when we hide a modalbox (such as a searchbox) which covered
+ a scrollbar, the scrollbars bitblt-method will copy from the
+ not-yet redrawn area - effectively clearing the scroller.
+ We need a short delay here, since at this time, the expose event has
+ not yet arrived.
+ "
+ Delay waitForSeconds:0.05.
+ masterGroup processExposeEvents
].
"/ WindowGroup leaveSignal raise.
@@ -6874,8 +6874,8 @@
For topViews, the windowManager will choose (or ask for) the
views position on the screen.
Notice:
- Actually, this method is only valid for topViews;
- however, it is defined here to allow things like 'Button new realize'"
+ Actually, this method is only valid for topViews;
+ however, it is defined here to allow things like 'Button new realize'"
self mapAt:nil iconified:false
@@ -6887,8 +6887,8 @@
For topViews, if aPoint is nonNil, the views origin is located there
(unless you have a dictator as windowManager ;-)
Notice:
- Actually, this method is only valid for topViews;
- however, it is defined here to allow things like 'Button new realize'"
+ Actually, this method is only valid for topViews;
+ however, it is defined here to allow things like 'Button new realize'"
self mapAt:aPoint iconified:false
@@ -6901,61 +6901,61 @@
(unless you have a dictator as windowManager ;-).
If the iconified argument is true, the window is created as icon initially.
Notice:
- Actually, this method is only valid for topViews;
- however, it is defined here to allow things like 'Button new realize'"
+ Actually, this method is only valid for topViews;
+ however, it is defined here to allow things like 'Button new realize'"
|subs|
realized ifFalse:[
- drawableId isNil ifTrue:[
- "
- first time ?
- yes, realize (implies a map)
- "
- self realizeKeepingGroup:false at:aPoint iconified:iconified
- ] ifFalse:[
- "
- no, map only
- "
- realized := true.
- aPoint isNil ifTrue:[
- iconified ifTrue:[
- device
- mapView:self id:drawableId iconified:iconified
- atX:0 y:0
- width:width height:height
- minExtent:(self minExtent) maxExtent:(self maxExtent).
- ] ifFalse:[
- device mapWindow:drawableId.
- ]
- ] ifFalse:[
- left := aPoint x.
- top := aPoint y.
- device
- mapView:self id:drawableId iconified:iconified
- atX:left y:top
- width:width height:height
- minExtent:(self minExtent) maxExtent:(self maxExtent).
- ].
-
- "/
- "/ implies that all realized subviews
- "/ are now also mapped
- "/
- "/ not needed for topViews - the mapped event does exactly the same
- "/ however, X does not generate mapped events for non-topViews
- "/ when a view gets deiconified.
-
- superView notNil ifTrue:[
- (subs := self subViews) notNil ifTrue:[
- subs do:[:v |
- v shown ifFalse:[
- v mapped
- ]
- ]
- ]
- ]
- ].
+ drawableId isNil ifTrue:[
+ "
+ first time ?
+ yes, realize (implies a map)
+ "
+ self realizeKeepingGroup:false at:aPoint iconified:iconified
+ ] ifFalse:[
+ "
+ no, map only
+ "
+ realized := true.
+ aPoint isNil ifTrue:[
+ iconified ifTrue:[
+ device
+ mapView:self id:drawableId iconified:iconified
+ atX:0 y:0
+ width:width height:height
+ minExtent:(self minExtent) maxExtent:(self maxExtent).
+ ] ifFalse:[
+ device mapWindow:drawableId.
+ ]
+ ] ifFalse:[
+ left := aPoint x.
+ top := aPoint y.
+ device
+ mapView:self id:drawableId iconified:iconified
+ atX:left y:top
+ width:width height:height
+ minExtent:(self minExtent) maxExtent:(self maxExtent).
+ ].
+
+ "/
+ "/ implies that all realized subviews
+ "/ are now also mapped
+ "/
+ "/ not needed for topViews - the mapped event does exactly the same
+ "/ however, X does not generate mapped events for non-topViews
+ "/ when a view gets deiconified.
+
+ superView notNil ifTrue:[
+ (subs := self subViews) notNil ifTrue:[
+ subs do:[:v |
+ v shown ifFalse:[
+ v mapped
+ ]
+ ]
+ ]
+ ]
+ ].
]
"Modified: 23.8.1996 / 14:53:55 / stefan"
@@ -6990,20 +6990,20 @@
isInputOnly := self isInputOnly.
drawableId := device
- createWindowFor:self
- type:nil
- origin:org
- extent:(width @ height)
- minExtent:nil
- maxExtent:nil
- borderWidth:borderWidth
- subViewOf:sv
- style:(self windowStyle)
- inputOnly:isInputOnly
- label:nil
- owner:nil
- icon:nil iconMask:nil
- iconView:nil.
+ createWindowFor:self
+ type:nil
+ origin:org
+ extent:(width @ height)
+ minExtent:nil
+ maxExtent:nil
+ borderWidth:borderWidth
+ subViewOf:sv
+ style:(self windowStyle)
+ inputOnly:isInputOnly
+ label:nil
+ owner:nil
+ icon:nil iconMask:nil
+ iconView:nil.
Lobby registerChange:self.
@@ -7017,30 +7017,30 @@
originChanged := false.
(borderColor notNil and:[borderColor ~= Black]) ifTrue:[
- isInputOnly ifFalse:[
+ isInputOnly ifFalse:[
"/ borderColor := borderColor on:device.
- self setBorderColor
- ]
+ self setBorderColor
+ ]
].
(viewGravity notNil "and:[viewGravity ~~ #NorthWest]") ifTrue:[
- device setWindowGravity:viewGravity in:drawableId
+ device setWindowGravity:viewGravity in:drawableId
].
(bitGravity notNil "and:[bitGravity ~~ #NorthWest]") ifTrue:[
- isInputOnly ifFalse:[
- device setBitGravity:bitGravity in:drawableId
- ]
+ isInputOnly ifFalse:[
+ device setBitGravity:bitGravity in:drawableId
+ ]
].
viewShape notNil ifTrue:[
- self setViewShape
+ self setViewShape
].
(backed notNil and:[backed ~~ false]) ifTrue:[
- device setBackingStore:backed in:drawableId
- ].
- saveUnder ifTrue:[
- device setSaveUnder:true in:drawableId
+ device setBackingStore:backed in:drawableId
+ ].
+ self saveUnder ifTrue:[
+ device setSaveUnder:true in:drawableId
].
cursor notNil ifTrue:[
- self setCursor
+ self setCursor
].
"Modified: / 9.4.1998 / 20:18:12 / cg"
@@ -7069,14 +7069,14 @@
"realize all my subviews - but not myself."
subViews notNil ifTrue:[
- subViews do:[:subView |
- subView realize
- ]
+ subViews do:[:subView |
+ subView realize
+ ]
].
components notNil ifTrue:[
- components do:[:component |
- component realize
- ]
+ components do:[:component |
+ component realize
+ ]
].
"Modified: 5.9.1995 / 23:30:47 / claus"
@@ -7119,11 +7119,11 @@
self fetchDeviceResources.
drawableId isNil ifTrue:[
- self create.
- drawableId isNil ifTrue:[
- ('SimpleView [warning]: could not create view: ' , self class name) errorPrintCR.
- ^ self
- ]
+ self create.
+ drawableId isNil ifTrue:[
+ ('SimpleView [warning]: could not create view: ' , self class name) errorPrintCR.
+ ^ self
+ ]
].
groupChange := false.
@@ -7131,82 +7131,82 @@
(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].
+ ]
+ ].
+ ].
].
(originChanged or:[extentChanged]) ifTrue:[
- self fixSize.
- self sizeChanged:nil. "/ new 29-aug-1995
+ self fixSize.
+ self sizeChanged:nil. "/ new 29-aug-1995
].
position notNil ifTrue:[
- self origin:position.
+ self origin:position.
].
(subViews notNil or:[components notNil]) ifTrue:[
- (realized not or:[groupChange]) ifTrue:[
+ (realized not or:[groupChange]) ifTrue:[
hiddenOnRealize ifFalse:[
- self realizeAllSubViews.
+ self realizeAllSubViews.
].
- ].
+ ].
].
iconified ifTrue:[
- realized ifFalse:[
- self mapIconified
- ]
+ realized ifFalse:[
+ self mapIconified
+ ]
] ifFalse:[
- hiddenOnRealize ifFalse:[
- self setInnerClip.
-
- realized ifFalse:[
- "
- now, make the view visible
- "
- self mapAt:position
- ]
- ]
+ hiddenOnRealize ifFalse:[
+ self setInnerClip.
+
+ realized ifFalse:[
+ "
+ now, make the view visible
+ "
+ self mapAt:position
+ ]
+ ]
].
controller notNil ifTrue:[
- controller startUp
+ controller startUp
].
self postRealize
@@ -7220,19 +7220,19 @@
"recreate (i.e. tell X about me) after a snapin"
drawableId isNil ifTrue:[
- super recreate.
- self physicalCreate.
-
- viewBackground notNil ifTrue:[
- self setViewBackground
- ].
-
- "
- XXX has to be changed: eventmasks are device specific -
- XXX will not allow restart on another Workstation-type.
- XXX event masks must become symbolic
- "
- device setEventMask:eventMask in:drawableId
+ super recreate.
+ self physicalCreate.
+
+ viewBackground notNil ifTrue:[
+ self setViewBackground
+ ].
+
+ "
+ XXX has to be changed: eventmasks are device specific -
+ XXX will not allow restart on another Workstation-type.
+ XXX event masks must become symbolic
+ "
+ device setEventMask:eventMask in:drawableId
]
!
@@ -7243,14 +7243,14 @@
are known to ignore this ..."
realized ifFalse:[
- "
- now, make the view visible
- "
- realized := true.
- device
- mapView:self id:drawableId iconified:false
- atX:left y:top width:width height:height
- minExtent:(self minExtent) maxExtent:(self maxExtent)
+ "
+ now, make the view visible
+ "
+ realized := true.
+ device
+ mapView:self id:drawableId iconified:false
+ atX:left y:top width:width height:height
+ minExtent:(self minExtent) maxExtent:(self maxExtent)
]
"Created: 8.5.1996 / 09:33:06 / cg"
@@ -7273,14 +7273,14 @@
drawableId isNil ifTrue:[self create].
drawableId notNil ifTrue:[
- aWindowGroup ~~ windowGroup ifTrue:[
- windowGroup notNil ifTrue:[
- windowGroup removeView:self
- ].
- windowGroup := aWindowGroup.
- aWindowGroup addTopView:self.
- ].
- self remap.
+ aWindowGroup ~~ windowGroup ifTrue:[
+ windowGroup notNil ifTrue:[
+ windowGroup removeView:self
+ ].
+ windowGroup := aWindowGroup.
+ aWindowGroup addTopView:self.
+ ].
+ self remap.
]
"Modified: 3.5.1996 / 23:59:30 / stefan"
@@ -7291,12 +7291,12 @@
"rerealize myself with all subviews"
drawableId notNil ifTrue:[
- realized := true.
- self realizeAllSubViews.
- device
- mapView:self id:drawableId iconified:false
- atX:left y:top width:width height:height
- minExtent:(self minExtent) maxExtent:(self maxExtent)
+ realized := true.
+ self realizeAllSubViews.
+ device
+ mapView:self id:drawableId iconified:false
+ atX:left y:top width:width height:height
+ minExtent:(self minExtent) maxExtent:(self maxExtent)
]
"Modified: 28.1.1997 / 17:59:28 / cg"
@@ -7308,10 +7308,10 @@
preferredExtent), but may be redefined in some subclasses."
explicitExtent ~~ true ifTrue:[
- layout isNil ifTrue:[
- self extent:(self preferredExtent).
- explicitExtent := false.
- ].
+ layout isNil ifTrue:[
+ self extent:(self preferredExtent).
+ explicitExtent := false.
+ ].
]
"Modified: 15.7.1996 / 11:20:27 / cg"
@@ -7321,17 +7321,17 @@
"unmap the view - the view stays created (but invisible), and can be remapped again later."
realized ifTrue:[
- realized := false.
- drawableId notNil ifTrue:[
- device unmapWindow:drawableId
- ].
-
- "/ cg: used to clear shown here,
- "/ but this is not correct with X, where the
- "/ unmap is an asyncronous operation.
- "/ (must wait for unmapped event to clear shown)
-
- shown := false.
+ realized := false.
+ drawableId notNil ifTrue:[
+ device unmapWindow:drawableId
+ ].
+
+ "/ cg: used to clear shown here,
+ "/ but this is not correct with X, where the
+ "/ unmap is an asyncronous operation.
+ "/ (must wait for unmapped event to clear shown)
+
+ shown := false.
].
"
@@ -7341,9 +7341,9 @@
top extent:200@200.
sub := View
- origin:0.2@0.2
- corner:0.8@0.8
- in:top.
+ origin:0.2@0.2
+ corner:0.8@0.8
+ in:top.
sub viewBackground:Color red.
sub hiddenOnRealize:true.
@@ -7415,12 +7415,12 @@
"/ sensor flushExposeEventsFor:self.
"/ ].
self
- invalidateDeviceRectangle:(Rectangle
- left:0
- top:0
- width:width
- height:height)
- repairNow:false
+ invalidateDeviceRectangle:(Rectangle
+ left:0
+ top:0
+ width:width
+ height:height)
+ repairNow:false
"Modified: / 9.11.1998 / 21:04:16 / cg"
!
@@ -7448,19 +7448,19 @@
|sensor r|
(sensor := self sensor) notNil ifTrue:[
- r := aRectangle.
- transformation notNil ifTrue:[
- r := transformation applyTo:r.
- ].
- sensor addDamage:r view:self.
- (shown and:[doRepair]) ifTrue:[
- self repairDamage
- ]
+ r := aRectangle.
+ transformation notNil ifTrue:[
+ r := transformation applyTo:r.
+ ].
+ sensor addDamage:r view:self.
+ (shown and:[doRepair]) ifTrue:[
+ self repairDamage
+ ]
] ifFalse:[
- shown ifTrue:[
- self redrawX:aRectangle left y:aRectangle top
- width:aRectangle width height:aRectangle height
- ].
+ shown ifTrue:[
+ self redrawX:aRectangle left y:aRectangle top
+ width:aRectangle width height:aRectangle height
+ ].
]
"Modified: / 10.11.1998 / 01:55:03 / cg"
@@ -7475,15 +7475,15 @@
|sensor|
(sensor := self sensor) notNil ifTrue:[
- sensor addDamage:aRectangle view:self.
- (shown and:[doRepair]) ifTrue:[
- self repairDamage
- ]
+ sensor addDamage:aRectangle view:self.
+ (shown and:[doRepair]) ifTrue:[
+ self repairDamage
+ ]
] ifFalse:[
- shown ifTrue:[
- self redrawDeviceX:aRectangle left y:aRectangle top
- width:aRectangle width height:aRectangle height
- ].
+ shown ifTrue:[
+ self redrawDeviceX:aRectangle left y:aRectangle top
+ width:aRectangle width height:aRectangle height
+ ].
]
"Modified: / 10.11.1998 / 01:55:03 / cg"
@@ -7496,8 +7496,8 @@
damaged areas right now."
self
- invalidateDeviceRectangle:(Rectangle left:0 top:0 width:width height:height)
- repairNow:doRepair
+ invalidateDeviceRectangle:(Rectangle left:0 top:0 width:width height:height)
+ repairNow:doRepair
"Created: 19.4.1997 / 11:58:04 / cg"
"Modified: 19.4.1997 / 12:00:00 / cg"
@@ -7516,10 +7516,10 @@
"redraw a part of the view immediately."
self
- redrawX:(aRectangle left)
- y:(aRectangle top)
- width:(aRectangle width)
- height:(aRectangle height)
+ redrawX:(aRectangle left)
+ y:(aRectangle top)
+ width:(aRectangle width)
+ height:(aRectangle height)
"Modified: 19.4.1997 / 11:54:23 / cg"
!
@@ -7533,15 +7533,15 @@
|lx ly lw lh|
transformation isNil ifTrue:[
- lx := x.
- ly := y.
- lw := w.
- lh := h.
+ lx := x.
+ ly := y.
+ lw := w.
+ lh := h.
] ifFalse:[
- lx := transformation applyInverseToX:x.
- ly := transformation applyInverseToY:y.
- lw := transformation applyInverseScaleX:w.
- lh := transformation applyInverseScaleY:h.
+ lx := transformation applyInverseToX:x.
+ ly := transformation applyInverseToY:y.
+ lw := transformation applyInverseScaleX:w.
+ lh := transformation applyInverseScaleY:h.
].
self redrawX:lx y:ly width:lw height:lh
!
@@ -7561,18 +7561,18 @@
self clippingRectangle:area.
components notNil ifTrue:[
- self clearRectangleX:x y:y width:w height:h.
- components do:[:aComponent |
- |thisFrame is|
-
- thisFrame := aComponent bounds.
- (thisFrame intersects:area) ifTrue:[
- aComponent displayOn:self
- ]
- ]
+ self clearRectangleX:x y:y width:w height:h.
+ components do:[:aComponent |
+ |thisFrame is|
+
+ thisFrame := aComponent bounds.
+ (thisFrame intersects:area) ifTrue:[
+ aComponent displayOn:self
+ ]
+ ]
] ifFalse:[
- "/ redraw everything - a fallBack for lazy views.
- self redraw
+ "/ redraw everything - a fallBack for lazy views.
+ self redraw
].
self clippingRectangle:oldClip.
@@ -7587,10 +7587,10 @@
|wg|
shown ifTrue:[
- (wg := self windowGroup) notNil ifTrue:[
- "/ wg processRealExposeEventsFor:self. "/ this ignores map/unmap
- wg processExposeEventsFor:self. "/ this handles map/unmap
- ]
+ (wg := self windowGroup) notNil ifTrue:[
+ "/ wg processRealExposeEventsFor:self. "/ this ignores map/unmap
+ wg processExposeEventsFor:self. "/ this handles map/unmap
+ ]
]
"Created: / 19.4.1997 / 12:01:13 / cg"
@@ -7660,8 +7660,8 @@
|viewOrigin|
nPixels ~~ 0 ifTrue:[
- viewOrigin := self viewOrigin.
- self scrollTo:(viewOrigin x @ (viewOrigin y + nPixels))
+ viewOrigin := self viewOrigin.
+ self scrollTo:(viewOrigin x @ (viewOrigin y + nPixels))
]
"Modified: / 20.8.1996 / 17:34:36 / stefan"
@@ -7686,10 +7686,10 @@
wCont := self widthOfContents.
transformation notNil ifTrue:[
- wCont := transformation applyScaleX:wCont.
+ wCont := transformation applyScaleX:wCont.
].
self scrollHorizontalTo:
- ((((wCont * percent) / 100.0) + 0.5) asInteger)
+ ((((wCont * percent) / 100.0) + 0.5) asInteger)
!
scrollLeft
@@ -7705,8 +7705,8 @@
|viewOrigin|
nPixels ~~ 0 ifTrue:[
- viewOrigin := self viewOrigin.
- self scrollTo:((viewOrigin x - nPixels) @ viewOrigin y).
+ viewOrigin := self viewOrigin.
+ self scrollTo:((viewOrigin x - nPixels) @ viewOrigin y).
]
"Modified: / 20.8.1996 / 17:35:09 / stefan"
@@ -7726,8 +7726,8 @@
|viewOrigin|
nPixels ~~ 0 ifTrue:[
- viewOrigin := self viewOrigin.
- self scrollTo:((viewOrigin x + nPixels) @ viewOrigin y)
+ viewOrigin := self viewOrigin.
+ self scrollTo:((viewOrigin x + nPixels) @ viewOrigin y)
]
"Modified: / 20.8.1996 / 17:35:37 / stefan"
@@ -7758,12 +7758,12 @@
hCont := self heightOfContents.
transformation notNil ifTrue:[
- wCont := transformation applyScaleX:wCont.
- hCont := transformation applyScaleY:hCont.
+ wCont := transformation applyScaleX:wCont.
+ hCont := transformation applyScaleY:hCont.
].
self scrollTo:
- ((((wCont * percent x) / 100.0) + 0.5) asInteger) @
- ((((hCont * percent y) / 100.0) + 0.5) asInteger)
+ ((((wCont * percent x) / 100.0) + 0.5) asInteger) @
+ ((((hCont * percent y) / 100.0) + 0.5) asInteger)
"Created: 5.8.1996 / 12:15:53 / stefan"
"Modified: 5.8.1996 / 12:42:57 / stefan"
@@ -7776,7 +7776,7 @@
wCont := self widthOfContents.
transformation notNil ifTrue:[
- wCont := transformation applyScaleX:wCont.
+ wCont := transformation applyScaleX:wCont.
].
self scrollHorizontalTo:((wCont - self innerWidth) max:0)
@@ -7807,8 +7807,8 @@
|viewOrigin|
nPixels ~~ 0 ifTrue:[
- viewOrigin := self viewOrigin.
- self scrollTo:(viewOrigin x @ (viewOrigin y - nPixels)).
+ viewOrigin := self viewOrigin.
+ self scrollTo:(viewOrigin x @ (viewOrigin y - nPixels)).
]
"Modified: / 20.8.1996 / 17:36:16 / stefan"
@@ -7833,10 +7833,10 @@
hCont := self heightOfContents.
transformation notNil ifTrue:[
- hCont := transformation applyScaleY:hCont.
+ hCont := transformation applyScaleY:hCont.
].
self scrollVerticalTo:
- ((((hCont * percent) / 100.0) + 0.5) asInteger)
+ ((((hCont * percent) / 100.0) + 0.5) asInteger)
!
verticalScrollStep
@@ -7886,12 +7886,12 @@
hCont := self heightOfContents.
wCont := self widthOfContents.
transformation isNil ifTrue:[
- orgY := orgX := 0
+ orgY := orgX := 0
] ifFalse:[
- wCont := (transformation applyScaleX:wCont) rounded.
- hCont := (transformation applyScaleY:hCont) rounded.
- orgY := transformation translation y negated.
- orgX := transformation translation x negated
+ wCont := (transformation applyScaleX:wCont) rounded.
+ hCont := (transformation applyScaleY:hCont) rounded.
+ orgY := transformation translation y negated.
+ orgX := transformation translation x negated
].
iw := self innerWidth.
@@ -7903,16 +7903,16 @@
y := newOrigin y.
x + iw > wCont ifTrue:[
- x := wCont - iw.
+ x := wCont - iw.
].
x < 0 ifTrue:[
- x := 0
+ x := 0
].
y + ih > hCont ifTrue:[
- y := hCont - ih.
+ y := hCont - ih.
].
y < 0 ifTrue:[
- y := 0.
+ y := 0.
].
dX := x - orgX.
@@ -7923,79 +7923,79 @@
].
(wg := self windowGroup) notNil ifTrue:[
- wg processRealExposeEventsFor:self.
+ wg processRealExposeEventsFor:self.
].
self originWillChange.
(shown and:[doRedraw]) ifTrue:[
- copyWidth := iw - dX abs.
- copyHeight := ih - dY abs.
- ((copyWidth > 0) and:[copyHeight > 0]) ifTrue:[
- "/ some of the currently displayed pixels
- "/ remain visible. Copy them
-
- dX < 0 ifTrue:[
- fromX := margin.
- toX := margin - dX.
- redrawX := margin
- ] ifFalse:[
- fromX := margin + dX.
- toX := margin.
- redrawX := margin + copyWidth.
- ].
- dY < 0 ifTrue:[
- fromY := margin.
- toY := margin - dY.
- redrawY := margin.
- ] ifFalse:[
- fromY := margin + dY.
- toY := margin.
- redrawY := margin + copyHeight.
- ].
- self catchExpose.
- self setViewOrigin:(x @ y).
- self
- copyFrom:self
- x:fromX y:fromY
- toX:toX y:toY
- width:copyWidth
- height:copyHeight
- async:true.
-
- self setInnerClip.
-
- "first redraw the rectangle above/below the
- copied area (with full width)."
-
- copyHeight < ih ifTrue:[
- self invalidateDeviceRectangle:((margin@redrawY) extent:(iw@(ih - copyHeight))) repairNow:false.
+ copyWidth := iw - dX abs.
+ copyHeight := ih - dY abs.
+ ((copyWidth > 0) and:[copyHeight > 0]) ifTrue:[
+ "/ some of the currently displayed pixels
+ "/ remain visible. Copy them
+
+ dX < 0 ifTrue:[
+ fromX := margin.
+ toX := margin - dX.
+ redrawX := margin
+ ] ifFalse:[
+ fromX := margin + dX.
+ toX := margin.
+ redrawX := margin + copyWidth.
+ ].
+ dY < 0 ifTrue:[
+ fromY := margin.
+ toY := margin - dY.
+ redrawY := margin.
+ ] ifFalse:[
+ fromY := margin + dY.
+ toY := margin.
+ redrawY := margin + copyHeight.
+ ].
+ self catchExpose.
+ self setViewOrigin:(x @ y).
+ self
+ copyFrom:self
+ x:fromX y:fromY
+ toX:toX y:toY
+ width:copyWidth
+ height:copyHeight
+ async:true.
+
+ self setInnerClip.
+
+ "first redraw the rectangle above/below the
+ copied area (with full width)."
+
+ copyHeight < ih ifTrue:[
+ self invalidateDeviceRectangle:((margin@redrawY) extent:(iw@(ih - copyHeight))) repairNow:false.
"/ self
"/ redrawDeviceX:margin y:redrawY
"/ width:iw height:(ih - copyHeight).
- ].
-
- "second redraw the rectangle left/right of the
- copied area"
-
- copyWidth < iw ifTrue:[
- self invalidateDeviceRectangle:((redrawX@toY) extent:((iw-copyWidth)@copyHeight)) repairNow:false.
+ ].
+
+ "second redraw the rectangle left/right of the
+ copied area"
+
+ copyWidth < iw ifTrue:[
+ self invalidateDeviceRectangle:((redrawX@toY) extent:((iw-copyWidth)@copyHeight)) repairNow:false.
"/ self redrawDeviceX:redrawX y:toY
"/
"/ width:iw - copyWidth
"/ height:copyHeight.
- ].
- self waitForExpose.
- ] ifFalse:[
- "redraw everything"
-
- self setViewOrigin:(x @ y).
- self invalidateDeviceRectangle:((margin@margin) extent:(iw@ih)) repairNow:false.
+ ].
+ self waitForExpose.
+ ] ifFalse:[
+ "redraw everything"
+
+ self setViewOrigin:(x @ y).
+ self invalidateDeviceRectangle:((margin@margin) extent:(iw@ih)) repairNow:false.
"/ self redrawDeviceX:margin y:margin
"/ width:iw
"/ height:ih.
- ].
+ ].
] ifFalse:[
- self setViewOrigin:(x @ y).
+ self setViewOrigin:(x @ y).
].
self originChanged:(dX negated @ dY negated).
@@ -8055,17 +8055,17 @@
"does not work:
- |v|
-
- v := View new open.
- v displayLineFrom:0@0 to:50@50
+ |v|
+
+ v := View new open.
+ v displayLineFrom:0@0 to:50@50
does work:
- |v|
-
- v := View new openAndWait.
- v displayLineFrom:0@0 to:50@50
+ |v|
+
+ v := View new openAndWait.
+ v displayLineFrom:0@0 to:50@50
"
!
@@ -8102,10 +8102,10 @@
The view will be handled by its own process, effectively running in
parallel.
Notice:
- This entry is for NON-topviews, which want to be served
- autonomous from their real topview.
- (see the fileBrowsers kill-button
- when executing unix commands as an example)"
+ This entry is for NON-topviews, which want to be served
+ autonomous from their real topview.
+ (see the fileBrowsers kill-button
+ when executing unix commands as an example)"
|wg mainGroup|
@@ -8114,7 +8114,7 @@
mainGroup := WindowGroup activeGroup.
mainGroup notNil ifTrue:[
- mainGroup := mainGroup mainGroup.
+ mainGroup := mainGroup mainGroup.
].
wg isForModalSubview:true. "/ make it handle update events for the main group
@@ -8150,14 +8150,14 @@
"
the same:
- YesNoBox new open
-
- YesNoBox new openModal
+ YesNoBox new open
+
+ YesNoBox new openModal
different:
- (Button label:'hello') open
-
- (Button label:'hello') openModal
+ (Button label:'hello') open
+
+ (Button label:'hello') openModal
"
!
@@ -8177,7 +8177,7 @@
masterGroup := WindowGroup activeGroup.
[masterGroup notNil and:[masterGroup isPopUp]] whileTrue:[
- masterGroup := masterGroup previousGroup.
+ masterGroup := masterGroup previousGroup.
].
^ self openModal:aBlock inGroup:masterGroup "/ mainGroup.
@@ -8197,101 +8197,101 @@
|tops mainView mainViewID|
self isPopUpView ifFalse:[
- ModalBox usingTransientViews ifTrue:[
- mainGroup notNil ifTrue:[
- (tops := mainGroup topViews) notNil ifTrue:[
- tops notEmpty ifTrue:[
- mainView := tops first.
- mainView notNil ifTrue:[
- mainViewID := mainView id.
- ]
- ]
- ].
- ].
-
- mainViewID isNil ifTrue:[
- self origin:(device center - (self extent//2))
- ].
-
- drawableId isNil ifTrue:[self create].
- device setTransient:drawableId for:mainViewID.
- ].
+ ModalBox usingTransientViews ifTrue:[
+ mainGroup notNil ifTrue:[
+ (tops := mainGroup topViews) notNil ifTrue:[
+ tops notEmpty ifTrue:[
+ mainView := tops first.
+ mainView notNil ifTrue:[
+ mainViewID := mainView id.
+ ]
+ ]
+ ].
+ ].
+
+ mainViewID isNil ifTrue:[
+ self origin:(device center - (self extent//2))
+ ].
+
+ drawableId isNil ifTrue:[self create].
+ device setTransient:drawableId for:mainViewID.
+ ].
].
self raise.
Processor activeProcessIsSystemProcess ifTrue:[
- "
- put myself into the modal group, let it handle events for
- me as well. This is only a half way solution, since the view
- is not modal at all ... however, the only situation
- where this happens is with modal boxes popped while in a
- modal browser. You will forgive me for that inconvenience.
- "
- windowGroup := mainGroup.
- mainGroup notNil ifTrue:[mainGroup addTopView:self].
- self realize
+ "
+ put myself into the modal group, let it handle events for
+ me as well. This is only a half way solution, since the view
+ is not modal at all ... however, the only situation
+ where this happens is with modal boxes popped while in a
+ modal browser. You will forgive me for that inconvenience.
+ "
+ windowGroup := mainGroup.
+ mainGroup notNil ifTrue:[mainGroup addTopView:self].
+ self realize
] ifFalse:[
- "
- show a stop-cursor in the main group
- "
- mainGroup notNil ifTrue:[
- self isPopUpView ifFalse:[
- mainGroup showCursor:(Cursor stop).
- ]
- ].
-
- "
- create a new window group and put myself into it
- "
- windowGroup := WindowGroup new.
- windowGroup addTopView:self.
-
- superView notNil ifTrue:[
- "/
- "/ special: this is a modal subview,
- "/ prevent the view from reassigning its windowGroup when realized
- "/ (subviews normally place themself into the superviews group)
- "/
- windowGroup isForModalSubview:true.
- ].
-
- "
- go dispatch events in this new group
- (thus current windowgroup is blocked from interaction)
- "
- AbortSignal handle:[:ex |
- self hide.
- ex return.
- ] do:[
- [
- [
- windowGroup startupModal:[realized and:aBlock] forGroup:mainGroup
- ] valueOnUnwindDo:[
- self hide
- ]
- ] valueNowOrOnUnwindDo:[
- mainGroup notNil ifTrue:[
- ReturnFocusWhenClosingModalBoxes ifTrue:[
- "
- return input focus to previously active groups top.
- This helps with windowmanagers which need an explicit click
- on the view for the focus.
- "
- tops := mainGroup topViews.
- (tops notNil and:[tops notEmpty]) ifTrue:[
- tops first getKeyboardFocus
- ]
- ].
-
- "
- restore cursors in the main group & flush its buffered key & mouse events
- "
- mainGroup restoreCursors.
+ "
+ show a stop-cursor in the main group
+ "
+ mainGroup notNil ifTrue:[
+ self isPopUpView ifFalse:[
+ mainGroup showCursor:(Cursor stop).
+ ]
+ ].
+
+ "
+ create a new window group and put myself into it
+ "
+ windowGroup := WindowGroup new.
+ windowGroup addTopView:self.
+
+ superView notNil ifTrue:[
+ "/
+ "/ special: this is a modal subview,
+ "/ prevent the view from reassigning its windowGroup when realized
+ "/ (subviews normally place themself into the superviews group)
+ "/
+ windowGroup isForModalSubview:true.
+ ].
+
+ "
+ go dispatch events in this new group
+ (thus current windowgroup is blocked from interaction)
+ "
+ AbortSignal handle:[:ex |
+ self hide.
+ ex return.
+ ] do:[
+ [
+ [
+ windowGroup startupModal:[realized and:aBlock] forGroup:mainGroup
+ ] valueOnUnwindDo:[
+ self hide
+ ]
+ ] valueNowOrOnUnwindDo:[
+ mainGroup notNil ifTrue:[
+ ReturnFocusWhenClosingModalBoxes ifTrue:[
+ "
+ return input focus to previously active groups top.
+ This helps with windowmanagers which need an explicit click
+ on the view for the focus.
+ "
+ tops := mainGroup topViews.
+ (tops notNil and:[tops notEmpty]) ifTrue:[
+ tops first getKeyboardFocus
+ ]
+ ].
+
+ "
+ restore cursors in the main group & flush its buffered key & mouse events
+ "
+ mainGroup restoreCursors.
"/ mainGroup sensor flushUserEvents.
- ]
- ]
- ].
+ ]
+ ]
+ ].
]
"Created: 10.12.1995 / 14:06:14 / cg"
@@ -8344,25 +8344,25 @@
"
the same:
- (Button label:'hello') open
-
- (Button label:'hello') openModeless
+ (Button label:'hello') open
+
+ (Button label:'hello') openModeless
different:
- YesNoBox new open
-
- YesNoBox new openModeless
+ YesNoBox new open
+
+ YesNoBox new openModeless
"
"
(almost) the same:
- YesNoBox new open
-
- YesNoBox new openModal
+ YesNoBox new open
+
+ YesNoBox new openModal
different:
- (Button label:'hello') open
-
- (Button label:'hello') openModal
+ (Button label:'hello') open
+
+ (Button label:'hello') openModal
"
"Modified: 24.7.1997 / 13:17:49 / cg"
@@ -8397,21 +8397,21 @@
drawableId isNil ifTrue:[self create].
windowGroup isNil ifTrue:[
- newGroup := true.
- windowGroup := WindowGroup new.
+ newGroup := true.
+ windowGroup := WindowGroup new.
] ifFalse:[
- newGroup := false.
+ newGroup := false.
].
windowGroup addTopView:self.
(aPoint isNil and:[iconified not]) ifTrue:[
- windowGroup startupWith:[self realize].
+ windowGroup startupWith:[self realize].
] ifFalse:[
- windowGroup startupWith:[self realizeKeepingGroup:false at:aPoint iconified:iconified].
+ windowGroup startupWith:[self realizeKeepingGroup:false at:aPoint iconified:iconified].
].
newGroup ifFalse:[
- self realizeInGroup.
+ self realizeInGroup.
].
"
@@ -8451,35 +8451,35 @@
another view (which is only available once visible),
use this to suspend the current process until the receiver is shown.
Caveat:
- we poll here for the view to be shown - we need a semaphore
- which is raised by the view in order to do it right."
+ we poll here for the view to be shown - we need a semaphore
+ which is raised by the view in order to do it right."
|wg|
[self shown] whileFalse:[
- Delay waitForSeconds:0.05.
- (wg := self windowGroup) ifNotNil:[
- wg processExposeEvents.
- ].
+ Delay waitForSeconds:0.05.
+ (wg := self windowGroup) ifNotNil:[
+ wg processExposeEvents.
+ ].
].
"does not work (the view is in its opening phase,
when we attempt to draw a line - this gives an error, since
its internals are not yet correctly setup):
- |v|
-
- v := View new open.
- v displayLineFrom:0@0 to:50@50
+ |v|
+
+ v := View new open.
+ v displayLineFrom:0@0 to:50@50
does work (since we wait until the view has completely finished
its startup phase):
- |v|
-
- v := View new open.
- v waitUntilVisible.
- v displayLineFrom:0@0 to:50@50
+ |v|
+
+ v := View new open.
+ v waitUntilVisible.
+ v displayLineFrom:0@0 to:50@50
"
! !
@@ -8557,6 +8557,6 @@
!SimpleView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.359 2000-01-24 16:33:25 ca Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.360 2000-01-25 10:58:31 cg Exp $'
! !
SimpleView initialize!