Skip to main content

LensStudio:Ui

Module

The LensStudio:Ui module for Lens Studio plugins.

Before using anything in this namespace, make sure to import LensStudio:Ui.

Example

export class UiOverviewPanel extends PanelPlugin {
connections: any[];
static descriptor() {
const d = new Descriptor();
d.id = 'com.docs.UiOverviewExample';
d.name = 'Ui Overview';
d.defaultDockState = DockState.Detached;
d.defaultSize = new Size(350, 250);
return d;
}
constructor(pluginSystem: Editor.PluginSystem, descriptor?: Descriptor) {
super(pluginSystem, descriptor);
this.connections = [];
}
createWidget(parent: Widget): Widget {
const root = new Widget(parent);
const layout = new BoxLayout();
layout.setDirection(Direction.TopToBottom);
layout.spacing = 8;
root.layout = layout;

const title = new Label(root);
title.text = 'LensStudio:Ui Module';
title.fontRole = FontRole.LargeTitleBold;
layout.addWidget(title);

const info = new Label(root);
info.text = 'The Ui module provides widgets for building plugin panels.';
info.wordWrap = true;
layout.addWidget(info);

const btn = new PushButton(root);
btn.text = 'Click Me';
layout.addWidget(btn);

this.connections.push(
btn.onClick.connect(() => {
info.text = 'Button clicked! Widgets include Label, PushButton, LineEdit, CheckBox, ComboBox, and more.';
})
);
return root;
}
deinit(): void {
this.connections.forEach((c: any) => c?.disconnect());
this.connections = [];
}
}

Namespaces

Enumerations

EnumerationDescription
AlignmentEnum specifying text or widget alignment.
ArrowPositionEnum specifying arrow position for callouts.
AspectRatioModeEnum controlling aspect ratio scaling behavior.
BackgroundRoleEnum specifying background color role.
CheckStateEnum representing checkbox state.
ClearLayoutBehaviorEnum controlling layout clearing behavior.
ColorGroupEnum specifying color group role.
ColorRoleEnum specifying color role for styling.
ContextMenuPolicyEnum controlling context menu behavior.
CursorShapeEnum specifying mouse cursor shape.
DirectionEnum for layout direction in box layouts.
DockStateEnum representing dock widget state.
FontRoleEnum specifying font role for styling.
ForegroundRoleEnum specifying foreground color role.
IconModeEnum specifying icon display mode.
ItemFlagBit-flag enum describing per-item capabilities (selectable, editable, draggable, etc.) returned by ScriptableModel.flags().
KeyEnumeration of keyboard keys reported by KeyEvent and bound by Shortcut.
KeyboardModifierEnum representing keyboard modifier keys.
MouseButtonEnum representing mouse button identifiers.
OrientationEnum specifying horizontal or vertical orientation.
SectionCollapsible section widget for grouping content.
ShadowEnum specifying shadow effect style.
ShortcutContextEnum specifying the scope in which a Shortcut is active.
StackingModeEnum specifying stacking order mode.
ToolbarPositionEnum specifying toolbar position.
TransformationModeEnum specifying image transformation mode.

Classes

ClassDescription
AbstractButtonBase class for button widgets with icon and state support.
AbstractItemViewBase widget class for views that display a hierarchical or tabular model, such as lists, tables, and trees.
AbstractMenuBase class for menu widgets.
ActionRepresents an action that can be triggered in the UI.
BoxLayoutLayout manager arranging widgets in a row or column.
CalloutFrameWidget displaying a callout or tooltip with optional arrow.
CheckBoxWidget for toggling a boolean state.
ClickableLabelLabel widget that responds to mouse clicks.
CloseEventEvent triggered when a window or dialog closes.
CollapsiblePanelWidget panel that can be expanded or collapsed.
ColorRepresents an RGBA color value.
ColorButtonButton for selecting or displaying a color.
ColorScheme-
ComboBoxDropdown widget for selecting from a list of options.
DialogModal or modeless dialog window.
DoubleSpinBoxWidget for entering floating-point numbers.
EditorsManagerManages text and code editors.
EventBase class for UI input events that can be accepted or ignored by handlers.
GridLayoutArranges child layouts and widgets in a grid with rows and columns.
GuiBuilt-in interface for GUI operations in plugins.
IDialogsInterface for file and message dialogs.
IEditorsManagerInterface for text editor management.
IGuiMain interface for accessing UI dialogs, widgets, and workspaces in Lens Studio.
ImageViewWidget displaying an image.
KeyEventInput event describing a keyboard key press, including key code, modifiers, and text.
LabelWidget displaying read-only text.
LayoutBase class for layout managers.
LineEditWidget for single-line text input.
ListWidgetWidget displaying a scrollable list of items.
ListWidgetItemIndividual item in a ListWidget.
MenuPopup menu widget.
MessageBoxDialog for displaying messages or confirmations.
ModelIndexHandle identifying a single cell within a ScriptableModel by its row, column, and path of parent row indices.
MouseEventEvent object containing mouse interaction data.
MovieRepresents an animated movie or video file.
MovieViewWidget for playing movies or animations.
OverflowToolBarToolbar that collapses into a menu when space is limited.
PixmapRepresents an image in memory.
PopupWithArrowPopup widget with an arrow pointing to a reference position.
ProgressBarWidget displaying a progress bar.
ProgressIndicatorWidget showing progress without a specific percentage.
PushButtonClickable button widget.
QtObjectBase class for native Qt-backed UI objects exposed to plugin scripts.
RadioButtonWidget for selecting one option from a group.
RadioButtonGroupManager for radio button groups.
RectRepresents a rectangular area with x, y, width, height.
ScriptableModelBase class for custom item models implemented in plugin script; subclasses override rowCount, columnCount, data, headerData, flags, index, and roleNames to feed views like AbstractItemView.
SearchableMenuMenu with search/filter functionality.
SearchLineEditLineEdit with search capabilities.
SeparatorA horizontal or vertical line widget used to visually separate groups of UI elements.
ShortcutKeyboard shortcut bound to a widget that emits a signal when its key sequence is activated.
SizeRepresents width and height dimensions.
SizesCollection of size values.
SliderWidget for selecting a value within a range.
SpinBoxWidget for entering integer numbers.
SplitterWidget dividing a container into resizable sections.
StackedLayoutLayout manager displaying one widget at a time.
StackedWidgetContainer displaying one child widget at a time.
StatusIndicatorWidget showing status with color or icon.
TabBarWidget displaying tabs for switching between panels.
TextCursorRepresents cursor position in text.
TextEditWidget for multi-line text input.
ToolbarConfigConfiguration for toolbar appearance and behavior.
ToolbarSettingsSettings for toolbar configuration.
ToolButtonButton suitable for toolbar placement.
VerticalScrollAreaContainer with vertical scrolling.
VideoViewWidget for displaying video content.
WebEngineViewEmbedded Chromium browser widget for HTML/CSS/JavaScript UI.
WidgetBase class for all UI widgets.

Functions

FunctionDescription
getUrlStringRetrieve a URL string representation.