%B_ENABLE

Enable a button in a window or tab set

WSupported on Windows

 

 

 

prev_state = %B_ENABLE(container_id, button_name[, input_only])

or

xcall B_ENABLE(container_id, button_name[, input_only])

prev_state

On Windows, returns the previous state of the button: D_DISABLED, D_ENABLED, or D_INPUTONLY (enabled only within input; the default state). (^VAL)

On Unix and OpenVMS, always returns false.

container_id

The ID of the window or tab set that contains the button to enable. (n)

button_name

The name of the button to enable. (a)

input_only

(optional) The true/false flag that specifies whether the button is to be enabled only when being processed. This is the default state for all buttons. (n)

%B_ENABLE enables a button in a window and either restores or prevents automatic button enabling and disabling. (Use %L_BUTTONSTATE to enable a button on a list.)

By default, a button is automatically enabled when the window that contains the button is processed; otherwise, it is automatically disabled. There is an exception: if a button is in a composite window, the button will be automatically enabled when the composite window is processed (even if the button is on a child window that is not active) and disabled otherwise.

If you omit input_only or pass it as false, %B_ENABLE prevents the button from being automatically disabled and, if the button is disabled, enables it.

If you pass input_only as true, %B_ENABLE restores the default behavior, which, incidentally, enables the button if the window or tab set (or composite window) for the button is being processed.

If container_id is invalid or the window does not contain the specified button, an error occurs.

This routine has no effect on applications running on Unix or OpenVMS or in Synergy .NET. It does, however, save button information on these platforms, so if the window is saved to a window library (by using U_SAVE) and later loaded from that library on a Windows platform in traditional Synergy, the button will be on the window (assuming ISAM-compatible platforms).

The following example enables the OK button in window wndid.

prev_state = %b_enable(wndid, "OK")

The next example enables the Exit button in window inpid, but enables it only when inpid is being processed.

prev_state = %b_enable(inpid, "Exit", TRUE)