Go to the documentation of this file.
44 if (mButton !=
nullptr)
96 void ComboBox::notifyButtonPressed(
Widget* _sender,
int _left,
int _top,
MouseButton _id)
109 void ComboBox::notifyListLostFocus(Widget* _sender, Widget* _new)
117 if (focus == mButton)
128 void ComboBox::notifyListSelectAccept(ListBox* _widget,
size_t _position)
130 mItemIndex = _position;
145 void ComboBox::notifyListChangePosition(ListBox* _widget,
size_t _position)
147 mItemIndex = _position;
177 void ComboBox::notifyListMouseItemActivate(
ListBox* _widget,
size_t _position)
179 mItemIndex = _position;
193 void ComboBox::notifyMouseWheel(Widget* _sender,
int _rel)
238 void ComboBox::notifyMousePressed(Widget* _sender,
int _left,
int _top, MouseButton _id)
241 Base::notifyMousePressed(_sender, _left, _top, _id);
247 notifyButtonPressed(
nullptr, _left, _top, _id);
250 void ComboBox::notifyEditTextChange(EditBox* _sender)
265 void ComboBox::showList()
275 IntCoord coord = calculateListPosition();
291 void ComboBox::actionWidgetHide(Widget* _widget, ControllerItem* _controller)
293 _widget->setVisible(
false);
294 _widget->setEnabled(
true);
297 void ComboBox::hideList()
306 controller->eventPostAction +=
newDelegate(
this, &ComboBox::actionWidgetHide);
369 ControllerFadeAlpha* ComboBox::createControllerFadeAlpha(
float _alpha,
float _coef,
bool _enable)
388 mFlowDirection = _value;
391 IntCoord ComboBox::calculateListPosition()
397 length = mMaxListLength;
399 if (mMaxListLength > 0 && length > mMaxListLength)
400 length = mMaxListLength;
417 if ((coord.
top - length) >= 0)
425 if ((coord.
right() + length) <= sizeView.
width)
428 coord.
left -= length;
429 coord.
width = length;
433 if ((coord.
left - length) >= 0)
434 coord.
left -= length;
437 coord.
width = length;
446 if (_key ==
"ModeDrop")
450 else if (_key ==
"FlowDirection")
454 else if (_key ==
"MaxListLength")
458 else if (_key ==
"SmoothShow")
462 else if (_key ==
"AddItem")
534 mShowSmooth = _value;
544 mMaxListLength = _value;
549 return mMaxListLength;
554 return mFlowDirection;
591 if (mList !=
nullptr)
static InputManager & getInstance()
const UString & getItemNameAt(size_t _index)
Get item name from specified position.
EventPair< EventHandle_WidgetVoid, EventHandle_EditPtr > eventEditTextChange
ListBox properties. Skin childs. ListBox widget description should be here.
int getOptimalHeight()
Return optimal height to fit all items in ListBox.
void setItemDataAt(size_t _index, Any _data)
Replace an item data at a specified position.
size_t getIndexSelected() const
Get index of selected item (ITEM_NONE if none selected)
void setEditStatic(bool _value)
IntCoord getAbsoluteCoord() const
void setSmoothShow(bool _value)
Set smooth show of list.
const float COMBO_ALPHA_MIN
void insertItemAt(size_t _index, const UString &_name, Any _data=Any::Null)
Insert an item into a array at a specified position.
void removeItemAt(size_t _index)
Remove item at a specified position.
#define MYGUI_ASSERT_RANGE_AND_NONE(index, size, owner)
static const std::string & getClassTypeName()
void initialiseOverride() override
void beginToItemAt(size_t _index)
Move all elements so specified becomes visible.
void beginToItemFirst()
Move all elements so first becomes visible.
types::TCoord< int > IntCoord
const float COMBO_ALPHA_COEF
void beginToItemAt(size_t _index)
Move all elements so specified becomes visible.
void removeAllItems()
Remove all items.
const UString & _getItemNameAt(size_t _index) override
void removeItemAt(size_t _index)
Remove item at a specified position.
void setEnabled(bool _value)
void setItemNameAt(size_t _index, const UString &_name)
Replace an item name at a specified position.
void setIndexSelected(size_t _index)
Select specified _index.
size_t findItemIndexWith(const UString &_name)
Search item, returns the position of the first occurrence in array or ITEM_NONE if item not found.
void setItemDataAt(size_t _index, Any _data)
Replace an item data at a specified position.
void beginToItemFirst()
Move all elements so first becomes visible.
FlowDirection getFlowDirection() const
Get direction, where drop down list appears.
const std::string & getUserString(const std::string &_key) const
size_t getItemCount() const
Get number of items.
A UTF-16 string with implicit conversion to/from std::string and std::wstring.
delegates::DelegateFunction< Args... > * newDelegate(void(*_func)(Args... args))
void insertItemAt(size_t _index, const UString &_name, Any _data=Any::Null)
Insert an item into a array at a specified position.
void beginToItemLast()
Move all elements so last becomes visible.
void setCoord(const IntCoord &_value) override
static const std::string & getClassTypeName()
EventPair< EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > eventListSelectAccept
void setMaxListLength(int _value)
Get max list length.
int getMaxListLength() const
Set max list length.
const float COMBO_ALPHA_MAX
EventPair< EventHandle_WidgetVoid, EventHandle_ComboBoxPtrSizeT > eventComboAccept
void clearIndexSelected()
void setComboModeDrop(bool _value)
Set drop list mode (text can not be edited)
void _addItem(const MyGUI::UString &_name) override
void setIndexSelected(size_t _index)
Type * castType(bool _throw=true)
void clearIndexSelected()
Clear item selection.
void beginToItemSelected()
Move all elements so selected becomes visible.
void setPropertyOverride(const std::string &_key, const std::string &_value) override
bool getSmoothShow() const
Get smooth show of list flag.
void setCoef(float _value)
void removeAllItems()
Remove all items.
EventPair< EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > eventListChangePosition
ControllerItem * createItem(const std::string &_type)
void addItem(Widget *_widget, ControllerItem *_item)
void clearItemDataAt(size_t _index)
Clear an item data at a specified position.
void addItem(const UString &_name, Any _data=Any::Null)
Add an item to the end of a array.
void setFlowDirection(FlowDirection _value)
Set direction, where drop down list appears (TopToBottom by default).
void setAlpha(float _value)
EventPair< EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > eventListMouseItemActivate
const UString & getItemNameAt(size_t _index)
Get item name from specified position.
void setActivateOnClick(bool activateOnClick)
size_t _getItemCount() override
void _removeItemAt(size_t _index) override
void _resetContainer(bool _update) override
EventPair< EventHandle_WidgetSizeT, EventHandle_ComboBoxPtrSizeT > eventComboChangePosition
void _resetContainer(bool _update) override
void onKeyButtonPressed(KeyCode _key, Char _char) override
void setItemNameAt(size_t _index, const UString &_name)
Replace an item name at a specified position.
size_t getItemCount() const
Get number of items.
void shutdownOverride() override
size_t findItemIndexWith(const UString &_name)
Search item, returns the position of the first occurrence in array or ITEM_NONE if item not found.
bool getComboModeDrop() const
Get drop list mode flag.
void _setItemNameAt(size_t _index, const UString &_name) override
virtual void setCaption(const UString &_value)