Register
Essence » Wiki » UI Elements

Introduction

UI elements are a group of API objects that share common functionality relating to the user interface.

A UI element provides a common interface for message processing, notification processing and layouting. UI elements are arranged in a hierarchy.

The following objects are UI elements:

The following functions can be used to attach an element a parent element:

Message processing

Messages are used to implement the behaviour of a UI element.

Message processing roughly covers the functionality provided by views/controllers in the model-view-controller architecture. In contrast, notification processing is used for implementation of the "model".

See message processing.

Notification processing

Notifications are used to implement the program-side behaviours of a UI element.

Reference

OSElementDebug

1
void OSElementDebug(OSObject element);

Mark an element for debugging. Additional information will be logged. For internal use only.

OSElementDestroy

1
void OSElementDestroy(OSObject element);

Removes an element from its parent if one exists (see OSElementRemoveFromParent), and then destroys it, deallocating its memory.

OSElementDisable

1
void OSElementDisable(OSObject element, bool disabled);

Set disabled to true to disable an element, or false to enable an element.

Disabled controls cannot be interacted with. Other elements may disable their child elements.

OSElementEnable

1
void OSElementEnable(OSObject element, bool enabled);

Set enabled to true to enable an element, or false to disable an element.

Disabled controls cannot be interacted with. Other elements may disable their child elements.

OSElementGetBounds

1
OSRectangle OSElementGetBounds(OSObject element);

Get the rectangular bounds of an element, relative to the top-left corner of the window in which it exists.

OSElementGetWindow

1
OSObject OSElementGetWindow(OSObject element);

Get the window the element is attached to. If the element is a window, itself will be returned.

OSElementMove

1
void OSElementMove(OSObject element, OSRectangle rectangle);

Move an element to occupy new bounds. It will still be clipped to its parent element. The rectangle must contain coordinates relative to the top-left corner of the window.

OSElementRemoveFromParent

1
void OSElementRemoveFromParent(OSObject element);

Remove an element from its parent. It may then be attached to a new parent element.

OSElementRepaint

1
void OSElementRepaint(OSObject element);

Mark an element as needing a repaint. It will be repainted at the next convenience by the API, by means of sending it a OS_MESSAGE_PAINT message.

OSElementSetNotificationCallback

1
void OSElementSetNotificationCallback(OSObject element, OSNotificationCallback callback);

Set the notification callback of an element. The element will send all its notifications to this callback.

OSElementSetProperty

1
void OSElementSetProperty(OSObject object, uintptr_t index, uintptr_t value);

Set a property of an element. Deprecated.