| 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 | { |
nothing calls this directly
no test coverage detected