Purpose
Enables, disables, selects, or deselects a button from a ButtonPad (toolbar) or a ribbon group.
Syntax
Alter Button { handler | ID button_id }
[ { Enable | Disable } ]
[ { Check | Uncheck } ]
handler is the handler that is already assigned to an existing button. The handler can be the name of a MapBasic procedure, or a standard command code (e.g., M_TOOLS_RULER or M_WINDOW_LEGEND) from MENU.DEF.
button_id is a unique integer button identification number.
Description
If the Alter Button statement specifies a handler (e.g., a procedure name), MapInfo Pro modifies all buttons that call that handler. If the statement specifies a button_id number, MapInfo Pro modifies only the button that has that ID.
The Disable keyword changes the button to a grayed-out state, so that the user cannot select the button.
The Enable keyword enables a button that was previously disabled.
The Check and Uncheck keywords select and deselect ToggleButton type buttons, such as the Show Statistics Window button. The Check keyword has the effect of "pushing in" a ToggleButton control, and the Uncheck keyword has the effect of releasing the button. For example, the following statement selects the Show Statistics Window button:
Alter Button M_WINDOW_STATISTICS Check
Similarly, you can use the Check keyword to change the appearance of a ToolButton. However, checking a ToolButton does not actually select that tool, it only changes the appearance of the button. To make a standard tool the active tool, issue a Run Menu Command statement, such as the following:
Run Menu Command M_TOOLS_RULER
To make a custom tool the active tool, use the syntax Run Menu Command ID IDnum.
- This command allows you to enable\disable or select\unselect a control added to ButtonPad group.
- If you check/uncheck using a mapinfo run menu command then controls which have an ischecked property bind are affected.
See Also:
Alter ButtonPad statement, Create ButtonPad statement, Run Menu Command statement