Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Submenu items from an array???
Message
 
To
15/05/1997 16:04:24
Bill Gravell
Indoor Purification System
Menifee, California, United States
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
00032493
Message ID:
00032528
Views:
36
>Anybody know how to create a submenu from items in an array....without rewriting the menu in code?
>
>I've tried macro substitution without success....
>
>Bill

I've made some little tests and i write this little program on the fly.
I think it could help you :-)

**********************************
testmenu.prg
**********************************
dimension myarray[3,3]
myarray[1,1] = "'i am pad1'"
myarray[1,2] = "1"
myarray[1,3] = "=saymyname('pad1')"
myarray[2,1] = "'i am pad2'"
myarray[2,2] = "2"
myarray[2,3] = "=saymyname('pad2')"
myarray[3,1] = "'i am pad3'"
myarray[3,2] = "3"
myarray[3,3] = "=saymyname('pad3')"

DEFINE PAD _rdm0tb6b8 OF _MSYSMENU PROMPT "TestMenu" COLOR SCHEME 3 ;
KEY ALT+T, ""
ON PAD _rdm0tb6b8 OF _MSYSMENU ACTIVATE POPUP _abc1234
DEFINE POPUP _abc1234 MARGIN RELATIVE SHADOW COLOR SCHEME 4

mycomm=""
for i = 1 to alen(myarray,1)
mycomm= "DEFINE BAR "+myarray[i,2]+" OF _abc1234 PROMPT "+myarray[i,1]
&mycomm
mycomm= "ON SELECTION BAR "+myarray[i,2]+" OF _abc1234 "+myarray[i,3]
&mycomm
endfor

***************
function saymyname
****
lparameters thename

=messagebox(thename,64,"testmenu")

return
********************************

Hope this help! ;-)
If we exchange an apple, we both get an apple.
But if we exchange an idea, we both get 2 ideas, cool...


Gérald Santerre
Independant programmer - internet or intranet stuff - always looking for contracts big or small :)
http://www.siteintranet.qc.ca
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform