Canvas Toolkit
← Class index

CComboBox

Widgets · extends CWidget

Implements the combo box widget.

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

Declared members

static readonly MaxVisibleItems = 10;
readonly currentIndexChanged: CSignal<[number]>;

Signal emitted when current index changes.

readonly currentTextChanged: CSignal<[string]>;

Signal emitted when current text changes.

readonly activated: CSignal<[number]>;

Public activated member.

constructor(parent?: CWidget | null);

Creates a new instance.

isEditable(): boolean;

Returns whether the editable condition is active.

setEditable(editable: boolean): void;

Sets the editable.

lineEdit(): CLineEdit;

Provides line edit behavior.

addItem(text: string): void;

Adds item.

addItems(items: string[]): void;

Adds items.

insertItem(index: number, text: string): void;

Inserts item.

removeItem(index: number): void;

Removes item.

clear(): void;

Clears the current contents.

count(): number;

Provides count behavior.

itemText(index: number): string;

Provides item text behavior.

setItemText(index: number, text: string): void;

Sets the item text.

currentIndex(): number;

Returns the current index.

setCurrentIndex(index: number): void;

Sets the current index.

currentText(): string;

Returns the current text.

setCurrentText(text: string): void;

Sets the current text.

findText(text: string): number;

Finds text.

isDown(): boolean;

Returns whether the down condition is active.

popup(): CPopupWidget;

Provides popup behavior.

listWidget(): CListWidget;

Provides list widget behavior.

showPopup(): void;

Shows popup.

hidePopup(): void;

Hides popup.

isArrowHovered(): boolean;

Returns whether the arrow hovered condition is active.

handleComboKey(event: CKeyEvent): void;

Provides handle combo key behavior.

activatePopupItem(): void;

Provides activate popup item behavior.

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

Sets the geometry.

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

Provides resize behavior.

sizeHint(): CSize;

Returns the preferred size of the widget.

destroy(): void;

Releases resources owned by the widget.

protected mousePressEvent(event: CMouseEvent): void;

Handles the mouse press event.

protected mouseReleaseEvent(event: CMouseEvent): void;

Handles the mouse release event.

protected mouseMoveEvent(event: CMouseEvent): void;

Handles the mouse move event.

protected mouseLeaveEvent(event: CMouseEvent): void;

Handles the mouse leave event.

protected keyPressEvent(event: CKeyEvent): void;

Handles the key press event.

protected paintEvent(painter: CPainter): void;

Handles the paint event.