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

Method notifyItem

Tools/EditorFramework/ListBoxDataControl.cpp:150–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148 }
149
150 void ListBoxDataControl::notifyItem(MyGUI::ListBox* _sender, const MyGUI::IBNotifyItemData& _info)
151 {
152 if (_info.notify == MyGUI::IBNotifyItemData::MousePressed)
153 {
154 if (_info.id == MyGUI::MouseButton::Right)
155 {
156 mListBox->setIndexSelected(_info.index);
157 mLastIndex = _info.index;
158
159 if (mParentData != nullptr)
160 {
161 DataPtr selection =
162 _info.index != MyGUI::ITEM_NONE ? *mListBox->getItemDataAt<DataPtr>(_info.index) : nullptr;
163 DataSelectorManager::getInstance().changeParentSelection(mParentData, selection);
164 }
165 }
166 }
167 else if (_info.notify == MyGUI::IBNotifyItemData::MouseReleased)
168 {
169 if (_info.id == MyGUI::MouseButton::Right)
170 {
171 if (mContextMenu->getChildCount() != 0)
172 {
173 MyGUI::IntPoint point = MyGUI::IntPoint(_info.x, _info.y);
174 if ((_info.y + mContextMenu->getHeight()) >=
175 MyGUI::RenderManager::getInstance().getViewSize().height)
176 point.top -= mContextMenu->getHeight();
177 if ((_info.x + mContextMenu->getWidth()) >= MyGUI::RenderManager::getInstance().getViewSize().width)
178 point.left -= mContextMenu->getWidth();
179
180 mContextMenu->setPosition(point.left, point.top);
181 mContextMenu->setVisibleSmooth(true);
182 }
183 }
184 }
185 }
186
187 void ListBoxDataControl::OnRenameData()
188 {

Callers

nothing calls this directly

Calls 9

changeParentSelectionMethod · 0.80
getChildCountMethod · 0.80
IntPointFunction · 0.50
setIndexSelectedMethod · 0.45
getHeightMethod · 0.45
getViewSizeMethod · 0.45
getWidthMethod · 0.45
setPositionMethod · 0.45
setVisibleSmoothMethod · 0.45

Tested by

no test coverage detected