Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Still need help with menus!
Message
From
26/12/1997 12:58:28
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00067974
Message ID:
00067991
Views:
25
>>You can use *skip for myproc* and arrange your popup as needed.
>>Cetin
>
>Cetin, that still doesn't quite work. If you put SKIP FOR in the DEFINE PAD command, the SKIP FOR is only executed at the time the menu is activated or when the pad is initially defined. The SKIP FOR is *not* executed every time the popup is activated. I need the capability to dynamically add and remove bars from the popup every time the popup is activated.
>
>Jim Booth's suggestion is the only way I know to accomplish this, but it can become quite convoluted when you have snippets of code all over the place that are altering a popup based on changes in the environment. I would much rather have the equivalent of a "BeforePopping" event for a popup. With this capabilitiy, I can have one snippet of code that uses current environment information (within my app) to set / remove all bars in the popup... i.e., exactly as one can do with a shortcut menu.
Hi,
Skip for does the job quite well. Try like this :

public popchanger && Sample controller for skip for
popchanger=1

SET SYSMENU TO
SET SYSMENU AUTOMATIC

***
* Some pads here
***
DEFINE PAD testpad OF _MSYSMENU PROMPT ... COLOR SCHEME 3 ;
KEY ALT+T, "" ;
MESSAGE "This pad changes on the fly" ;
skip for myredefine()
ON PAD testpad OF _MSYSMENU ACTIVATE POPUP testpop && Our popup
* Other on pads

**********
* myredefine.prg
**********
deactivate popup testpop
release popup testpop extended
DEFINE POPUP testpop MARGIN RELATIVE SHADOW COLOR SCHEME 4

do case
case popchanger=1
DEFINE BAR 1 OF testpop PROMPT "Version 1" ;
MESSAGE "V1"
case popchanger=2
DEFINE BAR 1 OF testpop PROMPT "Version 2" ;
MESSAGE "V2"
case popchanger=3
DEFINE BAR 1 OF testpop PROMPT "Version 3" ;
MESSAGE "V3"
otherwise
DEFINE BAR 1 OF testpop PROMPT "Wizard" ;
MESSAGE "Runs the selected wizard"
endcase

DEFINE BAR _mtl_spell OF testpop PROMPT "Spelling..." ;
MESSAGE "Checks spelling"
DEFINE BAR _mst_macro OF testpop PROMPT "Macros..." ;
MESSAGE "Creates, deletes, or revises a keyboard macro"
DEFINE BAR _mtl_browser OF testpop PROMPT "Class Browser" ;
MESSAGE "Runs the Class Browser"

ON BAR 1 OF testpop do subprog with popchanger

return .f.

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform