#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Tue, 24 Jul 2018 23:15:00 +0200
changeset 6381 866b86e4dfda
parent 6379 6a0103018ab9
child 6382 161c963b04c1
#FEATURE by cg class: DialogBox class definition class: DialogBox class added: #defaultMinWidthForListBoxes changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
DialogBox.st
--- a/DialogBox.st	Fri Jul 13 16:46:37 2018 +0200
+++ b/DialogBox.st	Tue Jul 24 23:15:00 2018 +0200
@@ -21,7 +21,8 @@
 		inputFieldGroup acceptOnLeave acceptValue tabableElements
 		hideOnAccept acceptCheck needResize autoAccept focusToOKOnLeave
 		bindings namedComponents verticalPanel'
-	classVariableNames:'AboutToOpenBoxNotificationSignal DefaultFocusToOKOnLeave'
+	classVariableNames:'AboutToOpenBoxNotificationSignal DefaultFocusToOKOnLeave
+		DefaultMinWidthForListBoxes'
 	poolDictionaries:''
 	category:'Views-DialogBoxes'
 !
@@ -2119,6 +2120,12 @@
     "Created: 23.4.1996 / 17:13:10 / cg"
 !
 
+defaultMinWidthForListBoxes
+    ^ DefaultMinWidthForListBoxes ? 450
+
+    "Created: / 24-07-2018 / 23:09:05 / Claus Gittinger"
+!
+
 updateStyleCache
     "extract values from the styleSheet and cache them in class variables"
 
@@ -5710,7 +5717,7 @@
      If cancel is pressed, the value of cancelBlock is returned.
      Pressing ok without a selection returns nil or an empty collection (if multiple is true)."
 
-    |box listView panel sel haveDefault|
+    |box listView panel sel haveDefault minWidth|
 
     haveDefault := false.
 
@@ -5819,11 +5826,12 @@
     windowTitle notNil ifTrue:[
         box label:windowTitle.
     ].
+    minWidth := self defaultMinWidthForListBoxes.
     boxWidthOrNil notNil ifTrue:[
-        box width:(boxWidthOrNil max:250).
+        box width:(boxWidthOrNil max:minWidth).
     ] ifFalse:[
-        box width < 250 ifTrue:[
-            box width:250.
+        box width < minWidth ifTrue:[
+            box width:minWidth.
         ]
     ].
 
@@ -5880,6 +5888,7 @@
 
     "Created: / 08-11-2011 / 12:15:20 / cg"
     "Modified: / 15-01-2018 / 18:16:38 / Maren"
+    "Modified: / 24-07-2018 / 23:09:42 / Claus Gittinger"
 !
 
 choose:aString fromList:list values:listValues initialSelection:initialListSelectionOrNil buttons:buttonLabels values:buttonValues lines:maxLines cancel:cancelBlock multiple:multiple postBuildBlock:aBlockOrNil