44 if (mButton !=
nullptr)
97 void ComboBox::notifyButtonPressed(
Widget* _sender,
int _left,
int _top,
MouseButton _id)
110 void ComboBox::notifyListLostFocus(Widget* _sender, Widget* _new)
118 if (focus == mButton)
122 if (mModeDrop && focus ==
mClient)
129 void ComboBox::notifyListSelectAccept(ListBox* _widget,
size_t _position)
131 mItemIndex = _position;
146 void ComboBox::notifyListChangePosition(ListBox* _widget,
size_t _position)
148 mItemIndex = _position;
178 void ComboBox::notifyListMouseItemActivate(
ListBox* _widget,
size_t _position)
180 mItemIndex = _position;
194 void ComboBox::notifyMouseWheel(Widget* _sender,
int _rel)
239 void ComboBox::notifyMousePressed(Widget* _sender,
int _left,
int _top, MouseButton _id)
242 Base::notifyMousePressed(_sender, _left, _top, _id);
248 notifyButtonPressed(
nullptr, _left, _top, _id);
251 void ComboBox::notifyEditTextChange(EditBox* _sender)
266 void ComboBox::showList()
274 IntCoord coord = calculateListPosition();
290 void ComboBox::actionWidgetHide(Widget* _widget, ControllerItem* _controller)
292 _widget->setVisible(
false);
293 _widget->setEnabled(
true);
296 void ComboBox::hideList()
303 controller->eventPostAction +=
newDelegate(
this, &ComboBox::actionWidgetHide);
366 ControllerFadeAlpha* ComboBox::createControllerFadeAlpha(
float _alpha,
float _coef,
bool _enable)
385 mFlowDirection = _value;
388 IntCoord ComboBox::calculateListPosition()
394 length = mMaxListLength;
396 if (mMaxListLength > 0 && length > mMaxListLength)
397 length = mMaxListLength;
414 if ((coord.
top - length) >= 0)
422 if ((coord.
right() + length) <= sizeView.
width)
425 coord.
left -= length;
426 coord.
width = length;
430 if ((coord.
left - length) >= 0)
431 coord.
left -= length;
434 coord.
width = length;
443 if (_key ==
"ModeDrop")
447 else if (_key ==
"FlowDirection")
451 else if (_key ==
"MaxListLength")
455 else if (_key ==
"SmoothShow")
459 else if (_key ==
"AddItem")
531 mShowSmooth = _value;
541 mMaxListLength = _value;
546 return mMaxListLength;
551 return mFlowDirection;
588 if (mList !=
nullptr)
void addItem(Widget *_widget, ControllerItem *_item)
bool getComboModeDrop() const
Get drop list mode flag.
virtual void setPropertyOverride(const std::string &_key, const std::string &_value)
void setItemDataAt(size_t _index, Any _data)
Replace an item data at a specified position.
const UString & getItemNameAt(size_t _index)
Get item name from specified position.
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 getIndexSelected() const
Get index of selected item (ITEM_NONE if none selected)
void clearIndexSelected()
delegates::IDelegate0 * newDelegate(void(*_func)())
static InputManager & getInstance()
void beginToItemFirst()
Move all elements so first becomes visible.
virtual const UString & _getItemNameAt(size_t _index)
virtual void onKeyButtonPressed(KeyCode _key, Char _char)
virtual void shutdownOverride()
const std::string & getUserString(const std::string &_key) const
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 removeItemAt(size_t _index)
Remove item at a specified position.
void setIndexSelected(size_t _index)
Select specified _index.
ListBox properties. Skin childs. ListBox widget description should be here.
virtual void _resetContainer(bool _update)
void beginToItemAt(size_t _index)
Move all elements so specified becomes visible.
EventPair< EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > eventListChangePosition
types::TCoord< int > IntCoord
IntCoord getAbsoluteCoord() const
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)
Replace an item name at a specified position.
FlowDirection getFlowDirection() const
Get direction, where drop down list appears.
int getMaxListLength() const
Set max list length.
virtual void initialiseOverride()
const float COMBO_ALPHA_COEF
virtual void _resetContainer(bool _update)
EventPair< EventHandle_WidgetVoid, EventHandle_ComboBoxPtrSizeT > eventComboAccept
void setActivateOnClick(bool activateOnClick)
void insertItemAt(size_t _index, const UString &_name, Any _data=Any::Null)
Insert an item into a array at a specified position.
size_t getItemCount() const
Get number of items.
void setComboModeDrop(bool _value)
Set drop list mode (text can not be edited)
virtual void setCoord(const IntCoord &_value)
void beginToItemLast()
Move all elements so last becomes visible.
static const std::string & getClassTypeName()
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 setAlpha(float _value)
#define MYGUI_ASSERT_RANGE_AND_NONE(index, size, owner)
void setCoef(float _value)
EventPair< EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > eventListMouseItemActivate
const UString & getItemNameAt(size_t _index)
Get item name from specified position.
void clearIndexSelected()
Clear item selection.
void removeItemAt(size_t _index)
Remove item at a specified position.
virtual void _setItemNameAt(size_t _index, const UString &_name)
void setEnabled(bool _value)
virtual void setCaption(const UString &_value)
Type * castType(bool _throw=true)
size_t findItemIndexWith(const UString &_name)
Search item, returns the position of the first occurrence in array or ITEM_NONE if item not found...
int getOptimalHeight()
Return optimal height to fit all items in ListBox.
virtual size_t _getItemCount()
void clearItemDataAt(size_t _index)
Clear an item data at a specified position.
void beginToItemFirst()
Move all elements so first becomes visible.
EventPair< EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > eventListSelectAccept
void beginToItemSelected()
Move all elements so selected becomes visible.
void setFlowDirection(FlowDirection _value)
Set direction, where drop down list appears (TopToBottom by default).
void removeAllItems()
Remove all items.
virtual void _removeItemAt(size_t _index)
bool getSmoothShow() const
Get smooth show of list flag.
A UTF-16 string with implicit conversion to/from std::string and std::wstring.
EventPair< EventHandle_WidgetVoid, EventHandle_EditPtr > eventEditTextChange
EventPair< EventHandle_WidgetSizeT, EventHandle_ComboBoxPtrSizeT > eventComboChangePosition
static const std::string & getClassTypeName()
void addItem(const UString &_name, Any _data=Any::Null)
Add an item to the end of a array.
void setIndexSelected(size_t _index)
void setEditStatic(bool _value)
const float COMBO_ALPHA_MAX
void beginToItemAt(size_t _index)
Move all elements so specified becomes visible.
const float COMBO_ALPHA_MIN
virtual void _addItem(const MyGUI::UString &_name)
void removeAllItems()
Remove all items.
ControllerItem * createItem(const std::string &_type)