MyGUI 3.2.0

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files
- Examples

- File List
- Globals

MyGUI_ComboBox.cpp
Go to the documentation of this file.
1
6 /*
7 This file is part of MyGUI.
8
9 MyGUI is free software: you can redistribute it and/or modify
10 it under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 MyGUI is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public License
20 along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
21 */
22 #include "MyGUI_Precompiled.h"
23 #include "MyGUI_ComboBox.h"
24 #include "MyGUI_ControllerManager.h"
25 #include "MyGUI_InputManager.h"
26 #include "MyGUI_WidgetManager.h"
27 #include "MyGUI_Gui.h"
28 #include "MyGUI_ListBox.h"
29 #include "MyGUI_Button.h"
30 #include "MyGUI_ResourceSkin.h"
31 #include "MyGUI_LayerManager.h"
32
33 namespace MyGUI
34 {
35
36 const float COMBO_ALPHA_MAX = ALPHA_MAX;
37 const float COMBO_ALPHA_MIN = ALPHA_MIN;
38 const float COMBO_ALPHA_COEF = 4.0f;
39
40 ComboBox::ComboBox() :
41 mButton(nullptr),
42 mList(nullptr),
43 mListShow(false),
44 mMaxListLength(-1),
45 mItemIndex(ITEM_NONE),
46 mModeDrop(false),
47 mDropMouse(false),
48 mShowSmooth(false),
49 mFlowDirection(FlowDirection::TopToBottom)
50 {
51 }
52
53 void ComboBox::initialiseOverride()
54 {
55 Base::initialiseOverride();
56
57 assignWidget(mButton, "Button");
58 if (mButton != nullptr)
59 {
60 mButton->eventMouseButtonPressed += newDelegate(this, &ComboBox::notifyButtonPressed);
61 }
62
63 assignWidget(mList, "List");
64
65 if (mList == nullptr)
66 {
67 std::string list_skin = getUserString("ListSkin");
68 std::string list_layer = getUserString("ListLayer");
69
70 mList = static_cast<ListBox*>(_createSkinWidget(WidgetStyle::Popup, ListBox::getClassTypeName(), list_skin, IntCoord(), Align::Default, list_layer));
71 }
72
73 if (mList != nullptr)
74 {
75 mList->setVisible(false);
76 mList->eventKeyLostFocus += newDelegate(this, &ComboBox::notifyListLostFocus);
77 mList->eventListSelectAccept += newDelegate(this, &ComboBox::notifyListSelectAccept);
78 mList->eventListMouseItemActivate += newDelegate(this, &ComboBox::notifyListMouseItemActivate);
79 mList->eventListChangePosition += newDelegate(this, &ComboBox::notifyListChangePosition);
80
81 mList->setNeedToolTip(true);
82 mList->eventToolTip += newDelegate(this, &ComboBox::notifyToolTip);
83 }
84
85 // подписываем дочерние классы на скролл
86 if (mClient != nullptr)
87 {
88 mClient->eventMouseWheel += newDelegate(this, &ComboBox::notifyMouseWheel);
89 mClient->eventMouseButtonPressed += newDelegate(this, &ComboBox::notifyMousePressed);
90
91 mClient->setNeedToolTip(true);
92 mClient->eventToolTip += newDelegate(this, &ComboBox::notifyToolTip);
93 }
94
95 // подписываемся на изменения текста
96 eventEditTextChange += newDelegate(this, &ComboBox::notifyEditTextChange);
97 }
98
99 void ComboBox::shutdownOverride()
100 {
101 mList = nullptr;
102 mButton = nullptr;
103 mClient = nullptr;
104
105 Base::shutdownOverride();
106 }
107
108 void ComboBox::notifyButtonPressed(Widget* _sender, int _left, int _top, MouseButton _id)
109 {
110 if (MouseButton::Left != _id)
111 return;
112
113 mDropMouse = true;
114
115 if (mListShow)
116 hideList();
117 else
118 showList();
119 }
120
121 void ComboBox::notifyListLostFocus(Widget* _sender, Widget* _new)
122 {
123 if (mDropMouse)
124 {
125 mDropMouse = false;
126 Widget* focus = InputManager::getInstance().getMouseFocusWidget();
127
128 // кнопка сама уберет список
129 if (focus == mButton)
130 return;
131
132 // в режиме дропа все окна учавствуют
133 if (mModeDrop && focus == mClient)
134 return;
135 }
136
137 hideList();
138 }
139
140 void ComboBox::notifyListSelectAccept(ListBox* _widget, size_t _position)
141 {
142 mItemIndex = _position;
143 Base::setCaption(mItemIndex != ITEM_NONE ? mList->getItemNameAt(mItemIndex) : "");
144
145 mDropMouse = false;
146 InputManager::getInstance().setKeyFocusWidget(this);
147
148 if (mModeDrop)
149 {
150 _resetContainer(false);
151
152 eventComboAccept.m_eventObsolete(this);
153 eventComboAccept.m_event(this, mItemIndex);
154 }
155 }
156
157 void ComboBox::notifyListChangePosition(ListBox* _widget, size_t _position)
158 {
159 mItemIndex = _position;
160
161 _resetContainer(false);
162
163 eventComboChangePosition(this, _position);
164 }
165
166 void ComboBox::onKeyButtonPressed(KeyCode _key, Char _char)
167 {
168 Base::onKeyButtonPressed(_key, _char);
169
170 // при нажатии вниз, показываем лист
171 if (_key == KeyCode::ArrowDown)
172 {
173 // выкидываем список только если мыша свободна
174 if (!InputManager::getInstance().isCaptureMouse())
175 {
176 showList();
177 }
178 }
179 // нажат ввод в окне редиктирования
180 else if ((_key == KeyCode::Return) || (_key == KeyCode::NumpadEnter))
181 {
182 _resetContainer(false);
183
184 eventComboAccept.m_eventObsolete(this);
185 eventComboAccept.m_event(this, mItemIndex);
186 }
187 }
188
189 void ComboBox::notifyListMouseItemActivate(ListBox* _widget, size_t _position)
190 {
191 mItemIndex = _position;
192 Base::setCaption(mItemIndex != ITEM_NONE ? mList->getItemNameAt(mItemIndex) : "");
193
194 InputManager::getInstance().setKeyFocusWidget(this);
195
196 if (mModeDrop)
197 {
198 _resetContainer(false);
199
200 eventComboAccept.m_eventObsolete(this);
201 eventComboAccept.m_event(this, mItemIndex);
202 }
203 }
204
205 void ComboBox::notifyMouseWheel(Widget* _sender, int _rel)
206 {
207 if (mList->getItemCount() == 0)
208 return;
209 if (InputManager::getInstance().getKeyFocusWidget() != this)
210 return;
211 if (InputManager::getInstance().isCaptureMouse())
212 return;
213
214 if (_rel > 0)
215 {
216 if (mItemIndex != 0)
217 {
218 if (mItemIndex == ITEM_NONE)
219 mItemIndex = 0;
220 else
221 mItemIndex --;
222 Base::setCaption(mList->getItemNameAt(mItemIndex));
223 mList->setIndexSelected(mItemIndex);
224 mList->beginToItemAt(mItemIndex);
225
226 _resetContainer(false);
227
228 eventComboChangePosition(this, mItemIndex);
229 }
230 }
231 else if (_rel < 0)
232 {
233 if ((mItemIndex + 1) < mList->getItemCount())
234 {
235 if (mItemIndex == ITEM_NONE)
236 mItemIndex = 0;
237 else
238 mItemIndex ++;
239 Base::setCaption(mList->getItemNameAt(mItemIndex));
240 mList->setIndexSelected(mItemIndex);
241 mList->beginToItemAt(mItemIndex);
242
243 _resetContainer(false);
244
245 eventComboChangePosition(this, mItemIndex);
246 }
247 }
248 }
249
250 void ComboBox::notifyMousePressed(Widget* _sender, int _left, int _top, MouseButton _id)
251 {
252 // обязательно отдаем отцу, а то мы у него в наглую отняли
253 Base::notifyMousePressed(_sender, _left, _top, _id);
254
255 mDropMouse = true;
256
257 // показываем список
258 if (mModeDrop)
259 notifyButtonPressed(nullptr, _left, _top, _id);
260 }
261
262 void ComboBox::notifyEditTextChange(EditBox* _sender)
263 {
264 // сбрасываем выделенный элемент
265 if (ITEM_NONE != mItemIndex)
266 {
267 mItemIndex = ITEM_NONE;
268 mList->setIndexSelected(mItemIndex);
269 mList->beginToItemFirst();
270
271 _resetContainer(false);
272
273 eventComboChangePosition(this, mItemIndex);
274 }
275 }
276
277 void ComboBox::showList()
278 {
279 // пустой список не показываем
280 if (mList->getItemCount() == 0)
281 return;
282
283 mListShow = true;
284
285 IntCoord coord = calculateListPosition();
286 mList->setCoord(coord);
287
288 if (mShowSmooth)
289 {
290 ControllerFadeAlpha* controller = createControllerFadeAlpha(COMBO_ALPHA_MAX, COMBO_ALPHA_COEF, true);
291 ControllerManager::getInstance().addItem(mList, controller);
292 }
293 else
294 {
295 mList->setVisible(true);
296 }
297
298 InputManager::getInstance().setKeyFocusWidget(mList);
299 }
300
301 void ComboBox::actionWidgetHide(Widget* _widget)
302 {
303 _widget->setVisible(false);
304 _widget->setEnabled(true);
305 }
306
307 void ComboBox::hideList()
308 {
309 mListShow = false;
310
311 if (mShowSmooth)
312 {
313 ControllerFadeAlpha* controller = createControllerFadeAlpha(COMBO_ALPHA_MIN, COMBO_ALPHA_COEF, false);
314 controller->eventPostAction += newDelegate(this, &ComboBox::actionWidgetHide);
315 ControllerManager::getInstance().addItem(mList, controller);
316 }
317 else
318 {
319 mList->setVisible(false);
320 }
321 }
322
323 void ComboBox::setIndexSelected(size_t _index)
324 {
325 MYGUI_ASSERT_RANGE_AND_NONE(_index, mList->getItemCount(), "ComboBox::setIndexSelected");
326 mItemIndex = _index;
327 mList->setIndexSelected(_index);
328 if (_index == ITEM_NONE)
329 {
330 Base::setCaption("");
331 return;
332 }
333 Base::setCaption(mList->getItemNameAt(_index));
334 Base::updateView(); // hook for update
335 }
336
337 void ComboBox::setItemNameAt(size_t _index, const UString& _name)
338 {
339 mList->setItemNameAt(_index, _name);
340 mItemIndex = ITEM_NONE;//FIXME
341 mList->setIndexSelected(mItemIndex);//FIXME
342 }
343
344 void ComboBox::setItemDataAt(size_t _index, Any _data)
345 {
346 mList->setItemDataAt(_index, _data);
347 mItemIndex = ITEM_NONE;//FIXME
348 mList->setIndexSelected(mItemIndex);//FIXME
349 }
350
351 void ComboBox::insertItemAt(size_t _index, const UString& _item, Any _data)
352 {
353 mList->insertItemAt(_index, _item, _data);
354 mItemIndex = ITEM_NONE;//FIXME
355 mList->setIndexSelected(mItemIndex);//FIXME
356 }
357
358 void ComboBox::removeItemAt(size_t _index)
359 {
360 mList->removeItemAt(_index);
361 mItemIndex = ITEM_NONE;//FIXME
362 mList->clearIndexSelected();//FIXME
363 }
364
365 void ComboBox::removeAllItems()
366 {
367 mItemIndex = ITEM_NONE;//FIXME
368 mList->removeAllItems();//FIXME заново созданные строки криво стоят
369 }
370
371 void ComboBox::setComboModeDrop(bool _drop)
372 {
373 mModeDrop = _drop;
374 setEditStatic(mModeDrop);
375 }
376
377 ControllerFadeAlpha* ComboBox::createControllerFadeAlpha(float _alpha, float _coef, bool _enable)
378 {
379 ControllerItem* item = ControllerManager::getInstance().createItem(ControllerFadeAlpha::getClassTypeName());
380 ControllerFadeAlpha* controller = item->castType<ControllerFadeAlpha>();
381
382 controller->setAlpha(_alpha);
383 controller->setCoef(_coef);
384 controller->setEnabled(_enable);
385
386 return controller;
387 }
388
389 size_t ComboBox::findItemIndexWith(const UString& _name)
390 {
391 return mList->findItemIndexWith(_name);
392 }
393
394 void ComboBox::setFlowDirection(FlowDirection _value)
395 {
396 mFlowDirection = _value;
397 }
398
399 IntCoord ComboBox::calculateListPosition()
400 {
401 int length = 0;
402 if (mFlowDirection.isVertical())
403 length = mList->getOptimalHeight();
404 else
405 length = mMaxListLength;
406
407 if (mMaxListLength > 0 && length > mMaxListLength)
408 length = mMaxListLength;
409
410 // берем глобальные координаты выджета
411 IntCoord coord = getAbsoluteCoord();
412 // размер леера
413 IntSize sizeView = mList->getParentSize();
414
415 if (mFlowDirection == FlowDirection::TopToBottom)
416 {
417 if ((coord.bottom() + length) <= sizeView.height)
418 coord.top += coord.height;
419 else
420 coord.top -= length;
421 coord.height = length;
422 }
423 else if (mFlowDirection == FlowDirection::BottomToTop)
424 {
425 if ((coord.top - length) >= 0)
426 coord.top -= length;
427 else
428 coord.top += coord.height;
429 coord.height = length;
430 }
431 else if (mFlowDirection == FlowDirection::LeftToRight)
432 {
433 if ((coord.right() + length) <= sizeView.width)
434 coord.left += coord.width;
435 else
436 coord.left -= length;
437 coord.width = length;
438 }
439 else if (mFlowDirection == FlowDirection::RightToLeft)
440 {
441 if ((coord.left - length) >= 0)
442 coord.left -= length;
443 else
444 coord.left += coord.width;
445 coord.width = length;
446 }
447
448 return coord;
449 }
450
451 void ComboBox::setPropertyOverride(const std::string& _key, const std::string& _value)
452 {
453 if (_key == "ModeDrop")
454 setComboModeDrop(utility::parseValue<bool>(_value));
455 else if (_key == "FlowDirection")
456 setFlowDirection(utility::parseValue<FlowDirection>(_value));
457 else if (_key == "MaxListLength")
458 setMaxListLength(utility::parseValue<int>(_value));
459 else if (_key == "SmoothShow")
460 setSmoothShow(utility::parseValue<bool>(_value));
461 else if (_key == "AddItem")
462 addItem(_value);
463 else
464 {
465 Base::setPropertyOverride(_key, _value);
466 return;
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::KeyCode::Return
Definition: MyGUI_KeyCode.h:62
MyGUI::ControllerManager::addItem
void addItem(Widget *_widget, ControllerItem *_item)
Definition: MyGUI_ControllerManager.cpp:93
MyGUI::WidgetInput::eventMouseWheel
EventHandle_WidgetInt eventMouseWheel
Definition: MyGUI_WidgetInput.h:165
MyGUI::types::TCoord
Definition: MyGUI_TCoord.h:35
MyGUI::ALPHA_MIN
const float ALPHA_MIN
Definition: MyGUI_Macros.h:35
MyGUI::Widget
Definition: MyGUI_Widget.h:41
MyGUI::FlowDirection::BottomToTop
Definition: MyGUI_FlowDirection.h:38
MyGUI::ComboBox::setPropertyOverride
virtual void setPropertyOverride(const std::string &_key, const std::string &_value)
Definition: MyGUI_ComboBox.cpp:451
MyGUI::ListBox::setItemDataAt
void setItemDataAt(size_t _index, Any _data)
Replace an item data at a specified position.
Definition: MyGUI_ListBox.cpp:791
MyGUI::ComboBox::getItemNameAt
const UString & getItemNameAt(size_t _index)
Get item name from specified position.
Definition: MyGUI_ComboBox.cpp:496
MyGUI::ComboBox::setSmoothShow
void setSmoothShow(bool _value)
Set smooth show of list.
Definition: MyGUI_ComboBox.cpp:529
MyGUI_LayerManager.h
MyGUI_Precompiled.h
MyGUI::ComboBox::getComboModeDrop
bool getComboModeDrop() const
Get drop list mode flag.
Definition: MyGUI_ComboBox.cpp:524
MyGUI::KeyCode
Definition: MyGUI_KeyCode.h:30
MyGUI::ComboBox::setItemDataAt
void setItemDataAt(size_t _index, Any _data)
Replace an item data at a specified position.
Definition: MyGUI_ComboBox.cpp:344
MyGUI::types::TSize< int >
MyGUI::ListBox::clearIndexSelected
void clearIndexSelected()
Definition: MyGUI_ListBox.cpp:969
MyGUI::newDelegate
delegates::IDelegate0 * newDelegate(void(*_func)())
Definition: MyGUI_Delegate.h:150
MyGUI::Singleton< InputManager >::getInstance
static InputManager & getInstance()
Definition: MyGUI_Singleton.h:53
MyGUI_WidgetManager.h
MyGUI::ToolTipInfo
Definition: MyGUI_WidgetToolTip.h:32
MyGUI::FlowDirection::LeftToRight
Definition: MyGUI_FlowDirection.h:35
MyGUI::ComboBox::beginToItemFirst
void beginToItemFirst()
Move all elements so first becomes visible.
Definition: MyGUI_ComboBox.cpp:506
MyGUI::ComboBox::_getItemNameAt
virtual const UString & _getItemNameAt(size_t _index)
Definition: MyGUI_ComboBox.cpp:580
MyGUI::ListBox::getItemCount
size_t getItemCount() const
Get number of items.
Definition: MyGUI_ListBox.cpp:954
MyGUI::ComboBox::onKeyButtonPressed
virtual void onKeyButtonPressed(KeyCode _key, Char _char)
Definition: MyGUI_ComboBox.cpp:166
MyGUI::ComboBox::shutdownOverride
virtual void shutdownOverride()
Definition: MyGUI_ComboBox.cpp:99
MyGUI::Widget::assignWidget
void assignWidget(T *&_widget, const std::string &_name)
Definition: MyGUI_Widget.h:324
MyGUI::ComboBox::getFlowDirection
FlowDirection getFlowDirection() const
Get direction, where drop down list appears.
Definition: MyGUI_ComboBox.cpp:549
MyGUI::ComboBox::getIndexSelected
size_t getIndexSelected() const
Get index of selected item (ITEM_NONE if none selected)
Definition: MyGUI_ComboBox.cpp:481
MyGUI::Any
Definition: MyGUI_Any.h:81
MyGUI::ITEM_NONE
const size_t ITEM_NONE
Definition: MyGUI_Macros.h:32
MyGUI::ListBox::setItemNameAt
void setItemNameAt(size_t _index, const UString &_name)
Replace an item name at a specified position.
Definition: MyGUI_ListBox.cpp:784
MyGUI::FlowDirection::TopToBottom
Definition: MyGUI_FlowDirection.h:37
MyGUI::Widget::setVisible
virtual void setVisible(bool _value)
Definition: MyGUI_Widget.cpp:965
MyGUI_ListBox.h
MyGUI::ComboBox::removeItemAt
void removeItemAt(size_t _index)
Remove item at a specified position.
Definition: MyGUI_ComboBox.cpp:358
MyGUI::ComboBox::setIndexSelected
void setIndexSelected(size_t _index)
Select specified _index.
Definition: MyGUI_ComboBox.cpp:323
MyGUI::ListBox
Definition: MyGUI_ListBox.h:37
MyGUI_Button.h
nullptr
#define nullptr
Definition: MyGUI_Prerequest.h:47
MyGUI::Widget::getParentSize
IntSize getParentSize() const
Definition: MyGUI_Widget.cpp:1023
MyGUI::FlowDirection::RightToLeft
Definition: MyGUI_FlowDirection.h:36
MyGUI::ComboBox::getSmoothShow
bool getSmoothShow() const
Get smooth show of list flag.
Definition: MyGUI_ComboBox.cpp:534
MyGUI::ListBox::_resetContainer
virtual void _resetContainer(bool _update)
Definition: MyGUI_ListBox.cpp:1027
MyGUI::ComboBox::beginToItemAt
void beginToItemAt(size_t _index)
Move all elements so specified becomes visible.
Definition: MyGUI_ComboBox.cpp:501
MyGUI::types::TCoord::width
T width
Definition: MyGUI_TCoord.h:39
MyGUI::ListBox::eventListChangePosition
EventPair< EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > eventListChangePosition
Definition: MyGUI_ListBox.h:207
MyGUI::IntCoord
types::TCoord< int > IntCoord
Definition: MyGUI_Types.h:50
MyGUI::ComboBox::getItemCount
size_t getItemCount() const
Get number of items.
Definition: MyGUI_ComboBox.cpp:471
MyGUI::Align::Default
Definition: MyGUI_Align.h:51
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:389
MyGUI::types::TCoord::top
T top
Definition: MyGUI_TCoord.h:38
MyGUI::MouseButton
Definition: MyGUI_MouseButton.h:30
MyGUI::ComboBox::setItemNameAt
void setItemNameAt(size_t _index, const UString &_name)
Replace an item name at a specified position.
Definition: MyGUI_ComboBox.cpp:337
MyGUI::InputManager::isCaptureMouse
bool isCaptureMouse() const
Definition: MyGUI_InputManager.cpp:620
MyGUI::ComboBox::initialiseOverride
virtual void initialiseOverride()
Definition: MyGUI_ComboBox.cpp:53
MyGUI::COMBO_ALPHA_COEF
const float COMBO_ALPHA_COEF
Definition: MyGUI_ComboBox.cpp:38
MyGUI::Widget::Widget
Widget()
Definition: MyGUI_Widget.cpp:46
MyGUI::ComboBox::_resetContainer
virtual void _resetContainer(bool _update)
Definition: MyGUI_ComboBox.cpp:585
MyGUI::ComboBox::eventComboAccept
EventPair< EventHandle_WidgetVoid, EventHandle_ComboBoxPtrSizeT > eventComboAccept
Definition: MyGUI_ComboBox.h:161
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:351
MyGUI::FlowDirection
Definition: MyGUI_FlowDirection.h:31
MyGUI::ComboBox::setComboModeDrop
void setComboModeDrop(bool _value)
Set drop list mode (text can not be edited)
Definition: MyGUI_ComboBox.cpp:371
MyGUI::ListBox::setCoord
virtual void setCoord(const IntCoord &_value)
Definition: MyGUI_ListBox.cpp:312
MyGUI::InputManager::setKeyFocusWidget
void setKeyFocusWidget(Widget *_widget)
Definition: MyGUI_InputManager.cpp:396
MyGUI::ComboBox::beginToItemLast
void beginToItemLast()
Move all elements so last becomes visible.
Definition: MyGUI_ComboBox.cpp:512
MyGUI::ALPHA_MAX
const float ALPHA_MAX
Definition: MyGUI_Macros.h:34
MyGUI::ControllerFadeAlpha::getClassTypeName
static const std::string & getClassTypeName()
Definition: MyGUI_ControllerFadeAlpha.h:36
MyGUI::Widget::eventChangeProperty
EventHandle_WidgetStringString eventChangeProperty
Definition: MyGUI_Widget.h:271
MyGUI::WidgetInput::setNeedToolTip
void setNeedToolTip(bool _value)
Definition: MyGUI_WidgetInput.cpp:151
MyGUI::types::TCoord::right
T right() const
Definition: MyGUI_TCoord.h:165
MyGUI::WidgetInput::getNeedToolTip
bool getNeedToolTip() const
Definition: MyGUI_WidgetInput.cpp:156
MyGUI::types::TSize::width
T width
Definition: MyGUI_TSize.h:35
MyGUI::ComboBox::setMaxListLength
void setMaxListLength(int _value)
Get max list length.
Definition: MyGUI_ComboBox.cpp:539
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:534
MyGUI::ControllerFadeAlpha::setAlpha
void setAlpha(float _value)
Definition: MyGUI_ControllerFadeAlpha.cpp:111
MYGUI_ASSERT_RANGE_AND_NONE
#define MYGUI_ASSERT_RANGE_AND_NONE(index, size, owner)
Definition: MyGUI_Diagnostic.h:71
MyGUI::types::TCoord::bottom
T bottom() const
Definition: MyGUI_TCoord.h:170
MyGUI::ControllerFadeAlpha::setCoef
void setCoef(float _value)
Definition: MyGUI_ControllerFadeAlpha.cpp:116
MyGUI::ComboBox::ComboBox
ComboBox()
Definition: MyGUI_ComboBox.cpp:40
MyGUI::ListBox::eventListMouseItemActivate
EventPair< EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > eventListMouseItemActivate
Definition: MyGUI_ListBox.h:215
MyGUI::ListBox::getItemNameAt
const UString & getItemNameAt(size_t _index)
Get item name from specified position.
Definition: MyGUI_ListBox.cpp:798
MyGUI::EditBox::updateView
void updateView()
Definition: MyGUI_EditBox.cpp:1730
MyGUI::ComboBox::clearIndexSelected
void clearIndexSelected()
Clear item selection.
Definition: MyGUI_ComboBox.cpp:486
MyGUI_ControllerManager.h
MyGUI::ListBox::removeItemAt
void removeItemAt(size_t _index)
Remove item at a specified position.
Definition: MyGUI_ListBox.cpp:596
MyGUI::ComboBox::_setItemNameAt
virtual void _setItemNameAt(size_t _index, const UString &_name)
Definition: MyGUI_ComboBox.cpp:575
MyGUI::ControllerFadeAlpha::setEnabled
void setEnabled(bool _value)
Definition: MyGUI_ControllerFadeAlpha.cpp:121
MyGUI::Char
unsigned int Char
Definition: MyGUI_Types.h:66
MyGUI::FlowDirection::isVertical
bool isVertical() const
Definition: MyGUI_FlowDirection.h:66
MyGUI::KeyCode::NumpadEnter
Definition: MyGUI_KeyCode.h:140
MyGUI::EditBox::setCaption
virtual void setCaption(const UString &_value)
Definition: MyGUI_EditBox.cpp:1557
MyGUI_InputManager.h
MyGUI_ResourceSkin.h
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:1137
MyGUI::IObject::castType
Type * castType(bool _throw=true)
Definition: MyGUI_IObject.h:33
MyGUI::ComboBox::getMaxListLength
int getMaxListLength() const
Set max list length.
Definition: MyGUI_ComboBox.cpp:544
MyGUI::MouseButton::Left
Definition: MyGUI_MouseButton.h:36
MyGUI_ComboBox.h
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:934
MyGUI::ListBox::getOptimalHeight
int getOptimalHeight()
Return optimal height to fit all items in ListBox.
Definition: MyGUI_ListBox.cpp:944
MyGUI::ICroppedRectangle::getAbsoluteCoord
IntCoord getAbsoluteCoord() const
Definition: MyGUI_ICroppedRectangle.h:92
MyGUI::ComboBox::_getItemCount
virtual size_t _getItemCount()
Definition: MyGUI_ComboBox.cpp:560
MyGUI::ComboBox::clearItemDataAt
void clearItemDataAt(size_t _index)
Clear an item data at a specified position.
Definition: MyGUI_ComboBox.cpp:491
MyGUI::ListBox::beginToItemFirst
void beginToItemFirst()
Move all elements so first becomes visible.
Definition: MyGUI_ListBox.cpp:979
MyGUI::ListBox::eventListSelectAccept
EventPair< EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > eventListSelectAccept
Definition: MyGUI_ListBox.h:199
MyGUI::ControllerFadeAlpha
Definition: MyGUI_ControllerFadeAlpha.h:33
MyGUI::ComboBox::beginToItemSelected
void beginToItemSelected()
Move all elements so selected becomes visible.
Definition: MyGUI_ComboBox.cpp:518
MyGUI::WidgetInput::eventKeyLostFocus
EventHandle_WidgetWidget eventKeyLostFocus
Definition: MyGUI_WidgetInput.h:207
MyGUI::ComboBox::setFlowDirection
void setFlowDirection(FlowDirection _value)
Set direction, where drop down list appears (TopToBottom by default).
Definition: MyGUI_ComboBox.cpp:394
MyGUI::ComboBox::removeAllItems
void removeAllItems()
Remove all items.
Definition: MyGUI_ComboBox.cpp:365
MyGUI::ComboBox::_removeItemAt
virtual void _removeItemAt(size_t _index)
Definition: MyGUI_ComboBox.cpp:570
MyGUI::InputManager::getMouseFocusWidget
Widget * getMouseFocusWidget() const
Definition: MyGUI_InputManager.cpp:635
MyGUI::InputManager::getKeyFocusWidget
Widget * getKeyFocusWidget() const
Definition: MyGUI_InputManager.cpp:640
MyGUI::UString
A UTF-16 string with implicit conversion to/from std::string and std::wstring.
Definition: MyGUI_UString.h:169
MyGUI::ControllerItem
Definition: MyGUI_ControllerItem.h:34
MyGUI::EditBox::eventEditTextChange
EventPair< EventHandle_WidgetVoid, EventHandle_EditPtr > eventEditTextChange
Definition: MyGUI_EditBox.h:266
MyGUI::ComboBox::eventComboChangePosition
EventPair< EventHandle_WidgetSizeT, EventHandle_ComboBoxPtrSizeT > eventComboChangePosition
Definition: MyGUI_ComboBox.h:169
MyGUI_Gui.h
MyGUI::ListBox::getClassTypeName
static const std::string & getClassTypeName()
Definition: MyGUI_ListBox.h:42
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::WidgetStyle::Popup
Definition: MyGUI_WidgetStyle.h:36
MyGUI::types::TSize::height
T height
Definition: MyGUI_TSize.h:36
MyGUI::ListBox::setIndexSelected
void setIndexSelected(size_t _index)
Definition: MyGUI_ListBox.cpp:668
MyGUI::EditBox::setEditStatic
void setEditStatic(bool _value)
Definition: MyGUI_EditBox.cpp:1950
MyGUI::KeyCode::ArrowDown
Definition: MyGUI_KeyCode.h:160
MyGUI::COMBO_ALPHA_MAX
const float COMBO_ALPHA_MAX
Definition: MyGUI_ComboBox.cpp:36
MyGUI::types::TCoord::left
T left
Definition: MyGUI_TCoord.h:37
MyGUI::WidgetInput::eventMouseButtonPressed
EventHandle_WidgetIntIntButton eventMouseButtonPressed
Definition: MyGUI_WidgetInput.h:175
MyGUI::ListBox::beginToItemAt
void beginToItemAt(size_t _index)
Move all elements so specified becomes visible.
Definition: MyGUI_ListBox.cpp:701
MyGUI::COMBO_ALPHA_MIN
const float COMBO_ALPHA_MIN
Definition: MyGUI_ComboBox.cpp:37
MyGUI::ComboBox::_addItem
virtual void _addItem(const MyGUI::UString &_name)
Definition: MyGUI_ComboBox.cpp:565
MyGUI::ListBox::removeAllItems
void removeAllItems()
Remove all items.
Definition: MyGUI_ListBox.cpp:759
MyGUI::Any::Null
static AnyEmpty Null
Definition: MyGUI_Any.h:85
MyGUI::ScrollViewBase::mClient
Widget * mClient
Definition: MyGUI_ScrollViewBase.h:61
MyGUI::types::TCoord::height
T height
Definition: MyGUI_TCoord.h:40
MyGUI::WidgetInput::eventToolTip
EventHandle_WidgetToolTip eventToolTip
Definition: MyGUI_WidgetInput.h:258
MyGUI::UserData::getUserString
const std::string & getUserString(const std::string &_key) const
Definition: MyGUI_WidgetUserData.cpp:43
MyGUI::ControllerManager::createItem
ControllerItem * createItem(const std::string &_type)
Definition: MyGUI_ControllerManager.cpp:87