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)
#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.
EventPair< 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 setComboModeDrop(bool _value)
Set drop list mode (text can not be edited)
void onKeyButtonPressed(KeyCode _key, Char _char) override
const UString & _getItemNameAt(size_t _index) const override
void _removeItemAt(size_t _index) override
void shutdownOverride() override
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 insertItemAt(size_t _index, const UString &_name, Any _data=Any::Null)
Insert an item into a array at a specified position.
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
void setPropertyOverride(const std::string &_key, const std::string &_value) 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.
const UString & getItemNameAt(size_t _index) const
Get item name from specified position.
static const std::string & getClassTypeName()
void setAlpha(float _value)
void setCoef(float _value)
void setEnabled(bool _value)
ControllerItem * createItem(const std::string &_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)
widget description should be here.
void beginToItemAt(size_t _index)
Move all elements so specified becomes visible.
void _resetContainer(bool _update) override
const UString & getItemNameAt(size_t _index) const
Get item name from specified position.
void setActivateOnClick(bool activateOnClick)
void clearIndexSelected()
static const std::string & getClassTypeName()
size_t getItemCount() const
Get number of items.
int getOptimalHeight() const
Return optimal height to fit all items in ListBox.
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)
void setCoord(const IntCoord &_value) override
EventPair< EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > eventListMouseItemActivate
A UTF-16 string with implicit conversion to/from std::string and std::wstring.
const std::string & getUserString(const std::string &_key) const
const float COMBO_ALPHA_MAX
const float COMBO_ALPHA_MIN
types::TCoord< int > IntCoord
const float COMBO_ALPHA_COEF
delegates::DelegateFunction< Args... > * newDelegate(void(*_func)(Args... args))