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
wTbFloating = 12

Procs

proc getToolsCount(self: wToolBar): int {...}{.inline, raises: [], tags: [].}
Returns the number of tools in the toolbar.
proc getToolPos(self: wToolBar; toolId: wCommandID): int {...}{.raises: [], tags: [].}
Returns the tool position in the toolbar, or wNotFound if the tool is not found.
proc getToolSize(self: wToolBar): wSize {...}{.raises: [], tags: [].}
Returns the size of a whole button.
proc deleteToolByPos(self: wToolBar; pos: Natural) {...}{.raises: [], tags: [].}
This function behaves like deleteTool but it deletes the tool at the specified position.
proc deleteTool(self: wToolBar; toolId: wCommandID) {...}{.raises: [], tags: [].}
Removes the specified tool from the toolbar and deletes it.
proc clearTools(self: wToolBar) {...}{.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) {...}{.
    raises: [], tags: [].}
Inserts the tool with the specified attributes into the toolbar at the given position.
proc insertSeparator(self: wToolBar; pos: int) {...}{.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 = "") {...}{.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 = "") {...}{.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 = "") {...}{.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) {...}{.inline, raises: [],
    tags: [].}
Adds a tool to the toolbar.
proc addSeparator(self: wToolBar) {...}{.inline, raises: [], tags: [].}
Adds a separator for spacing groups of tools.
proc addCheckTool(self: wToolBar; toolId: wCommandID; label = ""; bitmap: wBitmap = nil;
                 shortHelp = ""; longHelp = "") {...}{.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 = "") {...}{.inline, raises: [], tags: [].}
Adds a new radio tool to the toolbar.
proc addDropDownTool(self: wToolBar; toolId: wCommandID; label = "";
                    bitmap: wBitmap = nil; shortHelp = ""; longHelp = "") {...}{.inline,
    raises: [], tags: [].}
Adds a new drowdown tool to the toolbar.
proc enableTool(self: wToolBar; toolId: wCommandID; enable = true) {...}{.inline, raises: [],
    tags: [].}
Enables or disables the tool.
proc disableTool(self: wToolBar; toolId: wCommandID) {...}{.inline, raises: [], tags: [].}
Disables the tool.
proc getToolEnabled(self: wToolBar; toolId: wCommandID): bool {...}{.inline, raises: [],
    tags: [].}
Called to determine whether a tool is enabled (responds to user input).
proc toggleTool(self: wToolBar; toolId: wCommandID; toggle = true) {...}{.raises: [], tags: [].}
Toggles a tool on or off.
proc getToolState(self: wToolBar; toolId: wCommandID): bool {...}{.inline, raises: [],
    tags: [].}
Gets the on/off state of a toggle tool.
proc getToolShortHelp(self: wToolBar; toolId: wCommandID): string {...}{.inline, raises: [],
    tags: [].}
Returns the short help for the given tool.
proc setToolShortHelp(self: wToolBar; toolId: wCommandID; shortHelp = "") {...}{.inline,
    raises: [], tags: [].}
Sets the short help for the given tool.
proc getToolLongHelp(self: wToolBar; toolId: wCommandID): string {...}{.inline, raises: [],
    tags: [].}
Returns the long help for the given tool.
proc setToolLongHelp(self: wToolBar; toolId: wCommandID; longHelp = "") {...}{.inline,
    raises: [], tags: [].}
Sets the long help for the given tool.
proc getDropdownMenu(self: wToolBar; toolId: wCommandID): wMenu {...}{.inline, raises: [],
    tags: [].}
Returns the dropdown menu for the given tool.
proc setDropdownMenu(self: wToolBar; toolId: wCommandID; menu: wMenu = nil) {...}{.inline,
    raises: [], tags: [].}
Sets the dropdown menu for the tool given by its id.
proc getToolLabel(self: wToolBar; toolId: wCommandID): string {...}{.raises: [], tags: [].}
Returns the label for the given tool.
proc setToolLabel(self: wToolBar; toolId: wCommandID; label: string) {...}{.raises: [],
    tags: [].}
Sets the label for the tool given by its id.
proc undock(self: wToolBar) {...}{.inline, raises: [], tags: [].}
Undock the toolar.
proc init(self: wToolBar; parent: wWindow; id = wDefaultID;
         style: wStyle = wTbDefaultStyle) {...}{.raises: [wNilAccess, wWindowError,
    wCursorError, wBrushError, Exception, IndexDefect, wFontError],
                                        tags: [RootEffect].}
Initializes a toolbar.
proc ToolBar(parent: wWindow; id = wDefaultID; style: wStyle = wTbDefaultStyle): wToolBar {...}{.
    inline, discardable, raises: [wNilAccess, wWindowError, wCursorError, wBrushError,
                               Exception, IndexDefect, wFontError],
    tags: [RootEffect].}
Constructor.

Methods

method getBestSize(self: wToolBar): wSize {...}{.raises: [], tags: [].}
Returns the best size for the tool bar.
method getDefaultSize(self: wToolBar): wSize {...}{.raises: [], tags: [].}
Returns the default size for the tool bar.
method show(self: wToolBar; flag = true) {...}{.inline, raises: [Exception],
                                     tags: [RootEffect].}
Shows or hides the toolbar.
method release(self: wToolBar) {...}{.raises: [], tags: [RootEffect].}
Release all the resources during destroying. Used internally.