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

Method notifyListChangePosition

Tools/EditorFramework/ListBoxDataControl.cpp:48–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46 }
47
48 void ListBoxDataControl::notifyListChangePosition(MyGUI::ListBox* _sender, size_t _index)
49 {
50 if (mLastIndex != MyGUI::ITEM_NONE && _index != MyGUI::ITEM_NONE)
51 {
52 if (MyGUI::InputManager::getInstance().isControlPressed())
53 {
54 if (mEnableChangePosition)
55 {
56 DataPtr data1 = *mListBox->getItemDataAt<DataPtr>(mLastIndex);
57 DataPtr data2 = *mListBox->getItemDataAt<DataPtr>(_index);
58 eventChangePosition(data1, data2);
59 }
60 }
61 }
62
63 mLastIndex = _index;
64
65 DataPtr selection = _index != MyGUI::ITEM_NONE ? *mListBox->getItemDataAt<DataPtr>(_index) : nullptr;
66 DataSelectorManager::getInstance().changeParentSelection(mParentData, selection);
67 }
68
69 void ListBoxDataControl::invalidateList()
70 {

Callers

nothing calls this directly

Calls 2

isControlPressedMethod · 0.80
changeParentSelectionMethod · 0.80

Tested by

no test coverage detected