changed:
#documentation
#labels:lines:values:
#startUpWithHeading:
--- a/PopUpMenu.st Mon Oct 12 10:35:24 2009 +0200
+++ b/PopUpMenu.st Mon Oct 12 12:10:05 2009 +0200
@@ -54,7 +54,7 @@
Dynamic menus are easier to use, if the number of or look of the entries has to
change according the internal state of some model. Also, this is the ST-80 way
- of using popupMenus. For dynamic popups, the views model is asked for a menu
+ of using popupMenus. For dynamic popups, the view's model is asked for a menu
via the #menuSelector each time a button press occurs.
See examples section for more.
@@ -991,14 +991,26 @@
Modal - i.e. stay in the menu until finished.
This is the ST-80 way of launching a menu."
+ |vector|
+
defaultHideOnRelease := false.
- menuView labels notNil ifTrue:[
- menuView labels:(Array with:aString with:'=') , menuView labels.
+ (vector := menuView labels) notNil ifTrue:[
+ menuView labels:(Array with:aString
+ with:'=') , vector.
+ ].
+ (vector := menuView selectors) notNil ifTrue:[
+ menuView selectors:#(nil nil) , vector.
].
- menuView selectors notNil ifTrue:[
- menuView selectors:(Array with:nil with:nil) , menuView selectors.
+ (vector := menuView args) notNil ifTrue:[
+ menuView args:#(nil nil) , vector.
].
-"/ menuView disable:1; disable:2.
+ (vector := menuView checkFlags) notNil ifTrue:[
+ menuView checkFlags:#(nil nil) , vector.
+ ].
+ (vector := menuView actions) notNil ifTrue:[
+ menuView actions:#(nil nil) , vector.
+ ].
+ menuView disable:1; disable:2.
^ self startUp.
@@ -1067,12 +1079,17 @@
^ menuView list
!
-labels:labelString lines:lineArray values:valueArray
+labels:labelString lines:lineArrayArg values:valueArray
"define the menu the ST-80 way (with labels and lines defined separately)"
- |labelArray argArray convertedLabels
+ |lineArray labelArray argArray convertedLabels
offs dstOffs linePos m|
+ lineArray := lineArrayArg.
+ lineArray first == 0 ifTrue:[
+ lineArray := lineArray copyFrom:2.
+ ].
+
actionLabels := labelString.
actionLines := lineArray.
actionValues := valueArray.
@@ -1607,5 +1624,9 @@
!PopUpMenu class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg/PopUpMenu.st,v 1.101 2009-09-15 18:20:09 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/PopUpMenu.st,v 1.102 2009-10-12 10:10:05 cg Exp $'
+!
+
+version_CVS
+ ^ '$Header: /cvs/stx/stx/libwidg/PopUpMenu.st,v 1.102 2009-10-12 10:10:05 cg Exp $'
! !