Urho3D
Public Member Functions | Private Member Functions | Private Attributes
Urho3D::UI Class Reference

UI subsystem. Manages the graphical user interface. More...

#include <UI.h>

Inheritance diagram for Urho3D::UI:
Urho3D::Object Urho3D::RefCounted

List of all members.

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< UIElementLoadLayout (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< UIElementLoadLayout (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.
UIElementGetRoot () const
 Return root UI element.
CursorGetCursor () const
 Return cursor.
UIElementGetElementAt (const IntVector2 &position, bool activeOnly=true)
 Return UI element at screen coordinates.
UIElementGetElementAt (int x, int y, bool activeOnly=true)
 Return UI element at screen coordinates.
UIElementGetFocusElement () const
 Return focused element.
UIElementGetFrontElement () const
 Return topmost enabled root-level element.
IntVector2 GetCursorPosition ()
 Return cursor position.
const StringGetClipBoardText () const
 Return clipboard text.
bool IsNonFocusedMouseWheel () const
 Return mouse wheel handling flag.
- Public Member Functions inherited from Urho3D::Object
 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 StringGetTypeName () 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.
ContextGetContext () const
 Return execution context.
ObjectGetSubsystem (ShortStringHash type) const
 Return subsystem by type.
ObjectGetEventSender () const
 Return active event sender. Null outside event handling.
EventHandlerGetEventHandler () 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.
- Public Member Functions inherited from Urho3D::RefCounted
 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.
RefCountRefCountPtr ()
 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 &currentScissor)
 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.
UIElementGetFocusableElement (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.

Private Attributes

WeakPtr< Graphicsgraphics_
 Graphics subsystem.
SharedPtr< ShaderVariationnoTextureVS_
 Vertex shader for no texture.
SharedPtr< ShaderVariationdiffTextureVS_
 Vertex shader for diffuse texture.
SharedPtr< ShaderVariationnoTexturePS_
 Pixel shader for no texture.
SharedPtr< ShaderVariationdiffTexturePS_
 Pixel shader for diffuse texture.
SharedPtr< ShaderVariationdiffMaskTexturePS_
 Pixel shader for diffuse texture masking.
SharedPtr< ShaderVariationalphaTexturePS_
 Pixel shader for alpha texture.
SharedPtr< UIElementrootElement_
 UI root element.
SharedPtr< Cursorcursor_
 Cursor.
WeakPtr< UIElementdragElement_
 UI element being dragged.
WeakPtr< UIElementfocusElement_
 Currently focused element.
PODVector< UIBatchbatches_
 UI rendering batches.
PODVector< UIQuadquads_
 UI rendering quads.
SharedPtr< VertexBuffervertexBuffer_
 UI vertex buffer.
PODVector< UIElement * > tempElements_
 UI element query vector.
String clipBoard_
 Clipboard text.
int mouseButtons_
 Mouse buttons held down.
int qualifiers_
 Qualifier keys held down.
bool initialized_
 Initialized flag.
bool nonFocusedMouseWheel_
 Flag to switch mouse wheel event to be sent to non-focused element at cursor.

Additional Inherited Members

- Protected Attributes inherited from Urho3D::Object
Contextcontext_
 Execution context.

Detailed Description

UI subsystem. Manages the graphical user interface.


The documentation for this class was generated from the following files: