Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Submenu items from an array???
Message
 
À
19/05/1997 21:09:03
Bill Gravell
Indoor Purification System
Menifee, Californie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de menu & Menus
Divers
Thread ID:
00032493
Message ID:
00032885
Vues:
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! ;-)
>
>
>Thanks .... I'll give it a try. Took me a while to get back to look at this...I'm working 3 projects right now....
>
>Bill

Be happy! Somebody dont have any job. :)
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform