Returns True if item should be visible, False if not
Function IsVisible Returns Boolean
| Call: | Get IsVisible to BooleanVariable |
IsVisible is a function that the developer should use to determine if an item should be visible or not. This is used by the Update method to set the object's pbVisible state. Update is called before a popup menu item is displayed, during an idle timer update (if pbActiveUpdate is true) and at the end of the Execute method. Therefore, if you place the required logic inside of IsVisible to determine if an item is visible your menu items will always properly display this state.
By default IsVisible returns the value pbVisible, which means that by default it always returns the current state of the object.
| Note: | You should never change the value of pbVisible within IsVisible. The only purpose of IsVisible is to determine if the object should be visible and not if it is currently visible. |
Object oSaveMenu is a cCJMenuItem
Set psCaption to "&Tab Workspace"
Set psToolTip to "Tab Workspace"
Set psDescription to "Add or Remove the tab workspace"
Set pbActiveUpdate to True
Procedure OnExecute Variant vCommandBarControl
Send SaveMe
End_Procedure
Function IsVisible Returns Boolean
Boolean bReadOnly
Handle hoCommandBar
Get CommandBarSystemObject to hoCommandBar
Get pbReadOnly of hoCommandBar to bReadOnly
Function_Return (not(bReadOnly))
End_Function
End_Object
If this item was used in a popup menu, there would be no need to set pbActiveUpdate to true. Update is sent to this item before it is popped up and therefore it will always be correct. If this item were used in a toolbar, setting pbActiveUpdate to True ensures that this will refreshed via the idle timer (if pbTimerUpdate is true) and will always reflect the latest changes.
See AlsoIsEnabled | IsChecked | pbChecked | pbEnabled | pbVisible | Update