MyGUI: MyGUI_ComboBox.cpp Source File

MyGUI 3.4.2

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

- File List
- Globals

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#include "MyGUI_LanguageManager.h"
18
19namespace MyGUI
20{
21
22 const float COMBO_ALPHA_MAX = ALPHA_MAX;
23 const float COMBO_ALPHA_MIN = ALPHA_MIN;
24 const float COMBO_ALPHA_COEF = 4.0f;
25
26 ComboBox::ComboBox() :
27 mButton(nullptr),
28 mList(nullptr),
29 mListShow(false),
30 mMaxListLength(-1),
31 mItemIndex(ITEM_NONE),
32 mModeDrop(false),
33 mDropMouse(false),
34 mShowSmooth(false),
35 mFlowDirection(FlowDirection::TopToBottom)
36 {
37 }
38
39 void ComboBox::initialiseOverride()
40 {
41 Base::initialiseOverride();
42
44 assignWidget(mButton, "Button");
45 if (mButton != nullptr)
46 {
47 mButton->eventMouseButtonPressed += newDelegate(this, &ComboBox::notifyButtonPressed);
48 }
49
51 assignWidget(mList, "List");
52
53 if (mList == nullptr)
54 {
55 std::string list_skin = getUserString("ListSkin");
56 std::string list_layer = getUserString("ListLayer");
57
58 mList = static_cast<ListBox*>(_createSkinWidget(WidgetStyle::Popup, ListBox::getClassTypeName(), list_skin, IntCoord(), Align::Default, list_layer));
59 }
60
61 if (mList != nullptr)
62 {
63 mList->setActivateOnClick(true);
64
65 mList->setVisible(false);
66 mList->eventKeyLostFocus += newDelegate(this, &ComboBox::notifyListLostFocus);
67 mList->eventListSelectAccept += newDelegate(this, &ComboBox::notifyListSelectAccept);
68 mList->eventListMouseItemActivate += newDelegate(this, &ComboBox::notifyListMouseItemActivate);
69 mList->eventListChangePosition += newDelegate(this, &ComboBox::notifyListChangePosition);
70
71 mList->setNeedToolTip(true);
72 mList->eventToolTip += newDelegate(this, &ComboBox::notifyToolTip);
73 }
74
75 // подписываем дочерние классы на скролл
76 if (mScrollViewClient != nullptr)
77 {
78 mScrollViewClient->eventMouseWheel += newDelegate(this, &ComboBox::notifyMouseWheel);
79 mScrollViewClient->eventMouseButtonPressed += newDelegate(this, &ComboBox::notifyMousePressed);
80
81 mScrollViewClient->setNeedToolTip(true);
82 mScrollViewClient->eventToolTip += newDelegate(this, &ComboBox::notifyToolTip);
83 }
84
85 // подписываемся на изменения текста
86 eventEditTextChange += newDelegate(this, &ComboBox::notifyEditTextChange);
87 }
88
89 void ComboBox::shutdownOverride()
90 {
91 mList = nullptr;
92 mButton = 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 == mScrollViewClient)
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 if (mListShow)
273 return;
274 mListShow = true;
275
276 IntCoord coord = calculateListPosition();
277 mList->setCoord(coord);
278
279 if (mShowSmooth)
280 {
281 ControllerFadeAlpha* controller = createControllerFadeAlpha(COMBO_ALPHA_MAX, COMBO_ALPHA_COEF, true);
282 ControllerManager::getInstance().addItem(mList, controller);
283 }
284 else
285 {
286 mList->setVisible(true);
287 }
288
289 InputManager::getInstance().setKeyFocusWidget(mList);
290 }
291
292 void ComboBox::actionWidgetHide(Widget* _widget, ControllerItem* _controller)
293 {
294 _widget->setVisible(false);
295 _widget->setEnabled(true);
296 }
297
298 void ComboBox::hideList()
299 {
300 if (!mListShow)
301 return;
302 mListShow = false;
303
304 if (mShowSmooth)
305 {
306 ControllerFadeAlpha* controller = createControllerFadeAlpha(COMBO_ALPHA_MIN, COMBO_ALPHA_COEF, false);
307 controller->eventPostAction += newDelegate(this, &ComboBox::actionWidgetHide);
308 ControllerManager::getInstance().addItem(mList, controller);
309 }
310 else
311 {
312 mList->setVisible(false);
313 }
314 }
315
316 void ComboBox::setIndexSelected(size_t _index)
317 {
318 MYGUI_ASSERT_RANGE_AND_NONE(_index, mList->getItemCount(), "ComboBox::setIndexSelected");
319 mItemIndex = _index;
320 mList->setIndexSelected(_index);
321 if (_index == ITEM_NONE)
322 {
323 Base::setCaption("");
324 return;
325 }
326 Base::setCaption(mList->getItemNameAt(_index));
327 Base::updateView(); // hook for update
328 }
329
330 void ComboBox::setItemNameAt(size_t _index, const UString& _name)
331 {
332 mList->setItemNameAt(_index, _name);
333 mItemIndex = ITEM_NONE;//FIXME
334 mList->setIndexSelected(mItemIndex);//FIXME
335 }
336
337 void ComboBox::setItemDataAt(size_t _index, Any _data)
338 {
339 mList->setItemDataAt(_index, _data);
340 mItemIndex = ITEM_NONE;//FIXME
341 mList->setIndexSelected(mItemIndex);//FIXME
342 }
343
344 void ComboBox::insertItemAt(size_t _index, const UString& _item, Any _data)
345 {
346 mList->insertItemAt(_index, _item, _data);
347 mItemIndex = ITEM_NONE;//FIXME
348 mList->setIndexSelected(mItemIndex);//FIXME
349 }
350
351 void ComboBox::removeItemAt(size_t _index)
352 {
353 mList->removeItemAt(_index);
354 mItemIndex = ITEM_NONE;//FIXME
355 mList->clearIndexSelected();//FIXME
356 }
357
358 void ComboBox::removeAllItems()
359 {
360 mItemIndex = ITEM_NONE;//FIXME
361 mList->removeAllItems();//FIXME заново созданные строки криво стоят
362 }
363
364 void ComboBox::setComboModeDrop(bool _drop)
365 {
366 mModeDrop = _drop;
367 setEditStatic(mModeDrop);
368 }
369
370 ControllerFadeAlpha* ComboBox::createControllerFadeAlpha(float _alpha, float _coef, bool _enable)
371 {
372 ControllerItem* item = ControllerManager::getInstance().createItem(ControllerFadeAlpha::getClassTypeName());
373 ControllerFadeAlpha* controller = item->castType<ControllerFadeAlpha>();
374
375 controller->setAlpha(_alpha);
376 controller->setCoef(_coef);
377 controller->setEnabled(_enable);
378
379 return controller;
380 }
381
382 size_t ComboBox::findItemIndexWith(const UString& _name)
383 {
384 return mList->findItemIndexWith(_name);
385 }
386
387 void ComboBox::setFlowDirection(FlowDirection _value)
388 {
389 mFlowDirection = _value;
390 }
391
392 IntCoord ComboBox::calculateListPosition()
393 {
394 int length = 0;
395 if (mFlowDirection.isVertical())
396 length = mList->getOptimalHeight();
397 else
398 length = mMaxListLength;
399
400 if (mMaxListLength > 0 && length > mMaxListLength)
401 length = mMaxListLength;
402
403 // берем глобальные координаты выджета
404 IntCoord coord = getAbsoluteCoord();
405 // размер леера
406 IntSize sizeView = mList->getParentSize();
407
408 if (mFlowDirection == FlowDirection::TopToBottom)
409 {
410 if ((coord.bottom() + length) <= sizeView.height)
411 coord.top += coord.height;
412 else
413 coord.top -= length;
414 coord.height = length;
415 }
416 else if (mFlowDirection == FlowDirection::BottomToTop)
417 {
418 if ((coord.top - length) >= 0)
419 coord.top -= length;
420 else
421 coord.top += coord.height;
422 coord.height = length;
423 }
424 else if (mFlowDirection == FlowDirection::LeftToRight)
425 {
426 if ((coord.right() + length) <= sizeView.width)
427 coord.left += coord.width;
428 else
429 coord.left -= length;
430 coord.width = length;
431 }
432 else if (mFlowDirection == FlowDirection::RightToLeft)
433 {
434 if ((coord.left - length) >= 0)
435 coord.left -= length;
436 else
437 coord.left += coord.width;
438 coord.width = length;
439 }
440
441 return coord;
442 }
443
444 void ComboBox::setPropertyOverride(const std::string& _key, const std::string& _value)
445 {
447 if (_key == "ModeDrop")
448 setComboModeDrop(utility::parseValue<bool>(_value));
449
451 else if (_key == "FlowDirection")
452 setFlowDirection(utility::parseValue<FlowDirection>(_value));
453
455 else if (_key == "MaxListLength")
456 setMaxListLength(utility::parseValue<int>(_value));
457
459 else if (_key == "SmoothShow")
460 setSmoothShow(utility::parseValue<bool>(_value));
461
462 // не коментировать
463 else if (_key == "AddItem")
464 addItem(LanguageManager::getInstance().replaceTags(_value));
465
466 else
467 {
468 Base::setPropertyOverride(_key, _value);
469 return;
470 }
471
472 eventChangeProperty(this, _key, _value);
473 }
474
475 size_t ComboBox::getItemCount() const
476 {
477 return mList->getItemCount();
478 }
479
480 void ComboBox::addItem(const UString& _name, Any _data)
481 {
482 return insertItemAt(ITEM_NONE, _name, _data);
483 }
484
485 size_t ComboBox::getIndexSelected() const
486 {
487 return mItemIndex;
488 }
489
490 void ComboBox::clearIndexSelected()
491 {
492 setIndexSelected(ITEM_NONE);
493 }
494
495 void ComboBox::clearItemDataAt(size_t _index)
496 {
497 setItemDataAt(_index, Any::Null);
498 }
499
500 const UString& ComboBox::getItemNameAt(size_t _index) const
501 {
502 return mList->getItemNameAt(_index);
503 }
504
505 void ComboBox::beginToItemAt(size_t _index)
506 {
507 mList->beginToItemAt(_index);
508 }
509
510 void ComboBox::beginToItemFirst()
511 {
512 if (getItemCount())
513 beginToItemAt(0);
514 }
515
516 void ComboBox::beginToItemLast()
517 {
518 if (getItemCount())
519 beginToItemAt(getItemCount() - 1);
520 }
521
522 void ComboBox::beginToItemSelected()
523 {
524 if (getIndexSelected() != ITEM_NONE)
525 beginToItemAt(getIndexSelected());
526 }
527
528 bool ComboBox::getComboModeDrop() const
529 {
530 return mModeDrop;
531 }
532
533 void ComboBox::setSmoothShow(bool _value)
534 {
535 mShowSmooth = _value;
536 }
537
538 bool ComboBox::getSmoothShow() const
539 {
540 return mShowSmooth;
541 }
542
543 void ComboBox::setMaxListLength(int _value)
544 {
545 mMaxListLength = _value;
546 }
547
548 int ComboBox::getMaxListLength() const
549 {
550 return mMaxListLength;
551 }
552
553 FlowDirection ComboBox::getFlowDirection() const
554 {
555 return mFlowDirection;
556 }
557
558 void ComboBox::notifyToolTip(Widget* _sender, const ToolTipInfo& _info)
559 {
560 if (getNeedToolTip())
561 eventToolTip(this, _info);
562 }
563
564 size_t ComboBox::_getItemCount() const
565 {
566 return getItemCount();
567 }
568
569 void ComboBox::_addItem(const MyGUI::UString& _name)
570 {
571 addItem(_name);
572 }
573
574 void ComboBox::_removeItemAt(size_t _index)
575 {
576 removeItemAt(_index);
577 }
578
579 void ComboBox::_setItemNameAt(size_t _index, const UString& _name)
580 {
581 setItemNameAt(_index, _name);
582 }
583
584 const UString& ComboBox::_getItemNameAt(size_t _index) const
585 {
586 return getItemNameAt(_index);
587 }
588
589 void ComboBox::_resetContainer(bool _update)
590 {
591 Base::_resetContainer(_update);
592 if (mList != nullptr)
593 mList->_resetContainer(_update);
594 }
595
596} // namespace MyGUI
MyGUI_Button.h
MyGUI_ComboBox.h
MyGUI_ControllerManager.h
MYGUI_ASSERT_RANGE_AND_NONE
#define MYGUI_ASSERT_RANGE_AND_NONE(index, size, owner)
Definition MyGUI_Diagnostic.h:41
MyGUI_Gui.h
MyGUI_InputManager.h
MyGUI_LanguageManager.h
MyGUI_LayerManager.h
MyGUI_ListBox.h
MyGUI_Precompiled.h
MyGUI_ResourceSkin.h
MyGUI_WidgetManager.h
MyGUI::Any
Definition MyGUI_Any.h:56
MyGUI::Any::Null
static AnyEmpty Null
Definition MyGUI_Any.h:59
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:480
MyGUI::ComboBox::beginToItemSelected
void beginToItemSelected()
Move all elements so selected becomes visible.
Definition MyGUI_ComboBox.cpp:522
MyGUI::ComboBox::eventComboAccept
EventPair< EventHandle_WidgetVoid, EventHandle_ComboBoxPtrSizeT > eventComboAccept
Definition MyGUI_ComboBox.h:148
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:382
MyGUI::ComboBox::_setItemNameAt
void _setItemNameAt(size_t _index, const UString &_name) override
Definition MyGUI_ComboBox.cpp:579
MyGUI::ComboBox::clearIndexSelected
void clearIndexSelected()
Clear item selection.
Definition MyGUI_ComboBox.cpp:490
MyGUI::ComboBox::setItemNameAt
void setItemNameAt(size_t _index, const UString &_name)
Replace an item name at a specified position.
Definition MyGUI_ComboBox.cpp:330
MyGUI::ComboBox::setIndexSelected
void setIndexSelected(size_t _index)
Select specified _index.
Definition MyGUI_ComboBox.cpp:316
MyGUI::ComboBox::removeAllItems
void removeAllItems()
Remove all items.
Definition MyGUI_ComboBox.cpp:358
MyGUI::ComboBox::_addItem
void _addItem(const MyGUI::UString &_name) override
Definition MyGUI_ComboBox.cpp:569
MyGUI::ComboBox::setComboModeDrop
void setComboModeDrop(bool _value)
Set drop list mode (text can not be edited)
Definition MyGUI_ComboBox.cpp:364
MyGUI::ComboBox::onKeyButtonPressed
void onKeyButtonPressed(KeyCode _key, Char _char) override
Definition MyGUI_ComboBox.cpp:155
MyGUI::ComboBox::_getItemNameAt
const UString & _getItemNameAt(size_t _index) const override
Definition MyGUI_ComboBox.cpp:584
MyGUI::ComboBox::_removeItemAt
void _removeItemAt(size_t _index) override
Definition MyGUI_ComboBox.cpp:574
MyGUI::ComboBox::shutdownOverride
void shutdownOverride() override
Definition MyGUI_ComboBox.cpp:89
MyGUI::ComboBox::getIndexSelected
size_t getIndexSelected() const
Get index of selected item (ITEM_NONE if none selected)
Definition MyGUI_ComboBox.cpp:485
MyGUI::ComboBox::beginToItemAt
void beginToItemAt(size_t _index)
Move all elements so specified becomes visible.
Definition MyGUI_ComboBox.cpp:505
MyGUI::ComboBox::getSmoothShow
bool getSmoothShow() const
Get smooth show of list flag.
Definition MyGUI_ComboBox.cpp:538
MyGUI::ComboBox::setFlowDirection
void setFlowDirection(FlowDirection _value)
Set direction, where drop down list appears (TopToBottom by default).
Definition MyGUI_ComboBox.cpp:387
MyGUI::ComboBox::beginToItemLast
void beginToItemLast()
Move all elements so last becomes visible.
Definition MyGUI_ComboBox.cpp:516
MyGUI::ComboBox::setMaxListLength
void setMaxListLength(int _value)
Get max list length.
Definition MyGUI_ComboBox.cpp:543
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:344
MyGUI::ComboBox::initialiseOverride
void initialiseOverride() override
Definition MyGUI_ComboBox.cpp:39
MyGUI::ComboBox::getComboModeDrop
bool getComboModeDrop() const
Get drop list mode flag.
Definition MyGUI_ComboBox.cpp:528
MyGUI::ComboBox::ComboBox
ComboBox()
Definition MyGUI_ComboBox.cpp:26
MyGUI::ComboBox::eventComboChangePosition
EventPair< EventHandle_WidgetSizeT, EventHandle_ComboBoxPtrSizeT > eventComboChangePosition
Definition MyGUI_ComboBox.h:155
MyGUI::ComboBox::setSmoothShow
void setSmoothShow(bool _value)
Set smooth show of list.
Definition MyGUI_ComboBox.cpp:533
MyGUI::ComboBox::setItemDataAt
void setItemDataAt(size_t _index, Any _data)
Replace an item data at a specified position.
Definition MyGUI_ComboBox.cpp:337
MyGUI::ComboBox::_getItemCount
size_t _getItemCount() const override
Definition MyGUI_ComboBox.cpp:564
MyGUI::ComboBox::removeItemAt
void removeItemAt(size_t _index)
Remove item at a specified position.
Definition MyGUI_ComboBox.cpp:351
MyGUI::ComboBox::clearItemDataAt
void clearItemDataAt(size_t _index)
Clear an item data at a specified position.
Definition MyGUI_ComboBox.cpp:495
MyGUI::ComboBox::_resetContainer
void _resetContainer(bool _update) override
Definition MyGUI_ComboBox.cpp:589
MyGUI::ComboBox::setPropertyOverride
void setPropertyOverride(const std::string &_key, const std::string &_value) override
Definition MyGUI_ComboBox.cpp:444
MyGUI::ComboBox::getMaxListLength
int getMaxListLength() const
Set max list length.
Definition MyGUI_ComboBox.cpp:548
MyGUI::ComboBox::beginToItemFirst
void beginToItemFirst()
Move all elements so first becomes visible.
Definition MyGUI_ComboBox.cpp:510
MyGUI::ComboBox::getItemCount
size_t getItemCount() const
Get number of items.
Definition MyGUI_ComboBox.cpp:475
MyGUI::ComboBox::getFlowDirection
FlowDirection getFlowDirection() const
Get direction, where drop down list appears.
Definition MyGUI_ComboBox.cpp:553
MyGUI::ComboBox::getItemNameAt
const UString & getItemNameAt(size_t _index) const
Get item name from specified position.
Definition MyGUI_ComboBox.cpp:500
MyGUI::ControllerFadeAlpha
Definition MyGUI_ControllerFadeAlpha.h:20
MyGUI::ControllerFadeAlpha::getClassTypeName
static const std::string & getClassTypeName()
Definition MyGUI_ControllerFadeAlpha.h:21
MyGUI::ControllerFadeAlpha::setAlpha
void setAlpha(float _value)
Definition MyGUI_ControllerFadeAlpha.cpp:92
MyGUI::ControllerFadeAlpha::setCoef
void setCoef(float _value)
Definition MyGUI_ControllerFadeAlpha.cpp:97
MyGUI::ControllerFadeAlpha::setEnabled
void setEnabled(bool _value)
Definition MyGUI_ControllerFadeAlpha.cpp:102
MyGUI::ControllerItem
Definition MyGUI_ControllerItem.h:27
MyGUI::ControllerManager::createItem
ControllerItem * createItem(const std::string &_type)
Definition MyGUI_ControllerManager.cpp:72
MyGUI::ControllerManager::getInstance
static ControllerManager & getInstance()
MyGUI::ControllerManager::addItem
void addItem(Widget *_widget, ControllerItem *_item)
Definition MyGUI_ControllerManager.cpp:78
MyGUI::EditBox::updateView
void updateView()
Definition MyGUI_EditBox.cpp:1820
MyGUI::EditBox::setEditStatic
void setEditStatic(bool _value)
Definition MyGUI_EditBox.cpp:2040
MyGUI::EditBox::eventEditTextChange
EventPair< EventHandle_WidgetVoid, EventHandle_EditPtr > eventEditTextChange
Definition MyGUI_EditBox.h:251
MyGUI::EditBox::setCaption
void setCaption(const UString &_value) override
Definition MyGUI_EditBox.cpp:1642
MyGUI::ICroppedRectangle::getAbsoluteCoord
IntCoord getAbsoluteCoord() const
Definition MyGUI_ICroppedRectangle.h:77
MyGUI::IObject::castType
Type * castType(bool _throw=true)
Definition MyGUI_IObject.h:18
MyGUI::InputManager::setKeyFocusWidget
void setKeyFocusWidget(Widget *_widget)
Definition MyGUI_InputManager.cpp:401
MyGUI::InputManager::getMouseFocusWidget
Widget * getMouseFocusWidget() const
Definition MyGUI_InputManager.cpp:647
MyGUI::InputManager::getInstance
static InputManager & getInstance()
MyGUI::LanguageManager::getInstance
static LanguageManager & getInstance()
Definition MyGUI_LanguageManager.cpp:18
MyGUI::ListBox
widget description should be here.
Definition MyGUI_ListBox.h:31
MyGUI::ListBox::beginToItemAt
void beginToItemAt(size_t _index)
Move all elements so specified becomes visible.
Definition MyGUI_ListBox.cpp:635
MyGUI::ListBox::_resetContainer
void _resetContainer(bool _update) override
Definition MyGUI_ListBox.cpp:918
MyGUI::ListBox::getItemNameAt
const UString & getItemNameAt(size_t _index) const
Get item name from specified position.
Definition MyGUI_ListBox.cpp:724
MyGUI::ListBox::setActivateOnClick
void setActivateOnClick(bool activateOnClick)
Definition MyGUI_ListBox.cpp:1040
MyGUI::ListBox::clearIndexSelected
void clearIndexSelected()
Definition MyGUI_ListBox.cpp:875
MyGUI::ListBox::getClassTypeName
static const std::string & getClassTypeName()
Definition MyGUI_ListBox.h:32
MyGUI::ListBox::getItemCount
size_t getItemCount() const
Get number of items.
Definition MyGUI_ListBox.cpp:860
MyGUI::ListBox::getOptimalHeight
int getOptimalHeight() const
Return optimal height to fit all items in ListBox.
Definition MyGUI_ListBox.cpp:855
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:480
MyGUI::ListBox::removeAllItems
void removeAllItems()
Remove all items.
Definition MyGUI_ListBox.cpp:689
MyGUI::ListBox::eventListChangePosition
EventPair< EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > eventListChangePosition
Definition MyGUI_ListBox.h:203
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:845
MyGUI::ListBox::beginToItemFirst
void beginToItemFirst()
Move all elements so first becomes visible.
Definition MyGUI_ListBox.cpp:885
MyGUI::ListBox::setItemDataAt
void setItemDataAt(size_t _index, Any _data)
Replace an item data at a specified position.
Definition MyGUI_ListBox.cpp:717
MyGUI::ListBox::eventListSelectAccept
EventPair< EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > eventListSelectAccept
Definition MyGUI_ListBox.h:196
MyGUI::ListBox::removeItemAt
void removeItemAt(size_t _index)
Remove item at a specified position.
Definition MyGUI_ListBox.cpp:538
MyGUI::ListBox::setItemNameAt
void setItemNameAt(size_t _index, const UString &_name)
Replace an item name at a specified position.
Definition MyGUI_ListBox.cpp:710
MyGUI::ListBox::setIndexSelected
void setIndexSelected(size_t _index)
Definition MyGUI_ListBox.cpp:606
MyGUI::ListBox::setCoord
void setCoord(const IntCoord &_value) override
Definition MyGUI_ListBox.cpp:265
MyGUI::ListBox::eventListMouseItemActivate
EventPair< EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > eventListMouseItemActivate
Definition MyGUI_ListBox.h:210
MyGUI::ScrollViewBase::mScrollViewClient
Widget * mScrollViewClient
Definition MyGUI_ScrollViewBase.h:46
MyGUI::UString
A UTF-16 string with implicit conversion to/from std::string and std::wstring.
Definition MyGUI_UString.h:145
MyGUI::UserData::getUserString
const std::string & getUserString(const std::string &_key) const
Definition MyGUI_WidgetUserData.cpp:20
MyGUI::Widget
widget description should be here.
Definition MyGUI_Widget.h:37
MyGUI::Widget::eventChangeProperty
EventHandle_WidgetStringString eventChangeProperty
Definition MyGUI_Widget.h:268
MyGUI::Widget::assignWidget
void assignWidget(T *&_widget, const std::string &_name)
Definition MyGUI_Widget.h:336
MyGUI::Widget::setVisible
virtual void setVisible(bool _value)
Definition MyGUI_Widget.cpp:959
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::Widget::getParentSize
IntSize getParentSize() const
Definition MyGUI_Widget.cpp:1019
MyGUI::Widget::Widget
Widget()
Definition MyGUI_Widget.cpp:31
MyGUI::WidgetInput::eventKeyLostFocus
EventHandle_WidgetWidget eventKeyLostFocus
Definition MyGUI_WidgetInput.h:182
MyGUI::WidgetInput::getNeedToolTip
bool getNeedToolTip() const
Definition MyGUI_WidgetInput.cpp:137
MyGUI::WidgetInput::eventMouseButtonPressed
EventHandle_WidgetIntIntButton eventMouseButtonPressed
Definition MyGUI_WidgetInput.h:154
MyGUI::WidgetInput::eventToolTip
EventHandle_WidgetToolTip eventToolTip
Definition MyGUI_WidgetInput.h:227
MyGUI::WidgetInput::setNeedToolTip
void setNeedToolTip(bool _value)
Definition MyGUI_WidgetInput.cpp:132
MyGUI::WidgetInput::eventMouseWheel
EventHandle_WidgetInt eventMouseWheel
Definition MyGUI_WidgetInput.h:145
MyGUI::utility::parseValue
T parseValue(const std::string &_value)
Definition MyGUI_StringUtility.h:112
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::COMBO_ALPHA_MAX
const float COMBO_ALPHA_MAX
Definition MyGUI_ComboBox.cpp:22
MyGUI::COMBO_ALPHA_MIN
const float COMBO_ALPHA_MIN
Definition MyGUI_ComboBox.cpp:23
MyGUI::ALPHA_MIN
const float ALPHA_MIN
Definition MyGUI_Macros.h:21
MyGUI::Char
unsigned int Char
Definition MyGUI_Types.h:50
MyGUI::IntCoord
types::TCoord< int > IntCoord
Definition MyGUI_Types.h:36
MyGUI::ALPHA_MAX
const float ALPHA_MAX
Definition MyGUI_Macros.h:20
MyGUI::COMBO_ALPHA_COEF
const float COMBO_ALPHA_COEF
Definition MyGUI_ComboBox.cpp:24
MyGUI::ITEM_NONE
const size_t ITEM_NONE
Definition MyGUI_Macros.h:18
MyGUI::newDelegate
delegates::DelegateFunction< Args... > * newDelegate(void(*_func)(Args... args))
Definition MyGUI_Delegate.h:99
MyGUI::Align::Default
@ Default
Definition MyGUI_Align.h:36
MyGUI::FlowDirection
Definition MyGUI_FlowDirection.h:19
MyGUI::FlowDirection::isVertical
bool isVertical() const
Definition MyGUI_FlowDirection.h:53
MyGUI::FlowDirection::TopToBottom
@ TopToBottom
Definition MyGUI_FlowDirection.h:24
MyGUI::FlowDirection::RightToLeft
@ RightToLeft
Definition MyGUI_FlowDirection.h:23
MyGUI::FlowDirection::BottomToTop
@ BottomToTop
Definition MyGUI_FlowDirection.h:25
MyGUI::FlowDirection::LeftToRight
@ LeftToRight
Definition MyGUI_FlowDirection.h:22
MyGUI::KeyCode
Definition MyGUI_KeyCode.h:16
MyGUI::KeyCode::NumpadEnter
@ NumpadEnter
Definition MyGUI_KeyCode.h:125
MyGUI::KeyCode::ArrowDown
@ ArrowDown
Definition MyGUI_KeyCode.h:145
MyGUI::KeyCode::Return
@ Return
Definition MyGUI_KeyCode.h:47
MyGUI::MouseButton
Definition MyGUI_MouseButton.h:16
MyGUI::MouseButton::Left
@ Left
Definition MyGUI_MouseButton.h:21
MyGUI::ToolTipInfo
Definition MyGUI_WidgetToolTip.h:18
MyGUI::WidgetStyle::Popup
@ Popup
Definition MyGUI_WidgetStyle.h:23
MyGUI::types::TCoord< int >
MyGUI::types::TCoord::height
T height
Definition MyGUI_TCoord.h:25
MyGUI::types::TCoord::right
T right() const
Definition MyGUI_TCoord.h:150
MyGUI::types::TCoord::width
T width
Definition MyGUI_TCoord.h:24
MyGUI::types::TCoord::top
T top
Definition MyGUI_TCoord.h:23
MyGUI::types::TCoord::left
T left
Definition MyGUI_TCoord.h:22
MyGUI::types::TCoord::bottom
T bottom() const
Definition MyGUI_TCoord.h:155
MyGUI::types::TSize< int >
MyGUI::types::TSize::width
T width
Definition MyGUI_TSize.h:20
MyGUI::types::TSize::height
T height
Definition MyGUI_TSize.h:21