--- a/SimpleView.st Fri Nov 04 16:12:42 2016 +0100
+++ b/SimpleView.st Fri Nov 04 16:19:41 2016 +0100
@@ -631,11 +631,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
@@ -646,35 +646,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 open.
+ |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.
@@ -689,7 +689,7 @@
For textViews, the above is also valid, except if the menuHolder is explicitely
set - in this case, that one provides the menu; not the model.
- Dont get confused by the fact that menuHolders are only supported
+ Don't get confused by the fact that menuHolders are only supported
by textViews.
example: (in your application, the plug would be your application, topView or model)
@@ -700,42 +700,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).
@@ -748,31 +748,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.
"
! !
@@ -2854,7 +2854,7 @@
!
initialExtent:extent
- "set the views extent, but dont change its explicitExtent setting.
+ "set the views extent, but don't change its explicitExtent setting.
a variant of #extent."
|expl|
@@ -2865,13 +2865,13 @@
!
initialHeight:aNumber
- "set the views height in pixels, but dont change its explicitExtent setting"
+ "set the views height in pixels, but don't change its explicitExtent setting"
self initialExtent:(width @ aNumber)
!
initialWidth:aNumber
- "set the views width in pixels, but dont change its explicitExtent setting"
+ "set the views width in pixels, but don't change its explicitExtent setting"
self initialExtent:(aNumber @ height)
!
@@ -4693,19 +4693,19 @@
addComponent:aComponent
"components (i.e. gadgets or lightweight views) are being prepared.
- Dont use this right now for non-views"
+ Don't 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"
@@ -4805,18 +4805,18 @@
component:aComponent
"components (i.e. gadgets or lightweight views) are being prepared.
- Dont use this right now for non-views"
+ Don't use this right now for non-views"
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"
@@ -4847,14 +4847,14 @@
removeComponent:aComponent
"components (i.e. gadgets or lightweight views) are being prepared.
- Dont use this right now for non-views"
+ Don't 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 container:nil
+ components isNil ifTrue:[^self].
+ components remove:aComponent ifAbsent:[].
+ aComponent container:nil
]
"Modified: / 11-09-2006 / 17:14:30 / User"
@@ -9414,12 +9414,12 @@
buttonMotionEventPending
"return true, if a button motion event is pending.
- Normally, you dont want to use this, since no polling is needed
+ Normally, you don't want to use this, since no polling is needed
(not even for mouse-tracking).
Actually, its a historical leftover"
windowGroup notNil ifTrue:[
- ^ windowGroup sensor hasButtonMotionEventFor:self
+ ^ windowGroup sensor hasButtonMotionEventFor:self
].
^ super buttonMotionEventPending
@@ -10514,7 +10514,7 @@
redraw
"redraw myself completely - this is sent by redrawX:y:width:height:
as a fallback.
- Cannot do much here - is redefined in subclasses which dont care for
+ Cannot do much here - is redefined in subclasses which don't care for
updating regions but instead update everything."
"Modified: 29.5.1996 / 18:02:52 / cg"