Canvas Toolkit
← Class index

CMenuBar

Widgets · extends CWidget

Implements the menu bar widget.

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

Declared members

static readonly DefaultHeight = 28;
static readonly HorizontalPadding = 10;
static readonly ItemSpacing = 4;
constructor(parent?: CWidget | null);

Creates a new instance.

addMenu(text: string, menu: CMenu): CMenu;

Adds menu.

addSeparator(): void;

Adds separator.

clear(): void;

Clears the current contents.

count(): number;

Provides count behavior.

menuAt(index: number): CMenu | null;

Provides menu at behavior.

selectMenu(direction: 1 | -1): void;

Provides select menu behavior.

sizeHint(): CSize;

Returns the preferred size of the widget.

protected mouseMoveEvent(event: CMouseEvent): void;

Handles the mouse move event.

protected mouseLeaveEvent(event: CMouseEvent): void;

Handles the mouse leave event.

protected mousePressEvent(event: CMouseEvent): void;

Handles the mouse press event.

protected keyPressEvent(event: CKeyEvent): void;

Handles the key press event.

protected paintEvent(painter: CPainter): void;

Handles the paint event.