Fix in ComboView>>createPullDownMenuForList:
authorJan Vrany <jan.vrany@fit.cvut.cz>
Wed, 09 Apr 2014 19:00:13 +0200
changeset 4564 be449e47ce4b
parent 4563 3603d95da63c
child 4565 bafd0c21df02
Fix in ComboView>>createPullDownMenuForList: Make menu background be the same a edit field background. Fix for previous commit...
ComboView.st
--- a/ComboView.st	Wed Apr 09 18:59:20 2014 +0200
+++ b/ComboView.st	Wed Apr 09 19:00:13 2014 +0200
@@ -728,6 +728,40 @@
 
 !ComboView methodsFor:'menu interaction'!
 
+createPullDownMenuForList:aList
+    "pull the menu - triggered from the button"
+
+    |menu index|
+
+    comboMenuHolder notNil ifTrue:[
+        menu := (comboMenuHolder perform:comboMenuMessage ? #value). 
+        (menu isKindOf:Menu) ifTrue:[
+            menu := MenuPanel new menu:menu.
+        ]
+    ] ifFalse:[
+        menu := MenuPanel new.
+        menu doAccessCharacterTranslation:false.
+        menu labels:aList.
+        menu hideOnRelease:false.
+        menu backgroundColor: field backgroundColor. 
+
+        index := 1.
+
+        menu do:[:el |
+            el value:#select: argument:index.
+            index := index + 1.
+        ].
+        menu receiver:self.
+    ].
+
+    menu font:self font.
+    menu preferredWidth:self width.
+
+    ^ menu
+
+    "Modified: / 25-03-2014 / 01:21:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 deltaSelect:delta
     "change selection by delta. Wrap at start/end"
 
@@ -893,10 +927,10 @@
 !ComboView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/ComboView.st,v 1.115 2014-04-09 16:59:20 vrany Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/ComboView.st,v 1.116 2014-04-09 17:00:13 vrany Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libwidg2/ComboView.st,v 1.115 2014-04-09 16:59:20 vrany Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/ComboView.st,v 1.116 2014-04-09 17:00:13 vrany Exp $'
 ! !