56 Base::_initialise(_style, _coord, _align, _info, _parent, _croppedParent, _creator, _name);
58 initialiseWidgetSkin(_info);
70 initialiseWidgetSkin(_info);
77 if (!properties.empty())
79 MapString::const_iterator iter = properties.find(
"HeightList");
80 if (iter != properties.end()) mMaxHeight = utility::parseValue<int>(iter->second);
82 iter = properties.find(
"ListSmoothShow");
89 if (*(*iter)->_getInternalData<std::string>() ==
"Button")
92 mButton = (*iter)->
castType<Button>();
95 else if (*(*iter)->_getInternalData<std::string>() ==
"List")
111 mManualList = (mList ==
nullptr);
112 if (mList ==
nullptr)
114 std::string list_skin;
115 MapString::const_iterator iter = properties.find(
"ListSkin");
116 if (iter != properties.end()) list_skin = iter->second;
117 std::string list_layer;
118 iter = properties.find(
"ListLayer");
119 if (iter != properties.end()) list_layer = iter->second;
144 void ComboBox::shutdownWidgetSkin()
156 void ComboBox::notifyButtonPressed(Widget* _sender,
int _left,
int _top, MouseButton _id)
162 if (mListShow) hideList();
166 void ComboBox::notifyListLostFocus(Widget* _sender, Widget* _new)
173 if (focus == mButton)
return;
181 void ComboBox::notifyListSelectAccept(List* _widget,
size_t _position)
183 mItemIndex = _position;
196 void ComboBox::notifyListChangePosition(List* _widget,
size_t _position)
198 mItemIndex = _position;
224 void ComboBox::notifyListMouseItemActivate(
List* _widget,
size_t _position)
226 mItemIndex = _position;
238 void ComboBox::notifyMouseWheel(Widget* _sender,
int _rel)
248 if (mItemIndex ==
ITEM_NONE) mItemIndex = 0;
260 if (mItemIndex ==
ITEM_NONE) mItemIndex = 0;
270 void ComboBox::notifyMousePressed(Widget* _sender,
int _left,
int _top, MouseButton _id)
273 Base::notifyMousePressed(_sender, _left, _top, _id);
278 if (mModeDrop) notifyButtonPressed(
nullptr, _left, _top, _id);
281 void ComboBox::notifyEditTextChange(Edit* _sender)
293 void ComboBox::showList()
301 if (height > mMaxHeight) height = mMaxHeight;
309 coord.height = height;
310 coord.top -= coord.height;
315 coord.top += coord.height;
316 coord.height = height;
333 void ComboBox::actionWidgetHide(Widget* _widget)
335 _widget->setVisible(
false);
336 _widget->setEnabled(
true);
339 void ComboBox::hideList()
346 controller->eventPostAction =
newDelegate(
this, &ComboBox::actionWidgetHide);
409 ControllerFadeAlpha* ComboBox::createControllerFadeAlpha(
float _alpha,
float _coef,
bool _enable)
428 if (_key ==
"ComboBox_ModeDrop")
setComboModeDrop(utility::parseValue<bool>(_value));
429 else if (_key ==
"ComboBox_AddItem")
addItem(_value);