32 if (mButton !=
nullptr)
90 void ComboBox::notifyButtonPressed(
Widget* _sender,
int _left,
int _top,
MouseButton _id)
103 void ComboBox::notifyListLostFocus(Widget* _sender, Widget* _new)
111 if (focus == mButton)
122 void ComboBox::notifyListSelectAccept(ListBox* _widget,
size_t _position)
124 mItemIndex = _position;
138 void ComboBox::notifyListChangePosition(ListBox* _widget,
size_t _position)
140 mItemIndex = _position;
169 void ComboBox::notifyListMouseItemActivate(
ListBox* _widget,
size_t _position)
171 mItemIndex = _position;
184 void ComboBox::notifyMouseWheel(Widget* _sender,
int _rel)
229 void ComboBox::notifyMousePressed(Widget* _sender,
int _left,
int _top, MouseButton _id)
232 Base::notifyMousePressed(_sender, _left, _top, _id);
238 notifyButtonPressed(
nullptr, _left, _top, _id);
241 void ComboBox::notifyEditTextChange(EditBox* _sender)
256 void ComboBox::showList()
266 IntCoord coord = calculateListPosition();
282 void ComboBox::actionWidgetHide(Widget* _widget, ControllerItem* _controller)
284 _widget->setVisible(
false);
285 _widget->setEnabled(
true);
288 void ComboBox::hideList()
297 controller->eventPostAction +=
newDelegate(
this, &ComboBox::actionWidgetHide);
360 ControllerFadeAlpha* ComboBox::createControllerFadeAlpha(
float _alpha,
float _coef,
bool _enable)
379 mFlowDirection = _value;
382 IntCoord ComboBox::calculateListPosition()
388 length = mMaxListLength;
390 if (mMaxListLength > 0 && length > mMaxListLength)
391 length = mMaxListLength;
408 if ((coord.
top - length) >= 0)
416 if ((coord.
right() + length) <= sizeView.
width)
419 coord.
left -= length;
420 coord.
width = length;
424 if ((coord.
left - length) >= 0)
425 coord.
left -= length;
428 coord.
width = length;
437 if (_key ==
"ModeDrop")
441 else if (_key ==
"FlowDirection")
445 else if (_key ==
"MaxListLength")
449 else if (_key ==
"SmoothShow")
453 else if (_key ==
"AddItem")
525 mShowSmooth = _value;
535 mMaxListLength = _value;
540 return mMaxListLength;
545 return mFlowDirection;
582 if (mList !=
nullptr)
#define MYGUI_ASSERT_RANGE_AND_NONE(index, size, owner)
void addItem(const UString &_name, Any _data=Any::Null)
Add an item to the end of a array.
void beginToItemSelected()
Move all elements so selected becomes visible.
EventPairAddParameter< EventHandle_WidgetVoid, EventHandle_ComboBoxPtrSizeT > eventComboAccept
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 _setItemNameAt(size_t _index, const UString &_name) override
void clearIndexSelected()
Clear item selection.
void setItemNameAt(size_t _index, const UString &_name)
Replace an item name at a specified position.
void setIndexSelected(size_t _index)
Select specified _index.
void removeAllItems()
Remove all items.
void _addItem(const MyGUI::UString &_name) override
void onKeyButtonPressed(KeyCode _key, Char _char) override
const UString & _getItemNameAt(size_t _index) const override
void _removeItemAt(size_t _index) override
void shutdownOverride() override
void insertItemAt(size_t _index, const UString &_item, Any _data=Any::Null)
Insert an item into a array at a specified position.
size_t getIndexSelected() const
Get index of selected item (ITEM_NONE if none selected)
void beginToItemAt(size_t _index)
Move all elements so specified becomes visible.
bool getSmoothShow() const
Get smooth show of list flag.
void setFlowDirection(FlowDirection _value)
Set direction, where drop down list appears (TopToBottom by default).
void beginToItemLast()
Move all elements so last becomes visible.
void setMaxListLength(int _value)
Get max list length.
void initialiseOverride() override
bool getComboModeDrop() const
Get drop list mode flag.
EventPair< EventHandle_WidgetSizeT, EventHandle_ComboBoxPtrSizeT > eventComboChangePosition
void setSmoothShow(bool _value)
Set smooth show of list.
void setItemDataAt(size_t _index, Any _data)
Replace an item data at a specified position.
size_t _getItemCount() const override
void removeItemAt(size_t _index)
Remove item at a specified position.
void clearItemDataAt(size_t _index)
Clear an item data at a specified position.
void _resetContainer(bool _update) override
int getMaxListLength() const
Set max list length.
void beginToItemFirst()
Move all elements so first becomes visible.
size_t getItemCount() const
Get number of items.
FlowDirection getFlowDirection() const
Get direction, where drop down list appears.
void setPropertyOverride(std::string_view _key, std::string_view _value) override
const UString & getItemNameAt(size_t _index) const
Get item name from specified position.
void setComboModeDrop(bool _drop)
Set drop list mode (text can not be edited)
static std::string_view getClassTypeName()
void setAlpha(float _value)
void setCoef(float _value)
void setEnabled(bool _value)
ControllerItem * createItem(std::string_view _type)
static ControllerManager & getInstance()
void addItem(Widget *_widget, ControllerItem *_item)
void setEditStatic(bool _value)
EventPair< EventHandle_WidgetVoid, EventHandle_EditPtr > eventEditTextChange
void setCaption(const UString &_value) override
IntCoord getAbsoluteCoord() const
Type * castType(bool _throw=true)
static LanguageManager & getInstance()
widget description should be here.
void beginToItemAt(size_t _index)
Move all elements so specified becomes visible.
void _resetContainer(bool _update) override
static std::string_view getClassTypeName()
const UString & getItemNameAt(size_t _index) const
Get item name from specified position.
void setActivateOnClick(bool activateOnClick)
void clearIndexSelected()
size_t getItemCount() const
Get number of items.
int getOptimalHeight() const
Return optimal height to fit all items in ListBox.
void setCoord(const IntCoord &_coord) override
void insertItemAt(size_t _index, const UString &_name, Any _data=Any::Null)
Insert an item into a array at a specified position.
void removeAllItems()
Remove all items.
EventPair< EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > eventListChangePosition
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 beginToItemFirst()
Move all elements so first becomes visible.
void setItemDataAt(size_t _index, Any _data)
Replace an item data at a specified position.
EventPair< EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > eventListSelectAccept
void removeItemAt(size_t _index)
Remove item at a specified position.
void setItemNameAt(size_t _index, const UString &_name)
Replace an item name at a specified position.
void setIndexSelected(size_t _index)
EventPair< EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > eventListMouseItemActivate
A UTF-16 string with implicit conversion to/from std::string and std::wstring.
std::string_view getUserString(std::string_view _key) const
T parseValue(std::string_view _value)
constexpr float ALPHA_MAX
constexpr float ALPHA_MIN
const float COMBO_ALPHA_MAX
const float COMBO_ALPHA_MIN
constexpr size_t ITEM_NONE
types::TCoord< int > IntCoord
const float COMBO_ALPHA_COEF
delegates::DelegateFunction< Args... > * newDelegate(void(*_func)(Args... args))