Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can a form disable a option in the menu?
Message
De
24/06/1998 13:20:30
Bruce Gilmour
Cal-Mour Consultants
Calgary, Alberta, Canada
 
 
À
24/06/1998 09:55:13
Tan Gay Cheong
Cybercomp Computer Services
Singapore, Singapour
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de menu & Menus
Divers
Thread ID:
00110338
Message ID:
00111289
Vues:
21
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform