working with vfp native menus

Published on by Yousfi Benameur

              

[Post 272]
native vfp menus are obviously some old and somewhat obscure.
in vfp language there is some supports to work with menus:
1-the menu designer creates an mnx/mnt menu and generates an MPR menu ( as a prg file),compiled as MPX file.
the menu builder is a vfp system variable named _menudesigner.its an empty string as default.can be an user external program to create menus.
the system variable  _genmenu specifies the  program used to generate menu (MPR) from a mnx menu (who is a natively a vfp table).
the system bars are in this designer and can be inserted manually in the menu designer.
2-all the system vfp menus can retrieved as one string with sys(2013).
3-there is no another direct method to retrieve the system vfp  menus.i seen some APIs doing that but its as sys(2013) or parsing this string.
4.a manual method consists to open the designer, create an empty menu and invoke the "quickMenu"(available with menu not for shortcut menu) who fills the empty menu with default vfp main menu.
then can save the menu created and generate an MPR file used in the codes below.
5.the system vfp menu are system windows ones.dont play to change them otherwise this makes changes on all windows menus...(some APIs can do that operation but be careful).
in contrary,  can play  with custom menus created by the user without problem and with native codes (see define menu in help).
6.- can programmatically access Visual FoxPro system menu functionality with the SYS(1500) function. For example, if the active window is an editing window, the following line of code opens the Visual FoxPro Find dialog box:
=SYS(1500, "_MED_FIND", "_MEDIT") 

I worked with too menus in my previous posts.the codes below gives only some new lights to the subject.
note: the vfp system menu can be trapped as i point above.i dont find any way to retrieve the vfp system menu option :"Format" ! 
-to access to help on vfp system menu names simply type in command widow+return:help System Menu Names


Click on code to select [then copy] -click outside to deselect


*1*created on sunduay 15 of april 2018
*-this code retrieves code of bars defined in main vfp menu.can pick any bar to compose a menu (main or shortcut).
*of course, bar must be available in the context of its use(.)for ex. only bars relative to edition are available in an editbox).
*the code is assembled from the menu designer-create an empty menu-fill with the quickmenu bar--export to mpr...
*can do this with the menu designer but its some long & slow for a developper...
*this permit to dont re invent the wheel.

Public oform
oform=Newobject("yBars")
oform.Show
Read Events
Retu
Return
*
Define Class yBars As Form
	BorderStyle = 0
	Top = 0
	Left = 0
	Height = 473
	Width = 776
	ShowWindow = 2
	Caption = "Picking code of command line of vfp internal menu commands."
	Name = "form1"

	Add Object grid1 As Grid With ;
		FontBold = .T., ;
		FontSize = 10, ;
		Height = 457, ;
		Left = 0, ;
		RowHeight = 19, ;
		Top = 12, ;
		Width = 169, ;
    readonly=.t.,;
		Name = "Grid1"

	Add Object edit1 As EditBox With ;
		Height = 301, ;
		Left = 180, ;
		Top = 12, ;
		Width = 601, ;
		margin=10,;
		fontbold=.T.,;
		forecolor=Rgb(28,0,164),;
		readonly=.T.,;
		disabledForecolor=Rgb(28,0,164),;
		Name = "Edit1"

	Add Object label1 As Label With ;
		AutoSize = .T., ;
		FontBold = .T., ;
		FontSize = 12, ;
		Caption = "command line menu item to export-rightclick to select/copy bar code.", ;
		Height = 22, ;
		Left =225, ;
		Top = 324, ;
		Width = 264, ;
		Name = "Label1"

	Procedure my
	Lparameters nButton, nShift, nXCoord, nYCoord
*--- aevent create an array laEvents
	Aevents( myArray, 0)
*--- reference the calling object
	loObject = myArray[1]
	Sele ycurs
	Thisform.edit1.Value=xcommand
	Endproc

	Procedure Load
	Set Memow To 8192
	Local m.myvar
	TEXT to m.myvar noshow
		DEFINE BAR _mfi_new OF _mfile PROMPT "\<Nouveau..." 	KEY CTRL+N, "Ctrl+N" 	PICTRES _mfi_new 	MESSAGE "Crée un fichier"
		DEFINE BAR _mfi_open OF _mfile PROMPT "\<Ouvrir..." 	KEY CTRL+O, "Ctrl+O" 	PICTRES _mfi_open 	MESSAGE "Ouvre un fichier existant"
		DEFINE BAR _mfi_close OF _mfile PROMPT "\<Fermer" 	KEY CTRL+F4, "Ctrl+F4" 	PICTRES _mfi_close 	MESSAGE "Ferme le fichier en cours"
		DEFINE BAR _mfi_clall OF _mfile PROMPT "Fermer tout" 	PICTRES _mfi_clall 	MESSAGE "Ferme toutes les fenêtres"
		DEFINE BAR _mfi_sp100 OF _mfile PROMPT "\-" 	PICTRES _mfi_sp100
		DEFINE BAR _mfi_save OF _mfile PROMPT "\<Enregistrer" 	KEY CTRL+S, "Ctrl+S" 	PICTRES _mfi_save 	MESSAGE "Enregistre le fichier en cours"
		DEFINE BAR _mfi_savas OF _mfile PROMPT "En\<registrer sous..." 	PICTRES _mfi_savas 	MESSAGE "Enregistre le fichier en cours sous un nouveau nom"
		DEFINE BAR _mfi_saveashtml OF _mfile PROMPT "Enregistrer au format \<HTML..." 	PICTRES _mfi_saveashtml MESSAGE "Enregistre le fichier en cours en HTML"
		DEFINE BAR _mfi_revrt OF _mfile PROMPT "\<Annuler" 	PICTRES _mfi_revrt 	MESSAGE "Annule les modifications en cours"
		DEFINE BAR _mfi_sp200 OF _mfile PROMPT "\-" 	PICTRES _mfi_sp200
		DEFINE BAR _mfi_import OF _mfile PROMPT "Im\<porter..." 	PICTRES _mfi_import 	MESSAGE "Importe un fichier Visual FoxPro ou un fichier d'une autre application"
		DEFINE BAR _mfi_export OF _mfile PROMPT "E\<xporter..." 	PICTRES _mfi_export 	MESSAGE "Exporte un fichier Visual FoxPro dans un fichier d'une autre application"
		DEFINE BAR _mfi_sp300 OF _mfile PROMPT "\-" 	PICTRES _mfi_sp300
		DEFINE BAR _mfi_pgset OF _mfile PROMPT "\<Mise en page..." 	PICTRES _mfi_pgset 	MESSAGE "Modifie la mise en page et les options d'impression"
		DEFINE BAR _mfi_prevu OF _mfile PROMPT "Aperçu a\<vant impression" 	PICTRES _mfi_prevu 	MESSAGE "Affiche les pages telles qu'elles seront imprimées"
		DEFINE BAR _mfi_sysprint OF _mfile PROMPT "\<Imprimer..." 	KEY CTRL+P, "Ctrl+P" PICTRES _mfi_sysprint 	MESSAGE "Imprime un fichier texte, un état, une étiquette ou le contenu de la fenêtre Commande ou du Presse-papiers"
		DEFINE BAR _mfi_send OF _mfile PROMPT "Envo\<yer..." 	PICTRES _mfi_send 	MESSAGE "Affiche la fenêtre de messagerie électronique pour l'envoi du courrier électronique"
		DEFINE BAR _mfi_sp400 OF _mfile PROMPT "\-" 	PICTRES _mfi_sp400
		DEFINE BAR _mfi_quit OF _mfile PROMPT "Q\<uitter" 	KEY ALT+F4, "Alt+F4" 	PICTRES _mfi_quit 	MESSAGE "Quitte Visual FoxPro"
		DEFINE BAR _med_undo OF _medit PROMPT "\<Annuler" 	KEY CTRL+Z, "Ctrl+Z" 	PICTRES _med_undo 	MESSAGE "Annule la dernière modification"
		DEFINE BAR _med_redo OF _medit PROMPT "\<Rétablir" 	KEY CTRL+R, "Ctrl+R" 	PICTRES _med_redo 	MESSAGE "Rétablit la dernière opération annulée"
		DEFINE BAR _med_sp100 OF _medit PROMPT "\-" 	PICTRES _med_sp100
		DEFINE BAR _med_cut OF _medit PROMPT "\<Couper" 	KEY CTRL+X, "Ctrl+X" 	PICTRES _med_cut 	MESSAGE "Enlève la sélection et la place dans le Presse-papiers"
		DEFINE BAR _med_copy OF _medit PROMPT "Co\<pier" 	KEY CTRL+C, "Ctrl+C" 	PICTRES _med_copy	MESSAGE "Copie la sélection et la place dans le Presse-papiers"
		DEFINE BAR _med_paste OF _medit PROMPT "C\<oller" 	KEY CTRL+V, "Ctrl+V" 	PICTRES _med_paste 	MESSAGE "Place le contenu du Presse-papiers au point d'insertion"
		DEFINE BAR _med_pstlk OF _medit PROMPT "Co\<llage spécial..." 	PICTRES _med_pstlk 	MESSAGE "Colle le contenu du Presse-papiers en tant qu'objet lié, incorporé ou d'un autre type"
		DEFINE BAR _med_clear OF _medit PROMPT "E\<ffacer" 	PICTRES _med_clear 	MESSAGE "Enlève la sélection sans la copier dans le Presse-papiers"
		DEFINE BAR _med_sp200 OF _medit PROMPT "\-" 	PICTRES _med_sp200
		DEFINE BAR _med_slcta OF _medit PROMPT "Sélec\<tionner tout" 	KEY CTRL+A, "Ctrl+A" 	PICTRES _med_slcta 	MESSAGE "Sélectionne tout le texte ou tous les éléments de la fenêtre active"
		DEFINE BAR _med_sp300 OF _medit PROMPT "\-" 	PICTRES _med_sp300
		DEFINE BAR _med_find OF _medit PROMPT "Rec\<hercher..." 	KEY CTRL+F, "Ctrl+F"	PICTRES _med_find 	MESSAGE "Recherche le texte spécifié"
		DEFINE BAR _med_repl OF _medit PROMPT "\<Remplacer..." 	KEY CTRL+L, "Ctrl+L" 	PICTRES _med_repl 	MESSAGE "Remplace le texte spécifié"
		DEFINE BAR _med_sp400 OF _medit PROMPT "\-" 	PICTRES _med_sp400
		DEFINE BAR _med_listmembers OF _medit PROMPT "\<Liste des membres" 	KEY CTRL+ENTER, "Ctrl+J" 	PICTRES _med_listmembers MESSAGE "Répertorier les membres de l'objet sélectionné"
		DEFINE BAR _med_quickinfo OF _medit PROMPT "Info e\<xpress" 	KEY CTRL+I, "Ctrl+I" 	PICTRES _med_quickinfo 	MESSAGE "Informations rapides sur l'objet sélectionné"
		DEFINE BAR _med_sp500 OF _medit PROMPT "\-" 	PICTRES _med_sp500
		DEFINE BAR 18 OF _medit PROMPT "S\<ignets" 	PICTRES _mbk_togtask 	MESSAGE "Options de signet"
		DEFINE BAR 19 OF _medit PROMPT "\-"
		DEFINE BAR _med_insob OF _medit PROMPT "Insérer u\<n objet..." 	PICTRES _med_insob 	MESSAGE "Incorpore un objet dans un champ de type Général"
		DEFINE BAR _med_obj OF _medit PROMPT "O\<bjet..." 	PICTRES _med_obj 	MESSAGE "Modifie l'objet sélectionné"
		DEFINE BAR _med_link OF _medit PROMPT "L\<iaisons..." 	PICTRES _med_link 	MESSAGE "Ouvre les fichiers liés ou change les liens"
		DEFINE BAR 23 OF _medit PROMPT "\-"
		DEFINE BAR _med_pref OF _medit PROMPT "P\<ropriétés..." 	PICTRES _med_pref 	MESSAGE "Définit les propriétés de l'éditeur"
		DEFINE BAR _mbk_togtask OF _med_bkmks PROMPT "Basculer le \<raccourci de la liste des tâches" 	KEY ALT+F2, "Alt+F2" 	PICTRES _mbk_togtask 	MESSAGE "Ajoute un raccourci pour la ligne en cours"
		DEFINE BAR _mbk_togbkmk OF _med_bkmks PROMPT "\<Basculer le signet" 	KEY SHIFT+ALT+F2, "Alt+Maj+F2" 	PICTRES _mbk_togbkmk	MESSAGE "Bascule le signet pour la ligne en cours"
		DEFINE BAR _mbk_bkmknext OF _med_bkmks PROMPT "Raccourci/signet \<suivant" 	KEY F2, "F2"	PICTRES _mbk_bkmknext 	MESSAGE "Aller au signet ou raccourci suivant dans le fichier"
		DEFINE BAR _mbk_bkmkprev OF _med_bkmks PROMPT "\<Raccourci/signet précédent" 	KEY SHIFT+F2, "Maj+F2"	PICTRES _mbk_bkmkprev	MESSAGE "Aller au signet ou au raccourci précédent dans le fichier"
		DEFINE BAR _mvi_toolb OF _mview PROMPT "\<Barres d'outils..." 	PICTRES _mvi_toolb 	MESSAGE "Affiche, masque ou personnalise les barres d'outils"
		DEFINE BAR 1 OF _mtools PROMPT "\<Assistants" 	PICTRES _mtl_wzrds 	MESSAGE "Exécute l'assistant sélectionné"
		DEFINE BAR _mtl_sp100 OF _mtools PROMPT "\-" 	PICTRES _mtl_sp100
		DEFINE BAR _mst_macro OF _mtools PROMPT "Ma\<cros..." 	PICTRES _mst_macro 	MESSAGE "Crée, supprime ou modifie une macro clavier"
		DEFINE BAR _mtl_browser OF _mtools PROMPT "\<Explorateur de classes"	PICTRES _mtl_browser 	MESSAGE "Exécute l'Explorateur de classes"
		DEFINE BAR _mtl_gallery OF _mtools PROMPT "\<Component Gallery" 	PICTRES _mtl_gallery
		DEFINE BAR _mti_objectbrowser OF _mtools PROMPT "Explorateur d'ob\<jets" 	PICTRES _mti_objectbrowser 	MESSAGE "Explorer les objets OLE installés"
		DEFINE BAR _mti_foxcode OF _mtools PROMPT "\<Gestionnaire Intellisense" 	PICTRES _mti_foxcode 	MESSAGE "Exécute le Gestionnaire Intellisense"
		DEFINE BAR _mtl_taskpane OF _mtools PROMPT "\<Centre d'informations" 	PICTRES _mtl_taskpane 	MESSAGE "Affiche l'application Centre d'informations"
		DEFINE BAR _mtl_toolbox OF _mtools PROMPT "\<Boîte à outils" 	PICTRES _mtl_toolbox 	MESSAGE "Affiche la boîte à outils pour aider au développement d'applications"
		DEFINE BAR _mtl_sp200 OF _mtools PROMPT "\-" 	PICTRES _mtl_sp200
		DEFINE BAR _med_beaut OF _mtools PROMPT "\<Présenter..." 	PICTRES _med_beaut 	MESSAGE "Améliore la présentation d'un programme"
		DEFINE BAR _mti_tasklist OF _mtools PROMPT "\<Liste des tâches" 	PICTRES _mti_tasklist 	MESSAGE "Affiche la fenêtre Liste des tâches"
		DEFINE BAR _mti_docview OF _mtools PROMPT "Vue de \<document" 	PICTRES _mti_docview 	MESSAGE "Affiche la fenêtre de vue de document"
		DEFINE BAR _mtl_references OF _mtools PROMPT "Recherche da\<ns les sources"	PICTRES _mtl_references 	MESSAGE "Exécute l'application de recherche dans les sources"
		DEFINE BAR _mtl_sp300 OF _mtools PROMPT "\-" 	PICTRES _mtl_sp300
		DEFINE BAR _mtl_coverage OF _mtools PROMPT "\<Coverage Profiler" 	PICTRES _mtl_coverage 	MESSAGE "Exécute Coverage Profiler"
		DEFINE BAR _mti_breakpoint OF _mtools PROMPT "\<Points d'arrêt..." 	KEY CTRL+B, "Ctrl+B" 	PICTRES _mti_breakpoint	MESSAGE "Afficher la boîte de dialogue Points d'arrêt"
		DEFINE BAR _mtl_debugger OF _mtools PROMPT "\<Débogueur" 	PICTRES _mtl_debugger 	MESSAGE "Affiche le débogueur"
		DEFINE BAR _mtl_sp400 OF _mtools PROMPT "\-" 	PICTRES _mtl_sp400
		DEFINE BAR _mtl_optns OF _mtools PROMPT "\<Options..." 	PICTRES _mtl_optns 	MESSAGE "Modifie les diverses catégories des options de Visual FoxPro"
		DEFINE BAR _mwz_table OF _mwizards PROMPT "T\<able" 	PICTRES _mwz_table 	MESSAGE "Exécute l'Assistant Table"
		DEFINE BAR _mwz_query OF _mwizards PROMPT "\<Requête" 	PICTRES _mwz_query 	MESSAGE "Exécute les Assistants Requête, Analyse croisée, Graphique, Vue locale et distante"
		DEFINE BAR _mwz_form OF _mwizards PROMPT "\<Formulaire" 	PICTRES _mwz_form 	MESSAGE "Exécute les Assistants Formulaire et Formulaire un-à-plusieurs"
		DEFINE BAR _mwz_reprt OF _mwizards PROMPT "É\<tat" 	PICTRES _mwz_reprt 	MESSAGE "Exécute les Assistants État, État groupe/total et État un-à-plusieurs"
		DEFINE BAR _mwz_label OF _mwizards PROMPT "Étiqu\<ette" 	PICTRES _mwz_label 	MESSAGE "Exécute l'Assistant Étiquette"
		DEFINE BAR _mwz_mail OF _mwizards PROMPT "Fu\<sion et publipostage" 	PICTRES _mwz_mail 	MESSAGE "Exécute l'Assistant Fusion et publipostage"
		DEFINE BAR _mwz_pivot OF _mwizards PROMPT "Tableau croisé d\<ynamique" 	PICTRES _mwz_pivot	MESSAGE "Exécute l'Assistant Tableau croisé dynamique"
		DEFINE BAR _mwz_import OF _mwizards PROMPT "\<Importer" 	PICTRES _mwz_import	MESSAGE "Exécute l'Assistant Importation"
		DEFINE BAR _mwz_foxdoc OF _mwizards PROMPT "\<Documentation" 	PICTRES _mwz_foxdoc 	MESSAGE "Exécute l'Assistant Documentation"
		DEFINE BAR _mwz_upsizing OF _mwizards PROMPT "\<Upsizing" 	PICTRES _mwz_upsizing 	MESSAGE "Exécute l'Assistant Upsizing"
		DEFINE BAR _mwz_application OF _mwizards PROMPT "App\<lication" 	PICTRES _mwz_application 	MESSAGE "Exécute l'Assistant Application"
		DEFINE BAR _mwz_database OF _mwizards PROMPT "\<Base de données" 	PICTRES _mwz_database 	MESSAGE "Exécute l'Assistant Base de données"
		DEFINE BAR _mwz_webpublishing OF _mwizards PROMPT "Publication sur le \<Web"	PICTRES _mwz_webpublishing 	MESSAGE "Exécute l'Assistant Publication sur le Web"
		DEFINE BAR _mwz_webservices OF _mwizards PROMPT "\<Services Web" 	PICTRES _mwz_webservices 	MESSAGE "Exécute l'Assistant Services Web"
		DEFINE BAR _mwz_all OF _mwizards PROMPT "T\<ous les Assistants..." 	PICTRES _mwz_all	MESSAGE "Affiche la liste de tous les assistants"
		DEFINE BAR _mpr_do OF _mprog PROMPT "\<Exécuter..." 	KEY CTRL+D, "Ctrl+D" 	PICTRES _mpr_do 	MESSAGE "Exécute un programme, une application, un formulaire, un état, une requête ou un menu"
		DEFINE BAR _mpr_cancl OF _mprog PROMPT "\<Annuler" 	PICTRES _mpr_cancl 	MESSAGE "Arrête l'exécution d'un programme en cours"
		DEFINE BAR _mpr_resum OF _mprog PROMPT "\<Reprendre" 	KEY CTRL+M, "Ctrl+M" 	PICTRES _mpr_resum 	MESSAGE "Reprend l'exécution du programme actuellement interrompu"
		DEFINE BAR _mpr_suspend OF _mprog PROMPT "\<Suspendre" 	PICTRES _mpr_suspend 	MESSAGE "Suspend le programme en cours d'exécution"
		DEFINE BAR _mpr_sp100 OF _mprog PROMPT "\-" 	PICTRES _mpr_sp100
		DEFINE BAR _mpr_compl OF _mprog PROMPT "\<Compiler..." 	PICTRES _mpr_compl 	MESSAGE "Compile le programme en cours ou le programme sélectionné"
		DEFINE BAR _mwi_cascade OF _mwindow PROMPT "Casca\<de" 	PICTRES _mwi_cascade 	MESSAGE "Réorganise les fenêtres en cascade"
		DEFINE BAR _mwi_arran OF _mwindow PROMPT "\<Réorganiser" 	PICTRES _mwi_arran 	MESSAGE "Réorganise les fenêtres en mosaïque"
		DEFINE BAR _mwi_sp100 OF _mwindow PROMPT "\-" 	PICTRES _mwi_sp100
		DEFINE BAR _mwi_dockable OF _mwindow PROMPT "A\<ncrable" 	PICTRES _mwi_dockable	MESSAGE "Activer l'ancrage de cette fenêtre"
		DEFINE BAR _mwi_hide OF _mwindow PROMPT "\<Masquer la fenêtre" 	PICTRES _mwi_hide 	MESSAGE "Masque la fenêtre active"
		DEFINE BAR _mwi_hidea OF _mwindow PROMPT "Masquer tout" 	PICTRES _mwi_hidea	MESSAGE "Masque toutes les fenêtres"
		DEFINE BAR _mwi_showa OF _mwindow PROMPT "\<Afficher tout" 	PICTRES _mwi_showa 	MESSAGE "Affiche toutes les fenêtres masquées"
		DEFINE BAR _mwi_sp200 OF _mwindow PROMPT "\-" 	PICTRES _mwi_sp200
		DEFINE BAR _mwi_clear OF _mwindow PROMPT "\<Effacer" 	PICTRES _mwi_clear 	MESSAGE "Efface le texte de l'espace de travail ou de la fenêtre de résultats active"
		DEFINE BAR _mwi_rotat OF _mwindow PROMPT "\<Fenêtre suivante"	KEY CTRL+F1, "Ctrl+F1"	PICTRES _mwi_rotat	MESSAGE "Passe dans toutes les fenêtres ouvertes"
		DEFINE BAR _mwi_sp200 OF _mwindow PROMPT "\-" 	PICTRES _mwi_sp200
		DEFINE BAR _mwi_cmd OF _mwindow PROMPT "\<Fenêtre Commande" 	KEY CTRL+F2, "Ctrl+F2" 	PICTRES _mwi_cmd 	MESSAGE "Affiche la fenêtre Commande"
		DEFINE BAR _mwi_view OF _mwindow PROMPT "Session de do\<nnées" 	PICTRES _mwi_view DEFINE BAR _mwi_properties OF _mwindow PROMPT "\<Fenêtre Propriétés"	PICTRES _mwi_properties	MESSAGE "Afficher la fenêtre Propriétés"
		DEFINE BAR _mst_hpsch OF _msystem PROMPT "Aide de Microsoft \<Visual FoxPro" 	KEY F1, "F1" 	PICTRES _mst_hpsch 	MESSAGE "Recherche les rubriques d'aide sur la base des mots clés entrés"
		DEFINE BAR _mst_msdns OF _msystem PROMPT "\<Recherche MSDN" 	PICTRES _mst_msdns 	MESSAGE "Donne accès à l'onglet Search de MSDN."
		DEFINE BAR _mst_sp100 OF _msystem PROMPT "\-" 	PICTRES _mst_sp100
		DEFINE BAR _mst_techs OF _msystem PROMPT "Support \<technique" 	PICTRES _mst_techs 	MESSAGE "Fournit des informations sur la manière d'obtenir une aide technique supplémentaire"
		DEFINE BAR _mst_vfpweb OF _msystem PROMPT "Visual FoxPro sur le \<Web" 	PICTRES _mst_vfpweb	MESSAGE "Lance votre navigateur Internet pour aller sur les sites Web Visual FoxPro"
		DEFINE BAR _mst_sp300 OF _msystem PROMPT "\-" 	PICTRES _mst_sp300
		DEFINE BAR _mst_about OF _msystem PROMPT "À \<propos de Microsoft Visual FoxPro..." 	PICTRES _mst_about 	MESSAGE "Affiche la version et les informations de copyright de Visual FoxPro"
	ENDTEXT
	Create Cursor ycurs (xitem c(15),xcommand m)

	Local m.x1,m.x2
	For i=1 To Memlines(m.myvar)
		m.x1=Strextract(Mline(m.myvar,i),"DEFINE BAR","OF",1)
		m.x2=Allt(Mline(m.myvar,i))
		Insert Into ycurs Values(m.x1 ,m.x2 )
	Endfor
*brow
	Endproc

	Procedure Destroy
	Use In Select("ycurs")
	Clea Events
	Endproc

	Procedure grid1.Init
	With This
		.RecordSource="ycurs"
		.RecordSourceType=1
		.GridLines=0
		.DeleteMark=.F.
		.column2.Visible=.F.
		.MousePointer=15
		Locate
		.Refresh
		Bindevent(.column1.text1,"mousedown",Thisform,"my")
	Endwith
	Endproc

	Procedure edit1.RightClick
	Define Popup raccourci SHORTCUT Relative From Mrow(),Mcol()
	Define Bar _Med_slcta Of raccourci Prompt "Sélectionner tout" ;
		KEY CTRL+A, "Ctrl+A" ;
		PICTRES _Med_slcta ;
		MESSAGE "Sélectionne tout le texte ou tous les éléments de la fenêtre active"
	Define Bar _Med_copy Of raccourci Prompt "Copier" ;
		KEY CTRL+c, "Ctrl+C" ;
		PICTRES _Med_copy ;
		MESSAGE "Copie la sélection et la place dans le Presse-papiers"
	Activate Popup raccourci
	Endproc

Enddefine
*
*-- EndDefine: ybars


working with vfp native menus
working with vfp native menus
working with vfp native menus

Click on code to select [then copy] -click outside to deselect


*2* created on sunday 15 of april 2018
*create vfp menu on a top level form not with an external  mpr file but with a simple procedure inside the form.
*this method is insensible of modifications being operated on the mnx menu( in a project if you embed an mpr the proj asks always where is mnx and any modification in the menu is translated to mpr file).here its a procedure /method internal in the form and more light than a menu mnx,mpr,mpx...
*note can also stay mpr file as external (not included in project).
*of course each menu & menu bar must in its context(if not its disabled by vfp on the menu itself).
*this code creates also with the method citec in code *1* a shortcut big menu (bar commands pre composed and copied only).

If !_vfp.StartMode=0
	On Shutdown Quit
Endi


Public oform
oform=Newobject("ySmenus")
oform.Show
Read Events
Return
*
Define Class ySmenus As Form
	Height = 487
	Width = 755
	ShowWindow = 2
	AutoCenter = .T.
	Caption = "Embed menu on top level form without mpr file.all is inisde the form code."
	Name = "form1"

	Add Object edit1 As EditBox With ;
		Anchor = 15, ;
		Height = 429, ;
		Left = 10, ;
		Top = 42, ;
		Width = 733, ;
		Name = "Edit1"

	Add Object label1 As Label With ;
		AutoSize = .T., ;
		Anchor = 0, ;
		Caption = "Code only the available menu or disable the non available ones. Can rightclcik on editbox to fire the shortcut menu", ;
		Height = 17, ;
		Left = 44, ;
		Top = 11, ;
		Width = 623, ;
		Name = "Label1"

	Procedure ymenu
*this is the mpr generated by the menu designer for a top level form( mandatory)
*instead of running the mrp file with parameters its rub locally on a procedure with same parameters

	Lparameters oFormRef, getMenuName, lUniquePopups, parm4, parm5, parm6, parm7, parm8, parm9
	Local cMenuName, nTotPops, a_menupops, cTypeParm2, cSaveFormName
	If Type("m.oFormRef") # "O" Or ;
			LOWER(m.oFormRef.BaseClass) # 'form' Or ;
			M.oFormRef.ShowWindow # 2
		Messagebox([This menu can only be called from a Top-Level form. Ensure that your form's ShowWindow property is set to 2. Read the header section of the menu's MPR file for more details.])
		Return
	Endif
	m.cTypeParm2 = Type("m.getMenuName")
	m.cMenuName = Sys(2015)
	m.cSaveFormName = m.oFormRef.Name
	If m.cTypeParm2 = "C" Or (m.cTypeParm2 = "L" And m.getMenuName)
		m.oFormRef.Name = m.cMenuName
	Endif
	If m.cTypeParm2 = "C" And !Empty(m.getMenuName)
		m.cMenuName = m.getMenuName
	Endif
	Dimension a_menupops[9]
	If Type("m.lUniquePopups")="L" And m.lUniquePopups
		For nTotPops = 1 To Alen(a_menupops)
			a_menupops[m.nTotPops]= Sys(2015)
		Endfor
	Else
		a_menupops[1]="_mfile"
		a_menupops[2]="_medit"
		a_menupops[3]="_med_bkmks"
		a_menupops[4]="_mview"
		a_menupops[5]="_mtools"
		a_menupops[6]="_mwizards"
		a_menupops[7]="_mprog"
		a_menupops[8]="_mwindow"
		a_menupops[9]="_msystem"
	Endif

      **** Menu Definition ************

	Define Menu (m.cMenuName) In (m.oFormRef.Name) Bar  At Line 0    &&works only for defaut line 0 (if >=1 menu dont work  !! bug ?)

	Define Pad _Msm_file Of (m.cMenuName) Prompt "\<Fichier" Color Scheme 3 ;
		NEGOTIATE  Left, None ;
		KEY Alt+F, "" ;
		MESSAGE "Crée, ouvre, enregistre et imprime des fichiers ou quitte Visual FoxPro"
	Define Pad _Msm_edit Of (m.cMenuName) Prompt "\<Editer" Color Scheme 3 ;
		NEGOTIATE  None, Left ;
		KEY Alt+E, "" ;
		MESSAGE "Modifie le texte ou la sélection active"
	Define Pad _Msm_view Of (m.cMenuName) Prompt "Affi\<chage" Color Scheme 3 ;
		NEGOTIATE  None, Left ;
		KEY Alt+C, "" ;
		MESSAGE "Change les options d'affichage"
	Define Pad _Msm_tools Of (m.cMenuName) Prompt "O\<utils" Color Scheme 3 ;
		NEGOTIATE  None, Left ;
		KEY Alt+U, "" ;
		MESSAGE "Définit les options, exécute les Assistants et les autres outils"
	Define Pad _Msm_prog Of (m.cMenuName) Prompt "\<Programme" Color Scheme 3 ;
		NEGOTIATE  Middle, Left ;
		KEY Alt+P, "" ;
		MESSAGE "Exécute, débogue, compile et suspend l'exécution des programmes"
	Define Pad _Msm_windo Of (m.cMenuName) Prompt "Fe\<nêtre" Color Scheme 3 ;
		NEGOTIATE  Right, Left ;
		KEY Alt+N, "" ;
		MESSAGE "Manipule les fenêtres, affiche les fenêtres Commande et Session de données"
	Define Pad _Msm_systm Of (m.cMenuName) Prompt "\<?" Color Scheme 3 ;
		NEGOTIATE  None, Right ;
		KEY Shift+Alt+?, "" ;
		MESSAGE "Affiche l'aide de Visual FoxPro"
	On Pad _Msm_file Of (m.cMenuName) Activate Popup (a_menupops[1])
	On Pad _Msm_edit Of (m.cMenuName) Activate Popup (a_menupops[2])
	On Pad _Msm_view Of (m.cMenuName) Activate Popup (a_menupops[4])
	On Pad _Msm_tools Of (m.cMenuName) Activate Popup (a_menupops[5])
	On Pad _Msm_prog Of (m.cMenuName) Activate Popup (a_menupops[7])
	On Pad _Msm_windo Of (m.cMenuName) Activate Popup (a_menupops[8])
	On Pad _Msm_systm Of (m.cMenuName) Activate Popup (a_menupops[9])

	Define Popup (a_menupops[1]) Margin Relative Shadow Color Scheme 4
	Define Bar _Mfi_new Of (a_menupops[1]) Prompt "\<Nouveau..." ;
		KEY CTRL+N, "Ctrl+N" ;
		PICTRES _Mfi_new ;
		MESSAGE "Crée un fichier"
	Define Bar _Mfi_open Of (a_menupops[1]) Prompt "\<Ouvrir..." ;
		KEY CTRL+O, "Ctrl+O" ;
		PICTRES _Mfi_open ;
		MESSAGE "Ouvre un fichier existant"
	Define Bar _Mfi_close Of (a_menupops[1]) Prompt "\<Fermer" ;
		KEY CTRL+F4, "Ctrl+F4" ;
		PICTRES _Mfi_close ;
		MESSAGE "Ferme le fichier en cours"
	Define Bar _Mfi_clall Of (a_menupops[1]) Prompt "Fermer tout" ;
		PICTRES _Mfi_clall ;
		MESSAGE "Ferme toutes les fenêtres"
	Define Bar _Mfi_sp100 Of (a_menupops[1]) Prompt "\-" ;
		PICTRES _Mfi_sp100
	Define Bar _Mfi_save Of (a_menupops[1]) Prompt "\<Enregistrer" ;
		KEY CTRL+S, "Ctrl+S" ;
		PICTRES _Mfi_save ;
		MESSAGE "Enregistre le fichier en cours"
	Define Bar _Mfi_savas Of (a_menupops[1]) Prompt "En\<registrer sous..." ;
		PICTRES _Mfi_savas ;
		MESSAGE "Enregistre le fichier en cours sous un nouveau nom"
	Define Bar _mfi_saveashtml Of (a_menupops[1]) Prompt "Enregistrer au format \<HTML..." ;
		PICTRES _mfi_saveashtml ;
		MESSAGE "Enregistre le fichier en cours en HTML"
	Define Bar _Mfi_revrt Of (a_menupops[1]) Prompt "\<Annuler" ;
		PICTRES _Mfi_revrt ;
		MESSAGE "Annule les modifications en cours"
	Define Bar _Mfi_sp200 Of (a_menupops[1]) Prompt "\-" ;
		PICTRES _Mfi_sp200
	Define Bar _Mfi_import Of (a_menupops[1]) Prompt "Im\<porter..." ;
		PICTRES _Mfi_import ;
		MESSAGE "Importe un fichier Visual FoxPro ou un fichier d'une autre application"
	Define Bar _Mfi_export Of (a_menupops[1]) Prompt "E\<xporter..." ;
		PICTRES _Mfi_export ;
		MESSAGE "Exporte un fichier Visual FoxPro dans un fichier d'une autre application"
	Define Bar _Mfi_sp300 Of (a_menupops[1]) Prompt "\-" ;
		PICTRES _Mfi_sp300
	Define Bar _Mfi_pgset Of (a_menupops[1]) Prompt "\<Mise en page..." ;
		PICTRES _Mfi_pgset ;
		MESSAGE "Modifie la mise en page et les options d'impression"
	Define Bar _Mfi_prevu Of (a_menupops[1]) Prompt "Aperçu a\<vant impression" ;
		PICTRES _Mfi_prevu ;
		MESSAGE "Affiche les pages telles qu'elles seront imprimées"
	Define Bar _mfi_sysprint Of (a_menupops[1]) Prompt "\<Imprimer..." ;
		KEY CTRL+P, "Ctrl+P" ;
		PICTRES _mfi_sysprint ;
		MESSAGE "Imprime un fichier texte, un état, une étiquette ou le contenu de la fenêtre Commande ou du Presse-papiers"
	Define Bar _Mfi_send Of (a_menupops[1]) Prompt "Envo\<yer..." ;
		PICTRES _Mfi_send ;
		MESSAGE "Affiche la fenêtre de messagerie électronique pour l'envoi du courrier électronique"
	Define Bar _Mfi_sp400 Of (a_menupops[1]) Prompt "\-" ;
		PICTRES _Mfi_sp400
	Define Bar _Mfi_quit Of (a_menupops[1]) Prompt "Q\<uitter" ;
		KEY Alt+F4, "Alt+F4" ;
		PICTRES _Mfi_quit ;
		MESSAGE "Quitte Visual FoxPro"

	Define Popup (a_menupops[2]) Margin Relative Shadow Color Scheme 4
	Define Bar _Med_undo Of (a_menupops[2]) Prompt "\<Annuler" ;
		KEY CTRL+Z, "Ctrl+Z" ;
		PICTRES _Med_undo ;
		MESSAGE "Annule la dernière modification"
	Define Bar _Med_redo Of (a_menupops[2]) Prompt "\<Rétablir" ;
		KEY CTRL+R, "Ctrl+R" ;
		PICTRES _Med_redo ;
		MESSAGE "Rétablit la dernière opération annulée"
	Define Bar _Med_sp100 Of (a_menupops[2]) Prompt "\-" ;
		PICTRES _Med_sp100
	Define Bar _Med_cut Of (a_menupops[2]) Prompt "\<Couper" ;
		KEY CTRL+X, "Ctrl+X" ;
		PICTRES _Med_cut ;
		MESSAGE "Enlève la sélection et la place dans le Presse-papiers"
	Define Bar _Med_copy Of (a_menupops[2]) Prompt "Co\<pier" ;
		KEY CTRL+C, "Ctrl+C" ;
		PICTRES _Med_copy ;
		MESSAGE "Copie la sélection et la place dans le Presse-papiers"
	Define Bar _Med_paste Of (a_menupops[2]) Prompt "C\<oller" ;
		KEY CTRL+V, "Ctrl+V" ;
		PICTRES _Med_paste ;
		MESSAGE "Place le contenu du Presse-papiers au point d'insertion"
	Define Bar _Med_pstlk Of (a_menupops[2]) Prompt "Co\<llage spécial..." ;
		PICTRES _Med_pstlk ;
		MESSAGE "Colle le contenu du Presse-papiers en tant qu'objet lié, incorporé ou d'un autre type"
	Define Bar _Med_clear Of (a_menupops[2]) Prompt "E\<ffacer" ;
		PICTRES _Med_clear ;
		MESSAGE "Enlève la sélection sans la copier dans le Presse-papiers"
	Define Bar _Med_sp200 Of (a_menupops[2]) Prompt "\-" ;
		PICTRES _Med_sp200
	Define Bar _Med_slcta Of (a_menupops[2]) Prompt "Sélec\<tionner tout" ;
		KEY CTRL+A, "Ctrl+A" ;
		PICTRES _Med_slcta ;
		MESSAGE "Sélectionne tout le texte ou tous les éléments de la fenêtre active"
	Define Bar _Med_sp300 Of (a_menupops[2]) Prompt "\-" ;
		PICTRES _Med_sp300
	Define Bar _Med_find Of (a_menupops[2]) Prompt "Rec\<hercher..." ;
		KEY CTRL+F, "Ctrl+F" ;
		PICTRES _Med_find ;
		MESSAGE "Recherche le texte spécifié"
	Define Bar _Med_repl Of (a_menupops[2]) Prompt "\<Remplacer..." ;
		KEY CTRL+L, "Ctrl+L" ;
		PICTRES _Med_repl ;
		MESSAGE "Remplace le texte spécifié"
	Define Bar _Med_sp400 Of (a_menupops[2]) Prompt "\-" ;
		PICTRES _Med_sp400
	Define Bar _med_listmembers Of (a_menupops[2]) Prompt "\<Liste des membres" ;
		KEY CTRL+Enter, "Ctrl+J" ;
		PICTRES _med_listmembers ;
		MESSAGE "Répertorier les membres de l'objet sélectionné"
	Define Bar _med_quickinfo Of (a_menupops[2]) Prompt "Info e\<xpress" ;
		KEY CTRL+I, "Ctrl+I" ;
		PICTRES _med_quickinfo ;
		MESSAGE "Informations rapides sur l'objet sélectionné"
	Define Bar _Med_sp500 Of (a_menupops[2]) Prompt "\-" ;
		PICTRES _Med_sp500
	Define Bar 18 Of (a_menupops[2]) Prompt "S\<ignets" ;
		PICTRES _mbk_togtask ;
		MESSAGE "Options de signet"
	Define Bar 19 Of (a_menupops[2]) Prompt "\-"
	Define Bar _Med_insob Of (a_menupops[2]) Prompt "Insérer u\<n objet..." ;
		PICTRES _Med_insob ;
		MESSAGE "Incorpore un objet dans un champ de type Général"
	Define Bar _Med_obj Of (a_menupops[2]) Prompt "O\<bjet..." ;
		PICTRES _Med_obj ;
		MESSAGE "Modifie l'objet sélectionné"
	Define Bar _Med_link Of (a_menupops[2]) Prompt "L\<iaisons..." ;
		PICTRES _Med_link ;
		MESSAGE "Ouvre les fichiers liés ou change les liens"
	Define Bar 23 Of (a_menupops[2]) Prompt "\-"
	Define Bar _Med_pref Of (a_menupops[2]) Prompt "P\<ropriétés..." ;
		PICTRES _Med_pref ;
		MESSAGE "Définit les propriétés de l'éditeur"
	On Bar 18 Of (a_menupops[2]) Activate Popup (a_menupops[3])

	Define Popup (a_menupops[3]) Margin Relative Shadow Color Scheme 4
	Define Bar _mbk_togtask Of (a_menupops[3]) Prompt "Basculer le \<raccourci de la liste des tâches" ;
		KEY Alt+F2, "Alt+F2" ;
		PICTRES _mbk_togtask ;
		MESSAGE "Ajoute un raccourci pour la ligne en cours"
	Define Bar _mbk_togbkmk Of (a_menupops[3]) Prompt "\<Basculer le signet" ;
		KEY Shift+Alt+F2, "Alt+Maj+F2" ;
		PICTRES _mbk_togbkmk ;
		MESSAGE "Bascule le signet pour la ligne en cours"
	Define Bar _mbk_bkmknext Of (a_menupops[3]) Prompt "Raccourci/signet \<suivant" ;
		KEY F2, "F2" ;
		PICTRES _mbk_bkmknext ;
		MESSAGE "Aller au signet ou raccourci suivant dans le fichier"
	Define Bar _mbk_bkmkprev Of (a_menupops[3]) Prompt "\<Raccourci/signet précédent" ;
		KEY Shift+F2, "Maj+F2" ;
		PICTRES _mbk_bkmkprev ;
		MESSAGE "Aller au signet ou au raccourci précédent dans le fichier"

	Define Popup (a_menupops[4]) Margin Relative Shadow Color Scheme 4
	Define Bar _mvi_toolb Of (a_menupops[4]) Prompt "\<Barres d'outils..." ;
		PICTRES _mvi_toolb ;
		MESSAGE "Affiche, masque ou personnalise les barres d'outils"

	Define Popup (a_menupops[5]) Margin Relative Shadow Color Scheme 4
	Define Bar 1 Of (a_menupops[5]) Prompt "\<Assistants" ;
		PICTRES _mtl_wzrds ;
		MESSAGE "Exécute l'assistant sélectionné"
	Define Bar _mtl_sp100 Of (a_menupops[5]) Prompt "\-" ;
		PICTRES _mtl_sp100
	Define Bar _Mst_macro Of (a_menupops[5]) Prompt "Ma\<cros..." ;
		PICTRES _Mst_macro ;
		MESSAGE "Crée, supprime ou modifie une macro clavier"
	Define Bar _mtl_browser Of (a_menupops[5]) Prompt "\<Explorateur de classes" ;
		PICTRES _mtl_browser ;
		MESSAGE "Exécute l'Explorateur de classes"
	Define Bar _mtl_gallery Of (a_menupops[5]) Prompt "\<Component Gallery" ;
		PICTRES _mtl_gallery ;
		MESSAGE "Exécute Component Gallery"
	Define Bar _mti_objectbrowser Of (a_menupops[5]) Prompt "Explorateur d'ob\<jets" ;
		PICTRES _mti_objectbrowser ;
		MESSAGE "Explorer les objets OLE installés"
	Define Bar _mti_foxcode Of (a_menupops[5]) Prompt "\<Gestionnaire Intellisense" ;
		PICTRES _mti_foxcode ;
		MESSAGE "Exécute le Gestionnaire Intellisense"
	Define Bar _mtl_taskpane Of (a_menupops[5]) Prompt "\<Centre d'informations" ;
		PICTRES _mtl_taskpane ;
		MESSAGE "Affiche l'application Centre d'informations"
	Define Bar _mtl_toolbox Of (a_menupops[5]) Prompt "\<Boîte à outils" ;
		PICTRES _mtl_toolbox ;
		MESSAGE "Affiche la boîte à outils pour aider au développement d'applications"
	Define Bar _mtl_sp200 Of (a_menupops[5]) Prompt "\-" ;
		PICTRES _mtl_sp200
	Define Bar _med_beaut Of (a_menupops[5]) Prompt "\<Présenter..." ;
		PICTRES _med_beaut ;
		MESSAGE "Améliore la présentation d'un programme"
	Define Bar _mti_tasklist Of (a_menupops[5]) Prompt "\<Liste des tâches" ;
		PICTRES _mti_tasklist ;
		MESSAGE "Affiche la fenêtre Liste des tâches"
	Define Bar _mti_docview Of (a_menupops[5]) Prompt "Vue de \<document" ;
		PICTRES _mti_docview ;
		MESSAGE "Affiche la fenêtre de vue de document"
	Define Bar _mtl_references Of (a_menupops[5]) Prompt "Recherche da\<ns les sources" ;
		PICTRES _mtl_references ;
		MESSAGE "Exécute l'application de recherche dans les sources"
	Define Bar _mtl_sp300 Of (a_menupops[5]) Prompt "\-" ;
		PICTRES _mtl_sp300
	Define Bar _mtl_coverage Of (a_menupops[5]) Prompt "\<Coverage Profiler" ;
		PICTRES _mtl_coverage ;
		MESSAGE "Exécute Coverage Profiler"
	Define Bar _mti_breakpoint Of (a_menupops[5]) Prompt "\<Points d'arrêt..." ;
		KEY CTRL+B, "Ctrl+B" ;
		PICTRES _mti_breakpoint ;
		MESSAGE "Afficher la boîte de dialogue Points d'arrêt"
	Define Bar _mtl_debugger Of (a_menupops[5]) Prompt "\<Débogueur" ;
		PICTRES _mtl_debugger ;
		MESSAGE "Affiche le débogueur"
	Define Bar _mtl_sp400 Of (a_menupops[5]) Prompt "\-" ;
		PICTRES _mtl_sp400
	Define Bar _mtl_optns Of (a_menupops[5]) Prompt "\<Options..." ;
		PICTRES _mtl_optns ;
		MESSAGE "Modifie les diverses catégories des options de Visual FoxPro"
	On Bar 1 Of (a_menupops[5]) Activate Popup (a_menupops[6])

	Define Popup (a_menupops[6]) Margin Relative Shadow Color Scheme 4
	Define Bar _Mwz_table Of (a_menupops[6]) Prompt "T\<able" ;
		PICTRES _Mwz_table ;
		MESSAGE "Exécute l'Assistant Table"
	Define Bar _Mwz_query Of (a_menupops[6]) Prompt "\<Requête" ;
		PICTRES _Mwz_query ;
		MESSAGE "Exécute les Assistants Requête, Analyse croisée, Graphique, Vue locale et distante"
	Define Bar _Mwz_form Of (a_menupops[6]) Prompt "\<Formulaire" ;
		PICTRES _Mwz_form ;
		MESSAGE "Exécute les Assistants Formulaire et Formulaire un-à-plusieurs"
	Define Bar _Mwz_reprt Of (a_menupops[6]) Prompt "É\<tat" ;
		PICTRES _Mwz_reprt ;
		MESSAGE "Exécute les Assistants État, État groupe/total et État un-à-plusieurs"
	Define Bar _Mwz_label Of (a_menupops[6]) Prompt "Étiqu\<ette" ;
		PICTRES _Mwz_label ;
		MESSAGE "Exécute l'Assistant Étiquette"
	Define Bar _Mwz_mail Of (a_menupops[6]) Prompt "Fu\<sion et publipostage" ;
		PICTRES _Mwz_mail ;
		MESSAGE "Exécute l'Assistant Fusion et publipostage"
	Define Bar _Mwz_pivot Of (a_menupops[6]) Prompt "Tableau croisé d\<ynamique" ;
		PICTRES _Mwz_pivot ;
		MESSAGE "Exécute l'Assistant Tableau croisé dynamique"
	Define Bar _Mwz_import Of (a_menupops[6]) Prompt "\<Importer" ;
		PICTRES _Mwz_import ;
		MESSAGE "Exécute l'Assistant Importation"
	Define Bar _Mwz_foxdoc Of (a_menupops[6]) Prompt "\<Documentation" ;
		PICTRES _Mwz_foxdoc ;
		MESSAGE "Exécute l'Assistant Documentation"
	Define Bar _Mwz_upsizing Of (a_menupops[6]) Prompt "\<Upsizing" ;
		PICTRES _Mwz_upsizing ;
		MESSAGE "Exécute l'Assistant Upsizing"
	Define Bar _mwz_application Of (a_menupops[6]) Prompt "App\<lication" ;
		PICTRES _mwz_application ;
		MESSAGE "Exécute l'Assistant Application"
	Define Bar _mwz_database Of (a_menupops[6]) Prompt "\<Base de données" ;
		PICTRES _mwz_database ;
		MESSAGE "Exécute l'Assistant Base de données"
	Define Bar _mwz_webpublishing Of (a_menupops[6]) Prompt "Publication sur le \<Web" ;
		PICTRES _mwz_webpublishing ;
		MESSAGE "Exécute l'Assistant Publication sur le Web"
	Define Bar _mwz_webservices Of (a_menupops[6]) Prompt "\<Services Web" ;
		PICTRES _mwz_webservices ;
		MESSAGE "Exécute l'Assistant Services Web"
	Define Bar _Mwz_all Of (a_menupops[6]) Prompt "T\<ous les Assistants..." ;
		PICTRES _Mwz_all ;
		MESSAGE "Affiche la liste de tous les assistants"

	Define Popup (a_menupops[7]) Margin Relative Shadow Color Scheme 4
	Define Bar _Mpr_do Of (a_menupops[7]) Prompt "\<Exécuter..." ;
		KEY CTRL+D, "Ctrl+D" ;
		PICTRES _Mpr_do ;
		MESSAGE "Exécute un programme, une application, un formulaire, un état, une requête ou un menu"
	Define Bar _Mpr_cancl Of (a_menupops[7]) Prompt "\<Annuler" ;
		PICTRES _Mpr_cancl ;
		MESSAGE "Arrête l'exécution d'un programme en cours"
	Define Bar _Mpr_resum Of (a_menupops[7]) Prompt "\<Reprendre" ;
		KEY CTRL+M, "Ctrl+M" ;
		PICTRES _Mpr_resum ;
		MESSAGE "Reprend l'exécution du programme actuellement interrompu"
	Define Bar _Mpr_suspend Of (a_menupops[7]) Prompt "\<Suspendre" ;
		PICTRES _Mpr_suspend ;
		MESSAGE "Suspend le programme en cours d'exécution"
	Define Bar _Mpr_sp100 Of (a_menupops[7]) Prompt "\-" ;
		PICTRES _Mpr_sp100
	Define Bar _Mpr_compl Of (a_menupops[7]) Prompt "\<Compiler..." ;
		PICTRES _Mpr_compl ;
		MESSAGE "Compile le programme en cours ou le programme sélectionné"

	Define Popup (a_menupops[8]) Margin Relative Shadow Color Scheme 4
	Define Bar _mwi_cascade Of (a_menupops[8]) Prompt "Casca\<de" ;
		PICTRES _mwi_cascade ;
		MESSAGE "Réorganise les fenêtres en cascade"
	Define Bar _Mwi_arran Of (a_menupops[8]) Prompt "\<Réorganiser" ;
		PICTRES _Mwi_arran ;
		MESSAGE "Réorganise les fenêtres en mosaïque"
	Define Bar _Mwi_sp100 Of (a_menupops[8]) Prompt "\-" ;
		PICTRES _Mwi_sp100
	Define Bar _mwi_dockable Of (a_menupops[8]) Prompt "A\<ncrable" ;
		PICTRES _mwi_dockable ;
		MESSAGE "Activer l'ancrage de cette fenêtre"
	Define Bar _Mwi_hide Of (a_menupops[8]) Prompt "\<Masquer la fenêtre" ;
		PICTRES _Mwi_hide ;
		MESSAGE "Masque la fenêtre active"
	Define Bar _Mwi_hidea Of (a_menupops[8]) Prompt "Masquer tout" ;
		PICTRES _Mwi_hidea ;
		MESSAGE "Masque toutes les fenêtres"
	Define Bar _Mwi_showa Of (a_menupops[8]) Prompt "\<Afficher tout" ;
		PICTRES _Mwi_showa ;
		MESSAGE "Affiche toutes les fenêtres masquées"
	Define Bar _Mwi_sp200 Of (a_menupops[8]) Prompt "\-" ;
		PICTRES _Mwi_sp200
	Define Bar _Mwi_clear Of (a_menupops[8]) Prompt "\<Effacer" ;
		PICTRES _Mwi_clear ;
		MESSAGE "Efface le texte de l'espace de travail ou de la fenêtre de résultats active"
	Define Bar _Mwi_rotat Of (a_menupops[8]) Prompt "\<Fenêtre suivante" ;
		KEY CTRL+F1, "Ctrl+F1" ;
		PICTRES _Mwi_rotat ;
		MESSAGE "Passe dans toutes les fenêtres ouvertes"
	Define Bar _Mwi_sp200 Of (a_menupops[8]) Prompt "\-" ;
		PICTRES _Mwi_sp200
	Define Bar _Mwi_cmd Of (a_menupops[8]) Prompt "\<Fenêtre Commande" ;
		KEY CTRL+F2, "Ctrl+F2" ;
		PICTRES _Mwi_cmd ;
		MESSAGE "Affiche la fenêtre Commande"
	Define Bar _Mwi_view Of (a_menupops[8]) Prompt "Session de do\<nnées" ;
		PICTRES _Mwi_view ;
		MESSAGE "Affiche la fenêtre Session de données"
	Define Bar _mwi_properties Of (a_menupops[8]) Prompt "\<Fenêtre Propriétés" ;
		PICTRES _mwi_properties ;
		MESSAGE "Afficher la fenêtre Propriétés"

	Define Popup (a_menupops[9]) Margin Relative Shadow Color Scheme 4
	Define Bar _Mst_hpsch Of (a_menupops[9]) Prompt "Aide de Microsoft \<Visual FoxPro" ;
		KEY F1, "F1" ;
		PICTRES _Mst_hpsch ;
		MESSAGE "Recherche les rubriques d'aide sur la base des mots clés entrés"
	Define Bar _mst_msdns Of (a_menupops[9]) Prompt "\<Recherche MSDN" ;
		PICTRES _mst_msdns ;
		MESSAGE "Donne accès à l'onglet Search de MSDN."
	Define Bar _Mst_sp100 Of (a_menupops[9]) Prompt "\-" ;
		PICTRES _Mst_sp100
	Define Bar _mst_techs Of (a_menupops[9]) Prompt "Support \<technique" ;
		PICTRES _mst_techs ;
		MESSAGE "Fournit des informations sur la manière d'obtenir une aide technique supplémentaire"
	Define Bar _mst_vfpweb Of (a_menupops[9]) Prompt "Visual FoxPro sur le \<Web" ;
		PICTRES _mst_vfpweb ;
		MESSAGE "Lance votre navigateur Internet pour aller sur les sites Web Visual FoxPro"
	Define Bar _Mst_sp300 Of (a_menupops[9]) Prompt "\-" ;
		PICTRES _Mst_sp300
	Define Bar _Mst_about Of (a_menupops[9]) Prompt "À \<propos de Microsoft Visual FoxPro..." ;
		PICTRES _Mst_about ;
		MESSAGE "Affiche la version et les informations de copyright de Visual FoxPro"

	Activate Menu (m.cMenuName) Nowait

	If m.cTypeParm2 = "C"
		m.getMenuName = m.cMenuName
		m.oFormRef.Name = m.cSaveFormName
	Endif
	Endproc

	Procedure Init
