Canvas Toolkit
← Class index

CToolBar

Widgets · extends CWidget

Implements the tool bar widget.

import { CToolBar } from "canvas-toolkit-lib";

Declared members

static readonly DefaultExtent = 36;
static readonly Spacing = 2;
static readonly Margin = 4;
static readonly SeparatorExtent = 8;
static readonly GripExtent = 12;
constructor(parent?: CWidget | null);

Creates a new instance.

workspaceId(): string;

Provides workspace id behavior.

setWorkspaceId(id: string): void;

Sets the workspace id.

isMovable(): boolean;

Returns whether the movable condition is active.

setMovable(movable: boolean): void;

Sets the movable.

isFloating(): boolean;

Returns whether the floating condition is active.

setFloatingState(floating: boolean): void;

Sets the floating state.

mainWindow(): CMainWindow | null;

Provides main window behavior.

setMainWindow(mainWindow: CMainWindow | null): void;

Sets the main window.

extent(): number;

Provides extent behavior.

setExtent(extent: number): void;

Sets the extent.

orientation(): COrientation;

Provides orientation behavior.

setOrientation(orientation: COrientation): void;

Sets the orientation.

count(): number;

Provides count behavior.

addAction(action: CAction): CToolButton;

Adds action.

addSeparator(): CWidget;

Adds separator.

addWidget(widget: CWidget): CWidget;

Adds widget.

actionAt(index: number): CAction | null;

Provides action at behavior.

widgetForAction(action: CAction): CToolButton | null;

Provides widget for action behavior.

clear(): void;

Clears the current contents.

sizeHint(): CSize;

Returns the preferred size of the widget.

setGeometry(x: number, y: number, width: number, height: number): void;

Sets the geometry.

resize(width: number, height: number): void;

Provides resize behavior.

protected paintEvent(painter: CPainter): void;

Handles the paint event.

protected mousePressEvent(event: CMouseEvent): void;

Handles the mouse press event.

protected mouseMoveEvent(event: CMouseEvent): void;

Handles the mouse move event.

protected mouseReleaseEvent(event: CMouseEvent): void;

Handles the mouse release event.