Canvas Toolkit
← Class index

CToolButton

Widgets · extends CAbstractButton

Implements the tool button widget.

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

Declared members

constructor(parent?: CWidget | null);

Creates a new instance.

setText(text: string): void;

Sets the text.

setIcon(icon: CIcon | null): void;

Sets the icon.

setTextAndIcon(text: string, icon: CIcon | null): void;

Sets the text and icon.

icon(): CIcon | null;

Provides icon behavior.

isDown(): boolean;

Returns whether the down condition is active.

isHovered(): boolean;

Returns whether the hovered condition is active.

autoRaise(): boolean;

Provides auto raise behavior.

setAutoRaise(autoRaise: boolean): void;

Sets the auto raise.

toolButtonStyle(): CToolButtonStyle;

Provides tool button style behavior.

setToolButtonStyle(style: CToolButtonStyle): void;

Sets the tool button style.

iconSize(): CSize;

Provides icon size behavior.

setIconSize(size: CSize): void;

Sets the icon size.

defaultAction(): CAction | null;

Provides default action behavior.

setDefaultAction(action: CAction | null): void;

Sets the default action.

sizeHint(): CSize;

Returns the preferred size of the widget.

protected mousePressEvent(event: CMouseEvent): void;

Handles the mouse press event.

protected mouseReleaseEvent(event: CMouseEvent): void;

Handles the mouse release event.

protected mouseEnterEvent(event: CMouseEvent): void;

Handles the mouse enter event.

protected mouseLeaveEvent(event: CMouseEvent): void;

Handles the mouse leave event.

protected keyPressEvent(event: CKeyEvent): void;

Handles the key press event.

protected keyReleaseEvent(event: CKeyEvent): void;

Handles the key release event.

protected paintEvent(painter: CPainter): void;

Handles the paint event.