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

Class for construction of a combo box control. More...

#include <GUIComboBox.h>

Inheritance diagram for CGUIComboBox:

Public Types

enum  InputActionType_t { INPUT_INSERTED, INPUT_SEARCHED }
 
- Public Types inherited from CGUIObject
enum  FourWayFocus_t { FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUS_DOWN }
 

Public Member Functions

 CGUIComboBox ()
 
 CGUIComboBox (CGUICompositeObject *const pParent, const eC_Value &vX, const eC_Value &vY, const eC_Value &vWidth, const eC_Value &vHeight, const eC_Value &vHeaderButtonWidth, const ObjectHandle_t &eID=NO_HANDLE)
 
virtual ~CGUIComboBox ()
 This destructor is automatically virtual, as the base class destructor is virtual.
 
eC_Bool AddItem (CGUIListItem *pItem, eC_Bool bIsAutoAdjustArrange=true)
 
eC_Bool AddItem (const eC_String &kText, eC_Bool bIsAutoAdjustArrange=true)
 
void AddSelectionObserver (CGUIObserver *pObserver)
 
void AdjustComboBox ()
 
virtual void Close ()
 
virtual eC_Bool DoChar (const eC_UInt &uiKey, const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers)
 
virtual eC_Bool DoDraw ()
 
virtual eC_Bool DoKeyDown (const GUIKeyIdentifier_t &eKeyID, const eC_UInt &uiModifiers)
 
virtual eC_Bool DoUserEvent (CGUIEvent *const pEvent)
 
eC_Int FindItem (const eC_String &kItemStr) const
 
eC_Bool FocusAny ()
 
eC_Bool FocusSelectedItem ()
 
eC_Bool GetForceVisible () const
 
eC_UInt GetFrameBorderColor () const
 
CGUIComboBoxHeaderGetHeader () const
 
CGUIEditableTextGetHeaderLabel () const
 
eC_String GetHeaderText () const
 
InputActionType_t GetInputActionType () const
 
CGUIListItemGetItem (eC_UInt uiIndex) const
 
eC_UInt GetItemCount () const
 
CGUIListBoxGetListBox () const
 
eC_String GetPreviousSelection () const
 
eC_String GetSelectedItemStr () const
 
eC_UInt GetSelectedTextColor () const
 
eC_Int GetSelection () const
 
eC_Bool IsOpen () const
 
virtual void LoseFocus ()
 
virtual void OnNotification (const CGUIValue &kObservedValue, const CGUIObject *const pkUpdatedObject, const eC_UInt uiX=0, const eC_UInt uiY=0)
 
virtual void Open ()
 
virtual void ReadFromStream ()
 
eC_Bool RemoveItem (CGUIListItem *pItem, eC_Bool bIsAutoAdjustArrange=true)
 
eC_Bool RemoveItem (const eC_String &kItemStr, eC_Bool bIsAutoAdjustArrange=true)
 
void RemoveSelectionObserver (CGUIObserver *pObserver)
 
void Reset ()
 
void SetCommand (CGUICommandPtr pCommand)
 
void SetDisabled (const eC_Bool &bDisabled)
 
void SetForceVisible (const eC_Bool &bForceVisible)
 
void SetFrameBorderColor (const eC_UInt &uiFrameBorderColor)
 
void SetFrameBorderColor (const GlobalProperty_t &eFrameBorderColor)
 
void SetFrameBorderWidth (const eC_Value &vFrameBorderWidth)
 
void SetGrayedOut (const eC_Bool &bGrayedOut)
 
void SetHeaderButtonImages (const ImageResource_t &eBtnStandard, const ImageResource_t &eBtnPressed, const ImageResource_t &eBtnHighlighted, const ImageResource_t &eBtnGrayedOut, const ImageResource_t &eBtnFocused) const
 
void SetHeaderButtonWidth (const eC_Value &vHeaderButtonWidth) const
 
void SetHeaderEditable (const eC_Bool &bEditable) const
 
void SetHeaderSelectedTextColor (eC_UInt uiCol) const
 
void SetHeaderText (const eC_String &kStr) const
 
virtual void SetHeight (const eC_Value &vHeight)
 
void SetInputActionType (const InputActionType_t &eInputActionType)
 
void SetItemSelectedColor (eC_UInt uiItemSelectedColor) const
 
void SetLabel (CGUIEditableText *pkText) const
 
