of_setEnabled

Description

Sets the enabled/disabled state of a group, label or link.

Syntax

of_setEnabled(Long item, Boolean switch)
of_setEnabled(String item, Boolean switch)

of_setEnabled(String group, String item, Boolean switch)

Parameter(s)

Name Type Description
group String The name of the group containing the item for which the enabled indicator is to be set. The text of the group is the text the programmer gave when of_addGroup was called or when of_setText was last called for the item. This parameter is optional.
item Long or String The name or index of the item for which the enabled indicator is to be set. The text of the item is the text the programmer gave when of_addGroup, of_addLabel or of_addLink was called or when of_setText was last called for the item. The index of the item is the same as the value returned when of_addGroup, of_addLabel or of_addLink was called.
switch Boolean Indicates the state to which the item is to be set, TRUE = Enabled and FALSE = Disabled.

Return Value

Returns SUCCESS (1) if successful and FAILURE (-1) if en error occurs.

Usage

Enable/Disable is achieved by switching the transparency of the picture of the item between 100% (enabled) and 50% (disabled). The text color is changed to disabledText/grayText for disabled.

When the group parameter is included, the item parameter should only contain a label or link reference. When the group parameter is excluded, the item parameter can reference a group, label or link.

Examples

Examples

// Turn File/Save disabled
of_setEnabled('File', 'Save', FALSE)

// Turn File/Save enabled
of_setEnabled('Save', TRUE)

// Turn the group File disabled
of_setEnabled('File', FALSE)

See Also

Last edited Sep 26, 2016 at 12:06 PM by cjharris02892, version 13