Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can a form disable a option in the menu?
Message
From
24/06/1998 13:20:30
Bruce Gilmour
Cal-Mour Consultants
Calgary, Alberta, Canada
 
 
To
24/06/1998 09:55:13
Tan Gay Cheong
Cybercomp Computer Services
Singapore, Singapore
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
00110338
Message ID:
00111289
Views:
20
>>Another option is available if, for example, you have a toolbar with a NEW option on it. You can then set the SKIP FOR portion of the menu bar for new to the ENABLED status of the new buuton on the tool bar so that when you disable the toolbar button, the NEW menu option is automatically disabled as well.
>
>
>Is it automatically check for the true or false for the toolbar button? Or I have to refresh anything?

In the SKIP FOR section of the menu bar, I use the following
!FormIsObject() OR !ToolBarEnabled("Save")
where the first part is a function to see if a form exists and the second part is a function to check the form's tool bar button and is in a utility.prg that I include in my projects. The function is as follows
FUNCTION ToolBarEnabled
*- Return value of Toolbar object
PARAMETER oObject
LOCAL oToolObj
oToolObj = "oApp.oFormBar." + oobject + ".enabled"
IF TYPE(oToolObj) # "L"
RETURN .F.
ELSE
RETURN EVAL(oToolObj)
ENDIF
ENDFUNC

The parameter is the name of the toolbar button you want checked. Hope this helps.
***************************
Bruce Gilmour

"Two things are infinite, the Universe and human stupidity. And I am not sure about the Universe."
- Albert Einstein
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform