%B_DISABLE

Disable a button in a window or tab set

WSupported on Windows

 

 

 

state = %B_DISABLE(container_id, button_name)

or

xcall B_DISABLE(container_id, button_name)

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 disable. (n)

button_name

The name of the button to disable. (a)

%B_DISABLE prevents a button from being enabled and, if the button is enabled, disables the button (which prevents the button from receiving focus). (Use %L_BUTTONSTATE to disable a button on a list.) By default, a button is enabled only when its window is being processed. (See .BUTTON for details and exceptions.) To restore this default behavior (which %B_DISABLE prevents), call %B_ENABLE with the input_only argument set to true.

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 disables the OK button in window wndid.

prev_state = %b_disable(wndid, "OK")