class: DialogBox
authorClaus Gittinger <cg@exept.de>
Thu, 03 Jul 2014 18:37:48 +0200
changeset 5091 f69c39e3dc9e
parent 5090 ed3edaf6714f
child 5092 0108089c6550
class: DialogBox added: #request:title:
DialogBox.st
--- a/DialogBox.st	Thu Jul 03 18:36:28 2014 +0200
+++ b/DialogBox.st	Thu Jul 03 18:37:48 2014 +0200
@@ -4732,6 +4732,77 @@
     "Modified: 29.5.1996 / 14:28:59 / cg"
 !
 
+request:aString title:windowTitle
+    "launch a Dialog, which allows user to enter a string."
+
+    ^ self
+        request:aString 
+        displayAt:nil 
+        centered:(ForceModalBoxesToOpenAtCenter ? false) 
+        action:nil 
+        initialAnswer:nil 
+        okLabel:nil 
+        cancelLabel:nil 
+        title:windowTitle 
+        onCancel:''
+        list:nil
+        initialSelection:nil
+
+    "
+     at topLeft (centering is suppressed, to make the box fully visible)    
+         Dialog 
+            request:'enter a string:'
+            displayAt:0@0
+            centered:true
+            action:[:result | result printNewline]
+            initialAnswer:'the default'
+            onCancel:#foo
+
+     centered around 200@200:
+
+         Dialog 
+            request:'enter a string:'
+            displayAt:200@200
+            centered:true
+            action:[:result | result printNewline]
+            initialAnswer:'the default'
+            onCancel:#foo
+
+     topLeft of box at 200@200:
+
+         Dialog 
+            request:'enter a string:'
+            displayAt:200@200
+            centered:false 
+            action:[:result | result printNewline]
+            initialAnswer:'the default'
+            onCancel:#foo
+
+     under mouse pointer:
+
+         Dialog 
+            request:'enter a string:'
+            displayAt:nil
+            centered:false 
+            action:[:result | result printNewline]
+            initialAnswer:'the default'
+            onCancel:#foo
+
+     centered on the screen:
+
+         Dialog 
+            request:'enter a string:'
+            displayAt:nil
+            centered:true 
+            action:[:result | result printNewline]
+            initialAnswer:'the default'
+            onCancel:#foo
+    "
+
+    "Created: 7.12.1995 / 23:14:10 / cg"
+    "Modified: 29.5.1996 / 14:24:39 / cg"
+!
+
 request:aString title:titleString initialAnswer:initial
     "launch a Dialog, which allows user to enter something.
      Return the entered string (may be empty string) or nil (if cancel was pressed)"
@@ -10179,11 +10250,11 @@
 !DialogBox class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.358 2014-06-13 21:06:30 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.359 2014-07-03 16:37:48 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.358 2014-06-13 21:06:30 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.359 2014-07-03 16:37:48 cg Exp $'
 ! !