Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

My menu isn't showing up 1

Status
Not open for further replies.

spuppett

Programmer
Jan 25, 2003
48
US
I have a menu which I designed, then compiled and refrenced in my form. The form's showWindow property is set to 2, the menu option for Top-Level form is checked, and still the menu won't show up. I call the menu with
Code:
DO p2appmenu.mpr WITH THIS
I've taken out the 'WITH THIS' because I get an error saying that there was no PARAMETER list.

Any thoughts????
 
Don't you just love it when a thread gets trashed? I would rather see these VFP forums go back to just one forum rather than submit multiple replies.

Anyway,
It looks like you've done everything I suggested in the other thread, except you didn't specify where you are issuing that statement. Is it in the form's Init method?
Also, look at the p2appmenu.mpr menu code. Be sure you follow the instructions in the comments of the code.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
The call is indeed in the forms Init, and there are no instructions in the p2appmenu.mpr. All it has is a description and place for authors name, etc.
 

Dave,

I would rather see these VFP forums go back to just one forum rather than submit multiple replies.

I've occasionally thought the same thing. It would also make it easier to find past threads, and generally make navigation easier.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 

Have you save your menu as a "top-level form". Modify the menu, and the menu-general option select top-level form, regenarate your menu, this should add a parameter line as the first line of your menu (open the .mpr file to confirm this).

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
ReFox XI (www.mcrgsoftware.com)
 
Having solved that issue, I have a question along the same vein. I don't know exactly what I did to fix it. I tried to edit something, saved on exit, ran it, and nothing. I compiled the menu, ran it, and nothing. I renamed the file, edited the menu, saved on exit, ran the program, and it worked.

I guess my question is this, how do I get the .mpr file to actually update or change or what ever? How/when does the .mpr file get generated?

Thank you for your help.
 
Mike (Lewis),
Glad I'm not the only one.


spuppet,
What version of VFP are you using? Maybe it's a VFP 9 thing.
Just for future reference, here are the comments in the menu code I generated:
* To attach this menu to your Top-Level form,
* call it from the Init event of the form:

* Syntax: DO <mprname> WITH <oFormRef> [,<cMenuname>|<lRename>][<lUniquePopups>]

* oFormRef - form object reference (THIS)
* cMenuname - name for menu (this is required for Append menus - see below)
* lRename - renames Name property of your form
* lUniquePopups - determines whether to generate unique ids for popup names

* example:

* PROCEDURE Init
* DO mymenu.mpr WITH THIS,.T.
* ENDPROC

* Use the optional 2nd parameter if you plan on running multiple instances
* of your Top-Level form. The preferred method is to create an empty string
* variable and pass it by reference so you can receive the form name after
* the MPR file is run. You can later use this reference to destroy the menu.

* PROCEDURE Init
* LOCAL cGetMenuName
* cGetMenuName = ""
* DO mymenu.mpr WITH THIS, m.cGetMenuName
* ENDPROC

* The logical lRename parameter will change the name property of your
* form to the same name given the menu and may cause conflicts in your
* code if you directly reference the form by name.

* You will also need to remove the menu when the form is destroyed so that it does
* not remain in memory unless you wish to reactivate it later in a new form.

* If you passed the optional lRename parameter as .T. as in the above example,
* you can easily remove the menu in the form's Destroy event as shown below.
* This strategy is ideal when using multiple instances of Top-Level forms.

* example:

* PROCEDURE Destroy
* RELEASE MENU (THIS.Name) EXTENDED
* ENDPROC

* Using Append/Before/After location options:

* You might want to append a menu to an existing Top-Level form by setting
* the Location option in the General Options dialog. In order to do this, you
* must pass the name of the menu in which to attach the new one. The second
* parameter is required here. If you originally created the menu with the lRename
* parameter = .T., then you can update the menu with code similar to the following:

* example:

* DO mymenu2.mpr WITH THISFORM,THISFORM.name
*
* Using lUniquePopups:

* If you are running this menu multiple times in your application, such as in multiple
* instances of the same top-level form, you should pass .T. to the lUniquePopups
* parameter so that unique popup names are generated to avoid possible conflicts.

* example:

* PROCEDURE Init
* DO mymenu.mpr WITH THIS,.T.,.T.
* ENDPROC
*
* Note: Parm4-Parm9 are not reserved and freely available for use with your menu code.
*

-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Got everything working good now, thank you for all of your help.
 
The MPR is generated in one of two ways:

1) With the Menu Designer open, choose Menu | Generate from the VFP menu.

2) When a menu is part of a project, building the project regenerates the menu if it has changed.

Tamar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top