| 182 | } |
| 183 | |
| 184 | void ComboBox::notifyMouseWheel(Widget* _sender, int _rel) |
| 185 | { |
| 186 | if (mList->getItemCount() == 0) |
| 187 | return; |
| 188 | if (InputManager::getInstance().getKeyFocusWidget() != this) |
| 189 | return; |
| 190 | if (InputManager::getInstance().isCaptureMouse()) |
| 191 | return; |
| 192 | |
| 193 | if (_rel > 0) |
| 194 | { |
| 195 | if (mItemIndex != 0) |
| 196 | { |
| 197 | if (mItemIndex == ITEM_NONE) |
| 198 | mItemIndex = 0; |
| 199 | else |
| 200 | mItemIndex--; |
| 201 | Base::setCaption(mList->getItemNameAt(mItemIndex)); |
| 202 | mList->setIndexSelected(mItemIndex); |
| 203 | mList->beginToItemAt(mItemIndex); |
| 204 | |
| 205 | _resetContainer(false); |
| 206 | |
| 207 | eventComboChangePosition(this, mItemIndex); |
| 208 | } |
| 209 | } |
| 210 | else if (_rel < 0) |
| 211 | { |
| 212 | if ((mItemIndex + 1) < mList->getItemCount()) |
| 213 | { |
| 214 | if (mItemIndex == ITEM_NONE) |
| 215 | mItemIndex = 0; |
| 216 | else |
| 217 | mItemIndex++; |
| 218 | Base::setCaption(mList->getItemNameAt(mItemIndex)); |
| 219 | mList->setIndexSelected(mItemIndex); |
| 220 | mList->beginToItemAt(mItemIndex); |
| 221 | |
| 222 | _resetContainer(false); |
| 223 | |
| 224 | eventComboChangePosition(this, mItemIndex); |
| 225 | } |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | void ComboBox::notifyMousePressed(Widget* _sender, int _left, int _top, MouseButton _id) |
| 230 | { |
nothing calls this directly
no test coverage detected