| 3340 | //----------------------------------------------------------------------------- |
| 3341 | |
| 3342 | void GuiTreeViewCtrl::onMouseDown(const GuiEvent & event) |
| 3343 | { |
| 3344 | if( !mActive || !mAwake || !mVisible ) |
| 3345 | { |
| 3346 | Parent::onMouseDown(event); |
| 3347 | return; |
| 3348 | } |
| 3349 | if ( mProfile->mCanKeyFocus ) |
| 3350 | setFirstResponder(); |
| 3351 | |
| 3352 | Item * item = 0; |
| 3353 | BitSet32 hitFlags; |
| 3354 | mDragMidPoint = NomDragMidPoint; |
| 3355 | |
| 3356 | mMouseDragged = false; |
| 3357 | mMouseDownPoint = event.mousePoint; |
| 3358 | |
| 3359 | // |
| 3360 | if(!_hitTest(event.mousePoint, item, hitFlags)) |
| 3361 | return; |
| 3362 | |
| 3363 | mPossibleRenameItem = NULL; |
| 3364 | mRenamingItem = NULL; |
| 3365 | mTempItem = NULL; |
| 3366 | |
| 3367 | // |
| 3368 | if( event.modifier & SI_MULTISELECT ) |
| 3369 | { |
| 3370 | bool selectFlag = item->mState.test(Item::Selected); |
| 3371 | if (selectFlag == true) |
| 3372 | { |
| 3373 | // already selected, so unselect it and remove it |
| 3374 | removeSelection(item->mId); |
| 3375 | } |
| 3376 | else |
| 3377 | { |
| 3378 | addSelection(item->mId); |
| 3379 | } |
| 3380 | } |
| 3381 | else if( event.modifier & SI_RANGESELECT && mMultipleSelections ) |
| 3382 | { |
| 3383 | // is something already selected? |
| 3384 | S32 firstSelectedIndex = 0; |
| 3385 | Item * firstItem = NULL; |
| 3386 | if (!mSelectedItems.empty()) |
| 3387 | { |
| 3388 | firstItem = mSelectedItems.front(); |
| 3389 | for (S32 i = 0; i < mVisibleItems.size();i++) |
| 3390 | { |
| 3391 | if (mVisibleItems[i] == mSelectedItems.front()) |
| 3392 | { |
| 3393 | firstSelectedIndex = i; |
| 3394 | break; |
| 3395 | } |
| 3396 | } |
| 3397 | mCurrentDragCell = mMouseOverCell.y; |
| 3398 | if (mVisibleItems[firstSelectedIndex] != firstItem ) |
| 3399 | { |
nothing calls this directly
no test coverage detected