*this runs the mpr generated for a top level form but inside a form procedure.
	Thisform.ymenu(This,.T.)
	Endproc

	Procedure Destroy
	Clea Events
	Endproc

	Procedure edit1.Init
	TEXT to this.value pretext 7 noshow
				Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin vel risus eget lorem feugiat
				fermentum nec a turpis. Phasellus purus sem, mollis ac posuere eget, ornare vel orci. Sed ac rutrum
				nulla. Aenean ultrices eget lectus eu efficitur. In hac habitasse platea dictumst. Nulla in iaculis nisi.
				Nullam et pulvinar tellus. Donec arcu dui, efficitur a odio non, porta congue dolor. Aenean viverra
				auctor sagittis. Integer lobortis dignissim auctor. Proin et volutpat massa.
	ENDTEXT
	Endproc

	Procedure edit1.RightClick
&&pick snippets from the mpr menu generated as explianed.
	Define Popup raccourci  Margin Relative Shadow  From Mrow(),Mcol()   Color Scheme 4

*_medit menu
	Define Bar _Med_undo Of raccourci Prompt "\<Annuler" ;
		KEY CTRL+Z, "Ctrl+Z" ;
		PICTRES _Med_undo ;
		MESSAGE "Annule la dernière modification"
	Define Bar _Med_redo Of raccourci Prompt "\<Rétablir" ;
		KEY CTRL+R, "Ctrl+R" ;
		PICTRES _Med_redo ;
		MESSAGE "Rétablit la dernière opération annulée"
	Define Bar _Med_sp100 Of raccourci Prompt "\-" ;
		PICTRES _Med_sp100
	Define Bar _Med_cut Of raccourci Prompt "\<Couper" ;
		KEY CTRL+X, "Ctrl+X" ;
		PICTRES _Med_cut ;
		MESSAGE "Enlève la sélection et la place dans le Presse-papiers"
	Define Bar _Med_copy Of raccourci Prompt "Co\<pier" ;
		KEY CTRL+C, "Ctrl+C" ;
		PICTRES _Med_copy ;
		MESSAGE "Copie la sélection et la place dans le Presse-papiers"
	Define Bar _Med_paste Of raccourci Prompt "C\<oller" ;
		KEY CTRL+V, "Ctrl+V" ;
		PICTRES _Med_paste ;
		MESSAGE "Place le contenu du Presse-papiers au point d'insertion"
	Define Bar _Med_pstlk Of raccourci Prompt "\Co\<llage spécial..." ;
		PICTRES _Med_pstlk ;
		MESSAGE "Colle le contenu du Presse-papiers en tant qu'objet lié, incorporé ou d'un autre type"
	Define Bar _Med_clear Of raccourci Prompt "E\<ffacer" ;
		PICTRES _Med_clear ;
		MESSAGE "Enlève la sélection sans la copier dans le Presse-papiers"
	Define Bar _Med_sp200 Of raccourci Prompt "\-" ;
		PICTRES _Med_sp200
	Define Bar _Med_slcta Of raccourci Prompt "Sélec\<tionner tout" ;
		KEY CTRL+A, "Ctrl+A" ;
		PICTRES _Med_slcta ;
		MESSAGE "Sélectionne tout le texte ou tous les éléments de la fenêtre active"
	Define Bar _Med_sp300 Of raccourci Prompt "\-" ;
		PICTRES _Med_sp300
	Define Bar _Med_find Of raccourci Prompt "Rec\<hercher..." ;
		KEY CTRL+F, "Ctrl+F" ;
		PICTRES _Med_find ;
		MESSAGE "Recherche le texte spécifié"
	Define Bar _Med_repl Of raccourci Prompt "\<Remplacer..." ;
		KEY CTRL+L, "Ctrl+L" ;
		PICTRES _Med_repl ;
		MESSAGE "Remplace le texte spécifié"
	Define Bar _Med_sp400 Of raccourci Prompt "\-" ;
		PICTRES _Med_sp400
	Define Bar _med_listmembers Of raccourci Prompt "\<Liste des membres" ;
		KEY CTRL+Enter, "Ctrl+J" ;
		PICTRES _med_listmembers ;
		MESSAGE "Répertorier les membres de l'objet sélectionné"
	Define Bar _med_quickinfo Of raccourci Prompt "\Info e\<xpress" ;
		KEY CTRL+I, "Ctrl+I" ;
		PICTRES _med_quickinfo ;
		MESSAGE "Informations rapides sur l'objet sélectionné"
	Define Bar _Med_sp500 Of raccourci Prompt "\-" ;
		PICTRES _Med_sp500
	Define Bar 18 Of raccourci Prompt "\S\<ignets" ;
		PICTRES _mbk_togtask ;
		MESSAGE "Options de signet"
	Define Bar 19 Of raccourci Prompt "\-"
	Define Bar _Med_insob Of raccourci Prompt "\Insérer u\<n objet..." ;
		PICTRES _Med_insob ;
		MESSAGE "Incorpore un objet dans un champ de type Général"
	Define Bar _Med_obj Of raccourci Prompt "\O\<bjet..." ;
		PICTRES _Med_obj ;
		MESSAGE "Modifie l'objet sélectionné"
	Define Bar _Med_link Of raccourci Prompt "\L\<iaisons..." ;
		PICTRES _Med_link ;
		MESSAGE "Ouvre les fichiers liés ou change les liens"
	Define Bar 23 Of raccourci Prompt "\-"
	Define Bar _Med_pref Of raccourci Prompt "\P\<ropriétés..." ;
		PICTRES _Med_pref ;
		MESSAGE "Définit les propriétés de l'éditeur"
	On Bar 18 Of raccourci Activate Popup _med_bkmksoomin()


