wToolBar

A toolbar is a bar of buttons and/or other controls usually placed below the menu bar in a wFrame.

Superclass:wControl
Styles:
StylesDescription
wTbFlatGives the toolbar a flat and transparent look.
wTbNoDividerSpecifies no divider (border) above the toolbar.
wTbHorizontalSpecifies horizontal layout (default).
wTbVerticalSpecifies vertical layout.
wTbBottomAlign the toolbar at the bottom of parent window.
wTbRightAlign the toolbar at the right side of parent window.
wTbNoAlignSpecifies no alignment with the parent window.
wTbNoResizeSpecifies no resize.
wTbDefaultStyleCombination of wTbHorizontal and wTbFlat
Events:wCommandEvent
wCommandEventDescription
wEvent_ToolClick left mouse button on the tool bar. Same as wEvent_Menu.
wEvent_ToolRightClickClick right mouse button on the tool bar.
wEvent_ToolDropDownDrop down menu selected. If unhandled, displays the default dropdown menu.
wEvent_ToolEnterThe mouse cursor has moved into or moved off a tool.

Consts

wTbFlat = 0x00000800
wTbNoDivider = 0x00000040
wTbhorizontal = 0
wTbVertical = 0x00000080
wTbBottom = 0x00000003
wTbRight = 131
wTbNoAlign = 0x00000008
wTbNoResize = 0x00000004
wTbDefaultStyle = 2048
wTbNormal = 0x00000000
wTbSeparator = 0x00000001
wTbCheck = 0x00000002
wTbRadio = 6
wTbDropDown = 0x00000080

Procs

proc getToolPos(self: wToolBar; toolId: wCommandID): int {...}{.validate, property,
    raises: [], tags: [].}
Returns the tool position in the toolbar, or wNotFound if the tool is not found.
proc getToolSize(self: wToolBar): wSize {...}{.validate, property, raises: [], tags: [].}
Returns the size of a whole button.
proc deleteToolByPos(self: wToolBar; pos: Natural) {...}{.validate, raises: [], tags: [].}
This function behaves like deleteTool but it deletes the tool at the specified position.
proc deleteTool(self: wToolBar; toolId: wCommandID) {...}{.validate, raises: [], tags: [].}
Removes the specified tool from the toolbar and deletes it.
proc clearTools(self: wToolBar) {...}{.validate, raises: [], tags: [].}
 Deletes all the tools in the toolbar.
proc insertTool(self: wToolBar; pos: int; toolId: wCommandID; label = "";
               bitmap: wBitmap = nil; shortHelp = ""; longHelp = ""; kind: int = wTbNormal) {...}{.
    validate, raises: [], tags: [].}
Inserts the tool with the specified attributes into the toolbar at the given position.
proc insertSeparator(self: wToolBar; pos: int) {...}{.validate, inline, raises: [], tags: [].}
Inserts the separator into the toolbar at the given position.
proc insertCheckTool(self: wToolBar; pos: int; toolId: wCommandID; label = "";
                    bitmap: wBitmap = nil; shortHelp = ""; longHelp = "") {...}{.validate,
    inline, raises: [], tags: [].}
Insert the check (or toggle) tool into the toolbar at the given position.
proc insertRadioTool(self: wToolBar; pos: int; toolId: wCommandID; label = "";
                    bitmap: wBitmap = nil; shortHelp = ""; longHelp = "") {...}{.validate,
    inline, raises: [], tags: [].}
Insert the radio tool into the toolbar at the given position.
proc insertDropDownTool(self: wToolBar; pos: int; toolId: wCommandID; label = "";
                       bitmap: wBitmap = nil; shortHelp = ""; longHelp = "") {...}{.validate,
    inline, raises: [], tags: [].}
Insert the drowdown tool into the toolbar at the given position.
proc addTool(self: wToolBar; toolId: wCommandID; label = ""; bitmap: wBitmap = nil;
            shortHelp = ""; longHelp = ""; kind: int = wTbNormal) {...}{.validate, inline,
    raises: [], tags: [].}
