// 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"
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 ),
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 ),
//wxPoint drg = mDragOrigin;
//int dif = event.mPos.x - mDragOrigin.x;
- mDragStarted = TRUE;
- mDecisionMode = FALSE;
+ mDragStarted = true;
+ mDecisionMode = false;
mDragOrigin = pos;
PrepareForRowDrag();
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;
if ( HitTestCollapsedRowIcon( i, pos ) )
{
CheckPrevItemInFocus( NULL, i );
- SetMouseCapture( TRUE );
+ SetMouseCapture( true );
- focusFound = TRUE;
+ focusFound = true;
mCollapsedIconInFocus = i;
mpRowInFocus = NULL;
mpRowInFocus = NULL;
mCollapsedIconInFocus = -1;
- SetMouseCapture( FALSE );
+ SetMouseCapture( false );
}
if ( !ItemIsInFocus() )
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 );
}
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
{
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 );
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;
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;
}
}
// first, let other plugins add their decorations now
GetNextHandler()->ProcessEvent( event );
- event.Skip(FALSE);
+ event.Skip(false);
}
wxClientDC dc( &mpLayout->GetParentFrame() );
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 )
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 )
// hide it
if ( pBar->mpBarWnd )
- pBar->mpBarWnd->Show( FALSE );
+ pBar->mpBarWnd->Show( false );
pBar->mState = wxCBAR_HIDDEN;
SetPaneMargins();
- mpLayout->RecalcLayout(FALSE);
+ mpLayout->RecalcLayout(false);
mpRowInFocus = NULL;
SetPaneMargins();
- mpLayout->RecalcLayout(FALSE);
+ mpLayout->RecalcLayout(false);
mCollapsedIconInFocus = -1;
SetPaneMargins();
- mpLayout->RecalcLayout(FALSE);
+ mpLayout->RecalcLayout(false);
mCollapsedIconInFocus = -1;
//wxClientDC dc( &mpLayout->GetParentFrame() );
//mpPane->PaintRow( mpRowInFocus, dc );
- //DrawRowDragHint( mpRowInFocus, dc, FALSE );
+ //DrawRowDragHint( mpRowInFocus, dc, false );
}
}
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()
dc.DrawLine( p4.x, p4.y, p1.x, p1.y );
}
-void cbRowDragPlugin::DrawOrtoRomb( wxRect& inRect, wxDC& dc, wxBrush& bkBrush )
+void cbRowDragPlugin::DrawOrtoRomb( wxRect& inRect, wxDC& dc, const wxBrush& bkBrush )
{
dc.SetBrush( bkBrush );
dc.SetPen( mpLayout->mBlackPen );
dc.SetBrush( wxNullBrush );
}
-void cbRowDragPlugin::DrawRomb( wxRect& inRect, wxDC& dc, wxBrush& bkBrush )
+void cbRowDragPlugin::DrawRomb( wxRect& inRect, wxDC& dc, const wxBrush& bkBrush )
{
wxPoint points[4];
}
void cbRowDragPlugin::DrawRectShade( wxRect& inRect, wxDC& dc,
- int level, wxPen& upperPen, wxPen& lowerPen )
+ int level, const wxPen& upperPen, const wxPen& lowerPen )
{
// upper shade
dc.SetPen( upperPen );
dc.SetBrush( wxNullBrush );
}
-void cbRowDragPlugin::Draw3DRect( wxRect& inRect, wxDC& dc, wxBrush& bkBrush )
+void cbRowDragPlugin::Draw3DRect( wxRect& inRect, wxDC& dc, const wxBrush& bkBrush )
{
dc.SetPen( mpLayout->mNullPen );
dc.SetBrush( bkBrush );
}
}
-void cbRowDragPlugin::DrawRowsDragHintsBorder( wxDC& dc )
+void cbRowDragPlugin::DrawRowsDragHintsBorder( wxDC& WXUNUSED(dc) )
{
// FIXME:: what was that?
}