Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Callable but invisible menu pads ?
Message
From
16/03/2004 23:05:53
 
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
00886543
Message ID:
00886946
Views:
25
Terry,

I defined a pad with a blank ("") prompt and so far it seems to do what I want. Thanks for your suggestion.

Alex

>A "blank" or partially blank popup can be defined - it will not show till it is activated - this is a sample. Note the second procedure (OpenEditPopMenu) is the one called when the invisible popup is to be visible (menu is to be activated):
>
PROCEDURE DefineEditPopUpMenu(oform)
>DEFINE POPUP popEdit in Window myForm MARGIN RELATIVE shortcut TITLE "Menu" COLOR SCHEME 4
>DEFINE BAR 1 OF popEdit PROMPT '\<New' KEY ALT+N, "" PICTURE "popNew.Bmp" SKIP FOR lOkayForNew
>DEFINE BAR 4 OF popEdit PROMPT '\<Edit' KEY ALT+E, "" PICTURE "Edit.Bmp" skip for lOkayForEdit
>DEFINE BAR 2 OF popEdit PROMPT '\<Delete' KEY ALT+D, "" PICTURE "DELETE.Bmp" SKIP FOR lOkayToDelete
>DEFINE BAR 3 OF popEdit PROMPT "\-"
>* Note bar 5 has an incomplete prompt, to be clompleted at "activate" event
>* Bar 5 will not route a process, it will simply present record specific data
>DEFINE BAR 5 OF popEdit PROMPT 'Name'
>ON SELECTION BAR 1 of popEdit DO NewData
>ON SELECTION BAR 4 of popEdit do EditData
>ON SELECTION BAR 2 of popEdit do RemoveData
>ENDPROC
>
>* This guy gets called when a mouse click requests popEdit to appear
>PROCEDURE OpenEditPopMenu(nRow,nCol,oform)
>* Here we complete the prompt for bar 5 of popEdit
>lcPrompt=[Period return: ]+GetName(MyTable)
>DEFINE BAR 5 OF popEdit PROMPT lcPrompt
>ACTIVATE popup popEdit at nRow,nCol
>DEACTIVATE POPUP popEdit
>ENDPROC
>
>>>>Is it possible to define menu pads that can be called programmatically but are not visible?
>>>
>>>The short answer is yes. This used to be a popular trick for enabling Cut-Copy-Paste in apps that didn't have a Edit menu.
>>
>>Thank you. That is good news. That is exactly my situation.
>>
>>>The long answer will have to be supplied by someone else, unfortunately. I think it's just a question of defining the pad and not attaching it to a bar...
>>
>>Thanks again.
>>
>>Alex
Previous
Reply
Map
View

Click here to load this message in the networking platform