Lines Matching refs:mousePos
137 void cbBarDragPlugin::AdjustHintRect( wxPoint& mousePos )
139 mHintRect.x = mousePos.x - mMouseInRectX;
140 mHintRect.y = mousePos.y - mMouseInRectY;
178 int cbBarDragPlugin::GetDistanceToPane( cbDockPane* pPane, wxPoint& mousePos )
184 case FL_ALIGN_TOP : return mousePos.y - ( bounds.y + bounds.height );
185 case FL_ALIGN_BOTTOM : return bounds.y - mousePos.y;
186 case FL_ALIGN_LEFT : return mousePos.x - ( bounds.x + bounds.width );
187 case FL_ALIGN_RIGHT : return bounds.x - mousePos.x;
194 bool cbBarDragPlugin::IsInOtherPane( wxPoint& mousePos )
196 cbDockPane* pPane = HitTestPanes( mousePos );
202 bool cbBarDragPlugin::IsInClientArea( wxPoint& mousePos )
204 return ( HitTestPanes( mousePos ) == NULL );
237 static inline void check_upper_overrun( int& pos, int width, int mousePos )
239 if ( mousePos >= pos + width )
240 pos = mousePos - width/2;
243 static inline void check_lower_overrun( int& pos, int width, int mousePos )
245 if ( mousePos <= pos )
246 pos = mousePos - width/2;
249 void cbBarDragPlugin::StickToPane( cbDockPane* pPane, wxPoint& mousePos )
274 ? mousePos.y > bounds.y
275 : mousePos.x > bounds.x;
285 mHintRect.y = wxMin( paneBottomEdgeY, mousePos.y );
287 check_lower_overrun( mHintRect.y, hInPane, mousePos.y );
295 mHintRect.y = wxMax( paneTopEdgeY - hInPane, mousePos.y - hInPane );
297 check_upper_overrun( mHintRect.y, hInPane, mousePos.y );
304 mHintRect.x = wxMin( paneRightEdgeX, mousePos.x );
306 check_lower_overrun( mHintRect.x, hInPane, mousePos.x );
313 mHintRect.x = wxMax( paneLeftEdgeX - hInPane, mousePos.x - hInPane );
315 check_upper_overrun( mHintRect.x, hInPane, mousePos.x );
318 mMouseInRectX = mousePos.x - mHintRect.x;
319 mMouseInRectY = mousePos.y - mHintRect.y;
324 void cbBarDragPlugin::UnstickFromPane( cbDockPane* pPane, wxPoint& mousePos )
348 ? mousePos.y > bounds.y
349 : mousePos.x > bounds.x;
355 // bool fromLowerEdge = mousePos.y > bounds.y;
357 mHintRect.y = wxMax( bounds.y + bounds.height + 1, mousePos.y - newHeight );
359 check_upper_overrun( mHintRect.y, newHeight, mousePos.y );
364 mHintRect.x = mousePos.x - ( newWidth / 2 );
369 mHintRect.y = wxMin( bounds.y - newHeight - 1, mousePos.y );
374 mHintRect.x = mousePos.x - ( newWidth / 2 );
376 check_lower_overrun( mHintRect.y, newHeight, mousePos.y );
381 mHintRect.x = wxMax( bounds.x + bounds.width, mousePos.x - newWidth );
386 mHintRect.y = mousePos.y - ( newHeight / 2 );
388 check_upper_overrun( mHintRect.x, newWidth, mousePos.x );
393 mHintRect.x = wxMin( bounds.x - newWidth - 1, mousePos.x );
398 mHintRect.y = mousePos.y - ( newHeight / 2 );
400 check_lower_overrun( mHintRect.x, newWidth, mousePos.x );
403 mMouseInRectX = mousePos.x - mHintRect.x;
404 mMouseInRectY = mousePos.y - mHintRect.y;
535 wxPoint mousePos = event.mPos;
537 event.mpPane->PaneToFrame( &mousePos.x, &mousePos.y );
541 AdjustHintRect( mousePos );
554 GetDistanceToPane( pPane, mousePos ) < GetBarHeightInPane( pPane ) )
555 StickToPane( pPane, mousePos );
557 if ( pPane && HitTestPanes( mousePos ) == pPane && 0 ) // FOR NOW:: disabled
559 StickToPane( pPane, mousePos );
568 bool mouseInOther = IsInOtherPane( mousePos );
572 cbDockPane* pPane = HitTestPanes( mousePos );
574 StickToPane( pPane, mousePos );
578 if ( IsInClientArea( mousePos ) )
584 GetDistanceToPane( pPane, mousePos ) < GetBarHeightInPane( pPane ) )
585 StickToPane( pPane, mousePos );
589 UnstickFromPane( mpCurPane, mousePos );
597 if ( GetDistanceToPane( pPane, mousePos ) > GetBarHeightInPane( pPane ) )
601 UnstickFromPane( mpCurPane, mousePos );