Purpose
Returns information about a ButtonPad. You can call this function from the MapBasic window in MapInfo Pro.
Syntax
ButtonPadInfo( pad_name, attribute )
pad_name is a string representing the name of an existing ButtonPad; use "Main", "Drawing", "Tools" or "Standard" to query the standard pads, or specify the name of a custom pad.
attribute is a code indicating which information to return; see table below.
Return Value
Depends on the attribute parameter specified.
Description
The attribute parameter specifies what to return. Codes are defined in MAPBASIC.DEF
attribute code | ID | ButtonPadInfo() returns: |
---|---|---|
BTNPAD_INFO_FLOATING | 1 | Logical. TRUE means the pad is floating, FALSE means the pad is docked. |
BTNPAD_INFO_WIDTH | 2 | SmallInt: The width of the pad, expressed as a number of buttons (not including separators). |
BTNPAD_INFO_NBTNS | 3 | SmallInt. The number of buttons on the pad. |
BTNPAD_INFO_X | 4 | A number indicating the x-position of the upper-left corner of the pad. If the pad is docked, this is an integer. The value is negative when a toolbar is docked to the left of the menu bar. If the pad is floating, this is a float value, in paper units such as inches. For details about paper units, see Set Paper Units statement. |
BTNPAD_INFO_Y | 5 | A number indicating the y-position of the upper-left corner of the pad. This value is negative when a toolbar is docked above the menu bar. |
BTNPAD_INFO_WINID | 6 | Integer. The window ID of the specified pad. |
BTNPAD_INFO_DOCK_POSITION | 7 | Returns the position of the button pad as Floating, Left, Top, Right or Bottom. Use for floating toolbars as an alternative to BTNPAD_INFO_FLOATING. Returns:
|
Example
Include "mapbasic.def"
If ButtonPadInfo("Main", BTNPAD_INFO_FLOATING) Then
'...then the Main pad is floating; now let's dock it.
Alter ButtonPad "Main" ToolbarPosition(0,0) Fixed
End If
See Also: