X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a570d5b302bf1280452f35fa23ffd1c71b960b23..6d7b547184bfdcdf67790755deb0122050b1d728:/contrib/src/fl/panedrawpl.cpp?ds=sidebyside diff --git a/contrib/src/fl/panedrawpl.cpp b/contrib/src/fl/panedrawpl.cpp index cc3625ffc1..cb292b7285 100644 --- a/contrib/src/fl/panedrawpl.cpp +++ b/contrib/src/fl/panedrawpl.cpp @@ -6,13 +6,9 @@ // Created: 06/09/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ - #pragma implementation "panedrawpl.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -103,17 +99,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 +121,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 +250,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,9 +271,9 @@ 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 @@ -294,7 +290,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) @@ -305,7 +301,7 @@ void cbPaneDrawPlugin::OnMouseMove( cbMotionEvent& event ) else pCurs = mpLayout->mpHorizCursor; - mRowHandleHitted = TRUE; + mRowHandleHitted = true; mIsUpperHandle = ( testResult == CB_UPPER_ROW_HANDLE_HITTED ); } else @@ -318,7 +314,7 @@ void cbPaneDrawPlugin::OnMouseMove( cbMotionEvent& event ) else pCurs = mpLayout->mpVertCursor; - mBarHandleHitted = TRUE; + mBarHandleHitted = true; mIsLeftHandle = ( testResult == CB_LEFT_BAR_HANDLE_HITTED ); } @@ -326,17 +322,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 @@ -358,7 +354,7 @@ void cbPaneDrawPlugin::OnMouseMove( cbMotionEvent& event ) mpLayout->GetParentFrame().SetCursor( *mpLayout->mpNormalCursor ); #endif - mResizeCursorOn = FALSE; + mResizeCursorOn = false; } event.Skip(); // pass event to the next plugin @@ -406,14 +402,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 ) @@ -424,7 +420,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; @@ -447,7 +443,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; @@ -505,8 +501,8 @@ 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 ); @@ -591,20 +587,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 } @@ -1272,7 +1272,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 );