Adds a tool to the toolbar.
proc addSeparator(self: wToolBar) {...}{.validate, inline, raises: [], tags: [].}
Adds a separator for spacing groups of tools.
proc addCheckTool(self: wToolBar; toolId: wCommandID; label = ""; bitmap: wBitmap = nil;
                 shortHelp = ""; longHelp = "") {...}{.validate, inline, raises: [], tags: [].}
Adds a new check (or toggle) tool to the toolbar.
proc addRadioTool(self: wToolBar; toolId: wCommandID; label = ""; bitmap: wBitmap = nil;
                 shortHelp = ""; longHelp = "") {...}{.validate, inline, raises: [], tags: [].}
Adds a new radio tool to the toolbar.
proc addDropDownTool(self: wToolBar; toolId: wCommandID; label = "";
                    bitmap: wBitmap = nil; shortHelp = ""; longHelp = "") {...}{.validate,
    inline, raises: [], tags: [].}
Adds a new drowdown tool to the toolbar.
proc enableTool(self: wToolBar; toolId: wCommandID; enable = true) {...}{.validate, inline,
    raises: [], tags: [].}
Enables or disables the tool.
proc disableTool(self: wToolBar; toolId: wCommandID) {...}{.validate, inline, raises: [],
    tags: [].}
Disables the tool.
proc getToolEnabled(self: wToolBar; toolId: wCommandID): bool {...}{.validate, property,
    inline, raises: [], tags: [].}
Called to determine whether a tool is enabled (responds to user input).
proc toggleTool(self: wToolBar; toolId: wCommandID; toggle = true) {...}{.validate,
    raises: [], tags: [].}
Toggles a tool on or off.
proc getToolState(self: wToolBar; toolId: wCommandID): bool {...}{.validate, property,
    inline, raises: [], tags: [].}
Gets the on/off state of a toggle tool.
proc getToolShortHelp(self: wToolBar; toolId: wCommandID): string {...}{.validate, property,
    inline, raises: [], tags: [].}
Returns the short help for the given tool.
proc setToolShortHelp(self: wToolBar; toolId: wCommandID; shortHelp = "") {...}{.validate,
    property, inline, raises: [], tags: [].}
Sets the short help for the given tool.
proc getToolLongHelp(self: wToolBar; toolId: wCommandID): string {...}{.validate, property,
    inline, raises: [], tags: [].}
Returns the long help for the given tool.
proc setToolLongHelp(self: wToolBar; toolId: wCommandID; longHelp = "") {...}{.validate,
    property, inline, raises: [], tags: [].}
Sets the long help for the given tool.
proc getDropdownMenu(self: wToolBar; toolId: wCommandID): wMenu {...}{.validate, property,
    inline, raises: [], tags: [].}
Returns the dropdown menu for the given tool.
proc setDropdownMenu(self: wToolBar; toolId: wCommandID; menu: wMenu = nil) {...}{.validate,
    property, inline, raises: [], tags: [].}
Sets the dropdown menu for the tool given by its id.
proc getToolLabel(self: wToolBar; toolId: wCommandID): string {...}{.validate, property,
    raises: [], tags: [].}
Returns the label for the given tool.
proc setToolLabel(self: wToolBar; toolId: wCommandID; label: string) {...}{.validate,
    property, raises: [], tags: [].}
Sets the label for the tool given by its id.
proc final(self: wToolBar) {...}{.raises: [], tags: [].}
Default finalizer for wToolBar.
proc init(self: wToolBar; parent: wWindow; id = wDefaultID;
         style: wStyle = wTbDefaultStyle) {...}{.validate, raises: [], tags: [].}
Initializer.
proc ToolBar(parent: wWindow; id = wDefaultID; style: wStyle = wTbDefaultStyle): wToolBar {...}{.
    inline, discardable, raises: [], tags: [].}
Constructs a toolbar.

Methods

method getBestSize(self: wToolBar): wSize {...}{.property, inline, raises: [], tags: [].}
Returns the best size for the tool bar.
method getDefaultSize(self: wToolBar): wSize {...}{.property, inline, raises: [], tags: [].}
Returns the default size for the tool bar.