Scrollable list UI element. More...

#include <Urho3D/UI/ListView.h>

Inheritance diagram for Urho3D::ListView:
[legend]
Collaboration diagram for Urho3D::ListView:
[legend]

Public Member Functions

 ListView (Context *context)
 Construct.
 
 ~ListView () override
 Destruct.
 
void OnKey (Key key, MouseButtonFlags buttons, QualifierFlags qualifiers) override
 React to a key press.
 
void OnResize (const IntVector2 &newSize, const IntVector2 &delta) override
 React to resize.
 
void UpdateInternalLayout ()
 Manually update layout on internal elements.
 
void DisableInternalLayoutUpdate ()
 Disable automatic layout update for internal elements.
 
void EnableInternalLayoutUpdate ()
 Enable automatic layout update for internal elements.
 
void AddItem (UIElement *item)
 Add item to the end of the list.
 
void InsertItem (unsigned index, UIElement *item, UIElement *parentItem=nullptr)
 Insert item at a specific index. In hierarchy mode, the optional parameter will be used to determine the child's indent level in respect to its parent. If index is greater than the total items then the new item is inserted at the end of the list. In hierarchy mode, if index is greater than the index of last children of the specified parent item then the new item is inserted next to the last children. And if the index is lesser than the index of the parent item itself then the new item is inserted before the first child item.
 
void RemoveItem (UIElement *item, unsigned index=0)
 Remove specific item, starting search at the specified index if provided. In hierarchy mode will also remove any children.
 
void RemoveItem (unsigned index)
 Remove item at index. In hierarchy mode will also remove any children.
 
void RemoveAllItems ()
 Remove all items.
 
void SetSelection (unsigned index)
 
void SetSelections (const PODVector< unsigned > &indices)
 Set multiple selected items. If multiselect disabled, sets only the first.
 
void AddSelection (unsigned index)
 Add item to the selection, multiselect mode only.
 
void RemoveSelection (unsigned index)
 Remove item from the selection.
 
void ToggleSelection (unsigned index)
 Toggle selection of an item.
 
void ChangeSelection (int delta, bool additive=false)
 Move selection by a delta and clamp at list ends. If additive (multiselect only), will add to the existing selection.
 
void ClearSelection ()
 Clear selection.
 
void SetHighlightMode (HighlightMode mode)
 
void SetMultiselect (bool enable)
 
void SetHierarchyMode (bool enable)
 Enable hierarchy mode. Allows items to have parent-child relationship at different indent level and the ability to expand/collapse child items. All items in the list will be lost during mode change. More...
 
void SetBaseIndent (int baseIndent)
 
void SetClearSelectionOnDefocus (bool enable)
 
void SetSelectOnClickEnd (bool enable)
 
void Expand (unsigned index, bool enable, bool recursive=false)
 Expand item at index. Only has effect in hierarchy mode.
 
void ToggleExpand (unsigned index, bool recursive=false)
 Toggle item's expanded flag at index. Only has effect in hierarchy mode.
 
unsigned GetNumItems () const
 
UIElementGetItem (unsigned index) const
 
PODVector< UIElement * > GetItems () const
 Return all items.
 
unsigned FindItem (UIElement *item) const
 Return index of item, or M_MAX_UNSIGNED If not found.
 
unsigned GetSelection () const
 
const PODVector< unsigned > & GetSelections () const
 
void CopySelectedItemsToClipboard () const
 Copy selected items to system clipboard. Currently only applicable to Text items.
 
UIElementGetSelectedItem () const
 
PODVector< UIElement * > GetSelectedItems () const
 
bool IsSelected (unsigned index) const
 Return whether an item at index is selected.
 
bool IsExpanded (unsigned index) const
 Return whether an item at index has its children expanded (in hierarchy mode only).
 
HighlightMode GetHighlightMode () const
 
bool GetMultiselect () const
 
bool GetClearSelectionOnDefocus () const
 
bool GetSelectOnClickEnd () const
 
bool GetHierarchyMode () const
 
int GetBaseIndent () const
 
void EnsureItemVisibility (unsigned index)
 Ensure full visibility of the item.
 
void EnsureItemVisibility (UIElement *item)
 Ensure full visibility of the item.
 
- Public Member Functions inherited from Urho3D::ScrollView
 ScrollView (Context *context)
 Construct.
 
 ~ScrollView () override
 Destruct.
 
void Update (float timeStep) override
 Perform UI element update.
 
void ApplyAttributes () override
 Apply attribute changes that can not be applied immediately.
 
void OnWheel (int delta, MouseButtonFlags buttons, QualifierFlags qualifiers) override
 React to mouse wheel.
 
void OnKey (Key key, MouseButtonFlags buttons, QualifierFlags qualifiers) override
 React to a key press.
 
void OnResize (const IntVector2 &newSize, const IntVector2 &delta) override
 React to resize.
 
bool IsWheelHandler () const override
 Return whether the element could handle wheel input.
 
void SetContentElement (UIElement *element)
 
void SetViewPosition (const IntVector2 &position)
 
void SetViewPosition (int x, int y)
 Set view offset from the top-left corner.
 
void SetScrollBarsVisible (bool horizontal, bool vertical)
 Set scrollbars' visibility manually. Disables scrollbar autoshow/hide.
 
void SetHorizontalScrollBarVisible (bool visible)
 
void SetVerticalScrollBarVisible (bool visible)
 
void SetScrollBarsAutoVisible (bool enable)
 
void SetScrollStep (float step)
 
void SetPageStep (float step)
 
void SetScrollDeceleration (float deceleration)
 
void SetScrollSnapEpsilon (float snap)
 
void SetAutoDisableChildren (bool disable)
 
void SetAutoDisableThreshold (float amount)
 
const IntVector2GetViewPosition () const
 
UIElementGetContentElement () const
 
ScrollBarGetHorizontalScrollBar () const
 
ScrollBarGetVerticalScrollBar () const
 
BorderImageGetScrollPanel () const
 
bool GetScrollBarsAutoVisible () const
 
bool GetHorizontalScrollBarVisible () const
 
bool GetVerticalScrollBarVisible () const
 
float GetScrollStep () const
 
float GetPageStep () const
 
float GetScrollDeceleration () const
 
float GetScrollSnapEpsilon () const
 
bool GetAutoDisableChildren () const
 
float GetAutoDisableThreshold () const
 
void SetViewPositionAttr (const IntVector2 &value)
 Set view position attribute.
 
- Public Member Functions inherited from Urho3D::UIElement
 UIElement (Context *context)
 Construct.
 
 ~UIElement () override
 Destruct.
 
void ApplyAttributes () override
 Apply attribute changes that can not be applied immediately.
 
bool LoadXML (const XMLElement &source) override
 Load from XML data. Return true if successful.
 
virtual bool LoadXML (const XMLElement &source, XMLFile *styleFile)
 Load from XML data with style. Return true if successful.
 
virtual UIElementLoadChildXML (const XMLElement &childElem, XMLFile *styleFile)
 Create a child by loading from XML data with style. Returns the child element if successful, null if otherwise.
 
bool SaveXML (XMLElement &dest) const override
 Save as XML data. Return true if successful.
 
virtual bool IsWithinScissor (const IntRect &currentScissor)
 Return whether is visible and inside a scissor rectangle and should be rendered.
 
virtual const IntVector2GetScreenPosition () const
 
virtual void GetBatches (PODVector< UIBatch > &batches, PODVector< float > &vertexData, const IntRect &currentScissor)
 Return UI rendering batches.
 
virtual void GetDebugDrawBatches (PODVector< UIBatch > &batches, PODVector< float > &vertexData, const IntRect &currentScissor)
 Return UI rendering batches for debug draw.
 
virtual void OnHover (const IntVector2 &position, const IntVector2 &screenPosition, MouseButtonFlags buttons, QualifierFlags qualifiers, Cursor *cursor)
 React to mouse hover.
 
virtual void OnClickBegin (const IntVector2 &position, const IntVector2 &screenPosition, MouseButton button, MouseButtonFlags buttons, QualifierFlags qualifiers, Cursor *cursor)
 React to mouse click begin.
 
virtual void OnClickEnd (const IntVector2 &position, const IntVector2 &screenPosition, MouseButton button, MouseButtonFlags buttons, QualifierFlags qualifiers, Cursor *cursor, UIElement *beginElement)
 React to mouse click end.
 
virtual void OnDoubleClick (const IntVector2 &position, const IntVector2 &screenPosition, MouseButton button, MouseButtonFlags buttons, QualifierFlags qualifiers, Cursor *cursor)
 React to double mouse click.
 
virtual void OnDragBegin (const IntVector2 &position, const IntVector2 &screenPosition, MouseButtonFlags buttons, QualifierFlags qualifiers, Cursor *cursor)
 React to mouse drag begin.
 
virtual void OnDragMove (const IntVector2 &position, const IntVector2 &screenPosition, const IntVector2 &deltaPos, MouseButtonFlags buttons, QualifierFlags qualifiers, Cursor *cursor)
 React to mouse drag motion.
 
virtual void OnDragEnd (const IntVector2 &position, const IntVector2 &screenPosition, MouseButtonFlags dragButtons, MouseButtonFlags releaseButtons, Cursor *cursor)
 React to mouse drag end.
 
virtual void OnDragCancel (const IntVector2 &position, const IntVector2 &screenPosition, MouseButtonFlags dragButtons, MouseButtonFlags cancelButtons, Cursor *cursor)
 React to a mouse drag cancel event (ie, when an extra button is pressed).
 
virtual bool OnDragDropTest (UIElement *source)
 React to drag and drop test. Return true to signal that the drop is acceptable.
 
virtual bool OnDragDropFinish (UIElement *source)
 React to drag and drop finish. Return true to signal that the drop was accepted.
 
virtual void OnTextInput (const String &text)
 React to text input event.
 
virtual void OnPositionSet (const IntVector2 &newPosition)
 React to position change.
 
virtual void OnSetEditable ()
 React to editable status change.
 
virtual void OnIndentSet ()
 React to indent change.
 
virtual IntVector2 ScreenToElement (const IntVector2 &screenPosition)
 Convert screen coordinates to element coordinates.
 
virtual IntVector2 ElementToScreen (const IntVector2 &position)
 Convert element coordinates to screen coordinates.
 
bool LoadXML (Deserializer &source)
 Load from an XML file. Return true if successful.
 
bool SaveXML (Serializer &dest, const String &indentation="\t") const
 Save to an XML file. Return true if successful.
 
bool FilterAttributes (XMLElement &dest) const
 Filter attributes in serialization process.
 
void SetName (const String &name)
 
void SetPosition (const IntVector2 &position)
 
void SetPosition (int x, int y)
 Set position.
 
void SetSize (const IntVector2 &size)
 
void SetSize (int width, int height)
 Set size.
 
void SetWidth (int width)
 
void SetHeight (int height)
 
void SetMinSize (const IntVector2 &minSize)
 
void SetMinSize (int width, int height)
 Set minimum size.
 
void SetMinWidth (int width)
 
void SetMinHeight (int height)
 
void SetMaxSize (const IntVector2 &maxSize)
 
void SetMaxSize (int width, int height)
 Set maximum size.
 
void SetMaxWidth (int width)
 
void SetMaxHeight (int height)
 
void SetFixedSize (const IntVector2 &size)
 Set fixed size.
 
void SetFixedSize (int width, int height)
 Set fixed size.
 
void SetFixedWidth (int width)
 Set fixed width.
 
void SetFixedHeight (int height)
 Set fixed height.
 
void SetAlignment (HorizontalAlignment hAlign, VerticalAlignment vAlign)
 Set horizontal and vertical alignment.
 
void SetHorizontalAlignment (HorizontalAlignment align)
 
void SetVerticalAlignment (VerticalAlignment align)
 
void SetEnableAnchor (bool enable)
 
void SetMinAnchor (const Vector2 &anchor)
 
void SetMinAnchor (float x, float y)
 Set minimum anchor.
 
void SetMaxAnchor (const Vector2 &anchor)
 
void SetMaxAnchor (float x, float y)
 Set maximum anchor.
 
void SetMinOffset (const IntVector2 &offset)
 
void SetMaxOffset (const IntVector2 &offset)
 
void SetPivot (const Vector2 &pivot)
 
void SetPivot (float x, float y)
 Set pivot relative to element's size (from 0 to 1, where 0.5 is center). Overrides horizontal & vertical alignment.
 
void SetClipBorder (const IntRect &rect)
 
void SetColor (const Color &color)
 
void SetColor (Corner corner, const Color &color)
 
void SetPriority (int priority)
 
void SetOpacity (float opacity)
 
void SetBringToFront (bool enable)
 
void SetBringToBack (bool enable)
 
void SetClipChildren (bool enable)
 
void SetSortChildren (bool enable)
 
void SetUseDerivedOpacity (bool enable)
 
void SetEnabled (bool enable)
 
void SetDeepEnabled (bool enable)
 Set enabled state on self and child elements. Elements' own enabled state is remembered (IsEnabledSelf) and can be restored.
 
void ResetDeepEnabled ()
 Reset enabled state to the element's remembered state prior to calling SetDeepEnabled.
 
void SetEnabledRecursive (bool enable)
 Set enabled state on self and child elements. Unlike SetDeepEnabled this does not remember the elements' own enabled state, but overwrites it.
 
void SetEditable (bool enable)
 
void SetFocus (bool enable)
 
void SetSelected (bool enable)
 
void SetVisible (bool enable)
 
void SetFocusMode (FocusMode mode)
 
void SetDragDropMode (DragAndDropModeFlags mode)
 
bool SetStyle (const String &styleName, XMLFile *file=nullptr)
 Set style from an XML file. Find the style element by name. If the style file is not explicitly provided, use the default style from parental chain. Return true if the style is applied successfully. See also Defining UI layouts programmatically.
 
bool SetStyle (const XMLElement &element)
 Set style from an XML element. Return true if the style is applied successfully.
 
bool SetStyleAuto (XMLFile *file=nullptr)
 Set style from an XML file. Find the style element automatically by using the element's typename. If the style file is not explicitly provided, use the default style from parental chain. Return true if the style is applied successfully. See also Defining UI layouts programmatically.
 
void SetDefaultStyle (XMLFile *style)
 
void SetLayout (LayoutMode mode, int spacing=0, const IntRect &border=IntRect::ZERO)
 Set layout parameters.
 
void SetLayoutMode (LayoutMode mode)
 
void SetLayoutSpacing (int spacing)
 
void SetLayoutBorder (const IntRect &border)
 
void SetLayoutFlexScale (const Vector2 &scale)
 
void SetIndent (int indent)
 
void SetIndentSpacing (int indentSpacing)
 
void UpdateLayout ()
 Manually update layout. Should not be necessary in most cases, but is provided for completeness.
 
void DisableLayoutUpdate ()
 Disable automatic layout update. Should only be used if there are performance problems.
 
void EnableLayoutUpdate ()
 Enable automatic layout update.
 
void BringToFront ()
 Bring UI element to front.
 
UIElementCreateChild (StringHash type, const String &name=String::EMPTY, unsigned index=M_MAX_UNSIGNED)
 Create and add a child element and return it.
 
void AddChild (UIElement *element)
 Add a child element.
 
void InsertChild (unsigned index, UIElement *element)
 Insert a child element into a specific position in the child list.
 
void RemoveChild (UIElement *element, unsigned index=0)
 Remove a child element. Starting search at specified index if provided.
 
void RemoveChildAtIndex (unsigned index)
 Remove a child element at index.
 
void RemoveAllChildren ()
 Remove all child elements.
 
void Remove ()
 Remove from the parent element. If no other shared pointer references exist, causes immediate deletion.
 
unsigned FindChild (UIElement *element) const
 Find child index. Return M_MAX_UNSIGNED if not found.
 
void SetParent (UIElement *parent, unsigned index=M_MAX_UNSIGNED)
 Set parent element. Same as parent->InsertChild(index, this).
 
void SetVar (StringHash key, const Variant &value)
 Set a user variable.
 
void SetInternal (bool enable)
 
void SetTraversalMode (TraversalMode traversalMode)
 
void SetElementEventSender (bool flag)
 
void SetTags (const StringVector &tags)
 Set tags. Old tags are overwritten.
 
void AddTag (const String &tag)
 Add a tag.
 
void AddTags (const String &tags, char separator=';')
 Add tags with the specified separator (; by default).
 
void AddTags (const StringVector &tags)
 Add tags.
 
bool RemoveTag (const String &tag)
 Remove specific tag. Return true if existed.
 
void RemoveAllTags ()
 Remove all tags.
 
template<class T >
T * CreateChild (const String &name=String::EMPTY, unsigned index=M_MAX_UNSIGNED)
 Template version of creating a child element.
 
template<class T >
T * GetChildStaticCast (unsigned index) const
 Template version of returning child element by index using static cast.
 
template<class T >
T * GetChildStaticCast (const String &name, bool recursive=false) const
 Template version of returning child element by name using static cast.
 
template<class T >
T * GetChildStaticCast (const StringHash &key, const Variant &value=Variant::EMPTY, bool recursive=false) const
 Template version of returning child element by variable using static cast. If only key is provided, return the first child having the matching variable key. If value is also provided then the actual variable value would also be checked against.
 
template<class T >
T * GetChildDynamicCast (unsigned index) const
 Template version of returning child element by index using dynamic cast. May return 0 when casting failed.
 
template<class T >
T * GetChildDynamicCast (const String &name, bool recursive=false) const
 Template version of returning child element by name using dynamic cast. May return 0 when casting failed.
 
template<class T >
T * GetChildDynamicCast (const StringHash &key, const Variant &value=Variant::EMPTY, bool recursive=false) const
 Template version of returning child element by variable. If only key is provided, return the first child having the matching variable key. If value is also provided then the actual variable value would also be checked against using dynamic cast. May return 0 when casting failed.
 
const StringGetName () const
 
const IntVector2GetPosition () const
 
const IntVector2GetSize () const
 
int GetWidth () const
 
int GetHeight () const
 
const IntVector2GetMinSize () const
 
int GetMinWidth () const
 
int GetMinHeight () const
 
const IntVector2GetMaxSize () const
 
int GetMaxWidth () const
 
int GetMaxHeight () const
 
bool IsFixedSize () const
 
bool IsFixedWidth () const
 
bool IsFixedHeight () const
 
const IntVector2GetChildOffset () const
 
HorizontalAlignment GetHorizontalAlignment () const
 
VerticalAlignment GetVerticalAlignment () const
 
bool GetEnableAnchor () const
 
const Vector2GetMinAnchor () const
 
const Vector2GetMaxAnchor () const
 
const IntVector2GetMinOffset () const
 
const IntVector2GetMaxOffset () const
 
const Vector2GetPivot () const
 
const IntRectGetClipBorder () const
 
const ColorGetColor (Corner corner) const
 
int GetPriority () const
 
float GetOpacity () const
 
float GetDerivedOpacity () const
 
bool GetBringToFront () const
 
bool GetBringToBack () const
 
bool GetClipChildren () const
 
bool GetSortChildren () const
 
bool GetUseDerivedOpacity () const
 
bool HasFocus () const
 
bool IsChildOf (UIElement *element) const
 Return whether is a direct or indirect child of specified element.
 
bool IsEnabled () const
 
bool IsEnabledSelf () const
 
bool IsEditable () const
 
bool IsSelected () const
 
bool IsVisible () const
 
bool IsVisibleEffective () const
 
bool IsHovering () const
 
bool IsInternal () const
 
bool HasColorGradient () const
 
FocusMode GetFocusMode () const
 
DragAndDropModeFlags GetDragDropMode () const
 
const StringGetAppliedStyle () const
 
XMLFileGetDefaultStyle (bool recursiveUp=true) const
 Return default style.
 
LayoutMode GetLayoutMode () const
 
int GetLayoutSpacing () const
 
const IntRectGetLayoutBorder () const
 
const Vector2GetLayoutFlexScale () const
 
unsigned GetNumChildren (bool recursive=false) const
 
UIElementGetChild (unsigned index) const
 
UIElementGetChild (const String &name, bool recursive=false) const
 Return child element by name.
 
UIElementGetChild (const StringHash &key, const Variant &value=Variant::EMPTY, bool recursive=false) const
 Return child element by variable. If only key is provided, return the first child having the matching variable key. If value is also provided then the actual variable value would also be checked against.
 
const Vector< SharedPtr< UIElement > > & GetChildren () const
 Return immediate child elements.
 
void GetChildren (PODVector< UIElement * > &dest, bool recursive=false) const
 Return child elements either recursively or non-recursively.
 
PODVector< UIElement * > GetChildren (bool recursive) const
 Return child elements, optionally recursive.
 
UIElementGetParent () const
 
UIElementGetRoot () const
 
const ColorGetDerivedColor () const
 Return derived color. Only valid when no gradient.
 
const VariantGetVar (const StringHash &key) const
 Return a user variable.
 
const VariantMapGetVars () const
 Return all user variables.
 
bool HasTag (const String &tag) const
 Return whether element is tagged by a specific tag.
 
const StringVectorGetTags () const
 
void GetChildrenWithTag (PODVector< UIElement * > &dest, const String &tag, bool recursive=false) const
 Return child elements with a specific tag either recursively or non-recursively.
 
PODVector< UIElement * > GetChildrenWithTag (const String &tag, bool recursive=false) const
 Return child elements with a specific tag either recursively or non-recursively.
 
MouseButtonFlags GetDragButtonCombo () const
 
unsigned GetDragButtonCount () const
 
bool IsInside (IntVector2 position, bool isScreen)
 Return whether a point (either in element or screen coordinates) is inside the element.
 
bool IsInsideCombined (IntVector2 position, bool isScreen)
 Return whether a point (either in element or screen coordinates) is inside the combined rect of the element and its children.
 
IntRect GetCombinedScreenRect ()
 
void SortChildren ()
 Sort child elements if sorting enabled and order dirty. Called by UI. More...
 
int GetLayoutElementMaxSize () const
 Return maximum layout element size in the layout direction. Only valid after layout has been calculated. Used internally by UI for optimizations.
 
int GetIndent () const
 
int GetIndentSpacing () const
 
int GetIndentWidth () const
 
void SetChildOffset (const IntVector2 &offset)
 Set child offset.
 
void SetHovering (bool enable)
 Set hovering state.
 
void AdjustScissor (IntRect &currentScissor)
 Adjust scissor for rendering.
 
void GetBatchesWithOffset (IntVector2 &offset, PODVector< UIBatch > &batches, PODVector< float > &vertexData, IntRect currentScissor)
 Get UI rendering batches with a specified offset. Also recurse to child elements.
 
const ColorGetColorAttr () const
 Return color attribute. Uses just the top-left color.
 
TraversalMode GetTraversalMode () const
 
bool IsElementEventSender () const
 
UIElementGetElementEventSender () const
 Get element which should send child added / removed events.
 
IntVector2 GetEffectiveMinSize () const
 Return effective minimum size, also considering layout. Used internally.
 
void SetRenderTexture (Texture2D *texture)
 Set texture to which element will be rendered.
 
- Public Member Functions inherited from Urho3D::Animatable
 Animatable (Context *context)
 Construct.
 
 ~Animatable () override
 Destruct.
 
bool LoadJSON (const JSONValue &source) override
 Load from JSON data. Return true if successful.
 
bool SaveJSON (JSONValue &dest) const override
 Save as JSON data. Return true if successful.
 
void SetAnimationEnabled (bool enable)
 
void SetAnimationTime (float time)
 Set time position of all attribute animations or an object animation manually. Automatic update should be disabled in this case.
 
void SetObjectAnimation (ObjectAnimation *objectAnimation)
 
void SetAttributeAnimation (const String &name, ValueAnimation *attributeAnimation, WrapMode wrapMode=WM_LOOP, float speed=1.0f)
 Set attribute animation.
 
void SetAttributeAnimationWrapMode (const String &name, WrapMode wrapMode)
 Set attribute animation wrap mode.
 
void SetAttributeAnimationSpeed (const String &name, float speed)
 Set attribute animation speed.
 
void SetAttributeAnimationTime (const String &name, float time)
 Set attribute animation time position manually. Automatic update should be disabled in this case.
 
void RemoveObjectAnimation ()
 Remove object animation. Same as calling SetObjectAnimation with a null pointer.
 
void RemoveAttributeAnimation (const String &name)
 Remove attribute animation. Same as calling SetAttributeAnimation with a null pointer.
 
bool GetAnimationEnabled () const
 
ObjectAnimationGetObjectAnimation () const
 
ValueAnimationGetAttributeAnimation (const String &name) const
 Return attribute animation.
 
WrapMode GetAttributeAnimationWrapMode (const String &name) const
 Return attribute animation wrap mode.
 
float GetAttributeAnimationSpeed (const String &name) const
 Return attribute animation speed.
 
float GetAttributeAnimationTime (const String &name) const
 Return attribute animation time position.
 
void SetObjectAnimationAttr (const ResourceRef &value)
 Set object animation attribute.
 
ResourceRef GetObjectAnimationAttr () const
 Return object animation attribute.
 
- Public Member Functions inherited from Urho3D::Serializable
 Serializable (Context *context)
 Construct.
 
 ~Serializable () override
 Destruct.
 
virtual void OnSetAttribute (const AttributeInfo &attr, const Variant &src)
 Handle attribute write access. Default implementation writes to the variable at offset, or invokes the set accessor.
 
virtual void OnGetAttribute (const AttributeInfo &attr, Variant &dest) const
 Handle attribute read access. Default implementation reads the variable at offset, or invokes the get accessor.
 
virtual const Vector< AttributeInfo > * GetAttributes () const
 Return attribute descriptions, or null if none defined.
 
virtual const Vector< AttributeInfo > * GetNetworkAttributes () const
 Return network replication attribute descriptions, or null if none defined.
 
virtual bool Load (Deserializer &source)
 Load from binary data. Return true if successful.
 
virtual bool Save (Serializer &dest) const
 Save as binary data. Return true if successful.
 
virtual bool SaveDefaultAttributes () const
 Return whether should save default-valued attributes into XML. Default false.
 
virtual void MarkNetworkUpdate ()
 Mark for attribute check on the next network update.
 
bool SetAttribute (unsigned index, const Variant &value)
 
bool SetAttribute (const String &name, const Variant &value)
 Set attribute by name. Return true if successfully set.
 
void SetInstanceDefault (bool enable)
 Set instance-level default flag.
 
void ResetToDefault ()
 Reset all editable attributes to their default values.
 
void RemoveInstanceDefault ()
 Remove instance's default values if they are set previously.
 
void SetTemporary (bool enable)
 
void SetInterceptNetworkUpdate (const String &attributeName, bool enable)
 Enable interception of an attribute from network updates. Intercepted attributes are sent as events instead of applying directly. This can be used to implement client side prediction.
 
void AllocateNetworkState ()
 Allocate network attribute state.
 
void WriteInitialDeltaUpdate (Serializer &dest, unsigned char timeStamp)
 Write initial delta network update.
 
void WriteDeltaUpdate (Serializer &dest, const DirtyBits &attributeBits, unsigned char timeStamp)
 Write a delta network update according to dirty attribute bits.
 
void WriteLatestDataUpdate (Serializer &dest, unsigned char timeStamp)
 Write a latest data network update.
 
bool ReadDeltaUpdate (Deserializer &source)
 Read and apply a network delta update. Return true if attributes were changed.
 
bool ReadLatestDataUpdate (Deserializer &source)
 Read and apply a network latest data update. Return true if attributes were changed.
 
Variant GetAttribute (unsigned index) const
 
Variant GetAttribute (const String &name) const
 Return attribute value by name. Return empty if not found.
 
Variant GetAttributeDefault (unsigned index) const
 
Variant GetAttributeDefault (const String &name) const
 Return attribute default value by name. Return empty if not found.
 
unsigned GetNumAttributes () const
 
unsigned GetNumNetworkAttributes () const
 Return number of network replication attributes.
 
bool IsTemporary () const
 
bool GetInterceptNetworkUpdate (const String &attributeName) const
 Return whether an attribute's network updates are being intercepted.
 
NetworkStateGetNetworkState () const
 Return the network attribute state, if allocated.
 
- Public Member Functions inherited from Urho3D::Object
 Object (Context *context)
 Construct.
 
 ~Object () override
 Destruct. Clean up self from event sender & receiver structures.
 
virtual StringHash GetType () const =0
 
virtual const StringGetTypeName () const =0
 
virtual const TypeInfoGetTypeInfo () const =0
 Return type info.
 
virtual void OnEvent (Object *sender, StringHash eventType, VariantMap &eventData)
 Handle event.
 
bool IsInstanceOf (StringHash type) const
 Check current instance is type of specified type.
 
bool IsInstanceOf (const TypeInfo *typeInfo) const
 Check current instance is type of specified type.
 
template<typename T >
bool IsInstanceOf () const
 Check current instance is type of specified class.
 
template<typename T >
T * Cast ()
 Cast the object to specified most derived class.
 
template<typename T >
const T * Cast () const
 Cast the object to specified most derived class.
 
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 SubscribeToEvent (StringHash eventType, const std::function< void(StringHash, VariantMap &)> &function, void *userData=nullptr)
 Subscribe to an event that can be sent by any sender.
 
void SubscribeToEvent (Object *sender, StringHash eventType, const std::function< void(StringHash, VariantMap &)> &function, void *userData=nullptr)
 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.
 
VariantMapGetEventDataMap () const
 Return a preallocated map for event data. Used for optimization to avoid constant re-allocation of event data maps.
 
template<typename... Args>
void SendEvent (StringHash eventType, Args... args)
 Send event with variadic parameter pairs to all subscribers. The parameter pairs is a list of paramID and paramValue separated by comma, one pair after another.
 
ContextGetContext () const
 Return execution context.
 
const VariantGetGlobalVar (StringHash key) const
 
const VariantMapGetGlobalVars () const
 
void SetGlobalVar (StringHash key, const Variant &value)
 
ObjectGetSubsystem (StringHash 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.
 
bool HasEventHandlers () const
 Return whether has subscribed to any event.
 
template<class T >
T * GetSubsystem () const
 Template version of returning a subsystem.
 
const StringGetCategory () const
 
void SetBlockEvents (bool block)
 Block object from sending and receiving events.
 
bool GetBlockEvents () const
 Return sending and receiving events blocking status.
 
- 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.
 
 RefCounted (const RefCounted &rhs)=delete
 Prevent copy construction.
 
RefCountedoperator= (const RefCounted &rhs)=delete
 Prevent assignment.
 
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
 
int WeakRefs () const
 
RefCountRefCountPtr ()
 Return pointer to the reference count structure.
 

Static Public Member Functions

static void RegisterObject (Context *context)
 Register object factory.
 
- Static Public Member Functions inherited from Urho3D::ScrollView
static void RegisterObject (Context *context)
 Register object factory.
 
- Static Public Member Functions inherited from Urho3D::UIElement
static void RegisterObject (Context *context)
 Register object factory.
 
- Static Public Member Functions inherited from Urho3D::Animatable
static void RegisterObject (Context *context)
 Register object factory.
 
- Static Public Member Functions inherited from Urho3D::Object
static const TypeInfoGetTypeInfoStatic ()
 Return type info static.
 

Protected Member Functions

bool FilterImplicitAttributes (XMLElement &dest) const override
 Filter implicit attributes in serialization process.
 
void UpdateSelectionEffect ()
 Update selection effect when selection or focus changes.
 
- Protected Member Functions inherited from Urho3D::ScrollView
bool FilterImplicitAttributes (XMLElement &dest) const override
 Filter implicit attributes in serialization process.
 
bool FilterScrollBarImplicitAttributes (XMLElement &dest, const String &name) const
 Filter implicit attributes in serialization process for internal scroll bar.
 
void UpdatePanelSize ()
 Resize panel based on scrollbar visibility.
 
void UpdateViewSize ()
 Recalculate view size, validate view position and update scrollbars.
 
void UpdateScrollBars ()
 Update the scrollbars' ranges and positions.
 
void UpdateView (const IntVector2 &position)
 Limit and update the view with a new position.
 
- Protected Member Functions inherited from Urho3D::UIElement
void OnAttributeAnimationAdded () override
 Handle attribute animation added.
 
void OnAttributeAnimationRemoved () override
 Handle attribute animation removed.
 
AnimatableFindAttributeAnimationTarget (const String &name, String &outName) override
 Find target of an attribute animation from object hierarchy by name.
 
void MarkDirty ()
 Mark screen position as needing an update.
 
bool RemoveChildXML (XMLElement &parent, const String &name) const
 Remove child XML element by matching attribute name.
 
bool RemoveChildXML (XMLElement &parent, const String &name, const String &value) const
 Remove child XML element by matching attribute name and value.
 
bool FilterUIStyleAttributes (XMLElement &dest, const XMLElement &styleElem) const
 Filter UI-style attributes in serialization process.
 
void UpdateAnchoring ()
 Update anchored size & position. Only called when anchoring is enabled.
 
- Protected Member Functions inherited from Urho3D::Animatable
void SetObjectAttributeAnimation (const String &name, ValueAnimation *attributeAnimation, WrapMode wrapMode, float speed)
 Set object attribute animation internal.
 
void OnObjectAnimationAdded (ObjectAnimation *objectAnimation)
 Handle object animation added.
 
void OnObjectAnimationRemoved (ObjectAnimation *objectAnimation)
 Handle object animation removed.
 
void UpdateAttributeAnimations (float timeStep)
 Update attribute animations.
 
bool IsAnimatedNetworkAttribute (const AttributeInfo &attrInfo) const
 Is animated network attribute.
 
AttributeAnimationInfoGetAttributeAnimationInfo (const String &name) const
 Return attribute animation info.
 
void HandleAttributeAnimationAdded (StringHash eventType, VariantMap &eventData)
 Handle attribute animation added.
 
void HandleAttributeAnimationRemoved (StringHash eventType, VariantMap &eventData)
 Handle attribute animation removed.
 

Protected Attributes

PODVector< unsigned > selections_
 Current selection.
 
HighlightMode highlightMode_
 Highlight mode.
 
bool multiselect_
 Multiselect flag.
 
bool hierarchyMode_
 Hierarchy mode flag.
 
int baseIndent_
 Base indent, used in hierarchy mode only.
 
SharedPtr< UIElementoverlayContainer_
 Overlay container, used in hierarchy mode only.
 
bool clearSelectionOnDefocus_
 Clear selection on defocus flag.
 
bool selectOnClickEnd_
 React to click end instead of click start flag.
 
- Protected Attributes inherited from Urho3D::ScrollView
SharedPtr< UIElementcontentElement_
 Content element.
 
SharedPtr< ScrollBarhorizontalScrollBar_
 Horizontal scroll bar.
 
SharedPtr< ScrollBarverticalScrollBar_
 Vertical scroll bar.
 
SharedPtr< BorderImagescrollPanel_
 Scroll panel element.
 
IntVector2 viewPosition_
 Current view offset from the top-left corner.
 
IntVector2 viewSize_
 Total view size.
 
IntVector2 viewPositionAttr_
 View offset attribute.
 
Vector2 touchScrollSpeed_
 Accumulated touch scroll speed.
 
Vector2 touchScrollSpeedMax_
 Max touch scroll speed.
 
float pageStep_
 Arrow key page step.
 
bool scrollBarsAutoVisible_
 Automatically show/hide scrollbars flag.
 
bool ignoreEvents_
 Ignore scrollbar events flag. Used to prevent possible endless loop when resizing.
 
bool resizeContentWidth_
 Resize content widget width to match panel. Internal flag, used by the ListView class.
 
float scrollDeceleration_
 Scroll deceleration.
 
float scrollSnapEpsilon_
 Scroll snap epsilon.
 
bool scrollTouchDown_
 Used to trigger scroll smoothing when false.
 
bool barScrolling_
 Used to prevent touch scroll - scroll bar conflict.
 
bool autoDisableChildren_
 Used to determine if child elements should be disabled while touch scrolling, to prevent their trigger.
 
bool scrollChildrenDisable_
 Used to determine if children have been disabled.
 
float touchDistanceSum_
 Distance moved with touch scrolling.
 
float autoDisableThreshold_
 Threshold to trigger auto disable children.
 
- Protected Attributes inherited from Urho3D::UIElement
String name_
 Name.
 
Vector< SharedPtr< UIElement > > children_
 Child elements.
 
UIElementparent_ {}
 Parent element.
 
IntRect clipBorder_
 Child element clipping border.
 
Color colors_ [MAX_UIELEMENT_CORNERS]
 Colors.
 
VariantMap vars_
 User variables.
 
int priority_ {}
 Priority.
 
bool bringToFront_ {}
 Bring to front when focused flag.
 
bool bringToBack_ {true}
 Bring to back when defocused flag.
 
bool clipChildren_ {}
 Clip children flag.
 
bool sortChildren_ {true}
 Sort children according to priority flag.
 
bool useDerivedOpacity_ {true}
 Use derived opacity flag.
 
bool enabled_ {}
 Input enabled flag.
 
bool enabledPrev_ {}
 Last SetEnabled flag before any SetDeepEnabled.
 
bool editable_ {true}
 Value editable flag.
 
bool selected_ {}
 Selected flag.
 
bool visible_ {true}
 Visible flag.
 
bool hovering_ {}
 Hovering flag.
 
bool internal_ {}
 Internally created flag.
 
FocusMode focusMode_ {FM_NOTFOCUSABLE}
 Focus mode.
 
DragAndDropModeFlags dragDropMode_ {DD_DISABLED}
 Drag and drop flags.
 
LayoutMode layoutMode_ {LM_FREE}
 Layout mode.
 
int layoutSpacing_ {}
 Layout spacing.
 
IntRect layoutBorder_ {}
 Layout borders.
 
Vector2 layoutFlexScale_ {Vector2::ONE}
 Layout flex scale.
 
unsigned resizeNestingLevel_ {}
 Resize nesting level to prevent multiple events and endless loop.
 
unsigned layoutNestingLevel_ {}
 Layout update nesting level to prevent endless loop.
 
int layoutElementMaxSize_ {}
 Layout element maximum size in layout direction.
 
int indent_ {}
 Horizontal indentation.
 
int indentSpacing_ {16}
 Indent spacing (number of pixels per indentation level).
 
IntVector2 position_ {}
 Position.
 
IntVector2 screenPosition_
 Screen position.
 
bool positionDirty_ {true}
 Screen position dirty flag.
 
String appliedStyle_
 Applied style.
 
MouseButtonFlags dragButtonCombo_ {}
 Drag button combo.
 
unsigned dragButtonCount_ {}
 Drag button count.
 
- Protected Attributes inherited from Urho3D::Animatable
bool animationEnabled_
 Animation enabled.
 
SharedPtr< ObjectAnimationobjectAnimation_
 Animation.
 
HashSet< const AttributeInfo * > animatedNetworkAttributes_
 Animated network attribute set.
 
HashMap< String, SharedPtr< AttributeAnimationInfo > > attributeAnimationInfos_
 Attribute animation infos.
 
- Protected Attributes inherited from Urho3D::Serializable
UniquePtr< NetworkStatenetworkState_
 Network attribute state.
 
- Protected Attributes inherited from Urho3D::Object
Contextcontext_
 Execution context.
 

Private Member Functions

 URHO3D_OBJECT (ListView, ScrollView)
 
void HandleUIMouseClick (StringHash eventType, VariantMap &eventData)
 Handle global UI mouseclick to check for selection change.
 
void HandleUIMouseDoubleClick (StringHash eventType, VariantMap &eventData)
 Handle global UI mouse doubleclick.
 
void HandleItemFocusChanged (StringHash eventType, VariantMap &eventData)
 Handle global focus change to check whether an invisible item was focused.
 
void HandleFocusChanged (StringHash eventType, VariantMap &eventData)
 Handle focus changed.
 
void UpdateUIClickSubscription ()
 Update subscription to UI click events.
 

Detailed Description

Scrollable list UI element.

Member Function Documentation

◆ GetBaseIndent()

int Urho3D::ListView::GetBaseIndent ( ) const
inline

Return base indent.

Here is the caller graph for this function:

◆ GetClearSelectionOnDefocus()

bool Urho3D::ListView::GetClearSelectionOnDefocus ( ) const
inline

Return whether selection is cleared on defocus.

Here is the caller graph for this function:

◆ GetHierarchyMode()

bool Urho3D::ListView::GetHierarchyMode ( ) const
inline

Return whether hierarchy mode enabled.

Here is the caller graph for this function:

◆ GetHighlightMode()

HighlightMode Urho3D::ListView::GetHighlightMode ( ) const
inline

Return highlight mode.

Here is the caller graph for this function:

◆ GetItem()

UIElement * Urho3D::ListView::GetItem ( unsigned  index) const

Return item at index.

Here is the caller graph for this function:

◆ GetMultiselect()

bool Urho3D::ListView::GetMultiselect ( ) const
inline

Return whether multiselect enabled.

Here is the caller graph for this function:

◆ GetNumItems()

unsigned Urho3D::ListView::GetNumItems ( ) const

Return number of items.

Here is the caller graph for this function:

◆ GetSelectedItem()

UIElement * Urho3D::ListView::GetSelectedItem ( ) const

Return first selected item, or null if none selected.

Here is the call graph for this function:

◆ GetSelectedItems()

PODVector< UIElement * > Urho3D::ListView::GetSelectedItems ( ) const

Return all selected items.

Here is the call graph for this function:

◆ GetSelection()

unsigned Urho3D::ListView::GetSelection ( ) const

Return first selected index, or M_MAX_UNSIGNED if none selected.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetSelections()

const PODVector<unsigned>& Urho3D::ListView::GetSelections ( ) const
inline

Return all selected indices.

◆ GetSelectOnClickEnd()

bool Urho3D::ListView::GetSelectOnClickEnd ( ) const
inline

Return whether reacts to click end instead of click start for item selection.

Here is the caller graph for this function:

◆ SetBaseIndent()

void Urho3D::ListView::SetBaseIndent ( int  baseIndent)

Set base indent, i.e. the indent level of the ultimate parent item.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetClearSelectionOnDefocus()

void Urho3D::ListView::SetClearSelectionOnDefocus ( bool  enable)

Enable clearing of selection on defocus.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetHierarchyMode()

void Urho3D::ListView::SetHierarchyMode ( bool  enable)

Enable hierarchy mode. Allows items to have parent-child relationship at different indent level and the ability to expand/collapse child items. All items in the list will be lost during mode change.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetHighlightMode()

void Urho3D::ListView::SetHighlightMode ( HighlightMode  mode)

Set selected items' highlight mode.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetMultiselect()

void Urho3D::ListView::SetMultiselect ( bool  enable)

Enable multiselect.

Here is the caller graph for this function:

◆ SetSelection()

void Urho3D::ListView::SetSelection ( unsigned  index)

Set selection.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetSelectOnClickEnd()

void Urho3D::ListView::SetSelectOnClickEnd ( bool  enable)

Enable reacting to click end instead of click start for item selection. Default false.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files:
  • Source/Urho3D/UI/ListView.h
  • Source/Urho3D/UI/ListView.cpp