class: DialogBox
authorStefan Vogel <sv@exept.de>
Thu, 16 Apr 2015 11:35:01 +0200
changeset 5334 a6c0cdb615b8
parent 5331 1d78ee0cb88b
child 5335 b77a6bbca796
class: DialogBox added: #addComboBoxOn:list:tabable:
DialogBox.st
--- a/DialogBox.st	Fri Mar 27 14:12:57 2015 +0100
+++ b/DialogBox.st	Thu Apr 16 11:35:01 2015 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1994 by Claus Gittinger
 	      All Rights Reserved
@@ -8286,6 +8288,52 @@
     "Created: 4.3.1996 / 17:21:45 / cg"
 !
 
+addComboBoxOn:aModel list:list tabable:tabable
+    "create a comboBoxView on aModel and add it.
+     Returns the comboBoxView."
+
+    ^ (self addComboBoxOn:aModel tabable:tabable) list:list
+
+    "
+     without a list, the comboBox is disabled:
+
+     |box val|
+
+     val := 'some input' asValue.
+
+     box := Dialog new.
+
+     (box addTextLabel:'combo box example') adjust:#left.
+     box addVerticalSpace.
+     (box addComboBoxOn:val tabable:true).
+     box addOkButton.
+     box open.
+     box accepted ifTrue:[
+        Transcript showCR:val value
+     ].
+    "
+
+    "with a list, it can be pulled:
+
+     |box val|
+
+     val := '' asValue.
+
+     box := Dialog new.
+
+     (box addTextLabel:'combo box example') adjust:#left.
+     box addVerticalSpace.
+     (box addComboBoxOn:val tabable:true) list:#('one' 'two' 'three' 'four').
+     box addOkButton.
+     box open.
+     box accepted ifTrue:[
+        Transcript showCR:val value
+     ].
+    "
+
+    "Modified: 4.3.1996 / 17:21:57 / cg"
+!
+
 addComboBoxOn:aModel tabable:tabable
     "create a comboBoxView on aModel and add it.
      Returns the comboBoxView."
@@ -10340,11 +10388,11 @@
 !DialogBox class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.369 2015-03-19 11:21:21 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.370 2015-04-16 09:35:01 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.369 2015-03-19 11:21:21 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.370 2015-04-16 09:35:01 stefan Exp $'
 ! !