- // short-cuts
- wxPoint pos = event.mPos;
- mpPane = event.mpPane;
-
- mpPane->PaneToFrame( &pos.x, &pos.y );
-
- if ( !mDragStarted )
- {
- if ( mDecisionMode && mpRowInFocus )
- {
- int ofs;
-
- if ( mpPane->IsHorizontal() )
-
- ofs = pos.y - mDragOrigin.y;
- else
- ofs = pos.x - mDragOrigin.x;
-
- // check if the item was dragged sufficeintly
- // far, enough to consider that user really intends
- // to drag it
-
- if ( ofs >= MINIMAL_ROW_DRAG_OFS ||
- ofs <= -MINIMAL_ROW_DRAG_OFS )
- {
- // DBG::
- //.wxPoint pos = event.mPos;
- //wxPoint drg = mDragOrigin;
- //int dif = event.mPos.x - mDragOrigin.x;
-
- mDragStarted = TRUE;
- mDecisionMode = FALSE;
- mDragOrigin = pos;
-
- PrepareForRowDrag();
- return;
- }
-
- // this plugin "eats" all mouse input while item is dragged,
- return;
- }
-
- cbRowInfo* pRow = GetFirstRow();
-
- bool focusFound = FALSE;
-
- while( pRow )
- {
- if ( HitTestRowDragHint( pRow, pos ) )
- {
- CheckPrevItemInFocus( pRow, -1 );
- SetMouseCapture( TRUE );
-
- focusFound = TRUE;
-
- mpRowInFocus = pRow;
- mCollapsedIconInFocus = -1;
- break;
- }
-
- pRow = pRow->mpNext;
- }
-
- if ( !focusFound )
- {
- int hrCnt = GetHRowsCountForPane( event.mpPane );
-
- for( int i = 0; i != hrCnt; ++i )
- {
- if ( HitTestCollapsedRowIcon( i, pos ) )
- {
- CheckPrevItemInFocus( NULL, i );
- SetMouseCapture( TRUE );
-
- focusFound = TRUE;
-
- mCollapsedIconInFocus = i;
- mpRowInFocus = NULL;
- break;
- }
- }
- }
-
- if ( !focusFound && ItemIsInFocus() )
- {
- // kill focus from item previously been in focus
- UnhiglightItemInFocus();
-
- mpRowInFocus = NULL;
- mCollapsedIconInFocus = -1;
- SetMouseCapture( FALSE );
- }
-
- if ( !ItemIsInFocus() )
-
- // delegate it to other plugins
- event.Skip();
- }
- else
- {
- // otherwise mouse pointer moves, when dragging is started
-
- if ( mpPane->IsHorizontal() )
- {
- // DBG::
- wxPoint p = event.mPos;
- wxPoint d = mDragOrigin;
-// int dif = event.mPos.x - mDragOrigin.x;
-
- // row is dragged up or down;
- ShowDraggedRow( pos.y - mDragOrigin.y );
- }
- else
- {
- // DBG::
- wxPoint p = event.mPos;
- wxPoint d = mDragOrigin;
-// int dif = event.mPos.x - mDragOrigin.x;
-
- // row is dragged left or right
- ShowDraggedRow( pos.x - mDragOrigin.x );
- }
-
- // this plugin "eats" all mouse input while item is dragged,
- }
+ // short-cuts
+ wxPoint pos = event.mPos;
+ mpPane = event.mpPane;
+
+ mpPane->PaneToFrame( &pos.x, &pos.y );
+
+ if ( !mDragStarted )
+ {
+ if ( mDecisionMode && mpRowInFocus )
+ {
+ int ofs;
+
+ if ( mpPane->IsHorizontal() )
+
+ ofs = pos.y - mDragOrigin.y;
+ else
+ ofs = pos.x - mDragOrigin.x;
+
+ // check if the item was dragged sufficeintly
+ // far, enough to consider that user really intends
+ // to drag it
+
+ if ( ofs >= MINIMAL_ROW_DRAG_OFS ||
+ ofs <= -MINIMAL_ROW_DRAG_OFS )
+ {
+ // DBG::
+ //.wxPoint pos = event.mPos;
+ //wxPoint drg = mDragOrigin;
+ //int dif = event.mPos.x - mDragOrigin.x;
+
+ mDragStarted = true;
+ mDecisionMode = false;
+ mDragOrigin = pos;
+
+ PrepareForRowDrag();
+ return;
+ }
+
+ // this plugin "eats" all mouse input while item is dragged,
+ return;
+ }
+
+ cbRowInfo* pRow = GetFirstRow();
+
+ bool focusFound = false;
+
+ while( pRow )
+ {
+ if ( HitTestRowDragHint( pRow, pos ) )
+ {
+ CheckPrevItemInFocus( pRow, -1 );
+ SetMouseCapture( true );
+
+ focusFound = true;
+
+ mpRowInFocus = pRow;
+ mCollapsedIconInFocus = -1;
+ break;
+ }
+
+ pRow = pRow->mpNext;
+ }
+
+ if ( !focusFound )
+ {
+ int hrCnt = GetHRowsCountForPane( event.mpPane );
+
+ for( int i = 0; i != hrCnt; ++i )
+ {
+ if ( HitTestCollapsedRowIcon( i, pos ) )
+ {
+ CheckPrevItemInFocus( NULL, i );
+ SetMouseCapture( true );
+
+ focusFound = true;
+
+ mCollapsedIconInFocus = i;
+ mpRowInFocus = NULL;
+ break;
+ }
+ }
+ }
+
+ if ( !focusFound && ItemIsInFocus() )
+ {
+ // kill focus from item previously been in focus
+ UnhighlightItemInFocus();
+
+ mpRowInFocus = NULL;
+ mCollapsedIconInFocus = -1;
+ SetMouseCapture( false );
+ }
+
+ if ( !ItemIsInFocus() )
+
+ // delegate it to other plugins
+ event.Skip();
+ }
+ else
+ {
+ // otherwise mouse pointer moves, when dragging is started
+
+ if ( mpPane->IsHorizontal() )
+ {
+ // row is dragged up or down;
+ ShowDraggedRow( pos.y - mDragOrigin.y );
+ }
+ else
+ {
+ // row is dragged left or right
+ ShowDraggedRow( pos.x - mDragOrigin.x );
+ }
+
+ // this plugin "eats" all mouse input while item is dragged,
+ }