Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Shortcut menu
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Title:
Miscellaneous
Thread ID:
00491767
Message ID:
00492658
Views:
13
>>>>>>How can I get a shortcut menu when no forms are displayed, just the normal menu (wait state). I want to right click anywhere on the screen and a shortcut menu to appear. I know how to do it when forms are displayed.
>>>>>>
>>>>>>Thanks
>>>>>
>>>>>Here's a neat trick I learned to allow you to put code into any _SCREEN event:
>>>>>
>>>>>* screenmethods.prg
>>>>>*
>>>>>* Use the following to modify _SCREEN methods:
>>>>>*_SCREEN.NewObject("oSH","ScreenHook","screenmethods.prg")
>>>>>*
>>>>>DEFINE CLASS ScreenHook AS custom
>>>>>oscr = _SCREEN
>>>>>PROCEDURE oscr.RightClick
>>>>>  DO yourmenu.mpr
>>>>>ENDPROC
>>>>>ENDDEFINE
>>>>>
>>>>
>>>>Fred,
>>>>
>>>>For some reason, it doesn't work. I'm experiminting with the menu right now, using Mike Helland technique. The menu looks nice, but I can not add it to the screen by right click.
>>>
>>>You need to do the _SCREEN.NewObject() call from the command window (or another .PRG).
>>>
>>>Try creating a oscr.Resize procedure and puting some code in there, it should work.
>>
>>Fred,
>>
>>I added a wait window "Click" and then it works. Strange. Now it works without wait window too :)
>>
>>Nice trick, thanks.
>>
>>Ok, now is the little problem. I created a menu with a highlighted first item (according to today's threads by Hiten and Mike), now I want the first item never be selectable, e.g. it should be like a Header. Do you know, how this could be done?
>>
>>Thanks in advance.
>
>
>Disable it? SKIP FOR .T.

I tried it, the result is not desirable.
This is my simple test. Try it (by creating a menu) and you'll see, what I mean.
*       *********************************************************
*       *                                                         
*       * 04/05/01              MEN1.MPR                22:32:36  
*       *                                                         
*       *********************************************************
*       *                                                         
*       * Author's Name                                           
*       *                                                         
*       * Copyright (C) 2001 Company Name                         
*       * Address                                                 
*       * City,     Zip                                           
*       *                                                         
*       * Description:                                            
*       * This PROGRAM was automatically generated BY GENMENU.    
*       *                                                         
*       *********************************************************


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

DEFINE POPUP shortcut SHORTCUT RELATIVE FROM MROW(),MCOL()
DEFINE BAR 1 OF shortcut PROMPT "Header" ;
     MESSAGE "Status Bar" COLOR RGB(255,255,255,0,0,0) FONT "TAHOMA" STYLE 'B'
DEFINE BAR 2 OF shortcut PROMPT "\-"
DEFINE BAR 3 OF shortcut PROMPT "Option2"
ON SELECTION BAR 3 OF shortcut wait window "Option 2"

ACTIVATE POPUP shortcut
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform