Guiliani  Version 2.4 revision 5970 (build 3)
CGUIListBox Class Reference

Contains list items and can be scrolled if there is not enough space. More...

#include <GUIListBox.h>

Inheritance diagram for CGUIListBox:

Public Types

typedef eC_TListDoubleLinked< eC_UInt > IndexList_t
 Type used for the index of those selected items in the list box.
 
typedef eC_TListDoubleLinked< CGUIListItem * > ItemPtrList_t
 Type used for the item list that contains items.
 
enum  Mode_t { VER_EXT, HOR_EXT }
 
typedef eC_TListDoubleLinked< eC_String > StringList_t
 Type used for the string of those selected items in the list box.
 
- Public Types inherited from CGUIScrollView
enum  ScrollBarPolicy { AUTOMATIC, ALWAYS_VISIBLE, NEVER_VISIBLE }
 Scrollbar policies. These specify under which circumstances a scrollbar is visible. More...
 
- Public Types inherited from CGUIObject
enum  FourWayFocus_t { FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUS_DOWN }
 

Public Member Functions

 CGUIListBox (CGUICompositeObject *const pParent, const eC_Value &vX, const eC_Value &vY, const eC_Value &vWidth, const eC_Value &vHeight, const Mode_t &eMode=VER_EXT, const eC_Bool &bMultipleSelection=false, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUIListBox (CGUICompositeObject *const pParent, const CGUIRect &kRect, const Mode_t &eMode=VER_EXT, const eC_Bool &bMultipleSelection=false, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUIListBox ()
 Standard constructor.
 
 ~CGUIListBox ()
 Destructor.
 
eC_Bool AddItem (CGUIListItem *pItem, eC_Bool bIsAutoAdjustArrange=true)
 
eC_Bool AddSelection (eC_UInt uiIndex)
 
void AddSelectionObserver (CGUIObserver *pObserver)
 
void AdjustArrangement ()
 
void DeleteAllItems ()
 
virtual eC_Bool DoButtonDown (const eC_Value &vAbsX, const eC_Value &vAbsY)
 
virtual eC_Bool DoClick (const eC_Value &vAbsX=(eC_FromInt(-1)), const eC_Value &vAbsY=(eC_FromInt(-1)))
 
virtual eC_Bool DoDrag (const eC_Value &vDeltaX, const eC_Value &vDeltaY, const eC_Value &vAbsX, const eC_Value &vAbsY)
 
virtual eC_Bool DoDragEnd (const eC_Value &vAbsX, const eC_Value &vAbsY)
 
virtual eC_Bool DoDraw ()
 
eC_Bool DoKeyDown (const GUIKeyIdentifier_t &eKeyID, const eC_UInt &uiModifiers)
 
virtual eC_Bool DoMouseEnter (const eC_Value &vAbsX, const eC_Value &vAbsY)
 
eC_Bool DoPostDraw ()
 
eC_Int FindItem (const eC_String &kItemStr) const
 
eC_Int FindItemBySubstring (const eC_String &kSearchString) const
 
eC_Bool FocusAny ()
 
CGUIListItemGetItem (eC_UInt uiIndex)
 
eC_UInt GetItemCount () const
 
eC_Int GetItemIndexOfObject (const CGUIObject *pObj) const
 
CGUIListItemGetNextItem ()
 
StringList_t GetSelectedItemsStrList ()
 
eC_String GetSelectedItemStr ()
 
eC_Int GetSelection ()
 
IndexList_t GetSelectionIndexList ()
 
eC_Bool IsObjectAnItemInList (const CGUIObject *pObj) const
 
virtual void ReadFromStream ()
 
void ReleaseAllSelection ()
 
void ReleaseSelection (eC_UInt uiIndex)
 
eC_Bool RemoveItem (CGUIListItem *pItem, eC_Bool bIsAutoAdjustArrange=true)
 Removes an item from the scrolled container. More...
 
eC_Bool RemoveItems (eC_UInt uiStartIndex, eC_UInt uiEndIndex, eC_Bool bIsAutoAdjustArrange=true)
 
void RemoveSelectionObserver (CGUIObserver *pObserver)
 
virtual eC_Bool RequestFocusForSelection ()
 
eC_Bool SelectObject (const CGUIObject *pObj)
 
void SetBgColor (const eC_UInt &uiBgColor)
 
void SetBgColor (const GlobalProperty_t &eBgColor)
 
void SetDraggedFrameBgColor (const eC_UInt &uiDraggedFrameBgColor)
 
void SetDraggedFrameBgColor (const GlobalProperty_t &eDraggedFrameBgColor)
 
void SetHeight (const eC_Value &vHeight)
 
void SetItemSelectedColor (eC_UInt uiItemSelectedColor)
 
void SetMultipleSelection (const eC_Bool &bMultiSelection)
 
void SetSelectedByHighlighting (const eC_Bool &bSelectedByHighlighting)
 
void SetSelection (eC_UInt uiIndex)
 
void SetUnifyItemSize (const eC_Bool &bUnifyItemSize)
 
void SetUseKeyboard (const eC_Bool &bUseKeyboard)
 
void SetWidth (const eC_Value &vWidth)
 
virtual void WriteToStream (const eC_Bool bWriteClassID=false)
 
- Public Member Functions inherited from CGUIScrollView
 CGUIScrollView (CGUICompositeObject *const pParent, const eC_Value &vX, const eC_Value &vY, const eC_Value &vWidth, const eC_Value &vHeight, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUIScrollView (CGUICompositeObject *const pParent, const CGUIRect &kRect, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUIScrollView (const CGUIScrollView &rkSource)
 
 CGUIScrollView ()
 
virtual void AdjustScrollBars ()
 
virtual void DoAnimate (const eC_Value &vTimes=eC_FromInt(1))
 
virtual eC_Bool DoScrollDown (const eC_Value &vAbsX, const eC_Value &vAbsY)
 
virtual eC_Bool DoScrollLeft (const eC_Value &vAbsX, const eC_Value &vAbsY)
 
virtual eC_Bool DoScrollRight (const eC_Value &vAbsX, const eC_Value &vAbsY)
 
virtual eC_Bool DoScrollUp (const eC_Value &vAbsX, const eC_Value &vAbsY)
 
virtual CGUICompositeObjectGetClipper () const
 
virtual CGUICompositeObjectGetContainer () const
 
CGUIScrollBarGetHorizontalScrollbar ()
 
CGUIScrollBarGetVerticalScrollbar ()
 
virtual eC_Bool IsHorizontalScrollBarAtBottom () const
 
virtual eC_Bool IsVerticalScrollBarAtRight () const
 
CGUIScrollViewoperator= (const CGUIScrollView &rkSource)
 
virtual void RestoreScrollPosition ()
 
virtual void SaveScrollPosition ()
 Stores the scroll positions (values of both scroll bars)
 
virtual void ScrollToFocussedObject ()
 
virtual void ScrollToObject (CGUIObject *pkObject)
 
void SetAutoAdjustContainerSize (const eC_Bool bAutoAdjustContainerSize)
 
void SetAutoAdjustScrollViewLayout (const eC_Bool bAutoAdjustScrollViewLayout)
 
virtual void SetHorizontalScrollBarAtBottom (const eC_Bool bIsAtBottom)
 
virtual void SetHorizontalScrollbarPolicy (const ScrollBarPolicy ePolicy)
 
virtual void SetScrollingInertia (const eC_Value vInertia)
 
virtual void SetScrollingViewport (const eC_Value vX, const eC_Value vY)
 
virtual void SetVerticalScrollBarAtRight (const eC_Bool bIsAtRight)
 
virtual void SetVerticalScrollbarPolicy (const ScrollBarPolicy ePolicy)
 
virtual void StartScrollingAnimation ()
 Called when the Scrollview wishes to start scrolling. Overriding methods should call the base class implementation.
 
virtual void StopScrollingAnimation ()
 Called when the scrolling animation is over. Overriding methods should call the base class implementation.
 
- Public Member Functions inherited from CGUICompositeObject
 CGUICompositeObject ()
 
 CGUICompositeObject (CGUICompositeObject *const pParent, const eC_Value &vX, const eC_Value &vY, const eC_Value &vWidth, const eC_Value &vHeight, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUICompositeObject (CGUICompositeObject *const pParent, const CGUIRect &kRect, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUICompositeObject (const CGUICompositeObject &kSource)
 
virtual ~CGUICompositeObject ()
 This destructor is automatically virtual, as the base class destructor is virtual.
 
eC_Bool BringToFront (const CGUIObject *pkObject)
 
eC_Bool CanBeCyclicFocussed () const
 
void DrawOnTop (CGUIObject *pkObject)
 
void DrawOnTopOf (CGUIObject *const pkObject, CGUIObject *const pDrawOnTopOf)
 
virtual CGUIObjectFindObject (const eC_Value &vAbsX, const eC_Value &vAbsY)
 
void Flip (const eC_Bool &rbVertical)
 
virtual eC_Bool FocusNext (CGUIObject *const pRefObj=NULL, const eC_Bool &bSubTreeOfRefObjDone=false)
 
virtual eC_Bool FocusPrevious (CGUIObject *const pRefObj=NULL, const eC_Bool &bSubTreeOfRefObjDone=false)
 
const CGUIObjectGetAndCheckObjectByID (ObjectHandle_t eObjID, const eC_String &kObjectName) const
 
CGUIObjectGetAndCheckObjectByID (ObjectHandle_t eObjID, const eC_String &kObjectName)
 
CGUIObjectGetChild (const eC_UInt uIndex) const
 
CGUIObjectGetChild (const eC_UInt uIndex)
 
const ObjectPtrListGetChildObjectsList () const
 
const ObjectPtrListGetDrawOrderList () const
 
eC_Int GetIndexOfChild (const CGUIObject *pkObject) const
 
eC_UInt GetNumberOfChildren () const
 
CGUIObjectGetObjectByID (const ObjectHandle_t &eID, const eC_Bool &bOnlyVisible=false)
 
const CGUIObjectGetObjectByID (const ObjectHandle_t &eID, const eC_Bool &bOnlyVisible=false) const
 
eC_Bool InsertChildAt (const eC_UInt cuiIndex, CGUIObject *pkChild)
 
void InvalidateChildren ()
 Invalidates all chidren, but not this parent.
 
eC_Bool IsAncestorOf (const CGUIObject *pkObject) const
 
virtual eC_Bool IsCompositeObject () const
 
eC_Bool LowerOneLevel (const CGUIObject *pkObject)
 
CGUICompositeObjectoperator= (const CGUICompositeObject &kSource)
 
eC_Bool RaiseOneLevel (const CGUIObject *pkObject)
 
virtual void RefreshLayout (CGUILayouter::eMovedEdges_t eMovedEdges) const
 
void RemoveAllChildren ()
 
void Rotate (const eC_UInt &ruiDegrees, const eC_Bool &rbFirst=false)
 
eC_Bool SendToBack (const CGUIObject *pkObject)
 
virtual void SetClickThrough (const eC_Bool &bClickThrough)
 
virtual void SetClickThrough (const eC_Bool &bClickThrough, const eC_Bool &bChildrenClickThrough)
 
void SetCyclicFocus (const eC_Bool &bCyclicFocus)
 
virtual void SetDisabled (const eC_Bool &bDisabled)
 
virtual void SetDisabled (const eC_Bool &bDisabled, const eC_Bool &bChildrenDisabled)
 
virtual void SetFocussable (const eC_Bool &bFocussable)
 
virtual void SetFocussable (const eC_Bool &bFocussable, const eC_Bool &bChildrenFocussable)
 
virtual void SetGrayedOut (const eC_Bool &bGrayedOut)
 
virtual void SetGrayedOut (const eC_Bool &bGrayedOut, const eC_Bool &bChildrenGrayedOut)
 
virtual void SetInvisible (const eC_Bool &bInvisible)
 
virtual void SetInvisible (const eC_Bool &bInvisible, const eC_Bool &bChildrenInvisible)
 
- Public Member Functions inherited from CGUIObject
 CGUIObject (CGUICompositeObject *const pParent, const eC_Value &vX, const eC_Value &vY, const eC_Value &vWidth, const eC_Value &vHeight, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUIObject (CGUICompositeObject *const pParent, const CGUIRect &kRect, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUIObject ()
 
 CGUIObject (const CGUIObject &kSource)
 
virtual ~CGUIObject ()
 
void AddValueObserver (CGUIObserver *pObserver)
 
eC_Bool CalculateInvalidatedRect (CGUIRect &rRect) const
 
virtual eC_Bool ClaimFocus ()
 
virtual void CreateSnapshot (eC_UInt uiBackColor=0x00)
 
eC_Bool DataPoolConnectorExists () const
 
void DeleteSnapshot ()
 
virtual void DisableSnapshotDrawing (eC_Bool bDeleteSnapshot=true)
 
virtual eC_Bool DoDrawSnapshot ()
 
virtual void EnableSnapshotDrawing ()
 
CGUIRect GetAbsRect () const
 
eC_Value GetAbsXPos () const
 
eC_Value GetAbsXPosCenter () const
 
eC_Value GetAbsXPosREdge () const
 
eC_Value GetAbsYPos () const
 
eC_Value GetAbsYPosBEdge () const
 
eC_Value GetAbsYPosCenter () const
 
eC_UByte GetAlpha () const
 
CGUIBehaviourDecoratorGetBehaviour ()
 
const CGUIBehaviourDecoratorGetBehaviour () const
 
GUIBitmapPlaneID_t GetBitmapID () const
 
CGUIBitmapPlaneGetBitmapPlane () const
 
CGUIRect GetCurrentAbsRect () const
 
eC_Value GetCurrentAbsXPos () const
 
eC_Value GetCurrentAbsXPosCenter () const
 
eC_Value GetCurrentAbsXPosREdge () const
 
eC_Value GetCurrentAbsYPos () const
 
eC_Value GetCurrentAbsYPosBEdge () const
 
eC_Value GetCurrentAbsYPosCenter () const
 
CDataPoolConnectorGetDataPoolConnector ()
 
eC_Value GetDistanceBottom () const
 
eC_Value GetDistanceRight () const
 
eC_Value GetHalfHeight () const
 
eC_Value GetHalfWidth () const
 
eC_Value GetHeight () const
 
ObjectHandle_t GetID () const
 
CGUILayouterGetLayouter ()
 
const CGUILayouterGetLayouter () const
 
ObjectHandle_t GetNeighborBottomID () const
 
ObjectHandle_t GetNeighborLeftID () const
 
ObjectHandle_t GetNeighborRightID () const
 
ObjectHandle_t GetNeighborTopID () const
 
CGUIObjectGetObjectByID (const ObjectHandle_t &eID, const eC_Bool &bOnlyVisible=false)
 
const CGUIObjectGetObjectByID (const ObjectHandle_t &eID, const eC_Bool &bOnlyVisible=false) const
 
CGUIRect GetOriginRect () const
 
CGUICompositeObjectGetParent ()
 
const CGUICompositeObjectGetParent () const
 
CGUIRect GetRelRect () const
 
eC_Value GetRelXPos () const
 
eC_Value GetRelXPosCenter () const
 
eC_Value GetRelXPosREdge () const
 
eC_Value GetRelYPos () const
 
eC_Value GetRelYPosBEdge () const
 
eC_Value GetRelYPosCenter () const
 
eC_Value GetWidth () const
 
void InvalidateArea ()
 
eC_Bool IsClickable () const
 
eC_Bool IsClickThrough () const
 
eC_Bool IsDescendantOf (const CGUIObject *const pAncestor) const
 
eC_Bool IsDisabled () const
 
eC_Bool IsDragable () const
 
eC_Bool IsDragged () const
 
eC_Bool IsDrawingSnapshot () const
 
eC_Bool IsFocussable () const
 
eC_Bool IsFocussed () const
 
eC_Bool IsGrayedOut () const
 
virtual eC_Bool IsHighlightable () const
 
eC_Bool IsHighlighted () const
 
eC_Bool IsInvisible () const
 
eC_Bool IsPressed () const
 
eC_Bool IsStopFocus () const
 
void NotifyValueObservers (const CGUIValue &kValue, const eC_UInt uiX=0, const eC_UInt uiY=0)
 
CGUIObjectoperator= (const CGUIObject &kSource)
 
void RemoveValueObserver (CGUIObserver *pObserver)
 
void RenderToBitmap (eC_UInt uiBitmapID, eC_Value vXOffset=eC_FromInt(0), eC_Value vYOffset=eC_FromInt(0))
 
eC_Bool RequestFocus ()
 
void SetAlpha (eC_UByte ubAlpha)
 
void SetBehaviour (CGUIBehaviourDecorator *pBehaviour)
 
void SetClickThrough (const eC_Bool &bClickThrough)
 
void SetID (const ObjectHandle_t &eID)
 
void SetLayouter (CGUILayouter *pLayouter)
 
void SetNeighborBottomID (const ObjectHandle_t eNewNeighborBottomID)
 
void SetNeighborIDs (const ObjectHandle_t eNewNeighborLeftID, const ObjectHandle_t eNewNeighborRightID, const ObjectHandle_t eNewNeighborTopID, const ObjectHandle_t eNewNeighborBottomID)
 
void SetNeighborLeftID (const ObjectHandle_t eNewNeighborLeftID)
 
void SetNeighborRightID (const ObjectHandle_t eNewNeighborRightID)
 
void SetNeighborTopID (const ObjectHandle_t eNewNeighborTopID)
 
virtual void SetParent (CGUICompositeObject *const pParent)
 
void SetRelRect (const CGUIRect &kNewRect)
 
virtual void SetRelXPos (const eC_Value &vX)
 
void SetRelXPosCenter (const eC_Value &vXCenter)
 
void SetRelXPosREdge (const eC_Value &vX)
 
virtual void SetRelYPos (const eC_Value &vY)
 
void SetRelYPosBEdge (const eC_Value &vY)
 
void SetRelYPosCenter (const eC_Value &vYCenter)
 
void SetStopFocus (const eC_Bool &bDontFocusToParent)
 
virtual eC_Bool SetValue (const CGUIValue &rkValue)
 
virtual eC_Bool SetValue (CDataPoolEntry &rkValue)
 
- Public Member Functions inherited from CGUIBehaviour
virtual eC_Bool DoUserEvent (CGUIEvent *const pEvent)
 
virtual void OnCreate ()
 
virtual void OnDelete ()
 
virtual void OnHide ()
 
virtual void OnShow ()
 
virtual eC_Bool DoLongClick (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoDoubleClick (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoButtonUp (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoMouseLeave (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoMouseMove (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual void LoseFocus ()
 
virtual eC_Bool Decrease ()
 
virtual eC_Bool Increase ()
 
virtual eC_Bool DoKeyUp (const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers)
 
virtual eC_Bool DoChar (const eC_UInt &uiKey, const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers)
 
- Public Member Functions inherited from CGUIStreamableObject
const eC_String & GetXMLTag () const
 
void SetXMLTag (const eC_String &kXMLTag)
 
- Public Member Functions inherited from CGUIAnimatable
virtual ~CGUIAnimatable ()
 Destructor. Removes all existing animation callbacks.
 
virtual eC_Bool IsAnimating () const
 
virtual void StartAnimation ()
 
virtual void StopAnimation ()
 
- Public Member Functions inherited from CGUIColorPropertyObserver
 CGUIColorPropertyObserver ()
 default-constructor
 
 ~CGUIColorPropertyObserver ()
 destructor
 
eC_UInt AddColorProperty (const eC_Bool &bColorIsProperty, const eC_UInt &uiColorValue, const GlobalProperty_t &eColorProperty)
 
void AddColorProperty (const eC_UInt &uiIndex, const eC_Bool &bColorIsProperty, const eC_UInt &uiColorValue, const GlobalProperty_t &eColorProperty)
 
ColorValue_t GetColorProperty (const eC_UInt &uiIndex) const
 
eC_UInt GetColorValue (const eC_UInt &uiIndex) const
 
virtual void OnColorPropertyChange ()
 
virtual void OnNotification ()
 Called by CGUISubject whenever an observed object triggers an update.
 
void RemoveColorProperty (const eC_UInt &uiIndex)
 
void SetColorProperty (const eC_UInt &uiIndex, const eC_UInt &uiColorValue)
 
void SetColorProperty (const eC_UInt &uiIndex, const GlobalProperty_t &eColorProperty)
 
void SetColorProperty (const eC_UInt &uiIndex, const ColorValue_t &kColorValue)
 
- Public Member Functions inherited from CGUIObserver
 CGUIObserver ()
 Default constructor.
 
virtual ~CGUIObserver ()
 Default destructor. Notifies all subjects of destruction.
 
const eC_TListDoubleLinked< CGUISubject * > & GetSubjectList () const
 
virtual void OnNotification (const eC_String &kMessage)
 
virtual void OnNotification (const CGUIObject *const pkUpdatedObject)
 
virtual void OnNotification (const CGUIValue &kObservedValue, const CGUIObject *const pkUpdatedObject, const eC_UInt uiX=0, const eC_UInt uiY=0)
 
void SetAutoDelete (const eC_Bool bAutoDelete)
 

Protected Member Functions

virtual void GetFocus ()
 Reimplemented to handle selection behaviour when being operated via keyboard.
 
void Init ()
 General initialization.
 
void UpdateSelection (const CGUIObject *pObject, const CGUIEvent *pEvent)
 
- Protected Member Functions inherited from CGUIScrollView
virtual void AdjustClipperSize ()
 
virtual void AdjustContainerSize ()
 
void Init ()
 General initialization.
 
- Protected Member Functions inherited from CGUICompositeObject
virtual eC_Bool FourWayNext (FourWayFocus_t eFocusDirection)
 
ObjectPtrListGetChildObjectsList ()
 
virtual void HandleDraw (const CGUIRect &ClipRect)
 
- Protected Member Functions inherited from CGUIObject
virtual eC_Bool CreateBitmapPlane ()
 
- Protected Member Functions inherited from CGUIStreamableObject
eC_UInt ReadStreamingHeader (const eC_UInt &uiClassVersion, const eC_UInt &uiClassMinVersion=0) const
 
void WriteStreamingFooter (const eC_Bool &bWriteClassID) const
 
void WriteStreamingHeader (const eC_Bool &bWriteClassID, const eC_Char *const pkClassIDTag, const eC_Int &iClassID, const eC_UInt &uiClassVersion) const
 
- Protected Member Functions inherited from CGUIObserver
virtual void AddSubject (CGUISubject *pSubjectToAdd)
 
virtual void RemoveSubject (CGUISubject *pSubjectToRemove)
 

Additional Inherited Members

- Static Public Attributes inherited from CGUICompositeObject
static const eC_Char XMLTAG_CHILDREN [] = "Children"
 XML comment tag to be used before writing children to a stream.
 
static const eC_Char XMLTAG_ENDCHILDREN [] = "/Children"
 XML comment tag to be used after writing children to a stream.
 
- Static Public Attributes inherited from CGUIObject
static const eC_Char XMLTAG_ALPHA [] = "Alpha"
 XML tag to be used writing alpha-value into a stream.
 
static const eC_Char XMLTAG_CLICKTHROUGH [] = "ClickThrough"
 XML tag to be used writing clickthrough-state into a stream.
 
static const eC_Char XMLTAG_CONTROLCLASSID [] = "ControlClassID"
 XML tag to be used when writing a control class ID into a stream.
 
static const eC_Char XMLTAG_DISABLED [] = "Disabled"
 XML tag to be used writing disabled-state into a stream.
 
static const eC_Char XMLTAG_FOCUSSABLE [] = "Focussable"
 XML tag to be used writing focussable-state into a stream.
 
static const eC_Char XMLTAG_GRAYEDOUT [] = "GrayedOut"
 XML tag to be used writing grayedout-state into a stream.
 
static const eC_Char XMLTAG_HEIGHT [] = "Height"
 XML tag to be used writing height into a stream.
 
static const eC_Char XMLTAG_INVISIBLE [] = "Invisible"
 XML tag to be used writing invisible-state into a stream.
 
static const eC_Char XMLTAG_OBJECTID [] = "ObjectID"
 XML tag to be used writing object id into a stream.
 
static const eC_Char XMLTAG_OVERRIDDENNEIGHBORS [] = "OverriddenNeighbors"
 XML tag to be used writing overridden neighbors into a stream.
 
static const eC_Char XMLTAG_WIDTH [] = "Width"
 XML tag to be used writing width into a stream.
 
static const eC_Char XMLTAG_XPOS [] = "XPos"
 XML tag to be used writing x-position into a stream.
 
static const eC_Char XMLTAG_YPOS [] = "YPos"
 XML tag to be used writing y-position into a stream.
 
- Static Public Attributes inherited from CGUIBehaviour
static const eC_Char XMLTAG_BEHAVIOURCLASSID [] = "BehaviourClassID"
 XML tag to be used when writing a behaviour class ID into a stream.
 
- Static Public Attributes inherited from CGUIStreamableObject
static const eC_Char XMLTAG_CLASSVERSION [] = "ClassVersion"
 
- Protected Attributes inherited from CGUIScrollView
eC_Bool m_bAutoAdjustContainerSize
 
eC_Bool m_bAutoAdjustScrollViewLayout
 
eC_Bool m_bIsHorizontalScrollBarAtBottom
 Position of horizontal scrollbar (true=bottom, false=top)
 
eC_Bool m_bIsVerticalScrollBarAtRight
 Position of vertical scrollbar (true=right, false=left)
 
ScrollBarPolicy m_eHorizontalScrollBarPolicy
 Scrollbar policy defining whether a horizontal scrollbar is visible or not.
 
ScrollBarPolicy m_eVerticalScrollBarPolicy
 Scrollbar policy defining whether a vertical scrollbar is visible or not.
 
eC_Int m_iHorScrollPos
 Stored position of the horizontal scroll bar.
 
eC_Int m_iVerScrollPos
 Stored position of the vertical scroll bar.
 
CGUICompositeObjectm_pkClipper
 
CGUIScrollBarm_pkHorScrollBar
 
CGUIScrollBarm_pkVerScrollBar
 
eC_Value m_vScrollingInertia
 Inertia value for soft scrolling. Legal values are positive and greater than 1.
 
eC_Value m_vViewportXBorder
 Horizontal (in X direction) gap between visible area and the area outside of which scrolling will occur.
 
eC_Value m_vViewportYBorder
 Vertical (in Y direction) gap between visible area and the area outside of which scrolling will occur.
 

Detailed Description

Contains list items and can be scrolled if there is not enough space.

list_box.png
The "list box" control is a scrollable container for a list of entries (list items). These entries can be selected or unselected Single and multiple selection of entries is supported. If the total height of the items is bigger than the container itself, a vertical scroll bar is shown (Class: CGUIListBox).

This class is derived from CGUIScrollView and has all features of a scroll view. There is an enumeration type definition called Mode_t to indicate the show mode of the list box. It is possible to multiple select items inside the list box by specifying the parameter in the constructor.

The items can be added by calling AddItem() and removed by RemoveItem() or RemoveItems(). There are also interfaces for influencing all items. If multiple selection is enabled, an item can be selected by calling method AddSelection(). The selection of the item is released by calling method ReleaseSelection(). All selected items are released by ReleaseAllSelection().

There are interfaces to handle the items such as GetItem(), GetNextItem, FindItem(), DeleteAllItems(), GetItemCount() and so on. You can obtain the selected item index list and string list by calling the GetSelectionIndexList() and GetSelectedItemsStrList(), respectively. If only the index or the item string of the first selected item is interesting, the GetSelection() and GetSelectedItemStr() can be used.

If multiple selection is enabled, the user can select multiple items from the list box by dragging the mouse over items or by pressing SHIFT, CONTROL or both of them and clicking the mouse over item or dragging over items. By pressing SHIFT key and arrow key (UP, DOWN, LEFT or RIGHT key), it is also possible to select multiple items inside the list box.

The arrangement of items in the list box can be adjusted by calling AdjustArrangement(). If the width or height of the item is changed, this method should be called to adjust the arrangement.

Example:

// Create a list box.
CGUIListBox *pkListBox = new CGUIListBox(this,
eC_FromInt(10), eC_FromInt(50),
eC_FromInt(200), eC_FromInt(150),
CGUIListBox::HOR_EXT,
false,
NO_HANDLE);
// Fill the list with some items
for (int i=0; i<11; i++)
{
CGUIListItem* pkItem = new CGUIListItem(NULL,
eC_FromInt(0), eC_FromInt(0),
eC_FromInt(100), eC_FromInt(30),
"item "+ eC_String(i),
true,
eC_FromInt(0), eC_FromInt(0),
DUMMY_IMAGE,
NO_HANDLE);
// Vertically center the text
// Add some color to the items
pkItem->SetBackgroundColor(0xFFCCCCCC);
pkItem->SetSelectedColor(0x55FF6666);
// Add an icon to every 2nd item
if (i%2 == 0)
{
pkItem->SetIconImages(IMG_STDCTRL_RB_NOTSELECTED_NORMAL, IMG_STDCTRL_RB_SELECTED_NORMAL);
pkItem->SetIconPos(pkItem->GetWidth()-eC_FromInt(20), eC_FromInt(5));
}
// Add item into the list
pkListBox->AddItem(pkItem);
}
// Update item layout
pkListBox->AdjustArrangement();

Member Enumeration Documentation

◆ Mode_t

The enumeration specifies the layout mode of ListBoxes. The layout defines how items within a listbox are distributed within the available space.

VER_EXT: In this mode list items will be distributed row by row from left to right. If there is not enough room for all items to be displayed, a vertical scrollbar will be shown.

HOR_EXT: In this mode list items will be distributed column by column from top to bottom. If there is not enough room for all items to be displayed, a horizontal scrollbar will be shown.

Constructor & Destructor Documentation

◆ CGUIListBox() [1/2]

CGUIListBox::CGUIListBox ( CGUICompositeObject *const  pParent,
const eC_Value &  vX,
const eC_Value &  vY,
const eC_Value &  vWidth,
const eC_Value &  vHeight,
const Mode_t eMode = VER_EXT,
const eC_Bool &  bMultipleSelection = false,
const ObjectHandle_t eID = NO_HANDLE 
)

Constructor

Parameters
pParentPointer to the designated parent object
vXX-position relative to its parent object
vYX-position relative to its parent object
vWidthWidth of the input field
vHeightHeight of the input field
eModeSpecifies the List's layout mode
bMultipleSelectionIndicate whether the multiple selection is enabled or not.
eIDObject identifier.

◆ CGUIListBox() [2/2]

CGUIListBox::CGUIListBox ( CGUICompositeObject *const  pParent,
const CGUIRect kRect,
const Mode_t eMode = VER_EXT,
const eC_Bool &  bMultipleSelection = false,
const ObjectHandle_t eID = NO_HANDLE 
)

Constructor taking a rectangle as input.

Parameters
pParentPointer to the designated parent object
kRectBounding rectangle relative to parent.
eModeSpecifies the List's layout mode
bMultipleSelectionIndicate whether the multiple selection is enabled or not.
eIDObject identifier.

Member Function Documentation

◆ AddItem()

eC_Bool CGUIListBox::AddItem ( CGUIListItem pItem,
eC_Bool  bIsAutoAdjustArrange = true 
)

Add an item to the container object of this list box. If there is already at least one item in the list, the selected color used by that item is also used for the new item.

Parameters
pItemPointer to the item which will be added to the container object's childlist and the item list of this class.
bIsAutoAdjustArrangeIndicate whether after adding the item the arrangement of items is automatically adjusted or not. If it is true, the method AdjustArrangement() is called.
Returns
True if the object was added, otherwise False.

◆ AddSelection()

eC_Bool CGUIListBox::AddSelection ( eC_UInt  uiIndex)

Add an item to the selection list, if multiple selection is enabled.

Parameters
uiIndexIndex of the item that is added to the selection.
Returns
True if the item was selected; False otherwise.

◆ AdjustArrangement()

void CGUIListBox::AdjustArrangement ( )

According to the current layout mode (either HOR_EXT or VER_EXT), the method adjusts the arrangement of items within the list box. Please

See also
Mode_t for a definition of the available layout modes. If an item changes width or height, this method must be called to refresh the arrangement of the list box.

◆ DeleteAllItems()

void CGUIListBox::DeleteAllItems ( )

Reset the item list to delete all the items from the list.

◆ DoButtonDown()

eC_Bool CGUIListBox::DoButtonDown ( const eC_Value &  vAbsX,
const eC_Value &  vAbsY 
)
virtual

Handle the event after mouse button is pressed. In this method the position of the click-pointer is obtained.

Parameters
vAbsXX-position in screen coordinates where the click occurred
vAbsYY-position in screen coordinates where the click occurred
Returns
True The event has been handled.
False The event has not been handled.

Reimplemented from CGUIBehaviour.

◆ DoClick()

eC_Bool CGUIListBox::DoClick ( const eC_Value &  vAbsX = (eC_FromInt(-1)),
const eC_Value &  vAbsY = (eC_FromInt(-1)) 
)
virtual

Draws a selection frame above the list's content if multiselection is enabled

Parameters
vAbsXMouse position in X where event occurred
vAbsYMouse position in Y where event occurred
Returns
Always false

Reimplemented from CGUIBehaviour.

◆ DoDrag()

eC_Bool CGUIListBox::DoDrag ( const eC_Value &  vDeltaX,
const eC_Value &  vDeltaY,
const eC_Value &  vAbsX,
const eC_Value &  vAbsY 
)
virtual

If it is the multiple selection is enabled, this method calculates the dimension and position the dragged frame in the list box.

Parameters
vDeltaXMouse movement in X since last frame
vDeltaYMouse movement in X since last frame
vAbsXMouse position in X where event occurred
vAbsYMouse position in Y where event occurred
Returns
Always False

Reimplemented from CGUIBehaviour.

◆ DoDragEnd()

eC_Bool CGUIListBox::DoDragEnd ( const eC_Value &  vAbsX,
const eC_Value &  vAbsY 
)
virtual

Handle selection after releasing the mouse button.

Parameters
vAbsXMouse position in X where event occurred
vAbsYMouse position in Y where event occurred
Returns
Always False

Reimplemented from CGUIBehaviour.

◆ DoDraw()

eC_Bool CGUIListBox::DoDraw ( )
virtual

Reimplemented to fill control with background color.

Returns
True if something was painted, otherwise False.

Reimplemented from CGUIObject.

◆ DoKeyDown()

eC_Bool CGUIListBox::DoKeyDown ( const GUIKeyIdentifier_t eKeyID,
const eC_UInt &  uiModifiers 
)
virtual

Handle the key UP, DOWN event to select item.

Parameters
eKeyIDThe Guiliani key identifier.
uiModifiersThe key modifiers bitfield.
Returns
True If the event has been handled.
False Else.

Reimplemented from CGUIBehaviour.

◆ DoMouseEnter()

eC_Bool CGUIListBox::DoMouseEnter ( const eC_Value &  vAbsX,
const eC_Value &  vAbsY 
)
virtual

Handle the event after the mouse enter to one of the item in the normal mode. In normal mode, the item that is highlighted can be selected. In other two mode, nothing happens.

Parameters
vAbsXMouse position in X where event occurred
vAbsYMouse position in Y where event occurred
Returns
Always False

Reimplemented from CGUIBehaviour.

◆ DoPostDraw()

eC_Bool CGUIListBox::DoPostDraw ( )
virtual

Reimplemented to draw a frame marking the selected region in multiselection mode.

Returns
True if something was painted, otherwise False.

Reimplemented from CGUICompositeObject.

◆ FindItem()

eC_Int CGUIListBox::FindItem ( const eC_String &  kItemStr) const

Find the item index with the given item string.

Parameters
kItemStrThe given item string that should be found.
Returns
The index of the found item. If there is no item to be found, it returns -1.

◆ FindItemBySubstring()

eC_Int CGUIListBox::FindItemBySubstring ( const eC_String &  kSearchString) const

Find the item index which fits the given search string best. This will also match items which contain the search string only as a substring. The "best match" will be the item which contains the search string at the smallest character index.

Parameters
kSearchStringThe (sub)string for which to search.
Returns
The index of the found item. If there is no item to be found, it returns -1.

◆ FocusAny()

eC_Bool CGUIListBox::FocusAny ( )
virtual

Sets the focus to a currently selected item within the list (if there IS a selection)

Returns
True if focus was obtained, False otherwise

Reimplemented from CGUICompositeObject.

◆ GetItem()

CGUIListItem * CGUIListBox::GetItem ( eC_UInt  uiIndex)

Get item in the list box by given index.

Parameters
uiIndexThe given index.
Returns
The list item corresponding to the index, or NULL if the index is invalid.

◆ GetItemCount()

eC_UInt CGUIListBox::GetItemCount ( ) const

Get the number of the items that are in the item list.

Returns
how many items in the list.

◆ GetItemIndexOfObject()

eC_Int CGUIListBox::GetItemIndexOfObject ( const CGUIObject pObj) const

Returns the index of the given object within the list of items.

Parameters
pObjThe object
Returns
Index within item-list or -1 if the object is not within the list.

◆ GetNextItem()

CGUIListItem * CGUIListBox::GetNextItem ( )

Get the next item of currently accessed item in the list box. You must call GetItem() prior to using GetNextItem(). If the current accessed item iterator or the next item iterator is not valid, it returns NULL.

Returns
The next item, or NULL if the current accessed item iterator or the next item iterator is not valid.

◆ GetSelectedItemsStrList()

CGUIListBox::StringList_t CGUIListBox::GetSelectedItemsStrList ( )

Get the current selected item string list.

Returns
String list of currently selected items.

◆ GetSelectedItemStr()

eC_String CGUIListBox::GetSelectedItemStr ( )

Get the item string from the first selected item of the selected item list.

Returns
The text string of the first selected item, or an empty string if there is no selection.

◆ GetSelection()

eC_Int CGUIListBox::GetSelection ( )

Get the first selected item from the selected item index list.

Returns
Index of currently selected item, or a value of -1 if there is no selection.

◆ GetSelectionIndexList()

CGUIListBox::IndexList_t CGUIListBox::GetSelectionIndexList ( )

Get the current selected item index list.

Returns
Index list of currently selected item.

◆ IsObjectAnItemInList()

eC_Bool CGUIListBox::IsObjectAnItemInList ( const CGUIObject pObj) const

Check whether the given object is an item of the list box.

Parameters
pObjThe object that is to be checked.
Returns
True, if it is, False otherwise.

◆ ReadFromStream()

void CGUIListBox::ReadFromStream ( )
virtual

Reads composite object attributes and children from stream. Reads attributes from the streaming file. Only for use with GUIFactoryManager.

See also
CGUIObject::ReadFromStream()
Exceptions
CGUIStreamingControlExceptionWhen catching a CGUIStreamingControlException from a child, this method adds the object from the exception, resets the object pointer to 'this', then re-throws.

Reimplemented from CGUIScrollView.

◆ ReleaseAllSelection()

void CGUIListBox::ReleaseAllSelection ( )

Release all selections.

◆ ReleaseSelection()

void CGUIListBox::ReleaseSelection ( eC_UInt  uiIndex)

Deselect an item.

Parameters
uiIndexThe index of item that is set to be deselected.

◆ RemoveItem()

eC_Bool CGUIListBox::RemoveItem ( CGUIListItem pItem,
eC_Bool  bIsAutoAdjustArrange = true 
)

Removes an item from the scrolled container.

Objects are removed from the internal container of scrolled objects and the item list.

Parameters
pItemItem to be removed.
bIsAutoAdjustArrangeIndicate whether the items arrange is adjusted automatically by the current mode.
Returns
True if the item was removed, otherwise False.

◆ RemoveItems()

eC_Bool CGUIListBox::RemoveItems ( eC_UInt  uiStartIndex,
eC_UInt  uiEndIndex,
eC_Bool  bIsAutoAdjustArrange = true 
)

Removes bulk items, starting from start index and ending with end index, from the scrolled container. Objects are removed from the internal container of scrolled objects and the item list.

Parameters
uiStartIndexThe start index of the bulk items.
uiEndIndexThe end index of the bulk items.
bIsAutoAdjustArrangeIndicate whether the items arrange is adjusted automatically by the current mode.
Returns
True if the item was removed, otherwise False.

◆ RemoveSelectionObserver()

void CGUIListBox::RemoveSelectionObserver ( CGUIObserver pObserver)

Unsubscribe a selection observer.

Parameters
pObserverThe Observer that wants to unsubscribe.

◆ RequestFocusForSelection()

eC_Bool CGUIListBox::RequestFocusForSelection ( )
virtual

Requests the Focus for the selected item

Returns
eC_Bool True if focus was obtained, False otherwise

◆ SelectObject()

eC_Bool CGUIListBox::SelectObject ( const CGUIObject pObj)

Selects the given object if it is an item within the list.

Parameters
pObjPointer to object which shall be selected
Returns
True if it was selected, False otherwise (e.g. if the object is not an item in the list)

◆ SetBgColor() [1/2]

void CGUIListBox::SetBgColor ( const eC_UInt &  uiBgColor)

Set the background color for this control.

Parameters
uiBgColorThe background color of this control.

◆ SetBgColor() [2/2]

void CGUIListBox::SetBgColor ( const GlobalProperty_t eBgColor)

Set the background color for this control.

Parameters
eBgColorThe background color of this control.

◆ SetDraggedFrameBgColor() [1/2]

void CGUIListBox::SetDraggedFrameBgColor ( const eC_UInt &  uiDraggedFrameBgColor)

Set the background color for the dragged frame.

Parameters
uiDraggedFrameBgColorBackground color for the dragged frame.

◆ SetDraggedFrameBgColor() [2/2]

void CGUIListBox::SetDraggedFrameBgColor ( const GlobalProperty_t eDraggedFrameBgColor)

Set the background color for the dragged frame.

Parameters
eDraggedFrameBgColorBackground color for the dragged frame.

◆ SetHeight()

void CGUIListBox::SetHeight ( const eC_Value &  vHeight)
virtual

Change the height of the control and arrange the items inside list box to be in order according to the arrange mode.

Parameters
vHeightThe new height

Reimplemented from CGUIScrollView.

◆ SetItemSelectedColor()

void CGUIListBox::SetItemSelectedColor ( eC_UInt  uiItemSelectedColor)

Set the background color for the selected items in this list. This method calls CGUIListItem::SetSelectedColor on all items that are currently in the list.

Parameters
uiItemSelectedColorBackground color for selected items.

◆ SetMultipleSelection()

void CGUIListBox::SetMultipleSelection ( const eC_Bool &  bMultiSelection)

Enable or disable multiple selection.

Parameters
bMultiSelectionNew value

◆ SetSelectedByHighlighting()

void CGUIListBox::SetSelectedByHighlighting ( const eC_Bool &  bSelectedByHighlighting)

Enables or disables the selection by highlighting functionality.

Parameters
bSelectedByHighlightingNew value

◆ SetSelection()

void CGUIListBox::SetSelection ( eC_UInt  uiIndex)

Sets the item with given index as selected. The previously selected item will be deselected.

Parameters
uiIndexIndex of the item to be selected.

◆ SetUnifyItemSize()

void CGUIListBox::SetUnifyItemSize ( const eC_Bool &  bUnifyItemSize)

Defines whether all list items will automatically be resized to the largest item's dimensions.

Parameters
bUnifyItemSizeNew value

◆ SetUseKeyboard()

void CGUIListBox::SetUseKeyboard ( const eC_Bool &  bUseKeyboard)

Enable or disable the use of a keyboard during selection.

Parameters
bUseKeyboardNew value

◆ SetWidth()

void CGUIListBox::SetWidth ( const eC_Value &  vWidth)
virtual

Change the width of the control and arrange the items inside list box to be in order according to the arrange mode.

Parameters
vWidthThe new width

Reimplemented from CGUIScrollView.

◆ UpdateSelection()

void CGUIListBox::UpdateSelection ( const CGUIObject pObject,
const CGUIEvent pEvent 
)
protected

Updates the selection status of the given object with regard to the corresponding event. This takes multi-selection via CTRL/SHIFT into account.

Parameters
pObjectPointer to object which shall be (de)selected
pEventPointer to event which caused the (de)selection. Required for checking CTRL/SHIFT states.

◆ WriteToStream()

void CGUIListBox::WriteToStream ( const eC_Bool  bWriteClassID = false)
virtual

Writes all object attributes to the streaming file. StreamWriter has to be initialized. Only for use with GUIStreamWriter.

Parameters
bWriteClassIDThis flag is used to select if writing of ControlID, leading and trailing tags is performed. Only GUIStreamWriter and GUICompositeObject have to set this flag true.
See also
CGUIStreamWriter

Reimplemented from CGUIScrollView.


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