X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/196be0f13767693bb514cdff5b3020fee9ca1676..1721a8c028d3b6a553634c632117fbfac102a30e:/contrib/src/fl/rowdragpl.cpp?ds=inline diff --git a/contrib/src/fl/rowdragpl.cpp b/contrib/src/fl/rowdragpl.cpp index 56b569b093..d5ab85ea04 100644 --- a/contrib/src/fl/rowdragpl.cpp +++ b/contrib/src/fl/rowdragpl.cpp @@ -6,7 +6,7 @@ // Created: 06/10/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -66,10 +66,10 @@ cbRowDragPlugin::cbRowDragPlugin(void) mTrianInnerColor ( 0,0,255 ), mTrianInnerPen ( mTrianInnerColor, 1, wxSOLID ), - mDragStarted ( FALSE ), - mDecisionMode ( FALSE ), + mDragStarted ( false ), + mDecisionMode ( false ), mCurDragOfs ( 0 ), - mCaptureIsOn ( FALSE ), + mCaptureIsOn ( false ), mSvTopMargin ( -1 ), mSvBottomMargin ( -1 ), mSvLeftMargin ( -1 ), @@ -95,10 +95,10 @@ cbRowDragPlugin::cbRowDragPlugin( wxFrameLayout* pLayout, int paneMask ) mTrianInnerColor ( 0,0,255 ), mTrianInnerPen ( mTrianInnerColor, 1, wxSOLID ), - mDragStarted ( FALSE ), - mDecisionMode ( FALSE ), + mDragStarted ( false ), + mDecisionMode ( false ), mCurDragOfs ( 0 ), - mCaptureIsOn ( FALSE ), + mCaptureIsOn ( false ), mSvTopMargin ( -1 ), mSvBottomMargin ( -1 ), mSvLeftMargin ( -1 ), @@ -152,8 +152,8 @@ void cbRowDragPlugin::OnMouseMove( cbMotionEvent& event ) //wxPoint drg = mDragOrigin; //int dif = event.mPos.x - mDragOrigin.x; - mDragStarted = TRUE; - mDecisionMode = FALSE; + mDragStarted = true; + mDecisionMode = false; mDragOrigin = pos; PrepareForRowDrag(); @@ -166,16 +166,16 @@ void cbRowDragPlugin::OnMouseMove( cbMotionEvent& event ) cbRowInfo* pRow = GetFirstRow(); - bool focusFound = FALSE; + bool focusFound = false; while( pRow ) { if ( HitTestRowDragHint( pRow, pos ) ) { CheckPrevItemInFocus( pRow, -1 ); - SetMouseCapture( TRUE ); + SetMouseCapture( true ); - focusFound = TRUE; + focusFound = true; mpRowInFocus = pRow; mCollapsedIconInFocus = -1; @@ -194,9 +194,9 @@ void cbRowDragPlugin::OnMouseMove( cbMotionEvent& event ) if ( HitTestCollapsedRowIcon( i, pos ) ) { CheckPrevItemInFocus( NULL, i ); - SetMouseCapture( TRUE ); + SetMouseCapture( true ); - focusFound = TRUE; + focusFound = true; mCollapsedIconInFocus = i; mpRowInFocus = NULL; @@ -212,7 +212,7 @@ void cbRowDragPlugin::OnMouseMove( cbMotionEvent& event ) mpRowInFocus = NULL; mCollapsedIconInFocus = -1; - SetMouseCapture( FALSE ); + SetMouseCapture( false ); } if ( !ItemIsInFocus() ) @@ -226,21 +226,11 @@ void cbRowDragPlugin::OnMouseMove( cbMotionEvent& event ) 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 ); } @@ -258,14 +248,14 @@ void cbRowDragPlugin::OnLButtonDown( cbLeftDownEvent& event ) if ( ItemIsInFocus() ) { - mDecisionMode = TRUE; + mDecisionMode = true; wxPoint pos = event.mPos; mpPane->PaneToFrame( &pos.x, &pos.y ); mDragOrigin = pos; - SetMouseCapture( TRUE ); + SetMouseCapture( true ); } else // propagate event to other plugins @@ -286,10 +276,10 @@ void cbRowDragPlugin::OnLButtonUp ( cbLeftUpEvent& event ) { cbDockPane* pPane = mpPane; - SetMouseCapture( FALSE ); + SetMouseCapture( false ); - mDecisionMode = FALSE; - mDragStarted = FALSE; + mDecisionMode = false; + mDragStarted = false; wxPoint frmPos = event.mPos; pPane->PaneToFrame( &frmPos.x, &frmPos.y ); @@ -332,19 +322,19 @@ void cbRowDragPlugin::OnLButtonUp ( cbLeftUpEvent& event ) mpLayout->GetUpdatesManager().OnStartChanges(); - pRow->mUMgrData.SetDirty(TRUE); + pRow->mUMgrData.SetDirty(true); cbBarInfo* pBar = mpRowInFocus->mBars[0]; while ( pBar ) { - pBar->mUMgrData.SetDirty(TRUE); + pBar->mUMgrData.SetDirty(true); if ( pBar->mpBarWnd ) { // do complete refresh - pBar->mpBarWnd->Show(FALSE); - pBar->mpBarWnd->Show(TRUE); + pBar->mpBarWnd->Show(false); + pBar->mpBarWnd->Show(true); } pBar = pBar->mpNext; @@ -365,15 +355,15 @@ void cbRowDragPlugin::OnLButtonUp ( cbLeftUpEvent& event ) mpRowInFocus = NULL; - mpLayout->RecalcLayout(FALSE); + mpLayout->RecalcLayout(false); // finish change "transaction" mpLayout->GetUpdatesManager().OnFinishChanges(); mpLayout->GetUpdatesManager().UpdateNow(); // finish drag action - SetMouseCapture( FALSE ); - mDragStarted = FALSE; + SetMouseCapture( false ); + mDragStarted = false; } } @@ -388,7 +378,7 @@ void cbRowDragPlugin::OnDrawPaneBackground ( cbDrawPaneDecorEvent& event ) // first, let other plugins add their decorations now GetNextHandler()->ProcessEvent( event ); - event.Skip(FALSE); + event.Skip(false); } wxClientDC dc( &mpLayout->GetParentFrame() ); @@ -412,13 +402,13 @@ void cbRowDragPlugin::OnDrawPaneBackground ( cbDrawPaneDecorEvent& event ) while( pRow ) { - DrawRowDragHint( pRow, dc, FALSE ); + DrawRowDragHint( pRow, dc, false ); pRow = pRow->mpNext; } for( int i = 0; i != cnt; ++i ) - DrawCollapsedRowIcon(i, dc, FALSE ); + DrawCollapsedRowIcon(i, dc, false ); } int cbRowDragPlugin::GetHRowsCountForPane( cbDockPane* pPane ) @@ -524,11 +514,11 @@ void cbRowDragPlugin::UnhighlightItemInFocus() if ( mpRowInFocus ) - DrawRowDragHint( mpRowInFocus, dc, FALSE ); + DrawRowDragHint( mpRowInFocus, dc, false ); else if ( mCollapsedIconInFocus != - 1 ) - DrawCollapsedRowIcon( mCollapsedIconInFocus, dc, FALSE ); + DrawCollapsedRowIcon( mCollapsedIconInFocus, dc, false ); } void cbRowDragPlugin::ShowDraggedRow( int offset ) @@ -771,7 +761,7 @@ void cbRowDragPlugin::CollapseRow( cbRowInfo* pRow ) // hide it if ( pBar->mpBarWnd ) - pBar->mpBarWnd->Show( FALSE ); + pBar->mpBarWnd->Show( false ); pBar->mState = wxCBAR_HIDDEN; @@ -791,7 +781,7 @@ void cbRowDragPlugin::CollapseRow( cbRowInfo* pRow ) SetPaneMargins(); - mpLayout->RecalcLayout(FALSE); + mpLayout->RecalcLayout(false); mpRowInFocus = NULL; @@ -867,7 +857,7 @@ void cbRowDragPlugin::ExpandRow( int collapsedIconIdx ) SetPaneMargins(); - mpLayout->RecalcLayout(FALSE); + mpLayout->RecalcLayout(false); mCollapsedIconInFocus = -1; @@ -889,7 +879,7 @@ void cbRowDragPlugin::ExpandRow( int collapsedIconIdx ) SetPaneMargins(); - mpLayout->RecalcLayout(FALSE); + mpLayout->RecalcLayout(false); mCollapsedIconInFocus = -1; @@ -915,7 +905,7 @@ void cbRowDragPlugin::InsertDraggedRowBefore( cbRowInfo* pBeforeRow ) //wxClientDC dc( &mpLayout->GetParentFrame() ); //mpPane->PaintRow( mpRowInFocus, dc ); - //DrawRowDragHint( mpRowInFocus, dc, FALSE ); + //DrawRowDragHint( mpRowInFocus, dc, false ); } } @@ -935,12 +925,12 @@ void cbRowDragPlugin::CheckPrevItemInFocus( cbRowInfo* pRow, int iconIdx ) if ( iconIdx != - 1 ) - DrawCollapsedRowIcon( iconIdx, dc, TRUE ); + DrawCollapsedRowIcon( iconIdx, dc, true ); else if ( pRow != NULL ) - DrawRowDragHint( pRow, dc, TRUE ); + DrawRowDragHint( pRow, dc, true ); } cbRowInfo* cbRowDragPlugin::GetFirstRow()