A toolbar is an array of bitmap buttons, implemented by drawing bitmaps onto a canvas, instead of using the native button implementation.
Note: under XView, wxToolBar inherits from wxCanvas, not wxPanel, due to limitations in the XView toolkit.
wxToolBar create-buttons
wxToolBar orientation
wxToolBar rows-or-columns
wxToolBar add-separator
wxToolBar add-tool
wxToolBar clear-tools
wxToolBar create
wxToolBar create-tools
wxToolBar enable-tool
wxToolBar get-max-height
wxToolBar get-max-width
wxToolBar get-tool-client-data
wxToolBar get-tool-enabled
wxToolBar get-tool-long-help
wxToolBar get-tool-short-help
wxToolBar get-tool-state
wxToolBar layout
wxToolBar on-paint
wxToolBar set-default-size
wxToolBar set-margins
wxToolBar set-tool-long-help
wxToolBar set-tool-short-help
wxToolBar toggle-tool
bool create-buttons
Specify TRUE if the enhanced underlying wxButtonBar class is to be used (optimized for Windows), FALSE for the standard wxToolBar class. The default is TRUE.
string orientation
Specify wxVERTICAL for vertical layout, or wxHORIZONTAL for horizontal layout. Ignored if doing manual layout.
long rows-or-columns
The maximum number of rows or columns in this toolbar (depends on the value of orientation. Ignored if doing manual layout.
bool ( add-separator long id)
Adds a separator between tools: only functional under Windows 95, but harmless under other platforms.
bool ( add-tool long id long index wxBitmap bitmap1 optional wxBitmap bitmap2 = nil optional bool is-toggle = FALSE optional double x = -1.0 optional double x = 1.0 optional long client-data = 0 optional string short-help-string="" optional string long-help-string="")
Adds a tool to the toolbar. Pass at least one bitmap, the bitmap to be displayed when active and not depressed; and optionally, the bitmap to be displayed when the tool is depressed or toggled. Under Windows, only one bitmap is necessary, and under X, the second bitmap will be created automatically as the inverse of the first button if none is supplied.
You can specify whether the tool is allowed to toggle, and pass a position if you are not going to automatically layout the toolbar with toolbar-layout. You can associate client data with the tool.
short-help-string is only used by Windows 95 versions of wxCLIPS. The string is used to supply text for a tooltip, a small yellow window that appears as the mouse pointer hovers over the button.
long-help-string specifies a longer help string that can be used by the application.
bool ( clear-tools)
Clears all the tools from the toolbar.
void ( create)
Creates a toolbar. The following slots may be initialized.
style may be a bit list of:
Note that absolute tool positioning (or the layout function) does not work for buttonbars under Windows 95: instead, you can specify the number of rows for the toolbar, and use add-separator to achieve inter-tool spacing.
bool ( create-tools)
This should be called when creating Windows 95 buttonbars, after all tools have been added. It adds the tools to the toolbar. You can also call it for non-Windows 95 toolbars and buttonbars, in which case it will have no effect.
bool ( enable-tool long tool-id bool enable)
Enables the tool (if enable is TRUE) or disables it (if enable is FALSE).
double ( get-max-height)
Gets the maximum height of the toolbar when it has been automatically laid out.
double ( get-max-width)
Gets the maximum width of the toolbar when it has been automatically laid out.
long ( get-tool-client-data long tool-id)
Returns the client data associated with the given tool.
bool ( get-tool-enabled long tool-id)
Returns TRUE if the tool is enabled, FALSE otherwise.
string ( get-tool-long-help long tool-id)
Returns the long help string.
string ( get-tool-short-help long tool-id)
Returns the short help string.
bool ( get-tool-state long tool-id)
Returns the tool state (TRUE for toggled on, FALSE for off).
bool ( layout)
Lays out all the tools if automatic layout is required.
void ( on-paint)
Calls the default toolbar paint handler. You may wish to call this if you override the default handler.
bool ( set-default-size long width long height)
Sets the width and height of tool buttons (Windows only). The default is 24 by 22.
bool ( set-margins long x long y)
Sets the width and height of the toolbar margins and spacing, if automatic layout is being used.
bool ( set-tool-long-help long tool-id string help-string)
Sets the long help string for this tool.
bool ( set-tool-short-help long tool-id string help-string)
Sets the short help string for this tool.
bool ( toggle-tool long tool-id bool toggle)
Toggles the tool on or off.