MCPcopy Create free account
hub / github.com/MyGUI/mygui / _wrapItem

Method _wrapItem

MyGUIEngine/src/MyGUI_MultiListBox.cpp:700–745  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

698 }
699
700 void MultiListBox::_wrapItem(MultiListItem* _item)
701 {
702 // скрываем у крайнего скролл
703 if (!mVectorColumnInfo.empty())
704 mVectorColumnInfo.back().list->setScrollVisible(false);
705 else
706 mSortColumnIndex = ITEM_NONE;
707
708 ColumnInfo column;
709 column.width = 0;
710 column.realWidth = 0;
711 column.sizeType = ResizingPolicy::Auto;
712
713 column.item = _item;
714 column.list = _item->createWidget<ListBox>(
715 mSkinList,
716 IntCoord(0, 0, _item->getWidth(), _item->getHeight()),
717 Align::Stretch);
718 column.list->eventListChangePosition += newDelegate(this, &MultiListBox::notifyListChangePosition);
719 column.list->eventListMouseItemFocus += newDelegate(this, &MultiListBox::notifyListChangeFocus);
720 column.list->eventListChangeScroll += newDelegate(this, &MultiListBox::notifyListChangeScrollPosition);
721 column.list->eventListSelectAccept += newDelegate(this, &MultiListBox::notifyListSelectAccept);
722 column.list->eventNotifyItem += newDelegate(this, &MultiListBox::notifyListNotifyItem);
723
724 if (mHeaderPlace != nullptr)
725 column.button = mHeaderPlace->createWidget<Button>(mSkinButton, IntCoord(), Align::Default);
726 else
727 column.button = _getClientWidget()->createWidget<Button>(mSkinButton, IntCoord(), Align::Default);
728
729 column.button->eventMouseButtonClick += newDelegate(this, &MultiListBox::notifyButtonClick);
730
731 // если уже были столбики, то делаем то же колличество полей
732 if (!mVectorColumnInfo.empty())
733 {
734 size_t count = mVectorColumnInfo.front().list->getItemCount();
735 for (size_t pos = 0; pos < count; ++pos)
736 column.list->addItem(UString());
737 }
738
739 mVectorColumnInfo.push_back(column);
740
741 updateColumns();
742
743 // показываем скролл нового крайнего
744 mVectorColumnInfo.back().list->setScrollVisible(true);
745 }
746
747 void MultiListBox::_unwrapItem(MultiListItem* _item)
748 {

Callers

nothing calls this directly

Calls 10

newDelegateFunction · 0.85
UStringFunction · 0.85
setScrollVisibleMethod · 0.80
IntCoordFunction · 0.50
emptyMethod · 0.45
getWidthMethod · 0.45
getHeightMethod · 0.45
getItemCountMethod · 0.45
addItemMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected