MyGUI: MyGUI_ComboBox.cpp Source File

MyGUI 3.2.2

MyGUI_ComboBox.cpp
Go to the documentation of this file.
1 /*
2 * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3 * Distributed under the MIT License
4 * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5 */
6
7 #include "MyGUI_Precompiled.h"
8 #include "MyGUI_ComboBox.h"
9 #include "MyGUI_ControllerManager.h"
10 #include "MyGUI_InputManager.h"
11 #include "MyGUI_WidgetManager.h"
12 #include "MyGUI_Gui.h"
13 #include "MyGUI_ListBox.h"
14 #include "MyGUI_Button.h"
15 #include "MyGUI_ResourceSkin.h"
16 #include "MyGUI_LayerManager.h"
17
18 namespace MyGUI
19 {
20
21 const float COMBO_ALPHA_MAX = ALPHA_MAX;
22 const float COMBO_ALPHA_MIN = ALPHA_MIN;
23 const float COMBO_ALPHA_COEF = 4.0f;
24
25 ComboBox::ComboBox() :
26 mButton(nullptr),
27 mList(nullptr),
28 mListShow(false),
29 mMaxListLength(-1),
30 mItemIndex(ITEM_NONE),
31 mModeDrop(false),
32 mDropMouse(false),
33 mShowSmooth(false),
34 mFlowDirection(FlowDirection::TopToBottom)
35 {
36 }
37
38 void ComboBox::initialiseOverride()
39 {
40 Base::initialiseOverride();
41
43 assignWidget(mButton, "Button");
44 if (mButton != nullptr)
45 {
46 mButton->eventMouseButtonPressed += newDelegate(this, &ComboBox::notifyButtonPressed);
47 }
48
50 assignWidget(mList, "List");
51
52 if (mList == nullptr)
53 {
54 std::string list_skin = getUserString("ListSkin");
55 std::string list_layer = getUserString("ListLayer");
56
57 mList = static_cast<ListBox*>(_createSkinWidget(WidgetStyle::Popup, ListBox::getClassTypeName(), list_skin, IntCoord(), Align::Default, list_layer));
58 }
59
60 if (mList != nullptr)
61 {
62 mList->setActivateOnClick(true);
63
64 mList->setVisible(false);
65 mList->eventKeyLostFocus += newDelegate(this, &ComboBox::notifyListLostFocus);
66 mList->eventListSelectAccept += newDelegate(this, &ComboBox::notifyListSelectAccept);
67 mList->eventListMouseItemActivate += newDelegate(this, &ComboBox::notifyListMouseItemActivate);
68 mList->eventListChangePosition += newDelegate(this, &ComboBox::notifyListChangePosition);
69
70 mList->setNeedToolTip(true);
71 mList->eventToolTip += newDelegate(this, &ComboBox::notifyToolTip);
72 }
73
74 // подписываем дочерние классы на скролл
75 if (mClient != nullptr)
76 {
77 mClient->eventMouseWheel += newDelegate(this, &ComboBox::notifyMouseWheel);
78 mClient->eventMouseButtonPressed += newDelegate(this, &ComboBox::notifyMousePressed);
79
80 mClient->setNeedToolTip(true);
81 mClient->eventToolTip += newDelegate(this, &ComboBox::notifyToolTip);
82 }
83
84 // подписываемся на изменения текста
85 eventEditTextChange += newDelegate(this, &ComboBox::notifyEditTextChange);
86 }
87
88 void ComboBox::shutdownOverride()
89 {
90 mList = nullptr;
91 mButton = nullptr;
92 mClient = nullptr;
93
94 Base::shutdownOverride();
95 }
96
97 void ComboBox::notifyButtonPressed(Widget* _sender, int _left, int _top, MouseButton _id)
98 {
99 if (MouseButton::Left != _id)
100 return;
101
102 mDropMouse = true;
103
104 if (mListShow)
105 hideList();
106 else
107 showList();
108 }
109
110 void ComboBox::notifyListLostFocus(Widget* _sender, Widget* _new)
111 {
112 if (mDropMouse)
113 {
114 mDropMouse = false;
115 Widget* focus = InputManager::getInstance().getMouseFocusWidget();
116
117 // кнопка сама уберет список
118 if (focus == mButton)
119 return;
120
121 // в режиме дропа все окна учавствуют
122 if (mModeDrop && focus == mClient)
123 return;
124 }
125
126 hideList();
127 }
128
129 void ComboBox::notifyListSelectAccept(ListBox* _widget, size_t _position)
130 {
131 mItemIndex = _position;
132 Base::setCaption(mItemIndex != ITEM_NONE ? mList->getItemNameAt(mItemIndex) : "");
133
134 mDropMouse = false;
135 InputManager::getInstance().setKeyFocusWidget(this);
136
137 if (mModeDrop)
138 {
139 _resetContainer(false);
140
141 eventComboAccept.m_eventObsolete(this);
142 eventComboAccept.m_event(this, mItemIndex);
143 }
144 }
145
146 void ComboBox::notifyListChangePosition(ListBox* _widget, size_t _position)
147 {
148 mItemIndex = _position;
149
150 _resetContainer(false);
151
152 eventComboChangePosition(this, _position);
153 }
154
155 void ComboBox::onKeyButtonPressed(KeyCode _key, Char _char)
156 {
157 Base::onKeyButtonPressed(_key, _char);
158
159 // при нажатии вниз, показываем лист
160 if (_key == KeyCode::ArrowDown)
161 {
162 // выкидываем список только если мыша свободна
163 if (!InputManager::getInstance().isCaptureMouse())
164 {
165 showList();
166 }
167 }
168 // нажат ввод в окне редиктирования
169 else if ((_key == KeyCode::Return) || (_key == KeyCode::NumpadEnter))
170 {
171 _resetContainer(false);
172
173 eventComboAccept.m_eventObsolete(this);
174 eventComboAccept.m_event(this, mItemIndex);
175 }
176 }
177
178 void ComboBox::notifyListMouseItemActivate(ListBox* _widget, size_t _position)
179 {
180 mItemIndex = _position;
181 Base::setCaption(mItemIndex != ITEM_NONE ? mList->getItemNameAt(mItemIndex) : "");
182
183 InputManager::getInstance().setKeyFocusWidget(this);
184
185 if (mModeDrop)
186 {
187 _resetContainer(false);
188
189 eventComboAccept.m_eventObsolete(this);
190 eventComboAccept.m_event(this, mItemIndex);
191 }
192 }
193
194 void ComboBox::notifyMouseWheel(Widget* _sender, int _rel)
195 {
196 if (mList->getItemCount() == 0)
197 return;
198 if (InputManager::getInstance().getKeyFocusWidget() != this)
199 return;
200 if (InputManager::getInstance().isCaptureMouse())
201 return;
202
203 if (_rel > 0)
204 {
205 if (mItemIndex != 0)
206 {
207 if (mItemIndex == ITEM_NONE)
208 mItemIndex = 0;
209 else
210 mItemIndex --;
211 Base::setCaption(mList->getItemNameAt(mItemIndex));
212 mList->setIndexSelected(mItemIndex);
213 mList->beginToItemAt(mItemIndex);
214
215 _resetContainer(false);
216
217 eventComboChangePosition(this, mItemIndex);
218 }
219 }
220 else if (_rel < 0)
221 {
222 if ((mItemIndex + 1) < mList->getItemCount())
223 {
224 if (mItemIndex == ITEM_NONE)
225 mItemIndex = 0;
226 else
227 mItemIndex ++;
228 Base::setCaption(mList->getItemNameAt(mItemIndex));
229 mList->setIndexSelected(mItemIndex);
230 mList->beginToItemAt(mItemIndex);
231
232 _resetContainer(false);
233
234 eventComboChangePosition(this, mItemIndex);
235 }
236 }
237 }
238
239 void ComboBox::notifyMousePressed(Widget* _sender, int _left, int _top, MouseButton _id)
240 {
241 // обязательно отдаем отцу, а то мы у него в наглую отняли
242 Base::notifyMousePressed(_sender, _left, _top, _id);
243
244 mDropMouse = true;
245
246 // показываем список
247 if (mModeDrop)
248 notifyButtonPressed(nullptr, _left, _top, _id);
249 }
250
251 void ComboBox::notifyEditTextChange(EditBox* _sender)
252 {
253 // сбрасываем выделенный элемент
254 if (ITEM_NONE != mItemIndex)
255 {
256 mItemIndex = ITEM_NONE;
257 mList->setIndexSelected(mItemIndex);
258 mList->beginToItemFirst();
259
260 _resetContainer(false);
261
262 eventComboChangePosition(this, mItemIndex);
263 }
264 }
265
266 void ComboBox::showList()
267 {
268 // пустой список не показываем
269 if (mList->getItemCount() == 0)
270 return;
271
272 mListShow = true;
273
274 IntCoord coord = calculateListPosition();
275 mList->setCoord(coord);
276
277 if (mShowSmooth)
278 {
279 ControllerFadeAlpha* controller = createControllerFadeAlpha(COMBO_ALPHA_MAX, COMBO_ALPHA_COEF, true);
280 ControllerManager::getInstance().addItem(mList, controller);
281 }
282 else
283 {
284 mList->setVisible(true);
285 }
286
287 InputManager::getInstance().setKeyFocusWidget(mList);
288 }
289
290 void ComboBox::actionWidgetHide(Widget* _widget, ControllerItem* _controller)
291 {
292 _widget->setVisible(false);
293 _widget->setEnabled(true);
294 }
295
296 void ComboBox::hideList()
297 {
298 mListShow = false;
299
300 if (mShowSmooth)
301 {
302 ControllerFadeAlpha* controller = createControllerFadeAlpha(COMBO_ALPHA_MIN, COMBO_ALPHA_COEF, false);
303 controller->eventPostAction += newDelegate(this, &ComboBox::actionWidgetHide);
304 ControllerManager::getInstance().addItem(mList, controller);
305 }
306 else
307 {
308 mList->setVisible(false);
309 }
310 }
311
312 void ComboBox::setIndexSelected(size_t _index)
313 {
314 MYGUI_ASSERT_RANGE_AND_NONE(_index, mList->getItemCount(), "ComboBox::setIndexSelected");
315 mItemIndex = _index;
316 mList->setIndexSelected(_index);
317 if (_index == ITEM_NONE)
318 {
319 Base::setCaption("");
320 return;
321 }
322 Base::setCaption(mList->getItemNameAt(_index));
323 Base::updateView(); // hook for update
324 }
325
326 void ComboBox::setItemNameAt(size_t _index, const UString& _name)
327 {
328 mList->setItemNameAt(_index, _name);
329 mItemIndex = ITEM_NONE;//FIXME
330 mList->setIndexSelected(mItemIndex);//FIXME
331 }
332
333 void ComboBox::setItemDataAt(size_t _index, Any _data)
334 {
335 mList->setItemDataAt(_index, _data);
336 mItemIndex = ITEM_NONE;//FIXME
337 mList->setIndexSelected(mItemIndex);//FIXME
338 }
339
340 void ComboBox::insertItemAt(size_t _index, const UString& _item, Any _data)
341 {
342 mList->insertItemAt(_index, _item, _data);
343 mItemIndex = ITEM_NONE;//FIXME
344 mList->setIndexSelected(mItemIndex);//FIXME
345 }
346
347 void ComboBox::removeItemAt(size_t _index)
348 {
349 mList->removeItemAt(_index);
350 mItemIndex = ITEM_NONE;//FIXME
351 mList->clearIndexSelected();//FIXME
352 }
353
354 void ComboBox::removeAllItems()
355 {
356 mItemIndex = ITEM_NONE;//FIXME
357 mList->removeAllItems();//FIXME заново созданные строки криво стоят
358 }
359
360 void ComboBox::setComboModeDrop(bool _drop)
361 {
362 mModeDrop = _drop;
363 setEditStatic(mModeDrop);
364 }
365
366 ControllerFadeAlpha* ComboBox::createControllerFadeAlpha(float _alpha, float _coef, bool _enable)
367 {
368 ControllerItem* item = ControllerManager::getInstance().createItem(ControllerFadeAlpha::getClassTypeName());
369 ControllerFadeAlpha* controller = item->castType<ControllerFadeAlpha>();
370
371 controller->setAlpha(_alpha);
372 controller->setCoef(_coef);
373 controller->setEnabled(_enable);
374
375 return controller;
376 }
377
378 size_t ComboBox::findItemIndexWith(const UString& _name)
379 {
380 return mList->findItemIndexWith(_name);
381 }
382
383 void ComboBox::setFlowDirection(FlowDirection _value)
384 {
385 mFlowDirection = _value;
386 }
387
388 IntCoord ComboBox::calculateListPosition()
389 {
390 int length = 0;
391 if (mFlowDirection.isVertical())
392 length = mList->getOptimalHeight();
393 else
394 length = mMaxListLength;
395
396 if (mMaxListLength > 0 && length > mMaxListLength)
397 length = mMaxListLength;
398
399 // берем глобальные координаты выджета
400 IntCoord coord = getAbsoluteCoord();
401 // размер леера
402 IntSize sizeView = mList->getParentSize();
403
404 if (mFlowDirection == FlowDirection::TopToBottom)
405 {
406 if ((coord.bottom() + length) <= sizeView.height)
407 coord.top += coord.height;
408 else
409 coord.top -= length;
410 coord.height = length;
411 }
412 else if (mFlowDirection == FlowDirection::BottomToTop)
413 {
414 if ((coord.top - length) >= 0)
415 coord.top -= length;
416 else
417 coord.top += coord.height;
418 coord.height = length;
419 }
420 else if (mFlowDirection == FlowDirection::LeftToRight)
421 {
422 if ((coord.right() + length) <= sizeView.width)
423 coord.left += coord.width;
424 else
425 coord.left -= length;
426 coord.width = length;
427 }
428 else if (mFlowDirection == FlowDirection::RightToLeft)
429 {
430 if ((coord.left - length) >= 0)
431 coord.left -= length;
432 else
433 coord.left += coord.width;
434 coord.width = length;
435 }
436
437 return coord;
438 }
439
440 void ComboBox::setPropertyOverride(const std::string& _key, const std::string& _value)
441 {
443 if (_key == "ModeDrop")
444 setComboModeDrop(utility::parseValue<bool>(_value));
445
447 else if (_key == "FlowDirection")
448 setFlowDirection(utility::parseValue<FlowDirection>(_value));
449
451 else if (_key == "MaxListLength")
452 setMaxListLength(utility::parseValue<int>(_value));
453
455 else if (_key == "SmoothShow")
456 setSmoothShow(utility::parseValue<bool>(_value));
457
458 // не коментировать
459 else if (_key == "AddItem")
460 addItem(_value);
461
462 else
463 {
464 Base::setPropertyOverride(_key, _value);
465 return;
466 }
467
468 eventChangeProperty(this, _key, _value);
469 }
470
471 size_t ComboBox::getItemCount() const
472 {
473 return mList->getItemCount();
474 }
475
476 void ComboBox::addItem(const UString& _name, Any _data)
477 {
478 return insertItemAt(ITEM_NONE, _name, _data);
479 }
480
481 size_t ComboBox::getIndexSelected() const
482 {
483 return mItemIndex;
484 }
485
486 void ComboBox::clearIndexSelected()
487 {
488 setIndexSelected(ITEM_NONE);
489 }
490
491 void ComboBox::clearItemDataAt(size_t _index)
492 {
493 setItemDataAt(_index, Any::Null);
494 }
495
496 const UString& ComboBox::getItemNameAt(size_t _index)
497 {
498 return mList->getItemNameAt(_index);
499 }
500
501 void ComboBox::beginToItemAt(size_t _index)
502 {
503 mList->beginToItemAt(_index);
504 }
505
506 void ComboBox::beginToItemFirst()
507 {
508 if (getItemCount())
509 beginToItemAt(0);
510 }
511
512 void ComboBox::beginToItemLast()
513 {
514 if (getItemCount())
515 beginToItemAt(getItemCount() - 1);
516 }
517
518 void ComboBox::beginToItemSelected()
519 {
520 if (getIndexSelected() != ITEM_NONE)
521 beginToItemAt(getIndexSelected());
522 }
523
524 bool ComboBox::getComboModeDrop() const
525 {
526 return mModeDrop;
527 }
528
529 void ComboBox::setSmoothShow(bool _value)
530 {
531 mShowSmooth = _value;
532 }
533
534 bool ComboBox::getSmoothShow() const
535 {
536 return mShowSmooth;
537 }
538
539 void ComboBox::setMaxListLength(int _value)
540 {
541 mMaxListLength = _value;
542 }
543
544 int ComboBox::getMaxListLength() const
545 {
546 return mMaxListLength;
547 }
548
549 FlowDirection ComboBox::getFlowDirection() const
550 {
551 return mFlowDirection;
552 }
553
554 void ComboBox::notifyToolTip(Widget* _sender, const ToolTipInfo& _info)
555 {
556 if (getNeedToolTip())
557 eventToolTip(this, _info);
558 }
559
560 size_t ComboBox::_getItemCount()
561 {
562 return getItemCount();
563 }
564
565 void ComboBox::_addItem(const MyGUI::UString& _name)
566 {
567 addItem(_name);
568 }
569
570 void ComboBox::_removeItemAt(size_t _index)
571 {
572 removeItemAt(_index);
573 }
574
575 void ComboBox::_setItemNameAt(size_t _index, const UString& _name)
576 {
577 setItemNameAt(_index, _name);
578 }
579
580 const UString& ComboBox::_getItemNameAt(size_t _index)
581 {
582 return getItemNameAt(_index);
583 }
584
585 void ComboBox::_resetContainer(bool _update)
586 {
587 Base::_resetContainer(_update);
588 if (mList != nullptr)
589 mList->_resetContainer(_update);
590 }
591
592 } // namespace MyGUI
MyGUI::Singleton< InputManager >::getInstance
static InputManager & getInstance()
Definition: MyGUI_Singleton.h:38
MyGUI::Widget::_createSkinWidget
Widget * _createSkinWidget(WidgetStyle _style, const std::string &_type, const std::string &_skin, const IntCoord &_coord, Align _align, const std::string &_layer="", const std::string &_name="")
Definition: MyGUI_Widget.cpp:1139
MyGUI::ComboBox::getItemNameAt
const UString & getItemNameAt(size_t _index)
Get item name from specified position.
Definition: MyGUI_ComboBox.cpp:496
MyGUI::EditBox::eventEditTextChange
EventPair< EventHandle_WidgetVoid, EventHandle_EditPtr > eventEditTextChange
Definition: MyGUI_EditBox.h:252
MyGUI::ListBox
ListBox properties. Skin childs. ListBox widget description should be here.
Definition: MyGUI_ListBox.h:27
MyGUI::WidgetInput::eventMouseButtonPressed
EventHandle_WidgetIntIntButton eventMouseButtonPressed
Definition: MyGUI_WidgetInput.h:154
MyGUI_Gui.h
MyGUI::types::TSize::height
T height
Definition: MyGUI_TSize.h:21
MyGUI_ControllerManager.h
MyGUI::InputManager::getKeyFocusWidget
Widget * getKeyFocusWidget() const
Definition: MyGUI_InputManager.cpp:633
MyGUI::ListBox::getOptimalHeight
int getOptimalHeight()
Return optimal height to fit all items in ListBox.
Definition: MyGUI_ListBox.cpp:912
MyGUI::InputManager::setKeyFocusWidget
void setKeyFocusWidget(Widget *_widget)
Definition: MyGUI_InputManager.cpp:382
MyGUI::types::TCoord::bottom
T bottom() const
Definition: MyGUI_TCoord.h:155
MyGUI::IntCoord
types::TCoord< int > IntCoord
Definition: MyGUI_Types.h:35
MyGUI::ComboBox::setPropertyOverride
virtual void setPropertyOverride(const std::string &_key, const std::string &_value)
Definition: MyGUI_ComboBox.cpp:440
MyGUI::ComboBox::setItemDataAt
void setItemDataAt(size_t _index, Any _data)
Replace an item data at a specified position.
Definition: MyGUI_ComboBox.cpp:333
MyGUI::ComboBox::getIndexSelected
size_t getIndexSelected() const
Get index of selected item (ITEM_NONE if none selected)
Definition: MyGUI_ComboBox.cpp:481
MyGUI::WidgetInput::eventToolTip
EventHandle_WidgetToolTip eventToolTip
Definition: MyGUI_WidgetInput.h:227
MyGUI::types::TCoord::left
T left
Definition: MyGUI_TCoord.h:22
MyGUI::EditBox::setEditStatic
void setEditStatic(bool _value)
Definition: MyGUI_EditBox.cpp:1944
MyGUI::ICroppedRectangle::getAbsoluteCoord
IntCoord getAbsoluteCoord() const
Definition: MyGUI_ICroppedRectangle.h:77
MyGUI::ListBox::setCoord
virtual void setCoord(const IntCoord &_value)
Definition: MyGUI_ListBox.cpp:274
MyGUI::ComboBox::_getItemNameAt
virtual const UString & _getItemNameAt(size_t _index)
Definition: MyGUI_ComboBox.cpp:580
MyGUI::ComboBox::setSmoothShow
void setSmoothShow(bool _value)
Set smooth show of list.
Definition: MyGUI_ComboBox.cpp:529
MyGUI::COMBO_ALPHA_MIN
const float COMBO_ALPHA_MIN
Definition: MyGUI_ComboBox.cpp:22
MyGUI::types::TCoord::top
T top
Definition: MyGUI_TCoord.h:23
MyGUI::ComboBox::onKeyButtonPressed
virtual void onKeyButtonPressed(KeyCode _key, Char _char)
Definition: MyGUI_ComboBox.cpp:155
MyGUI::Widget::Widget
Widget()
Definition: MyGUI_Widget.cpp:31
MyGUI::ScrollViewBase::mClient
Widget * mClient
Definition: MyGUI_ScrollViewBase.h:46
MyGUI::ListBox::insertItemAt
void insertItemAt(size_t _index, const UString &_name, Any _data=Any::Null)
Insert an item into a array at a specified position.
Definition: MyGUI_ListBox.cpp:500
MyGUI_ListBox.h
MyGUI::InputManager::getMouseFocusWidget
Widget * getMouseFocusWidget() const
Definition: MyGUI_InputManager.cpp:628
MyGUI::ComboBox::removeItemAt
void removeItemAt(size_t _index)
Remove item at a specified position.
Definition: MyGUI_ComboBox.cpp:347
MyGUI::Widget::eventChangeProperty
EventHandle_WidgetStringString eventChangeProperty
Definition: MyGUI_Widget.h:266
MyGUI::WidgetStyle::Popup
Definition: MyGUI_WidgetStyle.h:21
MyGUI::ALPHA_MAX
const float ALPHA_MAX
Definition: MyGUI_Macros.h:19
MyGUI::KeyCode::ArrowDown
Definition: MyGUI_KeyCode.h:145
MYGUI_ASSERT_RANGE_AND_NONE
#define MYGUI_ASSERT_RANGE_AND_NONE(index, size, owner)
Definition: MyGUI_Diagnostic.h:55
MyGUI::ControllerFadeAlpha::getClassTypeName
static const std::string & getClassTypeName()
Definition: MyGUI_ControllerFadeAlpha.h:21
MyGUI::FlowDirection::TopToBottom
Definition: MyGUI_FlowDirection.h:22
MyGUI::ListBox::beginToItemAt
void beginToItemAt(size_t _index)
Move all elements so specified becomes visible.
Definition: MyGUI_ListBox.cpp:667
MyGUI::ComboBox::beginToItemFirst
void beginToItemFirst()
Move all elements so first becomes visible.
Definition: MyGUI_ComboBox.cpp:506
MyGUI::Widget
Widget properties. Skin childs. Widget widget description should be here.
Definition: MyGUI_Widget.h:29
MyGUI::COMBO_ALPHA_COEF
const float COMBO_ALPHA_COEF
Definition: MyGUI_ComboBox.cpp:23
MyGUI::ComboBox::beginToItemAt
void beginToItemAt(size_t _index)
Move all elements so specified becomes visible.
Definition: MyGUI_ComboBox.cpp:501
MyGUI::ComboBox::shutdownOverride
virtual void shutdownOverride()
Definition: MyGUI_ComboBox.cpp:88
MyGUI::ListBox::removeAllItems
void removeAllItems()
Remove all items.
Definition: MyGUI_ListBox.cpp:725
MyGUI::ITEM_NONE
const size_t ITEM_NONE
Definition: MyGUI_Macros.h:17
MyGUI::ControllerItem
Definition: MyGUI_ControllerItem.h:25
MyGUI::Any
Definition: MyGUI_Any.h:63
MyGUI::types::TSize::width
T width
Definition: MyGUI_TSize.h:20
MyGUI::ListBox::removeItemAt
void removeItemAt(size_t _index)
Remove item at a specified position.
Definition: MyGUI_ListBox.cpp:562
MyGUI::ControllerFadeAlpha::setEnabled
void setEnabled(bool _value)
Definition: MyGUI_ControllerFadeAlpha.cpp:106
MyGUI::ComboBox::setItemNameAt
void setItemNameAt(size_t _index, const UString &_name)
Replace an item name at a specified position.
Definition: MyGUI_ComboBox.cpp:326
MyGUI::ComboBox::setIndexSelected
void setIndexSelected(size_t _index)
Select specified _index.
Definition: MyGUI_ComboBox.cpp:312
MyGUI::ComboBox::findItemIndexWith
size_t findItemIndexWith(const UString &_name)
Search item, returns the position of the first occurrence in array or ITEM_NONE if item not found.
Definition: MyGUI_ComboBox.cpp:378
MyGUI::ListBox::setItemDataAt
void setItemDataAt(size_t _index, Any _data)
Replace an item data at a specified position.
Definition: MyGUI_ListBox.cpp:757
MyGUI::ListBox::beginToItemFirst
void beginToItemFirst()
Move all elements so first becomes visible.
Definition: MyGUI_ListBox.cpp:947
MyGUI::ComboBox::getFlowDirection
FlowDirection getFlowDirection() const
Get direction, where drop down list appears.
Definition: MyGUI_ComboBox.cpp:549
MyGUI::Widget::getParentSize
IntSize getParentSize() const
Definition: MyGUI_Widget.cpp:1025
MyGUI::types::TCoord::right
T right() const
Definition: MyGUI_TCoord.h:150
MyGUI::UserData::getUserString
const std::string & getUserString(const std::string &_key) const
Definition: MyGUI_WidgetUserData.cpp:28
MyGUI::WidgetInput::setNeedToolTip
void setNeedToolTip(bool _value)
Definition: MyGUI_WidgetInput.cpp:136
MyGUI_ComboBox.h
MyGUI::FlowDirection
Definition: MyGUI_FlowDirection.h:16
MyGUI::ComboBox::_resetContainer
virtual void _resetContainer(bool _update)
Definition: MyGUI_ComboBox.cpp:585
MyGUI::ComboBox::getItemCount
size_t getItemCount() const
Get number of items.
Definition: MyGUI_ComboBox.cpp:471
MyGUI::UString
A UTF-16 string with implicit conversion to/from std::string and std::wstring.
Definition: MyGUI_UString.h:168
MyGUI::ComboBox::insertItemAt
void insertItemAt(size_t _index, const UString &_name, Any _data=Any::Null)
Insert an item into a array at a specified position.
Definition: MyGUI_ComboBox.cpp:340
MyGUI_Precompiled.h
MyGUI::Align::Default
Definition: MyGUI_Align.h:36
MyGUI::ComboBox::beginToItemLast
void beginToItemLast()
Move all elements so last becomes visible.
Definition: MyGUI_ComboBox.cpp:512
MyGUI::MouseButton
Definition: MyGUI_MouseButton.h:15
MyGUI::ListBox::getClassTypeName
static const std::string & getClassTypeName()
Definition: MyGUI_ListBox.h:32
MyGUI::ListBox::eventListSelectAccept
EventPair< EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > eventListSelectAccept
Definition: MyGUI_ListBox.h:200
MyGUI::ComboBox::initialiseOverride
virtual void initialiseOverride()
Definition: MyGUI_ComboBox.cpp:38
MyGUI::ComboBox::setMaxListLength
void setMaxListLength(int _value)
Get max list length.
Definition: MyGUI_ComboBox.cpp:539
MyGUI::EventPair::m_event
Event m_event
Definition: MyGUI_EventPair.h:126
MyGUI::ToolTipInfo
Definition: MyGUI_WidgetToolTip.h:17
MyGUI::ComboBox::getMaxListLength
int getMaxListLength() const
Set max list length.
Definition: MyGUI_ComboBox.cpp:544
MyGUI::COMBO_ALPHA_MAX
const float COMBO_ALPHA_MAX
Definition: MyGUI_ComboBox.cpp:21
MyGUI::ComboBox::eventComboAccept
EventPair< EventHandle_WidgetVoid, EventHandle_ComboBoxPtrSizeT > eventComboAccept
Definition: MyGUI_ComboBox.h:148
MyGUI_InputManager.h
MyGUI::ListBox::clearIndexSelected
void clearIndexSelected()
Definition: MyGUI_ListBox.cpp:937
MyGUI::ComboBox::setComboModeDrop
void setComboModeDrop(bool _value)
Set drop list mode (text can not be edited)
Definition: MyGUI_ComboBox.cpp:360
MyGUI::Widget::setVisible
virtual void setVisible(bool _value)
Definition: MyGUI_Widget.cpp:965
MyGUI_LayerManager.h
MyGUI_Button.h
MyGUI::ListBox::_resetContainer
virtual void _resetContainer(bool _update)
Definition: MyGUI_ListBox.cpp:995
MyGUI::WidgetInput::getNeedToolTip
bool getNeedToolTip() const
Definition: MyGUI_WidgetInput.cpp:141
MyGUI::FlowDirection::LeftToRight
Definition: MyGUI_FlowDirection.h:20
MyGUI::ListBox::setIndexSelected
void setIndexSelected(size_t _index)
Definition: MyGUI_ListBox.cpp:634
MyGUI::IObject::castType
Type * castType(bool _throw=true)
Definition: MyGUI_IObject.h:18
MyGUI_WidgetManager.h
MyGUI::ComboBox::ComboBox
ComboBox()
Definition: MyGUI_ComboBox.cpp:25
MyGUI::KeyCode::NumpadEnter
Definition: MyGUI_KeyCode.h:125
MyGUI::ComboBox::clearIndexSelected
void clearIndexSelected()
Clear item selection.
Definition: MyGUI_ComboBox.cpp:486
MyGUI::WidgetInput::eventKeyLostFocus
EventHandle_WidgetWidget eventKeyLostFocus
Definition: MyGUI_WidgetInput.h:182
MyGUI::ComboBox::_setItemNameAt
virtual void _setItemNameAt(size_t _index, const UString &_name)
Definition: MyGUI_ComboBox.cpp:575
MyGUI::ComboBox::_getItemCount
virtual size_t _getItemCount()
Definition: MyGUI_ComboBox.cpp:560
MyGUI::types::TSize< int >
MyGUI::ComboBox::beginToItemSelected
void beginToItemSelected()
Move all elements so selected becomes visible.
Definition: MyGUI_ComboBox.cpp:518
nullptr
#define nullptr
Definition: MyGUI_Prerequest.h:29
MyGUI::KeyCode::Return
Definition: MyGUI_KeyCode.h:47
MyGUI::ComboBox::getSmoothShow
bool getSmoothShow() const
Get smooth show of list flag.
Definition: MyGUI_ComboBox.cpp:534
MyGUI::ControllerFadeAlpha::setCoef
void setCoef(float _value)
Definition: MyGUI_ControllerFadeAlpha.cpp:101
MyGUI::ComboBox::removeAllItems
void removeAllItems()
Remove all items.
Definition: MyGUI_ComboBox.cpp:354
MyGUI::ListBox::eventListChangePosition
EventPair< EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > eventListChangePosition
Definition: MyGUI_ListBox.h:207
MyGUI::Widget::assignWidget
void assignWidget(T *&_widget, const std::string &_name)
Definition: MyGUI_Widget.h:328
MyGUI::ControllerManager::createItem
ControllerItem * createItem(const std::string &_type)
Definition: MyGUI_ControllerManager.cpp:72
MyGUI::ControllerManager::addItem
void addItem(Widget *_widget, ControllerItem *_item)
Definition: MyGUI_ControllerManager.cpp:78
MyGUI::types::TCoord::width
T width
Definition: MyGUI_TCoord.h:24
MyGUI::FlowDirection::isVertical
bool isVertical() const
Definition: MyGUI_FlowDirection.h:51
MyGUI::ComboBox::clearItemDataAt
void clearItemDataAt(size_t _index)
Clear an item data at a specified position.
Definition: MyGUI_ComboBox.cpp:491
MyGUI::Char
unsigned int Char
Definition: MyGUI_Types.h:51
MyGUI::ComboBox::addItem
void addItem(const UString &_name, Any _data=Any::Null)
Add an item to the end of a array.
Definition: MyGUI_ComboBox.cpp:476
MyGUI::ComboBox::setFlowDirection
void setFlowDirection(FlowDirection _value)
Set direction, where drop down list appears (TopToBottom by default).
Definition: MyGUI_ComboBox.cpp:383
MyGUI::ComboBox::_removeItemAt
virtual void _removeItemAt(size_t _index)
Definition: MyGUI_ComboBox.cpp:570
MyGUI::ControllerFadeAlpha
Definition: MyGUI_ControllerFadeAlpha.h:18
MyGUI::ControllerFadeAlpha::setAlpha
void setAlpha(float _value)
Definition: MyGUI_ControllerFadeAlpha.cpp:96
MyGUI::ListBox::eventListMouseItemActivate
EventPair< EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > eventListMouseItemActivate
Definition: MyGUI_ListBox.h:214
MyGUI::ListBox::getItemNameAt
const UString & getItemNameAt(size_t _index)
Get item name from specified position.
Definition: MyGUI_ListBox.cpp:764
MyGUI::MouseButton::Left
Definition: MyGUI_MouseButton.h:21
MyGUI::ListBox::setActivateOnClick
void setActivateOnClick(bool activateOnClick)
Definition: MyGUI_ListBox.cpp:1118
MyGUI::EditBox::updateView
void updateView()
Definition: MyGUI_EditBox.cpp:1724
MyGUI::InputManager::isCaptureMouse
bool isCaptureMouse() const
Definition: MyGUI_InputManager.cpp:613
MyGUI::ComboBox::eventComboChangePosition
EventPair< EventHandle_WidgetSizeT, EventHandle_ComboBoxPtrSizeT > eventComboChangePosition
Definition: MyGUI_ComboBox.h:155
MyGUI::types::TCoord
Definition: MyGUI_TCoord.h:20
MyGUI::FlowDirection::RightToLeft
Definition: MyGUI_FlowDirection.h:21
MyGUI::WidgetInput::eventMouseWheel
EventHandle_WidgetInt eventMouseWheel
Definition: MyGUI_WidgetInput.h:145
MyGUI::ListBox::setItemNameAt
void setItemNameAt(size_t _index, const UString &_name)
Replace an item name at a specified position.
Definition: MyGUI_ListBox.cpp:750
MyGUI::Any::Null
static AnyEmpty Null
Definition: MyGUI_Any.h:67
MyGUI::ListBox::getItemCount
size_t getItemCount() const
Get number of items.
Definition: MyGUI_ListBox.cpp:922
MyGUI::types::TCoord::height
T height
Definition: MyGUI_TCoord.h:25
MyGUI
Definition: MyGUI_ActionController.h:14
newDelegate
MYGUI_TEMPLATE MYGUI_TEMPLATE_PARAMS delegates::IDelegateMYGUI_SUFFIX MYGUI_TEMPLATE_ARGS * newDelegate(void(*_func)(MYGUI_PARAMS))
Definition: MyGUI_DelegateImplement.h:117
MyGUI::EventPair::m_eventObsolete
EventObsolete m_eventObsolete
Definition: MyGUI_EventPair.h:125
MyGUI::ListBox::findItemIndexWith
size_t findItemIndexWith(const UString &_name)
Search item, returns the position of the first occurrence in array or ITEM_NONE if item not found.
Definition: MyGUI_ListBox.cpp:902
MyGUI::ALPHA_MIN
const float ALPHA_MIN
Definition: MyGUI_Macros.h:20
MyGUI::ComboBox::_addItem
virtual void _addItem(const MyGUI::UString &_name)
Definition: MyGUI_ComboBox.cpp:565
MyGUI::ComboBox::getComboModeDrop
bool getComboModeDrop() const
Get drop list mode flag.
Definition: MyGUI_ComboBox.cpp:524
MyGUI::FlowDirection::BottomToTop
Definition: MyGUI_FlowDirection.h:23
MyGUI::EditBox::setCaption
virtual void setCaption(const UString &_value)
Definition: MyGUI_EditBox.cpp:1551
MyGUI_ResourceSkin.h
MyGUI::KeyCode
Definition: MyGUI_KeyCode.h:15