MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / onMouseUp

Method onMouseUp

Engine/source/gui/controls/guiTreeViewCtrl.cpp:3006–3476  ·  view source on GitHub ↗

on mouse up look at the current item and check to see if it is valid to move the selected item(s) to it.

Source from the content-addressed store, hash-verified

3004// on mouse up look at the current item and check to see if it is valid
3005// to move the selected item(s) to it.
3006void GuiTreeViewCtrl::onMouseUp(const GuiEvent &event)
3007{
3008 if( !mActive || !mAwake || !mVisible )
3009 return;
3010
3011 if( isMethod("onMouseUp") )
3012 {
3013 BitSet32 hitFlags = 0;
3014 Item* item;
3015
3016 S32 hitItemId = -1;
3017 if( _hitTest( event.mousePoint, item, hitFlags ) )
3018 hitItemId = item->mId;
3019
3020 onMouseUp_callback( hitItemId, event.mouseClickCount );
3021 }
3022
3023 mouseUnlock();
3024
3025 if ( mSelectedItems.empty())
3026 {
3027 mDragMidPoint = NomDragMidPoint;
3028 return;
3029 }
3030
3031 BitSet32 hitFlags = 0;
3032 Item *item;
3033 bool hitCheck = _hitTest( event.mousePoint, item, hitFlags );
3034 mRenamingItem = NULL;
3035
3036 if( hitCheck )
3037 {
3038 if ( event.mouseClickCount == 1 && !mMouseDragged && mPossibleRenameItem != NULL )
3039 {
3040 if ( item == mPossibleRenameItem )
3041 showItemRenameCtrl( item );
3042 }
3043 else // If mouseUp occurs on the same item as mouse down
3044 {
3045 bool wasSelected = isSelected( item );
3046 bool multiSelect = getSelectedItemsCount() > 1;
3047 if( wasSelected && multiSelect && item == mTempItem )
3048 {
3049 clearSelection();
3050 addSelection( item->mId );
3051 }
3052 }
3053 }
3054
3055 mPossibleRenameItem = NULL;
3056
3057 if (!mMouseDragged)
3058 return;
3059
3060 Item* newItem = NULL;
3061 Item* newItem2 = NULL;
3062
3063 if (mFlags.test(IsEditable))

Callers

nothing calls this directly

Calls 15

isSelectedFunction · 0.85
getSelectedItemsCountFunction · 0.85
printfFunction · 0.85
isInspectorDataMethod · 0.80
isParentMethod · 0.80
lastMethod · 0.80
emptyMethod · 0.45
testMethod · 0.45
clearMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected