MyGUI: MyGUI_ItemBox.cpp Source File

MyGUI 3.4.2

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

- File List
- Globals

MyGUI_ItemBox.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_ItemBox.h"
9#include "MyGUI_Button.h"
10#include "MyGUI_ScrollBar.h"
11#include "MyGUI_ResourceSkin.h"
12#include "MyGUI_InputManager.h"
13#include "MyGUI_Gui.h"
14#include "MyGUI_WidgetManager.h"
15
16namespace MyGUI
17{
18
19 ItemBox::ItemBox() :
20 mCountItemInLine(0),
21 mCountLines(0),
22 mFirstVisibleIndex(0),
23 mFirstOffsetIndex(0),
24 mIndexSelect(ITEM_NONE),
25 mIndexActive(ITEM_NONE),
26 mIndexAccept(ITEM_NONE),
27 mIndexRefuse(ITEM_NONE),
28 mIsFocus(false),
29 mItemDrag(nullptr),
30 mAlignVert(true)
31 {
32 mChangeContentByResize = true;
33 }
34
35 void ItemBox::initialiseOverride()
36 {
37 Base::initialiseOverride();
38
39 // FIXME нам нужен фокус клавы
40 setNeedKeyFocus(true);
41
42 mDragLayer = "DragAndDrop";
43
44 if (isUserString("DragLayer"))
45 mDragLayer = getUserString("DragLayer");
46
47 assignWidget(mScrollViewClient, "Client");
48 if (getClientWidget() != nullptr)
49 {
50 getClientWidget()->eventMouseWheel += newDelegate(this, &ItemBox::notifyMouseWheel);
51 getClientWidget()->eventMouseButtonPressed += newDelegate(this, &ItemBox::notifyMouseButtonPressed);
52 getClientWidget()->eventMouseButtonReleased += newDelegate(this, &ItemBox::notifyMouseButtonReleased);
53 }
54
56 assignWidget(mVScroll, "VScroll");
57 if (mVScroll != nullptr)
58 {
59 mVScroll->eventScrollChangePosition += newDelegate(this, &ItemBox::notifyScrollChangePosition);
60 }
61
63 assignWidget(mHScroll, "HScroll");
64 if (mHScroll != nullptr)
65 {
66 mHScroll->eventScrollChangePosition += newDelegate(this, &ItemBox::notifyScrollChangePosition);
67 }
68
69 // подписываем клиент для драгэндропа
70 if (getClientWidget() != nullptr)
71 getClientWidget()->_setContainer(this);
72
73 requestItemSize();
74
75 updateScrollSize();
76 updateScrollPosition();
77 }
78
79 void ItemBox::shutdownOverride()
80 {
81 mVScroll = nullptr;
82 mHScroll = nullptr;
83
84 Base::shutdownOverride();
85 }
86
87 void ItemBox::setPosition(const IntPoint& _point)
88 {
89 Base::setPosition(_point);
90 }
91
92 void ItemBox::setSize(const IntSize& _size)
93 {
94 Base::setSize(_size);
95 updateFromResize();
96 }
97
98 void ItemBox::setCoord(const IntCoord& _coord)
99 {
100 Base::setCoord(_coord);
101 updateFromResize();
102 }
103
104 void ItemBox::requestItemSize()
105 {
106 IntCoord coord(0, 0, 1, 1);
107
108 // спрашиваем размер иконок
109 requestCoordItem(this, coord, false);
110
111 mSizeItem = coord.size();
112 MYGUI_ASSERT((mSizeItem.width > 0 && mSizeItem.height > 0), "(mSizeItem.width > 0 && mSizeItem.height > 0) at requestCoordWidgetItem");
113 }
114
115 void ItemBox::updateFromResize()
116 {
117 requestItemSize();
118
119 updateScrollSize();
120 updateScrollPosition();
121
122 _updateAllVisible(true);
123 _resetContainer(true);
124 }
125
126 void ItemBox::_updateAllVisible(bool _redraw)
127 {
128 int count_visible = 0;
129 if (mAlignVert)
130 {
131 count_visible = (_getClientWidget()->getHeight() / mSizeItem.height) + 2;
132 }
133 else
134 {
135 count_visible = (_getClientWidget()->getWidth() / mSizeItem.width) + 2;
136 }
137
138 size_t start = (mFirstVisibleIndex * mCountItemInLine);
139 size_t count = (count_visible * mCountItemInLine) + start;
140
141 size_t index = 0;
142 for (size_t pos = start; pos < count; ++pos, ++index)
143 {
144 // дальше нет айтемов
145 if (pos >= mItemsInfo.size()) break;
146
147 Widget* item = getItemWidget(index);
148 if (mAlignVert)
149 {
150 item->setPosition(((int)index % mCountItemInLine) * mSizeItem.width - mContentPosition.left,
151 (((int)index / mCountItemInLine) * mSizeItem.height) - mFirstOffsetIndex);
152 }
153 else
154 {
155 item->setPosition((((int)index / mCountItemInLine) * mSizeItem.width) - mFirstOffsetIndex,
156 ((int)index % mCountItemInLine) * mSizeItem.height - mContentPosition.top);
157 }
158
159 item->setSize(mSizeItem);
160 item->setVisible(true);
161
162 if (_redraw)
163 {
164 IBDrawItemInfo data(pos, mIndexSelect, mIndexActive, mIndexAccept, mIndexRefuse, true, false);
165 requestDrawItem(this, item, data);
166 }
167
168 }
169
170 // все виджеты еще есть, то их надо бы скрыть
171 while (index < mVectorItems.size())
172 {
173 mVectorItems[index]->setVisible(false);
174 index ++;
175 }
176 }
177
178 Widget* ItemBox::getItemWidget(size_t _index)
179 {
180 // еще нет такого виджета, нуно создать
181 if (_index == mVectorItems.size())
182 {
183 requestItemSize();
184
185 Widget* item = _getClientWidget()->createWidget<Widget>("Default", IntCoord(0, 0, mSizeItem.width, mSizeItem.height), Align::Default);
186
187 // вызываем запрос на создание виджета
188 requestCreateWidgetItem(this, item);
189
190 item->eventMouseWheel += newDelegate(this, &ItemBox::notifyMouseWheel);
191 item->eventRootMouseChangeFocus += newDelegate(this, &ItemBox::notifyRootMouseChangeFocus);
192 item->eventMouseButtonPressed += newDelegate(this, &ItemBox::notifyMouseButtonPressed);
193 item->eventMouseButtonReleased += newDelegate(this, &ItemBox::notifyMouseButtonReleased);
194 item->eventMouseButtonDoubleClick += newDelegate(this, &ItemBox::notifyMouseButtonDoubleClick);
195 item->eventMouseDrag += newDelegate(this, &ItemBox::notifyMouseDrag);
196 item->_setContainer(this);
197 item->eventKeyButtonPressed += newDelegate(this, &ItemBox::notifyKeyButtonPressed);
198 item->eventKeyButtonReleased += newDelegate(this, &ItemBox::notifyKeyButtonReleased);
199
200 item->_setInternalData((size_t)mVectorItems.size());
201
202 mVectorItems.push_back(item);
203 }
204
205 // запрашивать только последовательно
206 MYGUI_ASSERT_RANGE(_index, mVectorItems.size(), "ItemBox::getItemWidget");
207
208 return mVectorItems[_index];
209 }
210
211 void ItemBox::onMouseWheel(int _rel)
212 {
213 notifyMouseWheel(nullptr, _rel);
214
215 Base::onMouseWheel(_rel);
216 }
217
218 void ItemBox::onKeySetFocus(Widget* _old)
219 {
220 mIsFocus = true;
221
222 Base::onKeySetFocus(_old);
223 }
224
225 void ItemBox::onKeyLostFocus(Widget* _new)
226 {
227 mIsFocus = false;
228
229 Base::onKeyLostFocus(_new);
230 }
231
232 void ItemBox::resetCurrentActiveItem()
233 {
234 // сбрасываем старую подсветку
235 if (mIndexActive != ITEM_NONE)
236 {
237 size_t start = (size_t)(mFirstVisibleIndex * mCountItemInLine);
238 size_t index = mIndexActive;
239 mIndexActive = ITEM_NONE;
240
241 // если видим, то обновляем
242 if ((mIndexActive >= start) && (mIndexActive < (start + mVectorItems.size())))
243 {
244 IBDrawItemInfo data(index, mIndexSelect, mIndexActive, mIndexAccept, mIndexRefuse, false, false);
245
246 requestDrawItem(this, mVectorItems[mIndexActive - start], data);
247 }
248 }
249 }
250
251 void ItemBox::findCurrentActiveItem()
252 {
253 MYGUI_DEBUG_ASSERT(mIndexActive == ITEM_NONE, "use : resetCurrentActiveItem() before findCurrentActiveItem()");
254
255 const IntPoint& point = InputManager::getInstance().getMousePositionByLayer();
256
257 // сначала проверяем клиентскую зону
258 const IntRect& rect = _getClientWidget()->getAbsoluteRect();
259 if ((point.left < rect.left) || (point.left > rect.right) || (point.top < rect.top) || (point.top > rect.bottom))
260 {
261 return;
262 }
263
264 for (size_t pos = 0; pos < mVectorItems.size(); ++pos)
265 {
266 Widget* item = mVectorItems[pos];
267 const IntRect& abs_rect = item->getAbsoluteRect();
268 if ((point.left >= abs_rect.left) && (point.left <= abs_rect.right) && (point.top >= abs_rect.top) && (point.top <= abs_rect.bottom))
269 {
270
271 size_t index = calcIndexByWidget(item);
272 // при переборе индекс может быть больше, так как может создасться сколько угодно
273 if (index < mItemsInfo.size())
274 {
275
276 mIndexActive = index;
277 IBDrawItemInfo data(index, mIndexSelect, mIndexActive, mIndexAccept, mIndexRefuse, false, false);
278
279 requestDrawItem(this, item, data);
280 }
281
282 break;
283 }
284 }
285 }
286
287 size_t ItemBox::_getItemIndex(Widget* _item) const
288 {
289 if (_item == _getClientWidget())
290 return ITEM_NONE;
291 size_t index = calcIndexByWidget(_item);
292 if (index < mItemsInfo.size())
293 return index;
294 return ITEM_NONE;
295 }
296
297 void ItemBox::_setContainerItemInfo(size_t _index, bool _set, bool _accept)
298 {
299 if (_index == ITEM_NONE) return;
300 MYGUI_ASSERT_RANGE(_index, mItemsInfo.size(), "ItemBox::_setContainerItemInfo");
301
302 mIndexAccept = (_set && _accept ) ? _index : ITEM_NONE;
303 mIndexRefuse = (_set && !_accept) ? _index : ITEM_NONE;
304
305 size_t start = (size_t)(mFirstVisibleIndex * mCountItemInLine);
306 if ((_index >= start) && (_index < (start + mVectorItems.size())))
307 {
308 IBDrawItemInfo data(_index, mIndexSelect, mIndexActive, mIndexAccept, mIndexRefuse, false, false);
309 requestDrawItem(this, mVectorItems[_index - start], data);
310 }
311 }
312
313 void ItemBox::setItemDataAt(size_t _index, Any _data)
314 {
315 MYGUI_ASSERT_RANGE(_index, mItemsInfo.size(), "ItemBox::setItemData");
316 mItemsInfo[_index].data = _data;
317
318 size_t start = (size_t)(mFirstVisibleIndex * mCountItemInLine);
319 if ((_index >= start) && (_index < (start + mVectorItems.size())))
320 {
321 IBDrawItemInfo data(_index, mIndexSelect, mIndexActive, mIndexAccept, mIndexRefuse, true, false);
322 requestDrawItem(this, mVectorItems[_index - start], data);
323 }
324
325 _resetContainer(true);
326 }
327
328 void ItemBox::insertItemAt(size_t _index, Any _data, bool update)
329 {
330 MYGUI_ASSERT_RANGE_INSERT(_index, mItemsInfo.size(), "ItemBox::insertItemAt");
331 if (_index == ITEM_NONE) _index = mItemsInfo.size();
332
333 _resetContainer(false);
334 resetCurrentActiveItem();
335
336 mItemsInfo.insert(mItemsInfo.begin() + _index, ItemDataInfo(_data));
337
338 // расчитываем новый индекс выделения
339 if (mIndexSelect != ITEM_NONE)
340 {
341 if (mIndexSelect >= _index)
342 {
343 mIndexSelect ++;
344 }
345 }
346
347 if (update)
348 {
349 updateScrollSize();
350 updateScrollPosition();
351
352 findCurrentActiveItem();
353
354 _updateAllVisible(true);
355 }
356 }
357
358 void ItemBox::removeItemAt(size_t _index, bool update)
359 {
360 MYGUI_ASSERT_RANGE(_index, mItemsInfo.size(), "ItemBox::removeItemAt");
361
362 _resetContainer(false);
363 resetCurrentActiveItem();
364
365 mItemsInfo.erase(mItemsInfo.begin() + _index);
366
367 // расчитываем новый индекс выделения
368 if (mIndexSelect != ITEM_NONE)
369 {
370 if (mItemsInfo.empty())
371 {
372 mIndexSelect = ITEM_NONE;
373 }
374 else if ((mIndexSelect > _index) || (mIndexSelect == mItemsInfo.size()))
375 {
376 mIndexSelect --;
377 }
378 }
379
380 if (update)
381 {
382 updateScrollSize();
383 updateScrollPosition();
384
385 findCurrentActiveItem();
386
387 _updateAllVisible(true);
388 }
389 }
390
391 void ItemBox::removeAllItems()
392 {
393 if (mItemsInfo.empty())
394 return;
395 _resetContainer(false);
396
397 mItemsInfo.clear();
398
399 mIndexSelect = ITEM_NONE;
400 mIndexActive = ITEM_NONE;
401
402 updateScrollSize();
403 updateScrollPosition();
404
405 _updateAllVisible(true);
406 }
407
408 void ItemBox::redrawItemAt(size_t _index)
409 {
410 MYGUI_ASSERT_RANGE(_index, mItemsInfo.size(), "ItemBox::redrawItemAt");
411
412 size_t start = (size_t)(mFirstVisibleIndex * mCountItemInLine);
413 if ((_index >= start) && (_index < (start + mVectorItems.size())))
414 {
415 IBDrawItemInfo data(_index, mIndexSelect, mIndexActive, mIndexAccept, mIndexRefuse, true, false);
416 requestDrawItem(this, mVectorItems[_index - start], data);
417 }
418 }
419
420 void ItemBox::setIndexSelected(size_t _index)
421 {
422 MYGUI_ASSERT_RANGE_AND_NONE(_index, mItemsInfo.size(), "ItemBox::setIndexSelected");
423 if (_index == mIndexSelect) return;
424
425 size_t start = (size_t)(mFirstVisibleIndex * mCountItemInLine);
426
427 // сбрасываем старое выделение
428 if (mIndexSelect != ITEM_NONE)
429 {
430 size_t index = mIndexSelect;
431 mIndexSelect = ITEM_NONE;
432
433 if ((index >= start) && (index < (start + mVectorItems.size())))
434 {
435 IBDrawItemInfo data(index, mIndexSelect, mIndexActive, mIndexAccept, mIndexRefuse, false, false);
436 requestDrawItem(this, mVectorItems[index - start], data);
437 }
438 }
439
440 mIndexSelect = _index;
441 if (mIndexSelect != ITEM_NONE)
442 {
443 if ((_index >= start) && (_index < (start + mVectorItems.size())))
444 {
445 IBDrawItemInfo data(_index, mIndexSelect, mIndexActive, mIndexAccept, mIndexRefuse, false, false);
446 requestDrawItem(this, mVectorItems[_index - start], data);
447 }
448 }
449
450 }
451
452 void ItemBox::notifyMouseButtonDoubleClick(Widget* _sender)
453 {
454 size_t index = getIndexByWidget(_sender);
455
456 eventSelectItemAccept(this, index);
457 }
458
459 void ItemBox::setVerticalAlignment(bool _vert)
460 {
461 if (mAlignVert == _vert)
462 return;
463 mAlignVert = _vert;
464
465 mCountItemInLine = -1;
466 updateFromResize();
467 }
468
469 void ItemBox::notifyKeyButtonPressed(Widget* _sender, KeyCode _key, Char _char)
470 {
471 eventNotifyItem(this, IBNotifyItemData(getIndexByWidget(_sender), IBNotifyItemData::KeyPressed, _key, _char));
472 }
473
474 void ItemBox::notifyKeyButtonReleased(Widget* _sender, KeyCode _key)
475 {
476 eventNotifyItem(this, IBNotifyItemData(getIndexByWidget(_sender), IBNotifyItemData::KeyReleased, _key));
477 }
478
479 size_t ItemBox::getIndexByWidget(Widget* _widget) const
480 {
481 MYGUI_ASSERT(_widget, "ItemBox::getIndexByWidget : Widget == nullptr");
482 if (_widget == _getClientWidget()) return ITEM_NONE;
483 MYGUI_ASSERT(_widget->getParent() == _getClientWidget(), "ItemBox::getIndexByWidget : Widget is not child");
484
485 size_t index = calcIndexByWidget(_widget);
486 MYGUI_ASSERT_RANGE(index, mItemsInfo.size(), "ItemBox::getIndexByWidget");
487
488 return index;
489 }
490
491 size_t ItemBox::_getContainerIndex(const IntPoint& _point) const
492 {
493 for (const auto& item : mVectorItems)
494 {
495 if (item->getVisible())
496 {
497 if (item->getAbsoluteRect().inside(_point))
498 {
499 return getIndexByWidget(item);
500 }
501 }
502 }
503 return ITEM_NONE;
504 }
505
506 void ItemBox::_resetContainer(bool _update)
507 {
508 // обязательно у базового
509 Base::_resetContainer(_update);
510
511 if ( ! _update)
512 {
513 WidgetManager& instance = WidgetManager::getInstance();
514 for (VectorWidgetPtr::iterator iter = mVectorItems.begin(); iter != mVectorItems.end(); ++iter)
515 {
516 instance.unlinkFromUnlinkers(*iter);
517 }
518 }
519 }
520
521 Widget* ItemBox::getWidgetByIndex(size_t _index)
522 {
523 for (VectorWidgetPtr::iterator iter = mVectorItems.begin(); iter != mVectorItems.end(); ++iter)
524 {
525 if ((*iter)->getVisible())
526 {
527 size_t index = getIndexByWidget(*iter);
528
529 if (index == _index) return (*iter);
530 }
531 }
532 return nullptr;
533 }
534
535 void ItemBox::onMouseButtonPressed(int _left, int _top, MouseButton _id)
536 {
537 Base::onMouseButtonPressed(_left, _top, _id);
538 }
539
540 void ItemBox::onMouseButtonReleased(int _left, int _top, MouseButton _id)
541 {
542 Base::onMouseButtonReleased(_left, _top, _id);
543 }
544
545 void ItemBox::onMouseDrag(int _left, int _top, MouseButton _id)
546 {
547 Base::onMouseDrag(_left, _top, _id);
548 }
549
550 void ItemBox::removeDropItems()
551 {
552 if (mItemDrag) mItemDrag->setVisible(false);
553 }
554
555 void ItemBox::updateDropItems()
556 {
557 if (nullptr == mItemDrag)
558 {
559 // спрашиваем размер иконок
560 IntCoord coord;
561
562 requestCoordItem(this, coord, true);
563
564 mPointDragOffset = coord.point();
565
566 // создаем и запрашиваем детей
567 mItemDrag = Gui::getInstance().createWidget<Widget>("Default", IntCoord(0, 0, coord.width, coord.height), Align::Default, mDragLayer);
568 requestCreateWidgetItem(this, mItemDrag);
569 }
570
571 const IntPoint& point = InputManager::getInstance().getMousePosition();
572
573 mItemDrag->setPosition(point.left - mClickInWidget.left + mPointDragOffset.left, point.top - mClickInWidget.top + mPointDragOffset.top);
574 mItemDrag->setVisible(true);
575 }
576
577 void ItemBox::updateDropItemsState(const DDWidgetState& _state)
578 {
579 IBDrawItemInfo data;
580 data.drop_accept = _state.accept;
581 data.drop_refuse = _state.refuse;
582
583 data.select = false;
584 data.active = false;
585
586 data.index = mDropSenderIndex;
587 data.update = _state.update;
588 data.drag = true;
589
590 requestDrawItem(this, mItemDrag, data);
591 }
592
593 void ItemBox::notifyMouseDrag(Widget* _sender, int _left, int _top, MouseButton _id)
594 {
595 mouseDrag(_id);
596 }
597
598 void ItemBox::notifyMouseButtonPressed(Widget* _sender, int _left, int _top, MouseButton _id)
599 {
600 mouseButtonPressed(_id);
601
602 if ( MouseButton::Left == _id)
603 {
604 size_t old = mIndexSelect;
605
606 if (_sender == _getClientWidget())
607 {
608 // сбрасываем выделение
609 setIndexSelected(ITEM_NONE);
610 }
611 else
612 {
613 // индекс отправителя
614 mDropSenderIndex = getIndexByWidget(_sender);
615
616 // выделенный елемент
617 setIndexSelected(mDropSenderIndex);
618 }
619
620 // смещение внутри виджета, куда кликнули мышкой
621 mClickInWidget = InputManager::getInstance().getLastPressedPosition(MouseButton::Left) - _sender->getAbsolutePosition();
622
623 // отсылаем событие
624 eventMouseItemActivate(this, mIndexSelect);
625 // смену позиции отсылаем только при реальном изменении
626 if (old != mIndexSelect) eventChangeItemPosition(this, mIndexSelect);
627 }
628
629 eventNotifyItem(this, IBNotifyItemData(getIndexByWidget(_sender), IBNotifyItemData::MousePressed, _left, _top, _id));
630 }
631
632 void ItemBox::notifyMouseButtonReleased(Widget* _sender, int _left, int _top, MouseButton _id)
633 {
634 bool needEvent = !mStartDrop;
635 mouseButtonReleased(_id);
636
637 if (needEvent)
638 eventNotifyItem(this, IBNotifyItemData(getIndexByWidget(_sender), IBNotifyItemData::MouseReleased, _left, _top, _id));
639 }
640
641 void ItemBox::notifyRootMouseChangeFocus(Widget* _sender, bool _focus)
642 {
643 size_t index = calcIndexByWidget(_sender);
644 if (_focus)
645 {
646 MYGUI_ASSERT_RANGE(index, mItemsInfo.size(), "ItemBox::notifyRootMouseChangeFocus");
647
648 // сбрасываем старый
649 if (mIndexActive != ITEM_NONE)
650 {
651 size_t old_index = mIndexActive;
652 mIndexActive = ITEM_NONE;
653 IBDrawItemInfo data(old_index, mIndexSelect, mIndexActive, mIndexAccept, mIndexRefuse, false, false);
654 requestDrawItem(this, mVectorItems[old_index - (mFirstVisibleIndex * mCountItemInLine)], data);
655 }
656
657 mIndexActive = index;
658 IBDrawItemInfo data(index, mIndexSelect, mIndexActive, mIndexAccept, mIndexRefuse, false, false);
659 requestDrawItem(this, mVectorItems[*_sender->_getInternalData<size_t>()], data);
660 }
661 else
662 {
663 // при сбросе виджет может быть уже скрыт, и соответсвенно отсутсвовать индекс
664 // сбрасываем индекс, только если мы и есть актив
665 if (index < mItemsInfo.size() && mIndexActive == index)
666 {
667 mIndexActive = ITEM_NONE;
668 IBDrawItemInfo data(index, mIndexSelect, mIndexActive, mIndexAccept, mIndexRefuse, false, false);
669 requestDrawItem(this, mVectorItems[*_sender->_getInternalData<size_t>()], data);
670 }
671 }
672 }
673
674 void ItemBox::updateMetrics()
675 {
676 if (mAlignVert)
677 {
678 // колличество айтемов на одной строке
679 mCountItemInLine = _getClientWidget()->getWidth() / mSizeItem.width;
680 }
681 else
682 {
683 // колличество айтемов на одной строке
684 mCountItemInLine = _getClientWidget()->getHeight() / mSizeItem.height;
685 }
686
687 if (1 > mCountItemInLine) mCountItemInLine = 1;
688
689 // колличество строк
690 mCountLines = mItemsInfo.size() / mCountItemInLine;
691 if (0 != (mItemsInfo.size() % mCountItemInLine)) mCountLines ++;
692
693 if (mAlignVert)
694 {
695 mContentSize.width = (mSizeItem.width * mCountItemInLine);
696 mContentSize.height = (mSizeItem.height * mCountLines);
697 }
698 else
699 {
700 mContentSize.width = (mSizeItem.width * mCountLines);
701 mContentSize.height = (mSizeItem.height * mCountItemInLine);
702 }
703 }
704
705 void ItemBox::notifyScrollChangePosition(ScrollBar* _sender, size_t _index)
706 {
707 if (_sender == mVScroll)
708 {
709 mContentPosition.top = (int)_index;
710 }
711 else if (_sender == mHScroll)
712 {
713 mContentPosition.left = (int)_index;
714 }
715
716 setContentPosition(mContentPosition);
717 }
718
719 void ItemBox::notifyMouseWheel(Widget* _sender, int _rel)
720 {
721 if (mAlignVert)
722 {
723 if (mContentSize.height <= 0)
724 return;
725
726 int offset = mContentPosition.top;
727 if (_rel < 0)
728 offset += mSizeItem.height;
729 else
730 offset -= mSizeItem.height;
731
732 if (mContentSize.height <= _getClientWidget()->getHeight())
733 offset = 0;
734 else if (offset >= mContentSize.height - _getClientWidget()->getHeight())
735 offset = mContentSize.height - _getClientWidget()->getHeight();
736 else if (offset < 0)
737 offset = 0;
738
739 if (mContentPosition.top == offset)
740 return;
741
742 // сбрасываем старую подсветку
743 // так как при прокрутке, мышь может находиться над окном
744 resetCurrentActiveItem();
745
746 mContentPosition.top = offset;
747 }
748 else
749 {
750 if (mContentSize.width <= 0)
751 return;
752
753 int offset = mContentPosition.left;
754 if (_rel < 0)
755 offset += mSizeItem.width;
756 else
757 offset -= mSizeItem.width;
758
759 if (mContentSize.width <= _getClientWidget()->getWidth())
760 offset = 0;
761 else if (offset >= mContentSize.width - _getClientWidget()->getWidth())
762 offset = mContentSize.width - _getClientWidget()->getWidth();
763 else if (offset < 0)
764 offset = 0;
765
766 if (mContentPosition.left == offset)
767 return;
768
769 // сбрасываем старую подсветку
770 // так как при прокрутке, мышь может находиться над окном
771 resetCurrentActiveItem();
772
773 mContentPosition.left = offset;
774 }
775
776 setContentPosition(mContentPosition);
777
778 // заново ищем и подсвечиваем айтем
779 if (!mNeedDrop)
780 findCurrentActiveItem();
781
782 if (nullptr != mVScroll)
783 mVScroll->setScrollPosition(mContentPosition.top);
784 if (nullptr != mHScroll)
785 mHScroll->setScrollPosition(mContentPosition.left);
786 }
787
788 void ItemBox::setContentPosition(const IntPoint& _point)
789 {
790 mContentPosition = _point;
791
792 int old = mFirstVisibleIndex;
793
794 if (mAlignVert)
795 {
796 mFirstVisibleIndex = mContentPosition.top / mSizeItem.height;
797 mFirstOffsetIndex = mContentPosition.top % mSizeItem.height;
798 }
799 else
800 {
801 mFirstVisibleIndex = mContentPosition.left / mSizeItem.width;
802 mFirstOffsetIndex = mContentPosition.left % mSizeItem.width;
803 }
804
805 _updateAllVisible(old != mFirstVisibleIndex);
806 _resetContainer(true);
807 }
808
809 void ItemBox::redrawAllItems()
810 {
811 _updateAllVisible(true);
812 }
813
814 void ItemBox::resetDrag()
815 {
816 endDrop(true);
817 }
818
819 size_t ItemBox::calcIndexByWidget(Widget* _widget) const
820 {
821 return *_widget->_getInternalData<size_t>() + (mFirstVisibleIndex * mCountItemInLine);
822 }
823
824 IntSize ItemBox::getContentSize() const
825 {
826 return mContentSize;
827 }
828
829 IntPoint ItemBox::getContentPosition() const
830 {
831 return mContentPosition;
832 }
833
834 IntSize ItemBox::getViewSize() const
835 {
836 return _getClientWidget()->getSize();
837 }
838
839 void ItemBox::eraseContent()
840 {
841 updateMetrics();
842 }
843
844 size_t ItemBox::getHScrollPage() const
845 {
846 return mSizeItem.width;
847 }
848
849 size_t ItemBox::getVScrollPage() const
850 {
851 return mSizeItem.height;
852 }
853
854 Align ItemBox::getContentAlign() const
855 {
856 return Align::Default;
857 }
858
859 size_t ItemBox::getItemCount() const
860 {
861 return mItemsInfo.size();
862 }
863
864 void ItemBox::addItem(Any _data, bool update)
865 {
866 insertItemAt(ITEM_NONE, _data, update);
867 }
868
869 size_t ItemBox::getIndexSelected() const
870 {
871 return mIndexSelect;
872 }
873
874 void ItemBox::clearIndexSelected()
875 {
876 setIndexSelected(ITEM_NONE);
877 }
878
879 void ItemBox::clearItemDataAt(size_t _index)
880 {
881 setItemDataAt(_index, Any::Null);
882 }
883
884 bool ItemBox::getVerticalAlignment() const
885 {
886 return mAlignVert;
887 }
888
889 Widget* ItemBox::getWidgetDrag() const
890 {
891 return mItemDrag;
892 }
893
894 void ItemBox::setVisibleVScroll(bool _value)
895 {
896 mVisibleVScroll = _value;
897 updateFromResize();
898 }
899
900 void ItemBox::setVisibleHScroll(bool _value)
901 {
902 mVisibleHScroll = _value;
903 updateFromResize();
904 }
905
906 bool ItemBox::isVisibleVScroll() const
907 {
908 return mVisibleVScroll;
909 }
910
911 bool ItemBox::isVisibleHScroll() const
912 {
913 return mVisibleHScroll;
914 }
915
916 void ItemBox::setPropertyOverride(const std::string& _key, const std::string& _value)
917 {
919 if (_key == "VerticalAlignment")
920 setVerticalAlignment(utility::parseValue<bool>(_value));
921
923 else if (_key == "VisibleVScroll")
924 setVisibleVScroll(utility::parseValue<bool>(_value));
925
927 else if (_key == "VisibleHScroll")
928 setVisibleHScroll(utility::parseValue<bool>(_value));
929
930 else
931 {
932 Base::setPropertyOverride(_key, _value);
933 return;
934 }
935
936 eventChangeProperty(this, _key, _value);
937 }
938
939 void ItemBox::setViewOffset(const IntPoint& _value)
940 {
941 if (mAlignVert)
942 {
943 if (mContentSize.height <= 0)
944 return;
945
946 int offset = _value.top;
947
948 if (mContentSize.height <= _getClientWidget()->getHeight())
949 offset = 0;
950 else if (offset >= mContentSize.height - _getClientWidget()->getHeight())
951 offset = mContentSize.height - _getClientWidget()->getHeight();
952 else if (offset < 0)
953 offset = 0;
954
955 if (mContentPosition.top == offset)
956 return;
957
958 // сбрасываем старую подсветку
959 // так как при прокрутке, мышь может находиться над окном
960 resetCurrentActiveItem();
961
962 mContentPosition.top = offset;
963 }
964 else
965 {
966 if (mContentSize.width <= 0)
967 return;
968
969 int offset = _value.left;
970
971 if (mContentSize.width <= _getClientWidget()->getWidth())
972 offset = 0;
973 else if (offset >= mContentSize.width - _getClientWidget()->getWidth())
974 offset = mContentSize.width - _getClientWidget()->getWidth();
975 else if (offset < 0)
976 offset = 0;
977
978 if (mContentPosition.left == offset)
979 return;
980
981 // сбрасываем старую подсветку
982 // так как при прокрутке, мышь может находиться над окном
983 resetCurrentActiveItem();
984
985 mContentPosition.left = offset;
986 }
987
988 setContentPosition(mContentPosition);
989
990 // заново ищем и подсвечиваем айтем
991 if (!mNeedDrop)
992 findCurrentActiveItem();
993
994 if (nullptr != mVScroll)
995 mVScroll->setScrollPosition(mContentPosition.top);
996 if (nullptr != mHScroll)
997 mHScroll->setScrollPosition(mContentPosition.left);
998 }
999
1000 IntPoint ItemBox::getViewOffset() const
1001 {
1002 return getContentPosition();
1003 }
1004
1005 void ItemBox::onKeyButtonPressed(KeyCode _key, Char _char)
1006 {
1007 Base::onKeyButtonPressed(_key, _char);
1008
1009 eventNotifyItem(this, IBNotifyItemData(ITEM_NONE, IBNotifyItemData::KeyPressed, _key, _char));
1010 }
1011
1012 void ItemBox::onKeyButtonReleased(KeyCode _key)
1013 {
1014 Base::onKeyButtonReleased(_key);
1015
1016 eventNotifyItem(this, IBNotifyItemData(ITEM_NONE, IBNotifyItemData::KeyReleased, _key));
1017 }
1018
1019} // namespace MyGUI
MyGUI_Button.h
MYGUI_ASSERT
#define MYGUI_ASSERT(exp, dest)
Definition MyGUI_Diagnostic.h:29
MYGUI_DEBUG_ASSERT
#define MYGUI_DEBUG_ASSERT(exp, dest)
Definition MyGUI_Diagnostic.h:50
MYGUI_ASSERT_RANGE_INSERT
#define MYGUI_ASSERT_RANGE_INSERT(index, size, owner)
Definition MyGUI_Diagnostic.h:42
MYGUI_ASSERT_RANGE
#define MYGUI_ASSERT_RANGE(index, size, owner)
Definition MyGUI_Diagnostic.h:40
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_ItemBox.h
MyGUI_Precompiled.h
MyGUI_ResourceSkin.h
MyGUI_ScrollBar.h
MyGUI_WidgetManager.h
MyGUI::Any
Definition MyGUI_Any.h:56
MyGUI::Any::Null
static AnyEmpty Null
Definition MyGUI_Any.h:59
MyGUI::DDContainer::mDropSenderIndex
size_t mDropSenderIndex
Definition MyGUI_DDContainer.h:132
MyGUI::DDContainer::mouseButtonPressed
void mouseButtonPressed(MouseButton _id)
Definition MyGUI_DDContainer.cpp:52
MyGUI::DDContainer::mStartDrop
bool mStartDrop
Definition MyGUI_DDContainer.h:125
MyGUI::DDContainer::mClickInWidget
IntPoint mClickInWidget
Definition MyGUI_DDContainer.h:138
MyGUI::DDContainer::mouseButtonReleased
void mouseButtonReleased(MouseButton _id)
Definition MyGUI_DDContainer.cpp:74
MyGUI::DDContainer::mNeedDrop
bool mNeedDrop
Definition MyGUI_DDContainer.h:124
MyGUI::DDContainer::mouseDrag
void mouseDrag(MouseButton _id)
Definition MyGUI_DDContainer.cpp:82
MyGUI::DDContainer::endDrop
void endDrop(bool _reset)
Definition MyGUI_DDContainer.cpp:199
MyGUI::Gui::getInstance
static Gui & getInstance()
Definition MyGUI_Gui.cpp:34
MyGUI::Gui::createWidget
T * createWidget(const std::string &_skin, const IntCoord &_coord, Align _align, const std::string &_layer, const std::string &_name="")
Definition MyGUI_Gui.h:69
MyGUI::ICroppedRectangle::getAbsolutePosition
const IntPoint & getAbsolutePosition() const
Definition MyGUI_ICroppedRectangle.h:67
MyGUI::ICroppedRectangle::getWidth
int getWidth() const
Definition MyGUI_ICroppedRectangle.h:114
MyGUI::ICroppedRectangle::getHeight
int getHeight() const
Definition MyGUI_ICroppedRectangle.h:119
MyGUI::ICroppedRectangle::getAbsoluteRect
IntRect getAbsoluteRect() const
Definition MyGUI_ICroppedRectangle.h:72
MyGUI::ICroppedRectangle::getSize
IntSize getSize() const
Definition MyGUI_ICroppedRectangle.h:56
MyGUI::InputManager::getLastPressedPosition
const IntPoint & getLastPressedPosition(MouseButton _id) const
Definition MyGUI_InputManager.cpp:657
MyGUI::InputManager::getMousePosition
const IntPoint & getMousePosition() const
Definition MyGUI_InputManager.cpp:666
MyGUI::InputManager::getInstance
static InputManager & getInstance()
MyGUI::InputManager::getMousePositionByLayer
IntPoint getMousePositionByLayer() const
Definition MyGUI_InputManager.cpp:615
MyGUI::ItemBox::onMouseButtonPressed
void onMouseButtonPressed(int _left, int _top, MouseButton _id) override
Definition MyGUI_ItemBox.cpp:535
MyGUI::ItemBox::onKeyButtonPressed
void onKeyButtonPressed(KeyCode _key, Char _char) override
Definition MyGUI_ItemBox.cpp:1005
MyGUI::ItemBox::clearItemDataAt
void clearItemDataAt(size_t _index)
Clear an item data at a specified position.
Definition MyGUI_ItemBox.cpp:879
MyGUI::ItemBox::notifyMouseDrag
void notifyMouseDrag(Widget *_sender, int _left, int _top, MouseButton _id)
Definition MyGUI_ItemBox.cpp:593
MyGUI::ItemBox::setVisibleHScroll
void setVisibleHScroll(bool _value)
Definition MyGUI_ItemBox.cpp:900
MyGUI::ItemBox::getIndexByWidget
size_t getIndexByWidget(Widget *_widget) const
Definition MyGUI_ItemBox.cpp:479
MyGUI::ItemBox::notifyMouseButtonReleased
void notifyMouseButtonReleased(Widget *_sender, int _left, int _top, MouseButton _id)
Definition MyGUI_ItemBox.cpp:632
MyGUI::ItemBox::getItemCount
size_t getItemCount() const
Get number of items.
Definition MyGUI_ItemBox.cpp:859
MyGUI::ItemBox::requestDrawItem
EventHandle_ItemBoxPtrWidgetPtrCIBCellDrawInfoRef requestDrawItem
Definition MyGUI_ItemBox.h:166
MyGUI::ItemBox::getViewOffset
IntPoint getViewOffset() const
Definition MyGUI_ItemBox.cpp:1000
MyGUI::ItemBox::notifyMouseWheel
void notifyMouseWheel(Widget *_sender, int _rel)
Definition MyGUI_ItemBox.cpp:719
MyGUI::ItemBox::updateFromResize
void updateFromResize()
Definition MyGUI_ItemBox.cpp:115
MyGUI::ItemBox::shutdownOverride
void shutdownOverride() override
Definition MyGUI_ItemBox.cpp:79
MyGUI::ItemBox::setVisibleVScroll
void setVisibleVScroll(bool _value)
Definition MyGUI_ItemBox.cpp:894
MyGUI::ItemBox::removeItemAt
void removeItemAt(size_t _index, bool update=true)
Remove item at a specified position.
Definition MyGUI_ItemBox.cpp:358
MyGUI::ItemBox::notifyMouseButtonDoubleClick
void notifyMouseButtonDoubleClick(Widget *_sender)
Definition MyGUI_ItemBox.cpp:452
MyGUI::ItemBox::getVerticalAlignment
bool getVerticalAlignment() const
Definition MyGUI_ItemBox.cpp:884
MyGUI::ItemBox::setPosition
void setPosition(const IntPoint &_value) override
Definition MyGUI_ItemBox.cpp:87
MyGUI::ItemBox::isVisibleHScroll
bool isVisibleHScroll() const
Definition MyGUI_ItemBox.cpp:911
MyGUI::ItemBox::onKeySetFocus
void onKeySetFocus(Widget *_old) override
Definition MyGUI_ItemBox.cpp:218
MyGUI::ItemBox::redrawItemAt
void redrawItemAt(size_t _index)
Redraw at a specified position.
Definition MyGUI_ItemBox.cpp:408
MyGUI::ItemBox::setPropertyOverride
void setPropertyOverride(const std::string &_key, const std::string &_value) override
Definition MyGUI_ItemBox.cpp:916
MyGUI::ItemBox::onMouseWheel
void onMouseWheel(int _rel) override
Definition MyGUI_ItemBox.cpp:211
MyGUI::ItemBox::onKeyButtonReleased
void onKeyButtonReleased(KeyCode _key) override
Definition MyGUI_ItemBox.cpp:1012
MyGUI::ItemBox::getWidgetDrag
Widget * getWidgetDrag() const
Definition MyGUI_ItemBox.cpp:889
MyGUI::ItemBox::setSize
void setSize(const IntSize &_value) override
Definition MyGUI_ItemBox.cpp:92
MyGUI::ItemBox::notifyScrollChangePosition
void notifyScrollChangePosition(ScrollBar *_sender, size_t _index)
Definition MyGUI_ItemBox.cpp:705
MyGUI::ItemBox::setViewOffset
void setViewOffset(const IntPoint &_value)
Definition MyGUI_ItemBox.cpp:939
MyGUI::ItemBox::getItemWidget
Widget * getItemWidget(size_t _index)
Definition MyGUI_ItemBox.cpp:178
MyGUI::ItemBox::ItemBox
ItemBox()
Definition MyGUI_ItemBox.cpp:19
MyGUI::ItemBox::setIndexSelected
void setIndexSelected(size_t _index)
Select specified _index.
Definition MyGUI_ItemBox.cpp:420
MyGUI::ItemBox::redrawAllItems
void redrawAllItems()
Redraw all items.
Definition MyGUI_ItemBox.cpp:809
MyGUI::ItemBox::initialiseOverride
void initialiseOverride() override
Definition MyGUI_ItemBox.cpp:35
MyGUI::ItemBox::resetCurrentActiveItem
void resetCurrentActiveItem()
Definition MyGUI_ItemBox.cpp:232
MyGUI::ItemBox::onMouseDrag
void onMouseDrag(int _left, int _top, MouseButton _id) override
Definition MyGUI_ItemBox.cpp:545
MyGUI::ItemBox::onKeyLostFocus
void onKeyLostFocus(Widget *_new) override
Definition MyGUI_ItemBox.cpp:225
MyGUI::ItemBox::insertItemAt
void insertItemAt(size_t _index, Any _data=Any::Null, bool update=true)
Insert an item into a array at a specified position.
Definition MyGUI_ItemBox.cpp:328
MyGUI::ItemBox::_getContainerIndex
size_t _getContainerIndex(const IntPoint &_point) const override
Definition MyGUI_ItemBox.cpp:491
MyGUI::ItemBox::setCoord
void setCoord(const IntCoord &_value) override
Definition MyGUI_ItemBox.cpp:98
MyGUI::ItemBox::getViewSize
IntSize getViewSize() const override
Definition MyGUI_ItemBox.cpp:834
MyGUI::ItemBox::notifyMouseButtonPressed
void notifyMouseButtonPressed(Widget *_sender, int _left, int _top, MouseButton _id)
Definition MyGUI_ItemBox.cpp:598
MyGUI::ItemBox::eventMouseItemActivate
EventHandle_ItemBoxPtrSizeT eventMouseItemActivate
Definition MyGUI_ItemBox.h:187
MyGUI::ItemBox::updateMetrics
void updateMetrics()
Definition MyGUI_ItemBox.cpp:674
MyGUI::ItemBox::requestCreateWidgetItem
EventHandle_ItemBoxPtrWidgetPtr requestCreateWidgetItem
Definition MyGUI_ItemBox.h:150
MyGUI::ItemBox::resetDrag
void resetDrag()
Definition MyGUI_ItemBox.cpp:814
MyGUI::ItemBox::eventSelectItemAccept
EventHandle_ItemBoxPtrSizeT eventSelectItemAccept
Definition MyGUI_ItemBox.h:173
MyGUI::ItemBox::notifyKeyButtonReleased
void notifyKeyButtonReleased(Widget *_sender, KeyCode _key)
Definition MyGUI_ItemBox.cpp:474
MyGUI::ItemBox::setItemDataAt
void setItemDataAt(size_t _index, Any _data)
Replace an item data at a specified position.
Definition MyGUI_ItemBox.cpp:313
MyGUI::ItemBox::getWidgetByIndex
Widget * getWidgetByIndex(size_t _index)
Definition MyGUI_ItemBox.cpp:521
MyGUI::ItemBox::updateDropItems
void updateDropItems() override
Definition MyGUI_ItemBox.cpp:555
MyGUI::ItemBox::_getItemIndex
size_t _getItemIndex(Widget *_item) const override
Definition MyGUI_ItemBox.cpp:287
MyGUI::ItemBox::_updateAllVisible
void _updateAllVisible(bool _redraw)
Definition MyGUI_ItemBox.cpp:126
MyGUI::ItemBox::updateDropItemsState
void updateDropItemsState(const DDWidgetState &_state) override
Definition MyGUI_ItemBox.cpp:577
MyGUI::ItemBox::setVerticalAlignment
void setVerticalAlignment(bool _value)
Definition MyGUI_ItemBox.cpp:459
MyGUI::ItemBox::getIndexSelected
size_t getIndexSelected() const
Get index of selected item (ITEM_NONE if none selected)
Definition MyGUI_ItemBox.cpp:869
MyGUI::ItemBox::_resetContainer
void _resetContainer(bool _update) override
Definition MyGUI_ItemBox.cpp:506
MyGUI::ItemBox::notifyRootMouseChangeFocus
void notifyRootMouseChangeFocus(Widget *_sender, bool _focus)
Definition MyGUI_ItemBox.cpp:641
MyGUI::ItemBox::findCurrentActiveItem
void findCurrentActiveItem()
Definition MyGUI_ItemBox.cpp:251
MyGUI::ItemBox::onMouseButtonReleased
void onMouseButtonReleased(int _left, int _top, MouseButton _id) override
Definition MyGUI_ItemBox.cpp:540
MyGUI::ItemBox::removeAllItems
void removeAllItems()
Remove all items.
Definition MyGUI_ItemBox.cpp:391
MyGUI::ItemBox::notifyKeyButtonPressed
void notifyKeyButtonPressed(Widget *_sender, KeyCode _key, Char _char)
Definition MyGUI_ItemBox.cpp:469
MyGUI::ItemBox::removeDropItems
void removeDropItems() override
Definition MyGUI_ItemBox.cpp:550
MyGUI::ItemBox::_setContainerItemInfo
void _setContainerItemInfo(size_t _index, bool _set, bool _accept) override
Definition MyGUI_ItemBox.cpp:297
MyGUI::ItemBox::isVisibleVScroll
bool isVisibleVScroll() const
Definition MyGUI_ItemBox.cpp:906
MyGUI::ItemBox::clearIndexSelected
void clearIndexSelected()
Clear item selection.
Definition MyGUI_ItemBox.cpp:874
MyGUI::ItemBox::addItem
void addItem(Any _data=Any::Null, bool update=true)
Add an item to the end of a array.
Definition MyGUI_ItemBox.cpp:864
MyGUI::ItemBox::requestCoordItem
EventHandle_ItemBoxPtrIntCoordRefBool requestCoordItem
Definition MyGUI_ItemBox.h:158
MyGUI::ItemBox::eventNotifyItem
EventHandle_ItemBoxPtrCIBNotifyCellDataRef eventNotifyItem
Definition MyGUI_ItemBox.h:194
MyGUI::ItemBox::eventChangeItemPosition
EventHandle_ItemBoxPtrSizeT eventChangeItemPosition
Definition MyGUI_ItemBox.h:180
MyGUI::ScrollBar
widget description should be here.
Definition MyGUI_ScrollBar.h:26
MyGUI::ScrollBar::eventScrollChangePosition
EventHandle_ScrollBarPtrSizeT eventScrollChangePosition
Definition MyGUI_ScrollBar.h:127
MyGUI::ScrollBar::setScrollPosition
void setScrollPosition(size_t _value)
Definition MyGUI_ScrollBar.cpp:350
MyGUI::ScrollViewBase::mHScroll
ScrollBar * mHScroll
Definition MyGUI_ScrollViewBase.h:45
MyGUI::ScrollViewBase::updateScrollPosition
void updateScrollPosition()
Definition MyGUI_ScrollViewBase.cpp:230
MyGUI::ScrollViewBase::mScrollViewClient
Widget * mScrollViewClient
Definition MyGUI_ScrollViewBase.h:46
MyGUI::ScrollViewBase::mVisibleVScroll
bool mVisibleVScroll
Definition MyGUI_ScrollViewBase.h:49
MyGUI::ScrollViewBase::mChangeContentByResize
bool mChangeContentByResize
Definition MyGUI_ScrollViewBase.h:55
MyGUI::ScrollViewBase::mVisibleHScroll
bool mVisibleHScroll
Definition MyGUI_ScrollViewBase.h:48
MyGUI::ScrollViewBase::updateScrollSize
void updateScrollSize()
Definition MyGUI_ScrollViewBase.cpp:26
MyGUI::ScrollViewBase::mVScroll
ScrollBar * mVScroll
Definition MyGUI_ScrollViewBase.h:44
MyGUI::UserData::isUserString
bool isUserString(const std::string &_key) const
Definition MyGUI_WidgetUserData.cpp:44
MyGUI::UserData::_setInternalData
void _setInternalData(Any _data)
Definition MyGUI_WidgetUserData.cpp:59
MyGUI::UserData::getUserString
const std::string & getUserString(const std::string &_key) const
Definition MyGUI_WidgetUserData.cpp:20
MyGUI::UserData::_getInternalData
ValueType * _getInternalData(bool _throw=true) const
Definition MyGUI_WidgetUserData.h:54
MyGUI::Widget
widget description should be here.
Definition MyGUI_Widget.h:37
MyGUI::Widget::getParent
Widget * getParent() const
Definition MyGUI_Widget.cpp:1275
MyGUI::Widget::createWidget
T * createWidget(const std::string &_skin, const IntCoord &_coord, Align _align, const std::string &_name="")
Definition MyGUI_Widget.h:67
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::setPosition
void setPosition(const IntPoint &_value) override
Definition MyGUI_Widget.cpp:632
MyGUI::Widget::setSize
void setSize(const IntSize &_value) override
Definition MyGUI_Widget.cpp:649
MyGUI::Widget::getClientWidget
Widget * getClientWidget()
Definition MyGUI_Widget.cpp:1290
MyGUI::Widget::_setContainer
void _setContainer(Widget *_value)
Definition MyGUI_Widget.cpp:1310
MyGUI::Widget::_getClientWidget
Widget * _getClientWidget()
If there is client widget return it, otherwise return this.
Definition MyGUI_Widget.cpp:1129
MyGUI::WidgetInput::eventMouseButtonDoubleClick
EventHandle_WidgetVoid eventMouseButtonDoubleClick
Definition MyGUI_WidgetInput.h:175
MyGUI::WidgetInput::eventMouseButtonReleased
EventHandle_WidgetIntIntButton eventMouseButtonReleased
Definition MyGUI_WidgetInput.h:163
MyGUI::WidgetInput::setNeedKeyFocus
void setNeedKeyFocus(bool _value)
Definition MyGUI_WidgetInput.cpp:152
MyGUI::WidgetInput::eventMouseButtonPressed
EventHandle_WidgetIntIntButton eventMouseButtonPressed
Definition MyGUI_WidgetInput.h:154
MyGUI::WidgetInput::eventKeyButtonPressed
EventHandle_WidgetKeyCodeChar eventKeyButtonPressed
Definition MyGUI_WidgetInput.h:197
MyGUI::WidgetInput::eventRootMouseChangeFocus
EventHandle_WidgetBool eventRootMouseChangeFocus
Definition MyGUI_WidgetInput.h:212
MyGUI::WidgetInput::eventMouseDrag
EventPairAddParameter< EventHandle_WidgetIntInt, EventHandle_WidgetIntIntButton > eventMouseDrag
Definition MyGUI_WidgetInput.h:130
MyGUI::WidgetInput::eventMouseWheel
EventHandle_WidgetInt eventMouseWheel
Definition MyGUI_WidgetInput.h:145
MyGUI::WidgetInput::eventKeyButtonReleased
EventHandle_WidgetKeyCode eventKeyButtonReleased
Definition MyGUI_WidgetInput.h:204
MyGUI::WidgetManager
Definition MyGUI_WidgetManager.h:22
MyGUI::WidgetManager::getInstance
static WidgetManager & getInstance()
MyGUI::WidgetManager::unlinkFromUnlinkers
void unlinkFromUnlinkers(Widget *_widget)
Definition MyGUI_WidgetManager.cpp:146
MyGUI::utility::parseValue
T parseValue(const std::string &_value)
Definition MyGUI_StringUtility.h:112
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::IntPoint
types::TPoint< int > IntPoint
Definition MyGUI_Types.h:27
MyGUI::Char
unsigned int Char
Definition MyGUI_Types.h:50
MyGUI::IntCoord
types::TCoord< int > IntCoord
Definition MyGUI_Types.h:36
MyGUI::IntSize
types::TSize< int > IntSize
Definition MyGUI_Types.h:30
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::DDWidgetState
Definition MyGUI_DDItemInfo.h:100
MyGUI::DDWidgetState::update
bool update
Definition MyGUI_DDItemInfo.h:112
MyGUI::DDWidgetState::accept
bool accept
Definition MyGUI_DDItemInfo.h:114
MyGUI::DDWidgetState::refuse
bool refuse
Definition MyGUI_DDItemInfo.h:116
MyGUI::IBDrawItemInfo
Definition MyGUI_IBItemInfo.h:21
MyGUI::IBDrawItemInfo::index
size_t index
Definition MyGUI_IBItemInfo.h:46
MyGUI::IBDrawItemInfo::drop_refuse
bool drop_refuse
Definition MyGUI_IBItemInfo.h:58
MyGUI::IBDrawItemInfo::select
bool select
Definition MyGUI_IBItemInfo.h:50
MyGUI::IBDrawItemInfo::update
bool update
Definition MyGUI_IBItemInfo.h:48
MyGUI::IBDrawItemInfo::drag
bool drag
Definition MyGUI_IBItemInfo.h:54
MyGUI::IBDrawItemInfo::drop_accept
bool drop_accept
Definition MyGUI_IBItemInfo.h:56
MyGUI::IBDrawItemInfo::active
bool active
Definition MyGUI_IBItemInfo.h:52
MyGUI::IBNotifyItemData
Definition MyGUI_IBItemInfo.h:62
MyGUI::IBNotifyItemData::KeyReleased
@ KeyReleased
Definition MyGUI_IBItemInfo.h:68
MyGUI::IBNotifyItemData::KeyPressed
@ KeyPressed
Definition MyGUI_IBItemInfo.h:67
MyGUI::IBNotifyItemData::MousePressed
@ MousePressed
Definition MyGUI_IBItemInfo.h:65
MyGUI::IBNotifyItemData::MouseReleased
@ MouseReleased
Definition MyGUI_IBItemInfo.h:66
MyGUI::ItemBox::ItemDataInfo
Definition MyGUI_ItemBox.h:204
MyGUI::KeyCode
Definition MyGUI_KeyCode.h:16
MyGUI::MouseButton
Definition MyGUI_MouseButton.h:16
MyGUI::MouseButton::Left
@ Left
Definition MyGUI_MouseButton.h:21
MyGUI::types::TCoord< int >
MyGUI::types::TCoord::height
T height
Definition MyGUI_TCoord.h:25
MyGUI::types::TCoord::width
T width
Definition MyGUI_TCoord.h:24
MyGUI::types::TCoord::point
TPoint< T > point() const
Definition MyGUI_TCoord.h:185
MyGUI::types::TPoint< int >
MyGUI::types::TPoint::left
T left
Definition MyGUI_TPoint.h:20
MyGUI::types::TPoint::top
T top
Definition MyGUI_TPoint.h:21
MyGUI::types::TRect< int >
MyGUI::types::TRect::right
T right
Definition MyGUI_TRect.h:22
MyGUI::types::TRect::left
T left
Definition MyGUI_TRect.h:20
MyGUI::types::TRect::bottom
T bottom
Definition MyGUI_TRect.h:23
MyGUI::types::TRect::top
T top
Definition MyGUI_TRect.h:21
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