X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4cbc57f086cee690f397ac5622d3f1d7153b300e..5cf1cb1006d6b5762d96c07ee3892883607460c7:/contrib/src/fl/rowdragpl.cpp diff --git a/contrib/src/fl/rowdragpl.cpp b/contrib/src/fl/rowdragpl.cpp index 062e312bc5..7e3eb29df3 100644 --- a/contrib/src/fl/rowdragpl.cpp +++ b/contrib/src/fl/rowdragpl.cpp @@ -6,13 +6,9 @@ // Created: 06/10/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ - #pragma implementation "rowdragpl.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -66,10 +62,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 +91,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 +148,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 +162,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 +190,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 +208,7 @@ void cbRowDragPlugin::OnMouseMove( cbMotionEvent& event ) mpRowInFocus = NULL; mCollapsedIconInFocus = -1; - SetMouseCapture( FALSE ); + SetMouseCapture( false ); } if ( !ItemIsInFocus() ) @@ -226,21 +222,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 +244,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 +272,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 +318,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 +351,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 +374,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,30 +398,30 @@ 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 ) { - wxNode* pNode = mHiddenBars.First(); + wxNode* pNode = mHiddenBars.GetFirst(); int maxIconNo = -1; while( pNode ) { - cbHiddenBarInfo* pHBInfo = (cbHiddenBarInfo*)pNode->Data(); + cbHiddenBarInfo* pHBInfo = (cbHiddenBarInfo*)pNode->GetData(); if ( pHBInfo->mAlignment == pPane->mAlignment ) maxIconNo = wxMax( maxIconNo, pHBInfo->mIconNo ); - pNode = pNode->Next(); + pNode = pNode->GetNext(); } return ( maxIconNo + 1 ); @@ -524,11 +510,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 +757,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 +777,7 @@ void cbRowDragPlugin::CollapseRow( cbRowInfo* pRow ) SetPaneMargins(); - mpLayout->RecalcLayout(FALSE); + mpLayout->RecalcLayout(false); mpRowInFocus = NULL; @@ -805,7 +791,7 @@ void cbRowDragPlugin::ExpandRow( int collapsedIconIdx ) cbRowInfo* pNewRow = new cbRowInfo(); - wxNode* pNode = mHiddenBars.First(); + wxNode* pNode = mHiddenBars.GetFirst(); int rowNo = 0; @@ -813,7 +799,7 @@ void cbRowDragPlugin::ExpandRow( int collapsedIconIdx ) while( pNode ) { - cbHiddenBarInfo* pHBInfo = (cbHiddenBarInfo*)pNode->Data(); + cbHiddenBarInfo* pHBInfo = (cbHiddenBarInfo*)pNode->GetData(); if ( pHBInfo->mAlignment == mpPane->mAlignment && pHBInfo->mIconNo == collapsedIconIdx ) @@ -831,7 +817,7 @@ void cbRowDragPlugin::ExpandRow( int collapsedIconIdx ) // remove bar info from internal list - wxNode* pNext = pNode->Next(); + wxNode* pNext = pNode->GetNext(); delete pHBInfo; mHiddenBars.DeleteNode( pNode ); @@ -848,7 +834,7 @@ void cbRowDragPlugin::ExpandRow( int collapsedIconIdx ) --pHBInfo->mIconNo; - pNode = pNode->Next(); + pNode = pNode->GetNext(); } } @@ -867,7 +853,7 @@ void cbRowDragPlugin::ExpandRow( int collapsedIconIdx ) SetPaneMargins(); - mpLayout->RecalcLayout(FALSE); + mpLayout->RecalcLayout(false); mCollapsedIconInFocus = -1; @@ -889,7 +875,7 @@ void cbRowDragPlugin::ExpandRow( int collapsedIconIdx ) SetPaneMargins(); - mpLayout->RecalcLayout(FALSE); + mpLayout->RecalcLayout(false); mCollapsedIconInFocus = -1; @@ -915,7 +901,7 @@ void cbRowDragPlugin::InsertDraggedRowBefore( cbRowInfo* pBeforeRow ) //wxClientDC dc( &mpLayout->GetParentFrame() ); //mpPane->PaintRow( mpRowInFocus, dc ); - //DrawRowDragHint( mpRowInFocus, dc, FALSE ); + //DrawRowDragHint( mpRowInFocus, dc, false ); } } @@ -935,12 +921,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() @@ -1409,7 +1395,7 @@ void cbRowDragPlugin::DrawRowDragHint( cbRowInfo* pRow , wxDC& dc, bool isHighli } } -void cbRowDragPlugin::DrawRowsDragHintsBorder( wxDC& dc ) +void cbRowDragPlugin::DrawRowsDragHintsBorder( wxDC& WXUNUSED(dc) ) { // FIXME:: what was that? }