X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4cbc57f086cee690f397ac5622d3f1d7153b300e..a6905d8b558f1a0d258365b815bff0b5b5c76a0b:/contrib/src/fl/panedrawpl.cpp?ds=sidebyside diff --git a/contrib/src/fl/panedrawpl.cpp b/contrib/src/fl/panedrawpl.cpp index b5b06d3880..f07c30da89 100644 --- a/contrib/src/fl/panedrawpl.cpp +++ b/contrib/src/fl/panedrawpl.cpp @@ -6,7 +6,7 @@ // Created: 06/09/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -103,17 +103,17 @@ END_EVENT_TABLE() cbPaneDrawPlugin::cbPaneDrawPlugin(void) - : mResizeStarted ( FALSE ), + : mResizeStarted ( false ), - mResizeCursorOn ( FALSE ), + mResizeCursorOn ( false ), mpDraggedBar ( NULL ), mpResizedRow ( NULL ), - mRowHandleHitted ( FALSE ), - mIsUpperHandle ( FALSE ), - mBarHandleHitted ( FALSE ), - mIsLeftHandle ( FALSE ), - mBarContentHitted ( FALSE ), + mRowHandleHitted ( false ), + mIsUpperHandle ( false ), + mBarHandleHitted ( false ), + mIsLeftHandle ( false ), + mBarContentHitted ( false ), mpClntDc ( NULL ), mpPane ( NULL ) @@ -125,17 +125,17 @@ cbPaneDrawPlugin::cbPaneDrawPlugin( wxFrameLayout* pPanel, int paneMask ) // bar-row resizing state varaibles - mResizeStarted ( FALSE ), + mResizeStarted ( false ), - mResizeCursorOn ( FALSE ), + mResizeCursorOn ( false ), mpDraggedBar ( NULL ), mpResizedRow ( NULL ), - mRowHandleHitted ( FALSE ), - mIsUpperHandle ( FALSE ), - mBarHandleHitted ( FALSE ), - mIsLeftHandle ( FALSE ), - mBarContentHitted ( FALSE ), + mRowHandleHitted ( false ), + mIsUpperHandle ( false ), + mBarHandleHitted ( false ), + mIsLeftHandle ( false ), + mBarContentHitted ( false ), mpClntDc ( NULL ), mpPane ( NULL ) @@ -254,9 +254,9 @@ void cbPaneDrawPlugin::OnMouseMove( cbMotionEvent& event ) bool prevWasRowHandle = mRowHandleHitted; - mBarContentHitted = FALSE; - mBarHandleHitted = FALSE; - mRowHandleHitted = FALSE; + mBarContentHitted = false; + mBarHandleHitted = false; + mRowHandleHitted = false; int testResult = event.mpPane->HitTestPaneItems( event.mPos, // in pane's coordiantes @@ -275,11 +275,17 @@ void cbPaneDrawPlugin::OnMouseMove( cbMotionEvent& event ) mpLayout->ReleaseEventsFromPane( event.mpPane ); mpLayout->ReleaseEventsFromPlugin( this ); - mResizeCursorOn = FALSE; + mResizeCursorOn = false; - mBarContentHitted = TRUE; + mBarContentHitted = true; + // In Windows, at least, the frame needs to have a null cursor + // else child windows (such as text windows) inherit the cursor +#if 1 + mpLayout->GetParentFrame().SetCursor( wxNullCursor ); +#else mpLayout->GetParentFrame().SetCursor( *mpLayout->mpNormalCursor ); +#endif } // TBD:: fire something like "mouse-over-bar" event @@ -288,7 +294,7 @@ void cbPaneDrawPlugin::OnMouseMove( cbMotionEvent& event ) return; } - wxCursor* pCurs = NULL; + wxCursor* pCurs; if ( testResult == CB_UPPER_ROW_HANDLE_HITTED || testResult == CB_LOWER_ROW_HANDLE_HITTED) @@ -299,7 +305,7 @@ void cbPaneDrawPlugin::OnMouseMove( cbMotionEvent& event ) else pCurs = mpLayout->mpHorizCursor; - mRowHandleHitted = TRUE; + mRowHandleHitted = true; mIsUpperHandle = ( testResult == CB_UPPER_ROW_HANDLE_HITTED ); } else @@ -312,7 +318,7 @@ void cbPaneDrawPlugin::OnMouseMove( cbMotionEvent& event ) else pCurs = mpLayout->mpVertCursor; - mBarHandleHitted = TRUE; + mBarHandleHitted = true; mIsLeftHandle = ( testResult == CB_LEFT_BAR_HANDLE_HITTED ); } @@ -320,17 +326,17 @@ void cbPaneDrawPlugin::OnMouseMove( cbMotionEvent& event ) if ( !mResizeCursorOn || prevWasRowHandle != mRowHandleHitted ) { + mpLayout->GetParentFrame().SetCursor( *pCurs ); + if ( !mResizeCursorOn ) { // caputre if not captured yet mpLayout->CaptureEventsForPane( event.mpPane ); mpLayout->CaptureEventsForPlugin( this ); } - - mpLayout->GetParentFrame().SetCursor( *pCurs ); } - mResizeCursorOn = TRUE; + mResizeCursorOn = true; // handled is being dragged now, thus event is "eaten" by this plugin @@ -344,9 +350,15 @@ void cbPaneDrawPlugin::OnMouseMove( cbMotionEvent& event ) mpLayout->ReleaseEventsFromPane( event.mpPane ); mpLayout->ReleaseEventsFromPlugin( this ); + // In Windows, at least, the frame needs to have a null cursor + // else child windows (such as text windows) inherit the cursor +#if 1 + mpLayout->GetParentFrame().SetCursor( wxNullCursor ); +#else mpLayout->GetParentFrame().SetCursor( *mpLayout->mpNormalCursor ); +#endif - mResizeCursorOn = FALSE; + mResizeCursorOn = false; } event.Skip(); // pass event to the next plugin @@ -394,14 +406,14 @@ void cbPaneDrawPlugin::OnLButtonDown( cbLeftDownEvent& event ) if ( mResizeCursorOn ) { - mResizeStarted = TRUE; + mResizeStarted = true; mDragOrigin = event.mPos; // setup constraints for the dragging handle int from, till; mHandleOfs = 0; - mHandleIsVertical = FALSE; + mHandleIsVertical = false; if ( mRowHandleHitted ) @@ -412,7 +424,7 @@ void cbPaneDrawPlugin::OnLButtonDown( cbLeftDownEvent& event ) if ( mRowHandleHitted ) { - mHandleIsVertical = ( event.mpPane->IsHorizontal() ) ? FALSE : TRUE; + mHandleIsVertical = ( event.mpPane->IsHorizontal() ) ? false : true; mHandleDragArea.x = 0; mHandleDragArea.width = event.mpPane->mPaneWidth; @@ -435,7 +447,7 @@ void cbPaneDrawPlugin::OnLButtonDown( cbLeftDownEvent& event ) // cbRowInfo& rowInfo = *mpDraggedBar->mpRow; wxRect& bounds = mpDraggedBar->mBounds; - mHandleIsVertical = ( event.mpPane->IsHorizontal() ) ? TRUE : FALSE; + mHandleIsVertical = ( event.mpPane->IsHorizontal() ) ? true : false; mHandleDragArea.x = from; mHandleDragArea.width = till - from; @@ -493,13 +505,19 @@ void cbPaneDrawPlugin::OnLButtonUp( cbLeftUpEvent& event ) { DrawDraggedHandle( event.mPos, *event.mpPane ); - mResizeStarted = FALSE; - mResizeCursorOn = FALSE; + mResizeStarted = false; + mResizeCursorOn = false; mpLayout->ReleaseEventsFromPane( event.mpPane ); mpLayout->ReleaseEventsFromPlugin( this ); + // In Windows, at least, the frame needs to have a null cursor + // else child windows (such as text windows) inherit the cursor +#if 1 + mpLayout->GetParentFrame().SetCursor( wxNullCursor ); +#else mpLayout->GetParentFrame().SetCursor( *mpLayout->mpNormalCursor ); +#endif if ( mRowHandleHitted ) { @@ -573,20 +591,24 @@ void cbPaneDrawPlugin::OnSizeBarWindow( cbSizeBarWndEvent& event ) // FIXME:: +/- 1s + int nNewHeight = bounds.height - 2 - bar.mDimInfo.mVertGap *2; + if(nNewHeight < 0) + nNewHeight = 0; + bar.mpBarWnd->wxWindow::SetSize( bounds.x + 1 + bar.mDimInfo.mHorizGap, bounds.y + 1 + bar.mDimInfo.mVertGap, bounds.width - 2 - bar.mDimInfo.mHorizGap*2, - bounds.height - 2 - bar.mDimInfo.mVertGap *2 , + nNewHeight, 0 ); if ( !bar.mpBarWnd->IsShown() ) - bar.mpBarWnd->Show( TRUE ); + bar.mpBarWnd->Show( true ); } else // hide bar if not visible - bar.mpBarWnd->Show( FALSE ); + bar.mpBarWnd->Show( false ); event.Skip(); // pass event to the next plugin in the chain } @@ -1254,7 +1276,7 @@ void cbPaneDrawPlugin::OnStartDrawInArea( cbStartDrawInAreaEvent& event ) event.mArea.width, event.mArea.height ); } -void cbPaneDrawPlugin::OnFinishDrawInArea( cbFinishDrawInAreaEvent& event ) +void cbPaneDrawPlugin::OnFinishDrawInArea( cbFinishDrawInAreaEvent& WXUNUSED(event) ) { // DBG:: wxASSERT( mpClntDc );