*_msystem menune
	Define Bar _Mst_hpsch Of raccourci Prompt "Aide de Microsoft \<Visual FoxPro" ;
		KEY F1, "F1" ;
		PICTRES _Mst_hpsch ;
		MESSAGE "Recherche les rubriques d'aide sur la base des mots clés entrés"
	Define Bar _mst_msdns Of raccourci Prompt "\<Recherche MSDN" ;
		PICTRES _mst_msdns ;
		MESSAGE "Donne accès à l'onglet Search de MSDN."
	Define Bar _Mst_sp100 Of raccourci Prompt "\-" ;
		PICTRES _Mst_sp100
	Define Bar _mst_techs Of raccourci Prompt "Support \<technique" ;
		PICTRES _mst_techs ;
		MESSAGE "Fournit des informations sur la manière d'obtenir une aide technique supplémentaire"
	Define Bar _mst_vfpweb Of raccourci Prompt "Visual FoxPro sur le \<Web" ;
		PICTRES _mst_vfpweb ;
		MESSAGE "Lance votre navigateur Internet pour aller sur les sites Web Visual FoxPro"
	Define Bar _Mst_sp300 Of raccourci Prompt "\-" ;
		PICTRES _Mst_sp300
	Define Bar _Mst_about Of raccourci Prompt "À \<propos de Microsoft Visual FoxPro..." ;
		PICTRES _Mst_about ;
		MESSAGE "Affiche la version et les informations de copyright de Visual FoxPro"

	Activate Popup raccourci
	Endproc

Enddefine
*
*-- EndDefine: ySmenus


note the "pictres" property  have always the same name as internal menu .can change with "picture" property to get picture from disc.to disable a menu item put "\" before the prompt value.
note the "pictres" property  have always the same name as internal menu .can change with "picture" property to get picture from disc.to disable a menu item put "\" before the prompt value.

note the "pictres" property have always the same name as internal menu .can change with "picture" property to get picture from disc.to disable a menu item put "\" before the prompt value.

Click on code to select [then copy] -click outside to deselect


*3* created on sunday 15 of april 2018
*use of sys(2013) command to retrieve all vfp menu names.the result is in a txt file.
*the values are localized(depend on user language  set on PC.here its french).

set defa to addbs(justpath(sys(16,1)))
LOCAL lcMenuNames,m.x
lcMenuNames = SYS(2013)  &&retrieve all vfp menu names in one string
#define  cr chr(13)+chr(10)

m.x="vfp system menu : Menu string"+cr+repli("-",100)+cr

LOCAL lnMenu, lcMenu, lnBar
FOR lnMenu = 1 TO GETWORDCOUNT(m.lcMenuNames)
	lcMenu = GETWORDNUM(m.lcMenuNames, m.lnMenu)
	IF OCCURS('_', m.lcMenu) = 1
		m.x=m.x+ ""+cr
		m.x=m.x+ m.lcMenu+cr
		FOR lnBar = 1 TO CNTBAR(m.lcMenu)
			m.x=m.x+ PRMBAR( m.lcMenu, GETBAR(m.lcMenu,m.lnBar) )+cr
		ENDFOR
	ENDIF
ENDFOR


set safe off
strtofile(m.x, "getmenuString.txt")

modi comm getmenuString.txt
RETURN


working with vfp native menus

Click on code to select [then copy] -click outside to deselect


*4* created on monday 06 of april 2018 (adapted from http://www.dfpug.de/loseblattsammlung/migration/whitepapers/menus.htm)
*this code creates a pad menu adjacent to vfp _system menu from a class definition and com objects.

Push Menu _Msysmenu  &&Places a menu bar definition in a stack of menu bar definitions in memory.


bar1 = Createobject("mBar", "Test1", "bar1", "MESSAGEBOX(PROMPT())")
bar2 = Createobject("mBar", "Test2", "bar2", "MESSAGEBOX(PROMPT())")
bar3 = Createobject("mBar", "Test3", "bar3",  "MESSAGEBOX(PROMPT())")


pop1 = Createobject("mPop", "pop1")
pop1.AddBar(bar1)
pop1.AddBar(bar2)
pop1.AddBar(bar3)
pad1 = Createobject("mPad", "Pad1",  "No message")
pad1.SetPopup(pop1)

bar1 = Createobject("mBar", "Test1", "bar1", "MESSAGEBOX(PROMPT())")
bar2 = Createobject("mBar", "Test2", "bar2", "MESSAGEBOX(PROMPT())")
bar3 = Createobject("mBar", "Done-restore vfp menu", "bar3", "POP MENU _MSYSMENU")  &&Restores the specified menu definition that was placed on the stack with PUSH POPUP.


pop2 = Createobject("mPop", "pop2")
pop2.AddBar(bar1)
pop2.AddBar(bar2)
pop2.AddBar(bar3)
pad2 = Createobject("mPad", "Pad2",  "No message")
pad2.SetPopup(pop2)



* Class Definitions
Define Class mpad As Custom
	PadName = ""
	Message = ""

	Procedure Init(cName, cMessage)
	This.PadName = cName
	This.Message = cMessage
	Define Pad (cName) Of _Msysmenu ;
		PROMPT cName Message cMessage
	Endproc

	Procedure SetPopup(oPopup)
	cName = This.PadName
	cPopup = oPopup.PopName
	On Pad (cName) Of _Msysmenu Activate Popup (cPopup)
	Endproc
Enddefine

Define Class mpop As Custom
	PopName = ""
	Barcount = 0

	Procedure Init(cName)
	This.PopName = cName
	Define Popup (cName) Margin
	Endproc

	Procedure AddBar(oBar)
	cName = This.PopName
	cAction = oBar.Action
	This.Barcount = This.Barcount + 1
	Define Bar This.Barcount Of (cName) ;
		PROMPT oBar.Prompt ;
		MESSAGE oBar.Message
	On Selection Bar This.Barcount Of (cName) &cAction
	Endproc
Enddefine

Define Class mBar As Custom
	Prompt = ""
	Message = ""
	Action = ""

	Procedure Init(cPrompt, cMessage, cAction)
	This.Prompt = cPrompt
	This.Message = cMessage
	This.Action = cAction
	Endproc
Enddefine


This was already coded previously with another maner.

This was already coded previously with another maner.

Click on code to select [then copy] -click outside to deselect

*5* created on monday 16 of april 2018
*add a menu option to any of vfp system menu pads.here 'files'
*add option ""open folder windows recent programmatly to see all recents files/folders used".give to bar an Id (not used here 30 to be sure)
*the bar count of the systeml menu file can be done with: messagebox(cntbar("_MSM_FILE"))  &&i have 22 in my pc separators included).
*can see the code to run the most vfp recents at :http://yousfi.over-blog.com/2015/02/last-vfp-files-opened-windows-recent.html


local m.myvar
text to m.myvar noshow
this is how to add a menu item in vfp system menu 'files'(_msm_file is the internal name of this popup)
define a bar (not in service) and can fire any action (here a simple  messagebox)
issue "set sysmenu to defa " to restore the native menu.
can execute this code at each vfp start  in the start vfp prg (see vfp/menu/options/files in menu).
for ex.this adds option to open the window recent folder (see all historic objects used).
can see all vfp files recently opened (prg,forms,reports,proj...)-the bar is in files at bottom.
endtext
_screen.addproperty("ymessage",m.myvar)

*set sysmenu to defa  &&this clear also the prdefined custom menu items and restore original system menu
DEFINE BAR 30 OF _msm_file PROMPT 'Windows Recent'  pictres  _mtl_wzrds
ON SELECTION BAR 30 OF _msm_file 	 run/n explorer shell:Recent
messagebox(m.myvar,0+32+4096)



can read in previous posts how to get the recent vfp files programmatly.

can read in previous posts how to get the recent vfp files programmatly.

Click on code to select [then copy] -click outside to deselect

 
*6* created on tuesday 17 of april 2018
*gather all system menu bars in one pad added to vfp system menu at right and replace the original system menu by this one.
*click new pad created "All system bars" to see all bars(108),click Restore vfp menu to return to default vfp system menu.
*of course vfp disable bars that are not in context and enble them when they are in context automatically.

Set Sysmenu To  &&cut the vfp system menu
Set Sysmenu Automatic

Define Pad yb0  Of _Msysmenu Prompt "\<         All system bars" Color Scheme 3 ;
	NEGOTIATE  Left, None ;
	MESSAGE "Gather all vfp system bars in one menu pad"
On Pad yb0 Of _Msysmenu Activate Popup yb

Define Pad yb1  Of _Msysmenu Prompt "\<       Restore vfp menu" Color Scheme 3 ;
	NEGOTIATE  Left, None ;
	MESSAGE "Restore native vfp menu"

On Pad yb1 Of _Msysmenu   Activate Popup Resto
Define Popup Resto  Margin Relative Shadow Color Scheme 4
Define Bar 1 Of Resto Prompt"\<Restore..."
On Selection Bar 1 Of Resto  Set Sysmenu To Defa


Define Popup yb Margin Relative Shadow Color Scheme 4
Define Bar _Mfi_open Of yb Prompt "\<Ouvrir..." ;
	KEY CTRL+O, "Ctrl+O" ;
	PICTRES _Mfi_open ;
	MESSAGE "Ouvre un fichier existant"
Define Bar _Mfi_close Of yb Prompt "\<Fermer" ;
	KEY CTRL+F4, "Ctrl+F4" ;
	PICTRES _Mfi_close ;
	MESSAGE "Ferme le fichier en cours"
Define Bar _Mfi_clall Of yb Prompt "Fermer tout" ;
	PICTRES _Mfi_clall ;
	MESSAGE "Ferme toutes les fenêtres"
Define Bar _Mfi_sp100 Of yb Prompt "\-" ;
	PICTRES _Mfi_sp100
Define Bar _Mfi_save Of yb Prompt "\<Enregistrer" ;
	KEY CTRL+S, "Ctrl+S" ;
	PICTRES _Mfi_save ;
	MESSAGE "Enregistre le fichier en cours"
Define Bar _Mfi_savas Of yb Prompt "En\<registrer sous..." ;
	PICTRES _Mfi_savas ;
	MESSAGE "Enregistre le fichier en cours sous un nouveau nom"
Define Bar _mfi_saveashtml Of yb Prompt "Enregistrer au format \<HTML..." ;
	PICTRES _mfi_saveashtml ;
	MESSAGE "Enregistre le fichier en cours en HTML"
Define Bar _Mfi_revrt Of yb Prompt "\<Annuler" ;
	PICTRES _Mfi_revrt ;
	MESSAGE "Annule les modifications en cours"
Define Bar _Mfi_sp200 Of yb Prompt "\-" ;
	PICTRES _Mfi_sp200
Define Bar _Mfi_import Of yb Prompt "Im\<porter..." ;
	PICTRES _Mfi_import ;
	MESSAGE "Importe un fichier Visual FoxPro ou un fichier d'une autre application"
Define Bar _Mfi_export Of yb Prompt "E\<xporter..." ;
	PICTRES _Mfi_export ;
	MESSAGE "Exporte un fichier Visual FoxPro dans un fichier d'une autre application"
Define Bar _Mfi_sp300 Of yb Prompt "\-" ;
	PICTRES _Mfi_sp300
Define Bar _Mfi_pgset Of yb Prompt "\<Mise en page..." ;
	PICTRES _Mfi_pgset ;
	MESSAGE "Modifie la mise en page et les options d'impression"
Define Bar _Mfi_prevu Of yb Prompt "Aperçu a\<vant impression" ;
	PICTRES _Mfi_prevu ;
	MESSAGE "Affiche les pages telles qu'elles seront imprimées"
Define Bar _mfi_sysprint Of yb Prompt "\<Imprimer..." ;
	KEY CTRL+P, "Ctrl+P" ;
	PICTRES _mfi_sysprint ;
	MESSAGE "Imprime un fichier texte, un état, une étiquette ou le contenu de la fenêtre Commande ou du Presse-papiers"
Define Bar _Mfi_send Of yb Prompt "Envo\<yer..." ;
	PICTRES _Mfi_send ;
	MESSAGE "Affiche la fenêtre de messagerie électronique pour l'envoi du courrier électronique"
Define Bar _Mfi_sp400 Of yb Prompt "\-" ;
	PICTRES _Mfi_sp400
Define Bar _Mfi_quit Of yb Prompt "Q\<uitter" ;
	KEY Alt+F4, "Alt+F4" ;
	PICTRES _Mfi_quit ;
	MESSAGE "Quitte Visual FoxPro"

*_med_edit
Define Bar _Med_undo Of yb Prompt "\<Annuler" ;
	KEY CTRL+Z, "Ctrl+Z" ;
	PICTRES _Med_undo ;
	MESSAGE "Annule la dernière modification"
Define Bar _Med_redo Of yb Prompt "\<Rétablir" ;
	KEY CTRL+R, "Ctrl+R" ;
	PICTRES _Med_redo ;
	MESSAGE "Rétablit la dernière opération annulée"
Define Bar _Med_sp100 Of yb Prompt "\-" ;
	PICTRES _Med_sp100
Define Bar _Med_cut Of yb Prompt "\<Couper" ;
	KEY CTRL+X, "Ctrl+X" ;
	PICTRES _Med_cut ;
	MESSAGE "Enlève la sélection et la place dans le Presse-papiers"
Define Bar _Med_copy Of yb Prompt "Co\<pier" ;
	KEY CTRL+C, "Ctrl+C" ;
	PICTRES _Med_copy ;
	MESSAGE "Copie la sélection et la place dans le Presse-papiers"
Define Bar _Med_paste Of yb Prompt "C\<oller" ;
	KEY CTRL+V, "Ctrl+V" ;
	PICTRES _Med_paste ;
	MESSAGE "Place le contenu du Presse-papiers au point d'insertion"
Define Bar _Med_pstlk Of yb Prompt "Co\<llage spécial..." ;
	PICTRES _Med_pstlk ;
	MESSAGE "Colle le contenu du Presse-papiers en tant qu'objet lié, incorporé ou d'un autre type"
Define Bar _Med_clear Of yb Prompt "E\<ffacer" ;
	PICTRES _Med_clear ;
	MESSAGE "Enlève la sélection sans la copier dans le Presse-papiers"
Define Bar _Med_sp200 Of yb Prompt "\-" ;
	PICTRES _Med_sp200
Define Bar _Med_slcta Of yb Prompt "Sélec\<tionner tout" ;
	KEY CTRL+A, "Ctrl+A" ;
	PICTRES _Med_slcta ;
	MESSAGE "Sélectionne tout le texte ou tous les éléments de la fenêtre active"
Define Bar _Med_sp300 Of yb Prompt "\-" ;
	PICTRES _Med_sp300
Define Bar _Med_find Of yb Prompt "Rec\<hercher..." ;
	KEY CTRL+F, "Ctrl+F" ;
	PICTRES _Med_find ;
	MESSAGE "Recherche le texte spécifié"
Define Bar _Med_repl Of yb Prompt "\<Remplacer..." ;
	KEY CTRL+L, "Ctrl+L" ;
	PICTRES _Med_repl ;
	MESSAGE "Remplace le texte spécifié"
Define Bar _Med_sp400 Of yb Prompt "\-" ;
	PICTRES _Med_sp400
Define Bar _med_listmembers Of yb Prompt "\<Liste des membres" ;
	KEY CTRL+Enter, "Ctrl+J" ;
	PICTRES _med_listmembers ;
	MESSAGE "Répertorier les membres de l'objet sélectionné"
Define Bar _med_quickinfo Of yb Prompt "Info e\<xpress" ;
	KEY CTRL+I, "Ctrl+I" ;
	PICTRES _med_quickinfo ;
	MESSAGE "Informations rapides sur l'objet sélectionné"
Define Bar _Med_sp500 Of yb Prompt "\-" ;
	PICTRES _Med_sp500
Define Bar 18 Of yb Prompt "S\<ignets" ;
	PICTRES _mbk_togtask ;
	MESSAGE "Options de signet"
Define Bar 19 Of yb Prompt "\-"
Define Bar _Med_insob Of yb Prompt "Insérer u\<n objet..." ;
	PICTRES _Med_insob ;
	MESSAGE "Incorpore un objet dans un champ de type Général"
Define Bar _Med_obj Of yb Prompt "O\<bjet..." ;
	PICTRES _Med_obj ;
	MESSAGE "Modifie l'objet sélectionné"
Define Bar _Med_link Of yb Prompt "L\<iaisons..." ;
	PICTRES _Med_link ;
	MESSAGE "Ouvre les fichiers liés ou change les liens"
Define Bar 23 Of yb Prompt "\-"
Define Bar _Med_pref Of yb Prompt "P\<ropriétés..." ;
	PICTRES _Med_pref ;
	MESSAGE "Définit les propriétés de l'éditeur"
On Bar 18 Of yb Activate Popup _med_bkmks

*_med_bkmks
Define Bar _mbk_togtask Of yb Prompt "Basculer le \<raccourci de la liste des tâches" ;
	KEY Alt+F2, "Alt+F2" ;
	PICTRES _mbk_togtask ;
	MESSAGE "Ajoute un raccourci pour la ligne en cours"
Define Bar _mbk_togbkmk Of yb Prompt "\<Basculer le signet" ;
	KEY Shift+Alt+F2, "Alt+Maj+F2" ;
	PICTRES _mbk_togbkmk ;
	MESSAGE "Bascule le signet pour la ligne en cours"
Define Bar _mbk_bkmknext Of yb Prompt "Raccourci/signet \<suivant" ;
	KEY F2, "F2" ;
	PICTRES _mbk_bkmknext ;
	MESSAGE "Aller au signet ou raccourci suivant dans le fichier"
Define Bar _mbk_bkmkprev Of yb Prompt "\<Raccourci/signet précédent" ;
	KEY Shift+F2, "Maj+F2" ;
	PICTRES _mbk_bkmkprev ;
	MESSAGE "Aller au signet ou au raccourci précédent dans le fichier"

*_mview
Define Bar _mvi_toolb Of yb Prompt "\<Barres d'outils..." ;
	PICTRES _mvi_toolb ;
	MESSAGE "Affiche, masque ou personnalise les barres d'outils"

*_mtools
Define Bar 1 Of yb Prompt "\<Assistants" ;
	PICTRES _mtl_wzrds ;
	MESSAGE "Exécute l'assistant sélectionné"
Define Bar _mtl_sp100 Of yb Prompt "\-" ;
	PICTRES _mtl_sp100
Define Bar _Mst_macro Of yb Prompt "Ma\<cros..." ;
	PICTRES _Mst_macro ;
	MESSAGE "Crée, supprime ou modifie une macro clavier"
Define Bar _mtl_browser Of yb Prompt "\<Explorateur de classes" ;
	PICTRES _mtl_browser ;
	MESSAGE "Exécute l'Explorateur de classes"
Define Bar _mtl_gallery Of yb Prompt "\<Component Gallery" ;
	PICTRES _mtl_gallery ;
	MESSAGE "Exécute Component Gallery"
Define Bar _mti_objectbrowser Of yb Prompt "Explorateur d'ob\<jets" ;
	PICTRES _mti_objectbrowser ;
	MESSAGE "Explorer les objets OLE installés"
Define Bar _mti_foxcode Of yb Prompt "\<Gestionnaire Intellisense" ;
	PICTRES _mti_foxcode ;
	MESSAGE "Exécute le Gestionnaire Intellisense"
Define Bar _mtl_taskpane Of yb Prompt "\<Centre d'informations" ;
	PICTRES _mtl_taskpane ;
	MESSAGE "Affiche l'application Centre d'informations"
