Public Member Functions |
| UI (Context *context) |
| Construct.
|
virtual | ~UI () |
| Destruct.
|
void | SetCursor (Cursor *cursor) |
| Set cursor UI element.
|
void | SetFocusElement (UIElement *element) |
| Set focused UI element.
|
void | Clear () |
| Clear the UI (excluding the cursor.)
|
void | Update (float timeStep) |
| Update the UI logic. Called by HandlePostUpdate().
|
void | RenderUpdate () |
| Update the UI for rendering. Called by HandleRenderUpdate().
|
void | Render () |
| Render the UI.
|
SharedPtr< UIElement > | LoadLayout (Deserializer &source, XMLFile *styleFile=0) |
| Load a UI layout from an XML file. Optionally specify another XML file for element style. Return the root element.
|
SharedPtr< UIElement > | LoadLayout (XMLFile *file, XMLFile *styleFile=0) |
| Load a UI layout from an XML file. Optionally specify another XML file for element style. Return the root element.
|
bool | SaveLayout (Serializer &dest, UIElement *element) |
| Save a UI layout to an XML file. Return true if successful.
|
void | SetClipBoardText (const String &text) |
| Set clipboard text.
|
void | SetNonFocusedMouseWheel (bool nonFocusedMouseWheel) |
| Set mouse wheel handling flag.
|
UIElement * | GetRoot () const |
| Return root UI element.
|
Cursor * | GetCursor () const |
| Return cursor.
|
UIElement * | GetElementAt (const IntVector2 &position, bool activeOnly=true) |
| Return UI element at screen coordinates.
|
UIElement * | GetElementAt (int x, int y, bool activeOnly=true) |
| Return UI element at screen coordinates.
|
UIElement * | GetFocusElement () const |
| Return focused element.
|
UIElement * | GetFrontElement () const |
| Return topmost enabled root-level element.
|
IntVector2 | GetCursorPosition () |
| Return cursor position.
|
const String & | GetClipBoardText () const |
| Return clipboard text.
|
bool | IsNonFocusedMouseWheel () const |
| Return mouse wheel handling flag.
|
| Object (Context *context) |
| Construct.
|
virtual | ~Object () |
| Destruct. Clean up self from event sender & receiver structures.
|
virtual ShortStringHash | GetType () const =0 |
| Return type hash.
|
virtual const String & | GetTypeName () const =0 |
| Return type name.
|
virtual void | OnEvent (Object *sender, StringHash eventType, VariantMap &eventData) |
| Handle event.
|
void | SubscribeToEvent (StringHash eventType, EventHandler *handler) |
| Subscribe to an event that can be sent by any sender.
|
void | SubscribeToEvent (Object *sender, StringHash eventType, EventHandler *handler) |
| Subscribe to a specific sender's event.
|
void | UnsubscribeFromEvent (StringHash eventType) |
| Unsubscribe from an event.
|
void | UnsubscribeFromEvent (Object *sender, StringHash eventType) |
| Unsubscribe from a specific sender's event.
|
void | UnsubscribeFromEvents (Object *sender) |
| Unsubscribe from a specific sender's events.
|
void | UnsubscribeFromAllEvents () |
| Unsubscribe from all events.
|
void | UnsubscribeFromAllEventsExcept (const PODVector< StringHash > &exceptions, bool onlyUserData) |
| Unsubscribe from all events except those listed, and optionally only those with userdata (script registered events.)
|
void | SendEvent (StringHash eventType) |
| Send event to all subscribers.
|
void | SendEvent (StringHash eventType, VariantMap &eventData) |
| Send event with parameters to all subscribers.
|
Context * | GetContext () const |
| Return execution context.
|
Object * | GetSubsystem (ShortStringHash type) const |
| Return subsystem by type.
|
Object * | GetEventSender () const |
| Return active event sender. Null outside event handling.
|
EventHandler * | GetEventHandler () const |
| Return active event handler. Null outside event handling.
|
bool | HasSubscribedToEvent (StringHash eventType) const |
| Return whether has subscribed to an event without specific sender.
|
bool | HasSubscribedToEvent (Object *sender, StringHash eventType) const |
| Return whether has subscribed to a specific sender's event.
|
template<class T > |
T * | GetSubsystem () const |
| Template version of returning a subsystem.
|
| RefCounted () |
| Construct. Allocate the reference count structure and set an initial self weak reference.
|
virtual | ~RefCounted () |
| Destruct. Mark as expired and also delete the reference count structure if no outside weak references exist.
|
void | AddRef () |
| Increment reference count. Can also be called outside of a SharedPtr for traditional reference counting.
|
void | ReleaseRef () |
| Decrement reference count and delete self if no more references. Can also be called outside of a SharedPtr for traditional reference counting.
|
int | Refs () const |
| Return reference count.
|
int | WeakRefs () const |
| Return weak reference count.
|
RefCount * | RefCountPtr () |
| Return pointer to the reference count structure.
|
Private Member Functions |
| OBJECT (UI) |
void | Initialize () |
| Initialize when screen mode initially se.
|
void | Update (float timeStep, UIElement *element) |
| Update UI element logic recursively.
|
void | GetBatches (UIElement *element, IntRect currentScissor) |
| Generate batches from an UI element recursively.
|
bool | IsVisible (UIElement *element, const IntRect ¤tScissor) |
| Return whether element is visible and within the scissor rectangle.
|
void | GetElementAt (UIElement *&result, UIElement *current, const IntVector2 &position, bool activeOnly) |
| Return UI element at screen position recursively.
|
UIElement * | GetFocusableElement (UIElement *element) |
| Return the first element in hierarchy that can alter focus.
|
void | HandleScreenMode (StringHash eventType, VariantMap &eventData) |
| Handle screen mode event.
|
void | HandleMouseButtonDown (StringHash eventType, VariantMap &eventData) |
| Handle mouse button down event.
|
void | HandleMouseButtonUp (StringHash eventType, VariantMap &eventData) |
| Handle mouse button up event.
|
void | HandleMouseMove (StringHash eventType, VariantMap &eventData) |
| Handle mouse move event.
|
void | HandleMouseWheel (StringHash eventType, VariantMap &eventData) |
| Handle mouse wheel event.
|
void | HandleTouchBegin (StringHash eventType, VariantMap &eventData) |
| Handle touch begin event.
|
void | HandleTouchEnd (StringHash eventType, VariantMap &eventData) |
| Handle touch end event.
|
void | HandleTouchMove (StringHash eventType, VariantMap &eventData) |
| Handle touch move event.
|
void | HandleKeyDown (StringHash eventType, VariantMap &eventData) |
| Handle keypress event.
|
void | HandleChar (StringHash eventType, VariantMap &eventData) |
| Handle character event.
|
void | HandlePostUpdate (StringHash eventType, VariantMap &eventData) |
| Handle logic post-update event.
|
void | HandleRenderUpdate (StringHash eventType, VariantMap &eventData) |
| Handle render update event.
|
UI subsystem. Manages the graphical user interface.