- // calculate postion in frame's coordiantes
-
- if ( !mBarDragStarted )
- {
- event.Skip(); // pass event to the next plugin
- return;
- }
-
- wxPoint mousePos = event.mPos;
-
- event.mpPane->PaneToFrame( &mousePos.x, &mousePos.y );
-
- bool prevIsInClient = ( mpCurPane == 0 );
-
- AdjustHintRect( mousePos );
-
- // if the hint-rect is not "tempted" to any pane yet
-
- if ( mpCurPane == NULL )
- {
- cbDockPane* pPane = HitTestPanes( mHintRect );
-
- if ( !pPane )
-
- // enable sticking again, if we've left the pane completely
- mCanStick = TRUE;
-
- if ( mCanStick && pPane &&
- GetDistanceToPane( pPane, mousePos ) < GetBarHeightInPane( pPane ) )
-
- StickToPane( pPane, mousePos );
- else
- if ( pPane && HitTestPanes( mousePos ) == pPane && 0 ) // FOR NOW:: disabled
-
- StickToPane( pPane, mousePos );
- }
- else
- {
- // otherwise, when rect is now sticked to some of the panes
- // check if it should still remain in this pane
-
- mCanStick = TRUE;
-
- bool mouseInOther = IsInOtherPane( mousePos );
-
- if ( mouseInOther )
- {
- cbDockPane* pPane = HitTestPanes( mousePos );
-
- StickToPane( pPane, mousePos );
- }
- else
- {
- if ( IsInClientArea( mousePos ) )
- {
- cbDockPane* pPane = HitTestPanes( mHintRect );
-
- if ( pPane &&
- pPane != mpCurPane &&
- GetDistanceToPane( pPane, mousePos ) < GetBarHeightInPane( pPane ) )
-
- StickToPane( pPane, mousePos );
- else
- if ( !pPane )
- {
- UnstickFromPane( mpCurPane, mousePos );
-
- // FOR NOW:: disabled, would cause some mess
- //mCanStick = FALSE; // prevents from sticking to this
- // pane again, flag is reset when hint-rect
- // leaves the pane completely
- }
- else
- if ( GetDistanceToPane( pPane, mousePos ) > GetBarHeightInPane( pPane ) )
- {
- if ( !HitsPane( mpCurPane, mHintRect ) )
- {
- UnstickFromPane( mpCurPane, mousePos );
-
- // FOR NOW:: disabled, would cause some mess
- //mCanStick = FALSE; // prevents from sticking to this
- // pane again, flag is reset when hint-rect
- // leaves the pane completely
- }
- }
-
- }
- else
- {
- }
- }
- }
-
- ShowHint( prevIsInClient );
-
- wxCursor* pPrevCurs = mpCurCursor;
-
- if ( mpCurPane )
-
- mpCurCursor = mpLayout->mpDragCursor;
- else
- {
- if ( mpLayout->mFloatingOn && mpSrcPane->mProps.mRealTimeUpdatesOn )
-
- mpCurCursor = mpLayout->mpDragCursor;
- else
- mpCurCursor = mpLayout->mpNECursor;
- }
-
- if ( pPrevCurs != mpCurCursor )
-
- mpLayout->GetParentFrame().SetCursor( *mpCurCursor );
+ // calculate postion in frame's coordiantes
+
+ if ( !mBarDragStarted )
+ {
+ event.Skip(); // pass event to the next plugin
+ return;
+ }
+
+ wxPoint mousePos = event.mPos;
+
+ event.mpPane->PaneToFrame( &mousePos.x, &mousePos.y );
+
+ bool prevIsInClient = ( mpCurPane == 0 );
+
+ AdjustHintRect( mousePos );
+
+ // if the hint-rect is not "tempted" to any pane yet
+
+ if ( mpCurPane == NULL )
+ {
+ cbDockPane* pPane = HitTestPanes( mHintRect );
+
+ // enable sticking again, if we've left the pane completely
+ if ( !pPane )
+ mCanStick = true;
+
+ if ( mCanStick && pPane &&
+ GetDistanceToPane( pPane, mousePos ) < GetBarHeightInPane( pPane ) )
+ StickToPane( pPane, mousePos );
+ else
+ if ( pPane && HitTestPanes( mousePos ) == pPane && 0 ) // FOR NOW:: disabled
+
+ StickToPane( pPane, mousePos );
+ }
+ else
+ {
+ // otherwise, when rect is now sticked to some of the panes
+ // check if it should still remain in this pane
+
+ mCanStick = true;
+
+ bool mouseInOther = IsInOtherPane( mousePos );
+
+ if ( mouseInOther )
+ {
+ cbDockPane* pPane = HitTestPanes( mousePos );
+
+ StickToPane( pPane, mousePos );
+ }
+ else
+ {
+ if ( IsInClientArea( mousePos ) )
+ {
+ cbDockPane* pPane = HitTestPanes( mHintRect );
+
+ if ( pPane &&
+ pPane != mpCurPane &&
+ GetDistanceToPane( pPane, mousePos ) < GetBarHeightInPane( pPane ) )
+ StickToPane( pPane, mousePos );
+ else
+ if ( !pPane )
+ {
+ UnstickFromPane( mpCurPane, mousePos );
+
+ // FOR NOW:: disabled, would cause some mess
+ // mCanStick = false; // prevents from sticking to this
+ // pane again, flag is reset when hint-rect
+ // leaves the pane completely
+ }
+ else
+ if ( GetDistanceToPane( pPane, mousePos ) > GetBarHeightInPane( pPane ) )
+ {
+ if ( !HitsPane( mpCurPane, mHintRect ) )
+ {
+ UnstickFromPane( mpCurPane, mousePos );
+
+ // FOR NOW:: disabled, would cause some mess
+ // mCanStick = false; // prevents from sticking to this
+ // pane again, flag is reset when hint-rect
+ // leaves the pane completely
+ }
+ }
+
+ }
+ }
+ }
+
+ ShowHint( prevIsInClient );
+
+ wxCursor* pPrevCurs = mpCurCursor;
+
+ if ( mpCurPane )
+ {
+ mpCurCursor = mpLayout->mpNormalCursor;
+ }
+ else
+ {
+ // if floating is off, and we are in the client
+ // area, the cursor will be invalid, otherwise
+ // it will be the normal cursor
+
+ if (mpLayout->mFloatingOn)
+ {
+ mpCurCursor = mpLayout->mpNormalCursor;
+ }
+ else
+ {
+ mpCurCursor = mpLayout->mpNECursor;
+ }
+
+ }
+ if ( pPrevCurs != mpCurCursor )
+ mpLayout->GetParentFrame().SetCursor( *mpCurCursor );