EnterBox.st
changeset 197 00927189c882
parent 181 dc72c27581b7
child 242 1fa14a974cc2
--- a/EnterBox.st	Thu Nov 23 02:43:52 1995 +0100
+++ b/EnterBox.st	Thu Nov 23 03:26:58 1995 +0100
@@ -10,8 +10,6 @@
  hereby transferred.
 "
 
-'From Smalltalk/X, Version:2.10.4 on 28-dec-1994 at 2:45:44 pm'!
-
 DialogBox subclass:#EnterBox
 	 instanceVariableNames:'labelField enterField'
 	 classVariableNames:''
@@ -35,10 +33,6 @@
 "
 !
 
-version
-    ^ '$Header: /cvs/stx/stx/libwidg/EnterBox.st,v 1.32 1995-11-16 20:34:12 cg Exp $'
-!
-
 documentation
 "
     this class implements a pop-up box to enter some string
@@ -143,6 +137,10 @@
 "
 
     "Modified: 16.11.1995 / 21:28:11 / cg"
+!
+
+version
+    ^ '$Header: /cvs/stx/stx/libwidg/EnterBox.st,v 1.33 1995-11-23 02:24:52 cg Exp $'
 ! !
 
 !EnterBox class methodsFor:'instance creation'!
@@ -169,28 +167,28 @@
     ^ (self title:titleString) action:aBlock
 !
 
+title:titleString okText:okText abortText:abortText action:aBlock
+    "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 
+!
+
 title:titleString okText:okText action:aBlock
     "create and return a new EnterBox with title aString, and ok button showing
      okText; it will evaluate aBlock when 'ok' is pressed"
 
     ^ (self title:titleString action:aBlock) okText:okText
-!
-
-title:titleString okText:okText abortText:abortText action:aBlock
-    "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 
 ! !
 
 !EnterBox class methodsFor:'defaults'!
 
+defaultExtent
+    ^ (Screen current pixelPerMillimeter * (60 @ 30)) rounded
+!
+
 minExtent
     ^ self defaultExtent
-!
-
-defaultExtent
-    ^ (Screen current pixelPerMillimeter * (60 @ 30)) rounded
 ! !
 
 !EnterBox class methodsFor:'easy startup '!
@@ -239,14 +237,37 @@
     enterField contents:aString
 !
 
+enterField
+    "provide access to the entryfield"
+
+    ^ enterField
+
+    "Created: 16.11.1995 / 21:23:48 / cg"
+!
+
+entryCompletionBlock:aBlock
+    enterField entryCompletionBlock:aBlock
+!
+
 initialText:aString
     "define the initial text in the enterfield. all will be selected initially"
 
     enterField initialText:aString
 !
 
-entryCompletionBlock:aBlock
-    enterField entryCompletionBlock:aBlock
+initialText:aString selectFrom:start to:stop
+    "define the initial text in the enterfield, and the part to be selected"
+
+    enterField initialText:aString.
+    enterField selectFromLine:1 col:start toLine:1 col:stop
+!
+
+labelField
+    "provide access to the labelfield"
+
+    ^ labelField
+
+    "Created: 16.11.1995 / 21:23:48 / cg"
 !
 
 title:aString
@@ -267,13 +288,6 @@
     ]
 !
 
-initialText:aString selectFrom:start to:stop
-    "define the initial text in the enterfield, and the part to be selected"
-
-    enterField initialText:aString.
-    enterField selectFromLine:1 col:start toLine:1 col:stop
-!
-
 title:titleString okText:okString
     "set title and text in okbutton"
 
@@ -300,22 +314,20 @@
 	labelField forceResize.
 	shown ifTrue:[self resize].
     ]
-!
+! !
 
-enterField
-    "provide access to the entryfield"
+!EnterBox methodsFor:'change & update'!
 
-    ^ enterField
+update:something with:someArgument from:changedObject
+    "sent if my enterbox thinks it needs more real-estate ..."
 
-    "Created: 16.11.1995 / 21:23:48 / cg"
-!
-
-labelField
-    "provide access to the labelfield"
-
-    ^ labelField
-
-    "Created: 16.11.1995 / 21:23:48 / cg"
+    changedObject == enterField ifTrue:[
+	something == #preferredExtent ifTrue:[
+	    shown ifTrue:[self resizeUnderPointer].
+	    ^ self
+	]
+    ].
+    super update:something with:someArgument from:changedObject
 ! !
 
 !EnterBox methodsFor:'initialization'!
@@ -328,6 +340,10 @@
      ^ EditField new.
 !
 
+focusSequence
+    ^ Array with:enterField with:abortButton with:okButton 
+!
+
 initialize
     |space2 innerWidth|
 
@@ -376,24 +392,6 @@
     okButton resize.
     abortButton resize.
     self resize
-!
-
-focusSequence
-    ^ Array with:enterField with:abortButton with:okButton 
-! !
-
-!EnterBox methodsFor:'change & update'!
-
-update:something with:someArgument from:changedObject
-    "sent if my enterbox thinks it needs more real-estate ..."
-
-    changedObject == enterField ifTrue:[
-	something == #preferredExtent ifTrue:[
-	    shown ifTrue:[self resizeUnderPointer].
-	    ^ self
-	]
-    ].
-    super update:something with:someArgument from:changedObject
 ! !
 
 !EnterBox methodsFor:'queries'!
@@ -425,29 +423,6 @@
     ^ (wWanted + vs2) @ (hWanted + vs2) 
 ! !
 
-!EnterBox methodsFor:'user actions'!
-
-hideAndEvaluate:aBlock
-    "common processing for all ok-actions (see subclasses);
-     if modal, shut down box. 
-     Then fetch entered string and evaluate the passed action with it"
-
-    |string|
-
-    (windowGroup notNil and:[windowGroup isModal]) ifTrue:[
-	self hide.
-    ].
-    aBlock notNil ifTrue:[
-	string := self contents.
-	string isNil ifTrue:[
-	    string := ''
-	] ifFalse:[
-	    string := string withoutSeparators
-	].
-	aBlock value:string
-    ]
-! !
-
 !EnterBox methodsFor:'startup'!
 
 request
@@ -486,3 +461,27 @@
 
     "Created: 16.11.1995 / 21:25:33 / cg"
 ! !
+
+!EnterBox methodsFor:'user actions'!
+
+hideAndEvaluate:aBlock
+    "common processing for all ok-actions (see subclasses);
+     if modal, shut down box. 
+     Then fetch entered string and evaluate the passed action with it"
+
+    |string|
+
+    (windowGroup notNil and:[windowGroup isModal]) ifTrue:[
+	self hide.
+    ].
+    aBlock notNil ifTrue:[
+	string := self contents.
+	string isNil ifTrue:[
+	    string := ''
+	] ifFalse:[
+	    string := string withoutSeparators
+	].
+	aBlock value:string
+    ]
+! !
+