class GUIDropDownContent

GUI element that is used for representing entries in a drop down menu.

Public

Methods

staticGetGuiTypeName

static const String &GetGuiTypeName()

Returns type name of the GUI element used for finding GUI element styles.

staticCreate

static GUIDropDownContent *Create(GUIDropDownMenu::DropDownSubMenu *parent, const GUIDropDownData &dropDownData, const String &style = StringUtility::kBlank)

Creates a new drop down contents element.

parent
Parent sub-menu that owns the drop down contents.
dropDownData
Data that will be used for initializing the child entries.
style
Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on. If not specified default button style is used.

staticCreate

static GUIDropDownContent *Create(GUIDropDownMenu::DropDownSubMenu *parent, const GUIDropDownData &dropDownData, const GUIOptions &options, const String &style = StringUtility::kBlank)

Creates a new drop down contents element.

parent
Parent sub-menu that owns the drop down contents.
dropDownData
Data that will be used for initializing the child entries.
options
Options that allow you to control how is the element positioned and sized. This will override any similar options set by style.
style
Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on. If not specified default button style is used.

SetRange

void SetRange(u32 start, u32 end)

Changes the range of the displayed elements.

GetElementHeight

GUILogicalUnit GetElementHeight(u32 index) const

Returns height of a menu element at the specified index, in pixels.

SetKeyboardFocus

void SetKeyboardFocus(bool focus)

Enables or disables keyboard focus.

When keyboard focus is enabled the contents will respond to keyboard events.

Protected

Constructors

GUIDropDownContent

GUIDropDownContent(GUIDropDownMenu::DropDownSubMenu *parent, const GUIDropDownData &dropDownData, const String &style, const GUISizeConstraints &dimensions)

Methods

GetElementLocalizedName

HString GetElementLocalizedName(u32 index) const

Get localized name of a menu item element with the specified index.

CalculateUnconstrainedOptimalSize

GUILogicalSize CalculateUnconstrainedOptimalSize() const override

Calculates the optimal size for the GUI element, ignoring size constraints.

UpdateLayoutForChildren

void UpdateLayoutForChildren() override

Calculates sizes and relative positions for all child elements.

Should be preceded with a call to UpdateOptimalLayoutSizes().

DoOnCommandEvent

bool DoOnCommandEvent(const GUICommandEvent &ev) override

Called when a command event is triggered.

Return true if you have processed the event and don't want other elements to process it.

DoOnMouseEvent

bool DoOnMouseEvent(const GUIMouseEvent &ev) override

Called when a mouse event is received on any GUI element the mouse is interacting with.

Return true if you have processed the event and don't want other elements to process it.

SetSelected

void SetSelected(u32 index)

Marks the element with the specified index as selected.

index
Index of the displayed element (indexing visible elements).

SelectNext

void SelectNext(u32 startIndex)

Selects the next available non-separator entry.

startIndex
Index of the menu element.

SelectPrevious

void SelectPrevious(u32 startIndex)

Selects the previous available non-separator entry.

startIndex
Index of the menu element.

Fields

mDropDownData

GUIDropDownData mDropDownData

mStates

Vector<bool> mStates

mVisibleElements

Vector<VisibleElement> mVisibleElements

mSelectedIdx

u32 mSelectedIdx

mRangeStart

u32 mRangeStart

mRangeEnd

u32 mRangeEnd

mKeyboardFocus

bool mKeyboardFocus

mIsToggle

bool mIsToggle