pbVisible - cCJAction
Detrmines if an item is visible
Type: Property
Access: Read/Write
Data Type: Boolean
Parameters: None
Syntax
Property Boolean pbVisible
| Access Type | Syntax |
|---|---|
| Read Access: | Get pbVisible to BooleanVariable |
| Write Access: | Set pbVisible to BooleanVariable/Value |
Description
pbVisible determines if an item is visible. This is typically used to hide a menu or toolbar item. When set to true, the item will be visible; when set to false it will not.
Default value is true.
Although this can be used to set the visible state of an item, you will normally only get the value of this property. Augmenting the IsVisible function and relying on the Update method is the preferred method for setting an item's visible state.
Samples
This will make several items non visible
// not recommended
Procedure DiableFullAcess
Set pbVisible of (oSaveMenu) to False
Set pbVisible of (oDeleteMenu) to False
End_Procedure
This above sample is not realistic. An item's visible state is usually determined by the value of some external property. A method of coding this might be:
// still not recommended
Procedure DiableFullAcess
Set pbSaveAllowed to False
Set pbDeleteAllowed to False
Set pbVisible of (oSaveMenu) to False
Set pbVisible of (oDeleteMenu) to False
End_Procedure
The above is still not the best way to control an item's visible state. The IsVisible function provides an alternate way to determine if an item is visible. The following example shows the best way of controlling an item's visible state.
// recommended
Procedure DiableFullAcess
Set pbSaveAllowed to False
Set pbDeleteAllowed to False
End_Procedure
:
// Add this function to the oSaveMenu Object
Function IsVisible returns Boolean
Boolean bVisible
Get pbSaveAllowed to bVisible
Function_Return bVisible
End_function
:
// Add this function to the oDeleteMenu Object
Function IsVisible returns Boolean
Boolean bVisible
Get pbDeleteAllowed to bVisible
Function_Return bVisible
End_function
See Also