void SetSelection (eC_Int iIndex)
 
virtual eC_Bool SetValue (CDataPoolEntry &rkValue)
 
virtual eC_Bool SetValue (const CGUIValue &rkValue)
 
virtual void SetWidth (const eC_Value &vWidth)
 
virtual void WriteToStream (const eC_Bool bWriteClassID=false)
 
- 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.
 
virtual eC_Bool AddObject (CGUIObject *pkObject)
 
eC_Bool BringToFront (const CGUIObject *pkObject)
 
eC_Bool CanBeCyclicFocussed () const
 
virtual eC_Bool DoPostDraw ()
 
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)
 
eC_Bool FocusAny ()
 
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, 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, 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)
 
- Public Member Functions inherited from CGUIBehaviour
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 DoButtonDown (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 DoDrag (const eC_Value &vDeltaX=eC_FromInt(-1), const eC_Value &vDeltaY=eC_FromInt(-1), const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoDragEnd (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoMouseEnter (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 GetFocus ()
 
virtual eC_Bool Decrease ()
 
virtual eC_Bool Increase ()
 
virtual eC_Bool DoKeyUp (const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers)
 
virtual eC_Bool DoScrollUp (const eC_Value &vAbsX, const eC_Value &vAbsY)
 
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)
 
- 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 void DoAnimate (const eC_Value &vTimes=eC_FromInt(1))
 
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)
 
void SetAutoDelete (const eC_Bool bAutoDelete)
 

Protected Member Functions

virtual eC_Bool DoClick (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual void RemoveObject (CGUIObject *pObject)
 
- 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"
 

Detailed Description

Class for construction of a combo box control.

combo_box.png
The "combo box" control consists of a scrollable list combined with an input field. The list portion of the combo box may be displayed unfold or fold when the user selects the drop-down button next to the control. The "combo box" can be used for e.g., drop-down selection lists (Class: CGUIComboBox).

A combo box consists of a scrollable list combined with an input field as header that is either editable or not. The list portion of the control may be displayed dropped down or dropped up when the user selects the drop-down button next to the control. The currently selected item (if any) in the list is displayed. In addition, if the user types a character in the header, the list box is opened. If the type of combo box is to insert an input string, a new item is created and inserted to the list. After the combo box is opened, the next item is selected that matches that initial string in the header. The list is implemented using CGUIListBox class and the header is implemented with CGUIComboBoxHeader.

The combo box has two possible layouts, either the list is under header or above the header. The layout is decided automatically according to the space under the header or above the header. If there is enough space under header, the combo box has the layout of having list box under header, otherwise it checks whether there is enough space above header. It there is, then it turns out to have the list box above header.

The height of the combo box is adjusted according to the items that are inserted into the list box. If there is any change affect the height of the combo box, the height of the combo box is adjusted automatically.

It is possible to open or close the list box if the user clicks the drop-down button in the header. The list will also be opened when the user types character in the editable input field. The item can be selected into the combo box by clicking the item in the list box or pressing the GK_ACTION key if the selected item in the list box is focused.

The items in the combo box can be inserted by AddItem and removed by RemoveItem methods.

Key events are handled as follows:

  1. If the drop down button is focused and the GK_ACTION key is pressed, the list is opened and the selected item is focused.
  2. Entering characters in the header (if it is set to editable) will either search for an entry in the listbox which matches the entered search-string (if mode is INPUT_SEARCHED) or create a new entry within the ListBox (if mnode is INPUT_INSERTED).
  3. If the user hits the GK_ACTION key while focusing an entry in the listbox, the respective entry is selected and the text of header bar is updated accordingly. The list is then closed.
  4. Pressing GK_ESCAPE key closes the list, if is currently open.

It is possible to execute a user callback after an item is selected into header.

Example:

// Create a combo box
CGUIComboBox *pComboBox = new CGUIComboBox(&GETGUI, eC_FromInt(100), eC_FromInt(40), eC_FromInt(110), eC_FromInt(20), eC_FromInt(20));
// Create some dummy content
const eC_Char* kContent[] = { "Earth", "Mars", "Venus", "Jupiter", "Saturn" };
for (int i=0;i<5;i++)
{
CGUIListItem * pListItem = new CGUIListItem(NULL, 0, 0, eC_FromInt(80), eC_FromInt(20), kContent[i]);
// Modify the newly created item's label
pListItem->GetLabel()->SetTextColor(0xff000000, 0xffffffff, 0xff000000, 0xffffffff);
// Add it to the ComboBox
pComboBox->AddItem(pListItem);
}
// Set some visualization parameters. (e.g. Colors and Images)
pComboBox->SetItemSelectedColor(0xff0000cc);
IMG_STDCTRL_IMGBTN_STANDARD,
IMG_STDCTRL_IMGBTN_PRESSED,IMG_STDCTRL_IMGBTN_HIGHLIGHTED,
IMG_STDCTRL_IMGBTN_GRAYED_OUT,IMG_STDCTRL_IMGBTN_FOCUSED);
IMG_STDCTRL_INPUTFIELD_STANDARD,
IMG_STDCTRL_INPUTFIELD_HIGHLIGHTED,
IMG_STDCTRL_INPUTFIELD_FOCUSSED,
IMG_STDCTRL_INPUTFIELD_GRAYEDOUT);
// Select an item by index
pComboBox->SetSelection(2);
// Make the comboxbox-header editable, so that users can enter a search-string
pComboBox->SetHeaderEditable(true);

Member Enumeration Documentation

◆ InputActionType_t

Decide whether the input string in the header is taken as an element or the input string is just searched in the list and the most matched element is selected into header.

Enumerator
INPUT_INSERTED 

The input string is inserted to the list after the user finishes typing.

INPUT_SEARCHED 

The typed input string is searched and the matched string is selected into header.

Constructor & Destructor Documentation

◆ CGUIComboBox() [1/2]

CGUIComboBox::CGUIComboBox ( )

CGUIComboBox standard constructor.

See also
CGUICompositeObject().

◆ CGUIComboBox() [2/2]

CGUIComboBox::CGUIComboBox ( CGUICompositeObject *const  pParent,
const eC_Value &  vX,
const eC_Value &  vY,
const eC_Value &  vWidth,
const eC_Value &  vHeight,
const eC_Value &  vHeaderButtonWidth,
const ObjectHandle_t eID = NO_HANDLE 
)

CGUIComboBox constructor.

Parameters
pParentPointer to the designated parent object.
vXX-position relative to its parent object
vYY-position of the combo box left top corner of the header relative to the combo box's parent object
vWidthWidth of the composite object
vHeightThe height of the combo box when it is closed. It equals to the height of the header.
vHeaderButtonWidththe width of the header button.
eIDObject Identifier of this composite object (choose NO_HANDLE if none is required)

Member Function Documentation

◆ AddItem() [1/2]

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

Add an item to the container object of this list box. The height of the combo box is automatically adjusted if desired.

Parameters
pItemPointer to the item which will be added to the container object's childlist and the item list of this class.
bIsAutoAdjustArrangeFlag to enable and disable the autoadjust. Defaults to true = enable autoadjust.
Returns
True if the object was added, otherwise False.

◆ AddItem() [2/2]

eC_Bool CGUIComboBox::AddItem ( const eC_String &  kText,
eC_Bool  bIsAutoAdjustArrange = true 
)

Add an item to the container object of this list box. The height of the combo box is automatically adjusted if desired.

Parameters
kTextText which shall be shown on the new item
bIsAutoAdjustArrangeFlag to enable and disable the autoadjust. Defaults to true = enable autoadjust.
Returns
true if the object was added, otherwise false.

◆ AdjustComboBox()

void CGUIComboBox::AdjustComboBox ( )

Arranges the entries of the combo box vertically. Call this method after adding or removing entries without activated auto adjustment.

See also
AddItem() and RemoveItem()

◆ Close()

void CGUIComboBox::Close ( )
virtual

Closes the combo box by setting its drop-down list invisible. The focus is transferred to the header. The height of the combo box is changed to be same as the header.

If the combo box is not open, this method does nothing.

◆ DoChar()

eC_Bool CGUIComboBox::DoChar ( const eC_UInt &  uiKey,
const GUIKeyIdentifier_t eKeyIdentifier,
const eC_UInt &  uiModifiers 
)
virtual

If the ComboBox is configured to run in mode INPUT_SEARCHED, then incoming character events will be used to search the entries of the Listbox for matches. If a matching entry is found, it will automatically be selected.

Parameters
uiKeyThe keycode.
eKeyIdentifierThe Guiliani key identifier.
uiModifiersThe key modifiers bitfield.
Returns
Always false

Reimplemented from CGUIBehaviour.

◆ DoClick()

eC_Bool CGUIComboBox::DoClick ( const eC_Value &  vAbsX = eC_FromInt(-1),
const eC_Value &  vAbsY = eC_FromInt(-1) 
)
protectedvirtual

Handle the event after user clicks the control. If the button is clicked, the list box is opened and the selected item gets the focused or closed. If an item in the list box is clicked, the item is selected and the text of the item is set into the header. If a command is available, it is executed.

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.

◆ DoDraw()

eC_Bool CGUIComboBox::DoDraw ( )
virtual

Reimplemented to fill the control with background color. If multiple selection mode is set, it draws the dragged frame.

Returns
True if something was painted, otherwise False.

Reimplemented from CGUIObject.

◆ DoKeyDown()

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

Close the combobox in reaction to GK_ESCAPE events.

Parameters
eKeyIDThe Guiliani key identifier.
uiModifiersThe key modifiers bitfield.
Returns
True if the combobox was closed.

Reimplemented from CGUIBehaviour.

◆ DoUserEvent()

eC_Bool CGUIComboBox::DoUserEvent ( CGUIEvent *const  pEvent)
virtual

Close the combobox if the user clicks anywhere outside of the ComboBox

Parameters
pEventThe event to process
Returns
always false

Reimplemented from CGUIBehaviour.

◆ FindItem()

eC_Int CGUIComboBox::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, or -1 if no item was found.

◆ FocusAny()

eC_Bool CGUIComboBox::FocusAny ( )
virtual

FocusAny will call FocusSelectedItem internally.

Returns
False if no item was selected, otherwise it returns the result of RequestFocus() on the selected item.

Reimplemented from CGUIObject.

◆ FocusSelectedItem()

eC_Bool CGUIComboBox::FocusSelectedItem ( )

This will focus the currently selected item within the listbox (if any)

Returns
False if no item was selected. Otherwise it returns the result of RequestFocus() on the selected item.

◆ GetForceVisible()

eC_Bool CGUIComboBox::GetForceVisible ( ) const

Check if Force Visible is currently active

Returns
true if set

◆ GetFrameBorderColor()

eC_UInt CGUIComboBox::GetFrameBorderColor ( ) const

Return the currently set color for the frame-boder

Returns
color

◆ GetHeader()

CGUIComboBoxHeader * CGUIComboBox::GetHeader ( ) const

Returns the ComboBoxHeader

Returns
combobox-header

◆ GetHeaderLabel()

CGUIEditableText * CGUIComboBox::GetHeaderLabel ( ) const

Get the label of the header . Use this to obtain a pointer to the internal text for formatting etc.

Returns
Pointer to the internal text label.

◆ GetHeaderText()

eC_String CGUIComboBox::GetHeaderText ( ) const

Get the text that is currently displayed in the header.

Returns
The header text.

◆ GetInputActionType()

CGUIComboBox::InputActionType_t CGUIComboBox::GetInputActionType ( ) const

Get the input action type of the combo box.

Returns
The active input action type.

◆ GetItem()

CGUIListItem * CGUIComboBox::GetItem ( eC_UInt  uiIndex) const

Get item in the list box by given index.

Parameters
uiIndexThe given index.
Returns
The list item corresponds to the index.

◆ GetItemCount()

eC_UInt CGUIComboBox::GetItemCount ( ) const

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

Returns
count of items in the list.

◆ GetListBox()

CGUIListBox * CGUIComboBox::GetListBox ( ) const

Returns the ListBox pointer.

Returns
GUIListBox pointer.

◆ GetPreviousSelection()

eC_String CGUIComboBox::GetPreviousSelection ( ) const

Get the previously selected item string.

Returns
The previsouly selected item string.

◆ GetSelectedItemStr()

eC_String CGUIComboBox::GetSelectedItemStr ( ) const

Get the item string of the selected item.

Returns
The string related to the selected item in the combo box.

◆ GetSelectedTextColor()

eC_UInt CGUIComboBox::GetSelectedTextColor ( ) const

Get the color currently used as the background for selected text.

Returns
the selected text color.
See also
CGUIBaseInputField::GetSelectedTextColor()

◆ GetSelection()

eC_Int CGUIComboBox::GetSelection ( ) const

Get the current selected item index.

Returns
The index of the currently selected item or -1 if no selection

◆ IsOpen()

eC_Bool CGUIComboBox::IsOpen ( ) const

Check whether the combo box is open.

Returns
True if it is open; otherwise False.

◆ LoseFocus()

void CGUIComboBox::LoseFocus ( )
virtual

After the combo box loses focus and the focused object is not the descendant of this combo box, we close this combo box.

Reimplemented from CGUIBehaviour.

◆ OnNotification()

void CGUIComboBox::OnNotification ( const CGUIValue kObservedValue,
const CGUIObject *const  pkUpdatedObject,
const eC_UInt  uiX = 0,
const eC_UInt  uiY = 0 
)
virtual

Observes CGUIComboBoxHeader to get informed if input finished.

Parameters
kObservedValueThe update observed value.
pkUpdatedObjectThe observed object.
uiXX-Index Additional X-Index in case the updated value is part of a multidimensional array
uiYY-Index Additional Y-Index in case the updated value is part of a multidimensional array

Reimplemented from CGUIObserver.

◆ Open()

void CGUIComboBox::Open ( )
virtual

Opens the combo box by setting its drop-down list visible. It also determines the opening direction of the combo box according to the location and height of all parents to avoid clipping of the opened list box. It also selects an item in the list. The item is chosen either by exactly matching the current header text or by searching for the first item containing the current header text.

If the list box is empty (no combo box items present), the box is never opened.

◆ ReadFromStream()

void CGUIComboBox::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 CGUICompositeObject.

◆ RemoveItem() [1/2]

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

Removes an item from the scrolled container. The height of the combo box is automatically adjusted if desired. Objects are removed from the internal container of scrolled objects and the item list.

Parameters
pItemItem to be removed.
bIsAutoAdjustArrangeFlag to enable and disable the autoadjust. Defaults to true = enable autoadjust.
Returns
True if the item was removed, otherwise False.

◆ RemoveItem() [2/2]

eC_Bool CGUIComboBox::RemoveItem ( const eC_String &  kItemStr,
eC_Bool  bIsAutoAdjustArrange = true 
)

Removes an item with given item string from the scrolled container. Objects are removed from the internal container of scrolled objects and the item list. If there are more than one items with same text, only the first item is removed. The height of the combo box is automatically adjusted if necessary.

Parameters
kItemStrThe given item string.
bIsAutoAdjustArrangeFlag to enable and disable the autoadjust. Defaults to true = enable autoadjust.
Returns
True if there is one item is removed, otherwise False.

◆ RemoveObject()

void CGUIComboBox::RemoveObject ( CGUIObject pObject)
protectedvirtual

Overridden to NULL internal object pointers in case the Header or List gets destroyed

Parameters
pObjectobject to remove

Reimplemented from CGUICompositeObject.

◆ RemoveSelectionObserver()

void CGUIComboBox::RemoveSelectionObserver ( CGUIObserver pObserver)

Unsubscribe a selection observer.

Parameters
pObserverThe Observer that wants to unsubscribe.

◆ Reset()

void CGUIComboBox::Reset ( )

Removes all list items and the header text. The height of the combo box is automatically adjusted if necessary.

◆ SetCommand()

void CGUIComboBox::SetCommand ( CGUICommandPtr  pCommand)

Attaches a command to this control. This command is executed whenever one of the items is selected into the header.

Parameters
pCommandThe command to attach to this control.

◆ SetDisabled()

void CGUIComboBox::SetDisabled ( const eC_Bool &  bDisabled)
virtual

Toggle Disabled state of the combo box.

Parameters
bDisabledDefines if the combo box is disabled out or not.

Reimplemented from CGUICompositeObject.

◆ SetForceVisible()

void CGUIComboBox::SetForceVisible ( const eC_Bool &  bForceVisible)

Force Listbox to be visible when opening. This may be needed, if the height of the current parent is not high enough to fit even one line. On opening the parent is changed and on closing set back to original parent.

Parameters
bForceVisible

◆ SetFrameBorderColor() [1/2]

void CGUIComboBox::SetFrameBorderColor ( const eC_UInt &  uiFrameBorderColor)

Set the frame border color around the list box.

Parameters
uiFrameBorderColorThe frame border color.

◆ SetFrameBorderColor() [2/2]

void CGUIComboBox::SetFrameBorderColor ( const GlobalProperty_t eFrameBorderColor)

Set the frame border color around the list box.

Parameters
eFrameBorderColorThe frame border color.

◆ SetFrameBorderWidth()

void CGUIComboBox::SetFrameBorderWidth ( const eC_Value &  vFrameBorderWidth)

Set the frame border width around the list box. The list box's width, height, position, the header's position and the height of the combo box may also be adjusted.

Parameters
vFrameBorderWidthThe frame border width.

◆ SetGrayedOut()

void CGUIComboBox::SetGrayedOut ( const eC_Bool &  bGrayedOut)
virtual

Toggle GrayedOut state of the combo box.

Parameters
bGrayedOutDefines if the combo box is grayed out or not.

Reimplemented from CGUICompositeObject.

◆ SetHeaderButtonImages()

void CGUIComboBox::SetHeaderButtonImages ( const ImageResource_t eBtnStandard,
const ImageResource_t eBtnPressed,
const ImageResource_t eBtnHighlighted,
const ImageResource_t eBtnGrayedOut,
const ImageResource_t eBtnFocused 
) const

Sets the images of the drop-down button in the header. Directly passed to CGUIComboBoxHeader::SetButtonImages.

Parameters
eBtnStandardImage used when in normal state
eBtnPressedImage used when in pressed state
eBtnHighlightedImage used when in highlighted state
eBtnGrayedOutImage used when in grayed-out state
eBtnFocusedImage used when in focused state

◆ SetHeaderButtonWidth()

void CGUIComboBox::SetHeaderButtonWidth ( const eC_Value &  vHeaderButtonWidth) const

Set the width of the header button.

Parameters
vHeaderButtonWidthThe width of the header button.

◆ SetHeaderEditable()

void CGUIComboBox::SetHeaderEditable ( const eC_Bool &  bEditable) const

Set the header as editable or not.

Parameters
bEditable

◆ SetHeaderSelectedTextColor()

void CGUIComboBox::SetHeaderSelectedTextColor ( eC_UInt  uiCol) const

Sets the color used as the background for selected text.

Parameters
uiColThe selected text color.
See also
CGUIBaseInputField::SetSelectedTextColor()

◆ SetHeaderText()

void CGUIComboBox::SetHeaderText ( const eC_String &  kStr) const

Set the string for the header.

Parameters
kStrNew text for the header.

◆ SetHeight()

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

Changes the height of the combo box when it is closed. The height of header is also changed to be the given height.

Parameters
vHeightThe new height.

Reimplemented from CGUICompositeObject.

◆ SetInputActionType()

void CGUIComboBox::SetInputActionType ( const InputActionType_t eInputActionType)

Set the input action type for the combo box.

Parameters
eInputActionTypeThe input action type.

◆ SetItemSelectedColor()

void CGUIComboBox::SetItemSelectedColor ( eC_UInt  uiItemSelectedColor) const

Set the color for the selected item. Directly passed to CGUIListBox::SetItemSelectedColor.

Parameters
uiItemSelectedColorBackground color for selected items.

◆ SetLabel()

void CGUIComboBox::SetLabel ( CGUIEditableText pkText) const

Changes the internal text. This call is directly passed through to CGUIHeader::SetLabel.

Parameters
pkTextThe new text to be used by the internal edit control of the header.

◆ SetSelection()

void CGUIComboBox::SetSelection ( eC_Int  iIndex)

Set the selected item. This call is directly passed to CGUIListBox::SetSelection.

Parameters
iIndexIndex of the item to be selected.

◆ SetValue() [1/2]

eC_Bool CGUIComboBox::SetValue ( CDataPoolEntry rkValue)
virtual

If the given DataPoolEntry contains an array of values, they will be added into the List of the CGUIComboBox. If it contains a single value, it will be entered into the Header of the CGUIComboBox.

See also
AddItem(), SetHeaderText()
Parameters
rkValueThe DataPoolEntry containing the new value(s)
Returns
Always True.

Reimplemented from CGUIObject.

◆ SetValue() [2/2]

eC_Bool CGUIComboBox::SetValue ( const CGUIValue rkValue)
virtual

Sets the text within the Header of the CGUIComboBox.

See also
SetHeaderText()
Parameters
rkValueThe CGUIValue containing the new value
Returns
Always True.

Reimplemented from CGUIObject.

◆ SetWidth()

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

Calls the base class implementation and sets the children's width to the proper value. The width of items and list box is adjusted too.

Parameters
vWidthThe new width.

Reimplemented from CGUICompositeObject.

◆ WriteToStream()

void CGUIComboBox::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 CGUICompositeObject.


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