Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deactivate element from the main menu
Message
From
01/09/2006 13:19:22
 
 
To
01/09/2006 12:53:13
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01150125
Message ID:
01150406
Views:
27
have you tried something like Re: Dynamic menu option Thread #1064856 Message #1064923

>>>I am curious, I have set the menu SKIP FOR clause to a system level property (boolean). If I toggle the property, the menu does not always update to reflect the current setting for the property. Is there a way to reliably toggle the property and have the menu pads activate/deactivate accordingly? I have tried several work-arounds to try to force the update of appearance via code -- DO FORM somename with the form appearing off-screen and then closing on activate; this sometimes forces the menu to update but not always. Is there a "sure-fire" way to always have the menu state update? Thank you.
>>
>>Do you mean that you're treating Skip for clause like a resident prog, just sitting there waiting for you to change its param? Not sure, never having used it AFAIK. Maybe it doesn't work that way - rather sets the menu according to the toggles on invokation. I guess you have to explicitly invoke the menu each time. Set skip to is what I'd use when system conditions change.
>>
>>You could put it in a procedure, with a T/F param, that fires when the system prop toggles, but I don't see how the prog can automatically react (as in a form event) to the changing of a var (like in debug).
>>
>>'pends how you toggle the flag. Do you click a button? Is it in code? Either way, the event code for your toggling (e.g. the .click() of a toggle button) could invoke the proc to invoke the set skip.
>
>Basically I have the following:
>
>
>_screen.SavingsPadActive = .T.
>
>
>I now define and execute the menu that has the following:
>
>
>DEFINE PAD _1vy0rcxrs OF _MSYSMENU PROMPT "Savings" COLOR SCHEME 3 ;
>	KEY ALT+S, "" ;
>	SKIP FOR _screen.SavingsPadActive
>
>
>Now somewhere in code based on user interaction, I will set the value from true to false (or the reversed):
>
>
>...
>_screen.SavingsPadActive = .F.
>...
>
>
>The user will not have interacted with the menu at this point. What I want is the menu pad to now activate (was previously deactivated). If the user interacts with the menu, then the menu is updated. But I want the menu to update without the user having to interact with the menu. I have had some success in activating a form and then closing it -- it seems to cause a refresh, but this does not always work. I am wondering if anyone has found a way to force the activation/deactivation of menu items displayed without user interaction with the menu. This would only be applicable for the main pads (all the other items will be updated because the user has to interact with menu in order to see them).
>
>Thanks.
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Reply
Map
View

Click here to load this message in the networking platform