Define Bar _mtl_toolbox Of yb Prompt "\<Boîte à outils" ;
	PICTRES _mtl_toolbox ;
	MESSAGE "Affiche la boîte à outils pour aider au développement d'applications"
Define Bar _mtl_sp200 Of yb Prompt "\-" ;
	PICTRES _mtl_sp200
Define Bar _med_beaut Of yb Prompt "\<Présenter..." ;
	PICTRES _med_beaut ;
	MESSAGE "Améliore la présentation d'un programme"
Define Bar _mti_tasklist Of yb Prompt "\<Liste des tâches" ;
	PICTRES _mti_tasklist ;
	MESSAGE "Affiche la fenêtre Liste des tâches"
Define Bar _mti_docview Of yb Prompt "Vue de \<document" ;
	PICTRES _mti_docview ;
	MESSAGE "Affiche la fenêtre de vue de document"
Define Bar _mtl_references Of yb Prompt "Recherche da\<ns les sources" ;
	PICTRES _mtl_references ;
	MESSAGE "Exécute l'application de recherche dans les sources"
Define Bar _mtl_sp300 Of yb Prompt "\-" ;
	PICTRES _mtl_sp300
Define Bar _mtl_coverage Of yb Prompt "\<Coverage Profiler" ;
	PICTRES _mtl_coverage ;
	MESSAGE "Exécute Coverage Profiler"
Define Bar _mti_breakpoint Of yb Prompt "\<Points d'arrêt..." ;
	KEY CTRL+B, "Ctrl+B" ;
	PICTRES _mti_breakpoint ;
	MESSAGE "Afficher la boîte de dialogue Points d'arrêt"
Define Bar _mtl_debugger Of yb Prompt "\<Débogueur" ;
	PICTRES _mtl_debugger ;
	MESSAGE "Affiche le débogueur"
Define Bar _mtl_sp400 Of yb Prompt "\-" ;
	PICTRES _mtl_sp400
Define Bar _mtl_optns Of yb Prompt "\<Options..." ;
	PICTRES _mtl_optns ;
	MESSAGE "Modifie les diverses catégories des options de Visual FoxPro"
On Bar 1 Of yb Activate Popup _Mwizards

*_mwizards
Define Bar _Mwz_table Of yb Prompt "T\<able" ;
	PICTRES _Mwz_table ;
	MESSAGE "Exécute l'Assistant Table"
Define Bar _Mwz_query Of yb Prompt "\<Requête" ;
	PICTRES _Mwz_query ;
	MESSAGE "Exécute les Assistants Requête, Analyse croisée, Graphique, Vue locale et distante"
Define Bar _Mwz_form Of yb Prompt "\<Formulaire" ;
	PICTRES _Mwz_form ;
	MESSAGE "Exécute les Assistants Formulaire et Formulaire un-à-plusieurs"
Define Bar _Mwz_reprt Of yb Prompt "É\<tat" ;
	PICTRES _Mwz_reprt ;
	MESSAGE "Exécute les Assistants État, État groupe/total et État un-à-plusieurs"
Define Bar _Mwz_label Of yb Prompt "Étiqu\<ette" ;
	PICTRES _Mwz_label ;
	MESSAGE "Exécute l'Assistant Étiquette"
Define Bar _Mwz_mail Of yb Prompt "Fu\<sion et publipostage" ;
	PICTRES _Mwz_mail ;
	MESSAGE "Exécute l'Assistant Fusion et publipostage"
Define Bar _Mwz_pivot Of yb Prompt "Tableau croisé d\<ynamique" ;
	PICTRES _Mwz_pivot ;
	MESSAGE "Exécute l'Assistant Tableau croisé dynamique"
Define Bar _Mwz_import Of yb Prompt "\<Importer" ;
	PICTRES _Mwz_import ;
	MESSAGE "Exécute l'Assistant Importation"
Define Bar _Mwz_foxdoc Of yb Prompt "\<Documentation" ;
	PICTRES _Mwz_foxdoc ;
	MESSAGE "Exécute l'Assistant Documentation"
Define Bar _Mwz_upsizing Of yb Prompt "\<Upsizing" ;
	PICTRES _Mwz_upsizing ;
	MESSAGE "Exécute l'Assistant Upsizing"
Define Bar _mwz_application Of yb Prompt "App\<lication" ;
	PICTRES _mwz_application ;
	MESSAGE "Exécute l'Assistant Application"
Define Bar _mwz_database Of yb Prompt "\<Base de données" ;
	PICTRES _mwz_database ;
	MESSAGE "Exécute l'Assistant Base de données"
Define Bar _mwz_webpublishing Of yb Prompt "Publication sur le \<Web" ;
	PICTRES _mwz_webpublishing ;
	MESSAGE "Exécute l'Assistant Publication sur le Web"
Define Bar _mwz_webservices Of yb Prompt "\<Services Web" ;
	PICTRES _mwz_webservices ;
	MESSAGE "Exécute l'Assistant Services Web"
Define Bar _Mwz_all Of yb Prompt "T\<ous les Assistants..." ;
	PICTRES _Mwz_all ;
	MESSAGE "Affiche la liste de tous les assistants"

*_mprog
Define Bar _Mpr_do Of yb Prompt "\<Exécuter..." ;
	KEY CTRL+D, "Ctrl+D" ;
	PICTRES _Mpr_do ;
	MESSAGE "Exécute un programme, une application, un formulaire, un état, une requête ou un menu"
Define Bar _Mpr_cancl Of yb Prompt "\<Annuler" ;
	PICTRES _Mpr_cancl ;
	MESSAGE "Arrête l'exécution d'un programme en cours"
Define Bar _Mpr_resum Of yb Prompt "\<Reprendre" ;
	KEY CTRL+M, "Ctrl+M" ;
	PICTRES _Mpr_resum ;
	MESSAGE "Reprend l'exécution du programme actuellement interrompu"
Define Bar _Mpr_suspend Of yb Prompt "\<Suspendre" ;
	PICTRES _Mpr_suspend ;
	MESSAGE "Suspend le programme en cours d'exécution"
Define Bar _Mpr_sp100 Of yb Prompt "\-" ;
	PICTRES _Mpr_sp100
Define Bar _Mpr_compl Of yb Prompt "\<Compiler..." ;
	PICTRES _Mpr_compl ;
	MESSAGE "Compile le programme en cours ou le programme sélectionné"

*_mwindow
Define Bar _mwi_cascade Of yb Prompt "Casca\<de" ;
	PICTRES _mwi_cascade ;
	MESSAGE "Réorganise les fenêtres en cascade"
Define Bar _Mwi_arran Of yb Prompt "\<Réorganiser" ;
	PICTRES _Mwi_arran ;
	MESSAGE "Réorganise les fenêtres en mosaïque"
Define Bar _Mwi_sp100 Of yb Prompt "\-" ;
	PICTRES _Mwi_sp100
Define Bar _mwi_dockable Of yb Prompt "A\<ncrable" ;
	PICTRES _mwi_dockable ;
	MESSAGE "Activer l'ancrage de cette fenêtre"
Define Bar _Mwi_hide Of yb Prompt "\<Masquer la fenêtre" ;
	PICTRES _Mwi_hide ;
	MESSAGE "Masque la fenêtre active"
Define Bar _Mwi_hidea Of yb Prompt "Masquer tout" ;
	PICTRES _Mwi_hidea ;
	MESSAGE "Masque toutes les fenêtres"
Define Bar _Mwi_showa Of yb Prompt "\<Afficher tout" ;
	PICTRES _Mwi_showa ;
	MESSAGE "Affiche toutes les fenêtres masquées"
Define Bar _Mwi_sp200 Of yb Prompt "\-" ;
	PICTRES _Mwi_sp200
Define Bar _Mwi_clear Of yb Prompt "\<Effacer" ;
	PICTRES _Mwi_clear ;
	MESSAGE "Efface le texte de l'espace de travail ou de la fenêtre de résultats active"
Define Bar _Mwi_rotat Of yb Prompt "\<Fenêtre suivante" ;
	KEY CTRL+F1, "Ctrl+F1" ;
	PICTRES _Mwi_rotat ;
	MESSAGE "Passe dans toutes les fenêtres ouvertes"
Define Bar _Mwi_sp200 Of yb Prompt "\-" ;
	PICTRES _Mwi_sp200
Define Bar _Mwi_cmd Of yb Prompt "\<Fenêtre Commande" ;
	KEY CTRL+F2, "Ctrl+F2" ;
	PICTRES _Mwi_cmd ;
	MESSAGE "Affiche la fenêtre Commande"
Define Bar _Mwi_view Of yb Prompt "Session de do\<nnées" ;
	PICTRES _Mwi_view ;
	MESSAGE "Affiche la fenêtre Session de données"
Define Bar _mwi_properties Of yb Prompt "\<Fenêtre Propriétés" ;
	PICTRES _mwi_properties ;
	MESSAGE "Afficher la fenêtre Propriétés"

*_msystem
Define Bar _Mst_hpsch Of yb Prompt "Aide de Microsoft \<Visual FoxPro" ;
	KEY F1, "F1" ;
	PICTRES _Mst_hpsch ;
	MESSAGE "Recherche les rubriques d'aide sur la base des mots clés entrés"
Define Bar _mst_msdns Of yb Prompt "\<Recherche MSDN" ;
	PICTRES _mst_msdns ;
	MESSAGE "Donne accès à l'onglet Search de MSDN."
Define Bar _Mst_sp100 Of yb Prompt "\-" ;
	PICTRES _Mst_sp100
Define Bar _mst_techs Of yb Prompt "Support \<technique" ;
	PICTRES _mst_techs ;
	MESSAGE "Fournit des informations sur la manière d'obtenir une aide technique supplémentaire"
Define Bar _mst_vfpweb Of yb Prompt "Visual FoxPro sur le \<Web" ;
	PICTRES _mst_vfpweb ;
	MESSAGE "Lance votre navigateur Internet pour aller sur les sites Web Visual FoxPro"
Define Bar _Mst_sp300 Of yb Prompt "\-" ;
	PICTRES _Mst_sp300
Define Bar _Mst_about Of yb Prompt "À \<propos de Microsoft Visual FoxPro..." ;
	PICTRES _Mst_about ;
	MESSAGE "Affiche la version et les informations de copyright de Visual FoxPro"

Messagebox(Trans(Cntbar("yb"))+" defined bars",0+32+4096,"new menu",1500)



Note that the pad "format" is automatically added to any new system menu.but i dont trap its code and its not appear anywhere in vfp namespace.!
Note that the pad "format" is automatically added to any new system menu.but i dont trap its code and its not appear anywhere in vfp namespace.!

Note that the pad "format" is automatically added to any new system menu.but i dont trap its code and its not appear anywhere in vfp namespace.!

Click on code to select [then copy] -click outside to deselect

*7* created on tuesday 17 of april 2018
 *with the empty menu fill with quickmenu as described above can retrieve all vfp system  menu names with this method follow.the menu is used as table (native)

close data all
local m.lcfile
m.lcfile=getfile('mnx')  &&point to the menu obtained with quickmenu in designer(mandatory)
if empty(m.lcfile) or !inlist(lower(justext(m.lcfile)),"mnx")
return .f.
endi

crea cursor ycurs (name c(20),prompt c(20),resname c(20))  &&picked from menu structure
append from (m.lcfile)
locate
brow title trans(reccount())+" menu names"

use in select("ycurs")


the vfp system  menu names are also  obtained with one string in sys(2013).

the vfp system menu names are also obtained with one string in sys(2013).


                     

Yousfi Benameur


working with vfp native menus

Important:All Codes above are tested on VFP9SP2 & windows 10 pro 64 bits version 1709(fall creator) & IE11 emulation. Navigator: firefox - screen:32 pouces.

To be informed of the latest articles, subscribe:
Comment on this post