Canvas Toolkit
← Class index

CGroupBox

Widgets · extends CWidget

Implements the group box widget.

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

Declared members

readonly collapsedChanged: CSignal<[boolean]>;
constructor(title?: string, parent?: CWidget | null);

Creates a new instance.

title(): string;

Provides title behavior.

setTitle(title: string): void;

Sets the title.

isCollapsible(): boolean;
isCollapsed(): boolean;
setCollapsible(collapsible: boolean): void;

Disabling collapsing also expands the contents and restores the previous focus policy.

setCollapsed(collapsed: boolean): void;

Ignored unless collapsible is enabled.

headerHeight(): number;
headerRect(): CRect;

The entire title row is clickable; empty titles still expose the chevron.

protected childrenAreVisible(): boolean;
sizePolicy(): CSizePolicy;
sizeHint(): CSize;
hasHeightForWidth(): boolean;
heightForWidth(width: number): number;
setFont(font: CFont, propagate?: boolean): void;
protected mousePressEvent(event: CMouseEvent): void;
protected mouseReleaseEvent(event: CMouseEvent): void;
protected keyPressEvent(event: CKeyEvent): void;
protected keyReleaseEvent(event: CKeyEvent): void;
protected focusOutEvent(event: CFocusEvent): void;
protected visibilityChangeEvent(): void;
setEnabled(enabled: boolean): void;
contentsRect(): CRect;

Returns the widget's contents rectangle.

protected paintEvent(painter: CPainter): void;

Handles the paint event.