--- a/EnterBox.st Thu Oct 06 23:14:36 2016 +0200
+++ b/EnterBox.st Thu Oct 06 23:14:37 2016 +0200
@@ -42,7 +42,7 @@
originally, ST/X had separate classes for the various entry methods;
there were YesNoBox, EnterBox, InfoBox and so on.
In the meantime, the DialogBox class (and therefore its alias: Dialog)
- is going to duplicate most funcionality found in these classes.
+ is going to duplicate most functionality found in these classes.
In the future, those existing subclasses' functionality is going to
be moved fully into Dialog, and the subclasses will be replaced by dummy
@@ -58,11 +58,11 @@
However, to control more details of the box, it may also be created first
(EnterBox new) and then modified as appropriate before it is shown.
- For example, the boxes title can be changed with:
+ For example, the boxes title can be changed with:
aBox title:'some string'
- The two button-labels default to 'abort' and 'ok';
+ The two button-labels default to 'abort' and 'ok';
they can be changed using:
aBox okText:'someString'
@@ -97,7 +97,7 @@
"
!
-examples
+examples
"
examples (for ST-80 compatibility, please use Dialog messages):
@@ -150,7 +150,7 @@
[exBegin]
|box|
- box := EnterBox
+ box := EnterBox
title:'your name please:'
action:[:arg | Transcript showCR:'entered: ' , arg printString].
box open
@@ -191,7 +191,7 @@
[exBegin]
|box|
- box := EnterBox
+ box := EnterBox
title:'your name please:'
action:[:arg | Transcript showCR:'entered: ' , arg printString].
box enterField passwordCharacter:$*.
@@ -208,7 +208,7 @@
[exEnd]
ATTENTION:
- for ST-80 compatibility, please use protocol from Dialog
+ for ST-80 compatibility, please use protocol from Dialog
(which is an alias for DialogBox):
[exBegin]
|string|
@@ -220,7 +220,7 @@
Transcript showCR:('the entered string was: ' , string)
]
[exEnd]
- and:
+ and:
[exBegin]
|string|
@@ -235,9 +235,9 @@
!EnterBox class methodsFor:'instance creation'!
action:aBlock
- "create and return a new EnterBox
+ "create and return a new EnterBox
which will evaluate aBlock when 'ok' is pressed.
- Obsolete (but kept for backward compatibility):
+ Obsolete (but kept for backward compatibility):
boxes are never used without a proper label"
^ (self new) action:aBlock
@@ -266,7 +266,7 @@
"create and return a new EnterBox with title aString, and buttons showing
okText and abortText; it will evaluate aBlock when 'ok' is pressed"
- ^ (self title:titleString okText:okText action:aBlock) abortText:abortText
+ ^ (self title:titleString okText:okText action:aBlock) abortText:abortText
!
title:titleString okText:okText action:aBlock
@@ -459,7 +459,7 @@
okButton resize.
labelField label:titleString.
labelField forceResize.
- shown
+ shown
ifTrue:[self resize]
ifFalse:[ self sizeChanged:nil].
]
@@ -468,7 +468,7 @@
title:titleString okText:okString abortText:abortString
"set title and texts in the buttons"
- (titleString ~= labelField label
+ (titleString ~= labelField label
or:[okString ~= okButton label
or:[abortString ~= abortButton label]]) ifTrue:[
okButton label:okString.
@@ -477,7 +477,7 @@
abortButton resize.
labelField label:titleString.
labelField forceResize.
- shown
+ shown
ifTrue:[self resize]
ifFalse:[ self sizeChanged:nil].
]
@@ -513,10 +513,10 @@
innerWidth := width - space2.
self addComponent:aWidget.
- enterField
+ enterField
width:1.0;
origin:[0.0 @ (space2 + labelField preferredHeight "height")];
- leftInset:ViewSpacing-aWidget borderWidth;
+ leftInset:ViewSpacing-aWidget borderWidth;
rightInset:1 "ViewSpacing".
aWidget addDependent:self. "to get preferredExtent-changes"
@@ -552,12 +552,12 @@
innerWidth := width - space2.
labelField := Label in:self.
- labelField
- label:'';
+ labelField
+ label:'';
borderWidth:0;
adjust:#left;
origin:(0.0 @ ViewSpacing) extent:[1.0 @ labelField height];
- leftInset:ViewSpacing;
+ leftInset:ViewSpacing;
rightInset:ViewSpacing.
self addEnterField:(self createEnterField).
@@ -577,10 +577,10 @@
!EnterBox methodsFor:'queries'!
-preferredExtent
+preferredExtent
"compute the boxes preferredExtent from the components' sizes"
- |wWanted hWanted wPanel vs2 min
+ |wWanted hWanted wPanel vs2 min
labelPref enterPref panelPref|
"/ If I have an explicit preferredExtent..
@@ -604,7 +604,7 @@
hWanted := labelPref y + ViewSpacing + enterPref y +
ViewSpacing + panelPref y + ViewSpacing.
verticalPanel notNil ifTrue:[
- hWanted := hWanted + ViewSpacing + (verticalPanel preferredHeight).
+ hWanted := hWanted + ViewSpacing + (verticalPanel preferredHeight).
].
min := self class minExtent.
@@ -615,7 +615,7 @@
hWanted := min y
].
vs2 := ViewSpacing * 2.
- ^ (wWanted + vs2) @ (hWanted + vs2)
+ ^ (wWanted + vs2) @ (hWanted + vs2)
"Modified: / 22.1.1998 / 09:57:55 / md"
"Modified: / 27.7.1998 / 20:18:41 / cg"
@@ -639,12 +639,12 @@
^ self request:title onCancel:''
"
- EnterBox request:'enter some string:'
+ EnterBox request:'enter some string:'
|bx|
bx := EnterBox new.
bx label:'foo bar baz'.
- bx request:'enter some string:'
+ bx request:'enter some string:'
"
"Created: 7.12.1995 / 23:12:19 / cg"
@@ -664,7 +664,7 @@
|bx|
bx := EnterBox new.
bx label:'foo bar baz'.
- bx request:'enter some string:' onCancel:#foo
+ bx request:'enter some string:' onCancel:#foo
"
"Created: 7.12.1995 / 23:12:19 / cg"
@@ -672,7 +672,7 @@
!
requestOnCancel:cancelValue
- "open the box and return the entered string
+ "open the box and return the entered string
or cancelValue, if abort was pressed"
self action:[:string | ^ string].
@@ -683,7 +683,7 @@
!
requestPassword:title
- "set the title, set password mode, open the box and return the entered string
+ "set the title, set password mode, open the box and return the entered string
or nil, if abort was pressed"
^ self requestPassword:title onCancel:nil
@@ -693,7 +693,7 @@
!
requestPassword:title onCancel:cancelValue
- "set the title, set password mode, open the box and return the entered string
+ "set the title, set password mode, open the box and return the entered string
or cancelValue, if abort was pressed"
enterField bePassword.