Window

Implements: tracker.Observable

A draggable window container for UI elements.

Provides a standard window interface with:

  • Draggable header bar
  • Optional title text
  • Expand/collapse functionality
  • Close button support
  • Automatic state persistence (position, size, collapsed state)
  • Theme customization
  • Content scrolling support

Windows automatically save their state to the Context's user data and restore it when recreated with the same ID.

See: Context, WindowData, ColumnLayout

Static Members

elements
HEADER_HEIGHT: Int

Height of the window header bar in pixels

Instance Members

elements
observedDirty: Bool

Default is false, automatically set to true when any of this instance's observable variables has changed.


elements
theme: Theme

Custom theme override for this window


elements
contentView: ceramic.View

The main content view displayed in the window body


elements
title: String

Title text displayed in the window header


elements
closable: Bool

Whether the window shows a close button


elements
collapsible: Bool

Whether the window can be collapsed/expanded


Whether to show the window header bar


elements
titleAlign: Anonymous

Alignment of the title text in the header


elements
scrolls: Bool

Computed property that returns true if the content view is scrollable.


elements
movable: Bool

Whether the window can be dragged by its header


elements
overlay: ceramic.Quad

Optional overlay quad for modal behavior


elements
invalidateTheme(): Void

elements
invalidateContentView(): Void

elements
invalidateTitle(): Void

elements
invalidateClosable(): Void

elements
invalidateCollapsible(): Void

elements
invalidateHeader(): Void

elements
invalidateTitleAlign(): Void

elements
invalidateScrolls(): Void

elements
destroy(): Void

elements
new(): Void

Creates a new Window with default styling and behavior. Sets up the header, body, and interaction handlers.

Private Members

elements
FONT_PRE_RENDERED_SIZE: Int

Pre-rendered font size for title text


elements
TITLE_TEXT_SIZE: Int

Display size for title text


elements
DEFAULT_X: Int

Default X position for new windows


elements
DEFAULT_Y: Int

Default Y position for new windows


elements
DRAG_THRESHOLD: Int

Minimum drag distance to start window movement


elements
unobservedTheme: Theme

elements
unobservedContentView: ceramic.View

elements
unobservedTitle: String

elements
unobservedClosable: Bool

elements
unobservedCollapsible: Bool

elements
unobservedHeader: Bool

elements
unobservedTitleAlign: Anonymous

elements
unobservedScrolls: Bool

elements
headerView: ceramic.RowLayout

elements
expandCollapseClick: ceramic.Click

elements
headerViewDoubleClick: ceramic.DoubleClick

elements
closeClick: ceramic.Click

elements
bodyView: ceramic.ColumnLayout

elements
titleView: ceramic.TextView

elements
expandView: ceramic.View

elements
expandTriangle: ceramic.AntialiasedTriangle

elements
closeView: ceramic.View

elements
closeCross: CrossX

elements
windowPosStartX: Float

elements
windowPosStartY: Float

elements
dragPointerStartX: Float

elements
dragPointerStartY: Float

elements
dragging: Bool

elements
emitObservedDirty(instance: Window, fromSerializedField: Bool): Void

Event when any observable value as changed on this instance.

Name Type
instance Window
fromSerializedField Bool

elements
emitThemeChange(current: Theme, previous: Theme): Void

Event when theme field changes.

Name Type
current Theme
previous Theme

elements
emitContentViewChange(current: ceramic.View, previous: ceramic.View): Void

Event when contentView field changes.

Name Type
current ceramic.View
previous ceramic.View

elements
emitTitleChange(current: String, previous: String): Void

Event when title field changes.

Name Type
current String
previous String

elements
emitClosableChange(current: Bool, previous: Bool): Void

Event when closable field changes.

Name Type
current Bool
previous Bool

elements
emitCollapsibleChange(current: Bool, previous: Bool): Void

Event when collapsible field changes.

Name Type
current Bool
previous Bool

elements
emitHeaderChange(current: Bool, previous: Bool): Void

Event when header field changes.

Name Type
current Bool
previous Bool

elements
emitTitleAlignChange(current: Anonymous, previous: Anonymous): Void

Event when titleAlign field changes.

Name Type
current Anonymous
previous Anonymous

elements
emitScrollsChange(current: Bool, previous: Bool): Void

Event when scrolls field changes.

Name Type
current Bool
previous Bool

elements
emitExpandCollapseClick(): Void

Emitted when the expand/collapse button is clicked


elements
emitHeaderDoubleClick(): Void

Emitted when the header is double-clicked


elements
emitClose(): Void

Emitted when the close button is clicked


elements
headerDown(info: ceramic.TouchInfo): Void
Name Type
info ceramic.TouchInfo

elements
headerMove(info: ceramic.TouchInfo): Void
Name Type
info ceramic.TouchInfo

elements
headerUp(info: ceramic.TouchInfo): Void
Name Type
info ceramic.TouchInfo

elements
contentViewChange(contentView: ceramic.View, prevContentView: ceramic.View): Void
Name Type
contentView ceramic.View
prevContentView ceramic.View

elements
titleChange(title: String, prevTitle: String): Void
Name Type
title String
prevTitle String

elements
titleAlignChange(titleAlign: Anonymous, prevTitleAlign: Anonymous): Void
Name Type
titleAlign Anonymous
prevTitleAlign Anonymous

elements
closableChange(closable: Bool, prevClosable: Bool): Void
Name Type
closable Bool
prevClosable Bool

elements
collapsibleChange(collapsible: Bool, prevCollapsible: Bool): Void
Name Type
collapsible Bool
prevCollapsible Bool

elements
headerChange(header: Bool, prevHeader: Bool): Void
Name Type
header Bool
prevHeader Bool

elements
updateStyle(): Void

Metadata

Name Parameters
:build tracker.macros.ObservableMacro.build()
:autoBuild tracker.macros.ObservableMacro.build()
:build ceramic.macros.EntityMacro.buildForCompletion()
:autoBuild ceramic.macros.EntityMacro.buildForCompletion()
:build tracker.macros.EventsMacro.build()
:autoBuild tracker.macros.EventsMacro.build()