Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Khalil Shaddad
  Where is Khalil Shaddad?
 Khalil Shaddad
 To: Jamie Osborn
  Where is Jamie Osborn?
 Jamie Osborn
Subject: RE: Shortcut menu problem
Thread ID: 22430 Message ID: 22449 # Views: 2 # Ratings: 0
Version: Visual FoxPro 6 Category: Forms
Date: Friday, April 18, 2003 8:01:20 AM         

> > Hello friends,
> >
> > I am stuck with coding my first VFP (OOP) shortcut menu.
> >
> > I have a form which contains a variable number of Image objects. Each object is subclassed and has its own custom methods (in this case, a method ToggleSize()) which I want to fire with the shortcut menu.
> >
> > I have constructed the SCmenu, and it functions OK alone on dry run. The SCmenu is called by a RightClick from each object with...
> >
> > DO ImgShCut.mpr WITH THIS
> > 

> > ...as instructed in the manual.
> >
> > Then I receive an error message "No PARAMETER statement is found". What parameters?
> >
> > I can get rid of the error by omitting the "WITH THIS" in the above calling command, but then other problems emerge, and this isn't the answer either. I clearly don't understand the meaning of the WITH THIS, and also find that I cannot place a THIS.MethodName call in the Result-Options column of the Menu Designer where it calls for a COMMAND or a PROCEDURE.
> >
> > I am really confused. Any help would be much appreciated.
> >
> > TIA
> >
> > BillvV
> > Rochester, Michigan
> Thanks - you just taught me something about the menu designer that I didn't know !!
> The .mpr file is just a procedure file that is generated by the menu designer. So when you issue the statement - DO ImgShCut.mpr WITH THIS you are passing an object reference to your image object to the menu procedure (I assume that you want to do this for some reason).
> If you go into the menu designer for your shortcut and then select View/General Options you should have some code in there like :

> Then generate the .mpr file (MENU/GENERATE) and edit the .mpr file. You will see the code you entered at the beginning of the .mpr file and VFP will be happy - you have called it with a parameter and now the .mpr is handling the parameter.
> I assume that your menu wants to act upon the image and thus you should have some code in your menu items like :
> toImage.ToggleSize()

> or whatever the shortcut is supposed to call.
> Cheers,
> Jamie
> jamie.osborn@foxite.com

If you choose to create a SHORTCUT and not a MENU the lparameters statement should automatically be included in your mpr file. So it seems that you have created a MENU and not a SHORTCUT.
Khalil Shaddad (Lebanon)


Shortcut menu problem Posted by Bill von Valtier @ 4/17/2003 5:51:47 PM
RE: Shortcut menu problem Posted by Jamie Osborn @ 4/18/2003 1:59:40 AM
RE: Shortcut menu problem Posted by Khalil Shaddad @ 4/18/2003 8:01:20 AM
Thanks, Khalil Posted by Bill von Valtier @ 4/18/2003 5:52:25 PM
RE: Shortcut menu problem Posted by Bill von Valtier @ 4/18/2003 5:43:51 PM
RE: Shortcut menu problem Posted by Jamie Osborn @ 4/22/2003 1:21:07 AM
RE: Shortcut menu problem Posted by Cosmin Popescu @ 4/21/2003 1:34:11 PM