Removed non-reachable code (consulted Aleks first, and he said the code was no longer needed)
Commented out unused variables to stop BCC warnings - left the code for debugging purposes Removed hardcoded tabs and replaced with spaces per the wxWindows code style specs Spelling typos fixed in comments Miscellaneous source formatting issues fixed to meet standard wxwindows coding styles git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12605 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -371,7 +371,7 @@ void cbBarDragPlugin::UnstickFromPane( cbDockPane* pPane, wxPoint& mousePos )
|
||||
|
||||
if ( pPane->IsHorizontal() && fromLowerEdge )
|
||||
{
|
||||
bool fromLowerEdge = mousePos.y > bounds.y;
|
||||
// bool fromLowerEdge = mousePos.y > bounds.y;
|
||||
|
||||
mHintRect.y = wxMax( bounds.y + bounds.height + 1, mousePos.y - newHeight );
|
||||
|
||||
|
@@ -140,7 +140,7 @@ void cbBarHintsPlugin::DrawGrooves( wxDC& dc, const wxPoint& pos, int length )
|
||||
|
||||
int i;
|
||||
for ( i = 0; i != mGrooveCount; ++i, ofs += ( GROOVE_WIDTH + GROOVE_TO_GROOVE_GAP ) )
|
||||
|
||||
{
|
||||
if ( mpPane->IsHorizontal() )
|
||||
{
|
||||
dc.SetPen( mpLayout->mLightPen );
|
||||
@@ -164,6 +164,7 @@ void cbBarHintsPlugin::DrawGrooves( wxDC& dc, const wxPoint& pos, int length )
|
||||
dc.DrawPoint( pos.x + length - 1, pos.y + ofs );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void cbBarHintsPlugin::ExcludeHints( wxRect& rect, cbBarInfo& info )
|
||||
{
|
||||
@@ -239,20 +240,21 @@ void cbBarHintsPlugin::GetHintsLayout( wxRect& rect, cbBarInfo& info,
|
||||
int& boxOfs, int& grooveOfs, int& pos )
|
||||
{
|
||||
int boxHeight = BTN_BOX_HEIGHT;
|
||||
int boxWidth = BTN_BOX_WIDTH + BOX_TO_GROOVE_GAP + BTN_BOX_WIDTH;
|
||||
// int boxWidth = BTN_BOX_WIDTH + BOX_TO_GROOVE_GAP + BTN_BOX_WIDTH;
|
||||
|
||||
// collapse and close box are not placed on fixed bars
|
||||
|
||||
if ( info.IsFixed() || ( !mCloseBoxOn && !mCollapseBoxOn ) )
|
||||
{
|
||||
boxHeight = 0;
|
||||
boxWidth = 0;
|
||||
// boxWidth = 0;
|
||||
}
|
||||
/*
|
||||
else
|
||||
if ( !mCloseBoxOn || !mCollapseBoxOn )
|
||||
|
||||
boxWidth = BTN_BOX_WIDTH;
|
||||
|
||||
*/
|
||||
int grooveHeight = mGrooveCount*(GROOVE_WIDTH + GROOVE_TO_GROOVE_GAP)
|
||||
- GROOVE_TO_GROOVE_GAP;
|
||||
|
||||
@@ -299,9 +301,9 @@ void cbBarHintsPlugin::GetHintsLayout( wxRect& rect, cbBarInfo& info,
|
||||
|
||||
int i;
|
||||
for ( i = 0; i != BOXES_IN_HINT; ++i )
|
||||
|
||||
{
|
||||
mBoxes[i]->mpPane = mpPane;
|
||||
|
||||
}
|
||||
|
||||
if ( mpPane->IsHorizontal() )
|
||||
{
|
||||
@@ -445,8 +447,8 @@ void cbBarHintsPlugin::OnDrawBarDecorations( cbDrawBarDecorEvent& event )
|
||||
void cbBarHintsPlugin::OnLeftDown( cbLeftDownEvent& event )
|
||||
{
|
||||
mpPane = event.mpPane;
|
||||
|
||||
wxPoint inFrame = event.mPos;
|
||||
|
||||
mpPane->PaneToFrame( &inFrame.x, &inFrame.y );
|
||||
|
||||
wxBarIterator iter( mpPane->GetRowList() );
|
||||
@@ -503,12 +505,12 @@ void cbBarHintsPlugin::OnLeftUp( cbLeftUpEvent& event )
|
||||
if ( mBoxes[i]->WasClicked() )
|
||||
{
|
||||
if ( i == 0 )
|
||||
|
||||
{
|
||||
mpLayout->SetBarState( mpClickedBar, wxCBAR_HIDDEN, TRUE );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( mpClickedBar->IsExpanded() )
|
||||
|
||||
mpPane->ContractBar( mpClickedBar );
|
||||
else
|
||||
mpPane->ExpandBar( mpClickedBar );
|
||||
@@ -534,9 +536,10 @@ void cbBarHintsPlugin::OnMotion( cbMotionEvent& event )
|
||||
|
||||
int i;
|
||||
for ( i = 0; i != BOXES_IN_HINT; ++i )
|
||||
|
||||
{
|
||||
mBoxes[i]->OnMotion( inFrame );
|
||||
}
|
||||
}
|
||||
else
|
||||
event.Skip();
|
||||
}
|
||||
|
@@ -141,7 +141,8 @@ void cbGCUpdatesMgr::UpdateNow()
|
||||
|
||||
wxList mBarsToResize;
|
||||
|
||||
for( int n = 0; n != MAX_PANES; ++n )
|
||||
int n;
|
||||
for ( n = 0; n != MAX_PANES; ++n )
|
||||
{
|
||||
cbDockPane& pane = *(panes[n]);
|
||||
|
||||
@@ -164,7 +165,7 @@ void cbGCUpdatesMgr::UpdateNow()
|
||||
cbBarInfo* pBar = pRow->GetFirstBar();
|
||||
|
||||
bool rowChanged = FALSE;
|
||||
bool rowBkPainted = FALSE;
|
||||
// bool rowBkPainted = FALSE;
|
||||
|
||||
// FIXME:: the below should not be fixed
|
||||
cbBarInfo* barsToRepaint[128];
|
||||
|
@@ -381,14 +381,7 @@ void cbPaneDrawPlugin::OnLDblClick( cbLeftDClickEvent& event )
|
||||
&pBarToFloat ) == CB_BAR_CONTENT_HITTED
|
||||
)
|
||||
{
|
||||
// TBD: ????
|
||||
return;
|
||||
|
||||
mpLayout->SetBarState( pBarToFloat, wxCBAR_FLOATING, TRUE );
|
||||
|
||||
mpLayout->RepositionFloatedBar( pBarToFloat );
|
||||
|
||||
return; // event is "eaten" by this plugin
|
||||
}
|
||||
|
||||
event.Skip();
|
||||
@@ -439,7 +432,7 @@ void cbPaneDrawPlugin::OnLButtonDown( cbLeftDownEvent& event )
|
||||
{
|
||||
// otehrwise if bar handle dragged
|
||||
|
||||
cbRowInfo& rowInfo = *mpDraggedBar->mpRow;
|
||||
// cbRowInfo& rowInfo = *mpDraggedBar->mpRow;
|
||||
wxRect& bounds = mpDraggedBar->mBounds;
|
||||
|
||||
mHandleIsVertical = ( event.mpPane->IsHorizontal() ) ? TRUE : FALSE;
|
||||
@@ -735,12 +728,12 @@ void cbPaneDrawPlugin::OnDrawRowBackground ( cbDrawRowBkGroundEvent& event )
|
||||
wxRect rowBounds = pRow->mBoundsInParent;
|
||||
bool isHorizontal = event.mpPane->IsHorizontal();
|
||||
|
||||
int prevPos;
|
||||
// int prevPos;
|
||||
|
||||
if ( isHorizontal )
|
||||
{
|
||||
prevPos = rowBounds.x;
|
||||
// include one line obove and below the row
|
||||
// prevPos = rowBounds.x;
|
||||
// include one line above and below the row
|
||||
--rowBounds.y;
|
||||
rowBounds.height += 2;
|
||||
|
||||
@@ -749,8 +742,8 @@ void cbPaneDrawPlugin::OnDrawRowBackground ( cbDrawRowBkGroundEvent& event )
|
||||
}
|
||||
else
|
||||
{
|
||||
prevPos = rowBounds.y;
|
||||
// include one line obove and below the row
|
||||
// prevPos = rowBounds.y;
|
||||
// include one line above and below the row
|
||||
--rowBounds.x;
|
||||
rowBounds.width += 2;
|
||||
|
||||
@@ -1170,7 +1163,7 @@ void cbPaneDrawPlugin::OnDrawPaneDecorations( cbDrawPaneDecorEvent& event )
|
||||
|
||||
void cbPaneDrawPlugin::OnDrawBarDecorations( cbDrawBarDecorEvent& event )
|
||||
{
|
||||
cbBarInfo* pBar = event.mpBar;
|
||||
// cbBarInfo* pBar = event.mpBar;
|
||||
wxDC& dc = *event.mpDc;
|
||||
|
||||
// draw brick borders
|
||||
|
@@ -229,7 +229,7 @@ void cbRowDragPlugin::OnMouseMove( cbMotionEvent& event )
|
||||
// DBG::
|
||||
wxPoint p = event.mPos;
|
||||
wxPoint d = mDragOrigin;
|
||||
int dif = event.mPos.x - mDragOrigin.x;
|
||||
// int dif = event.mPos.x - mDragOrigin.x;
|
||||
|
||||
// row is dragged up or down;
|
||||
ShowDraggedRow( pos.y - mDragOrigin.y );
|
||||
@@ -239,7 +239,7 @@ void cbRowDragPlugin::OnMouseMove( cbMotionEvent& event )
|
||||
// DBG::
|
||||
wxPoint p = event.mPos;
|
||||
wxPoint d = mDragOrigin;
|
||||
int dif = event.mPos.x - mDragOrigin.x;
|
||||
// int dif = event.mPos.x - mDragOrigin.x;
|
||||
|
||||
// row is dragged left or right
|
||||
ShowDraggedRow( pos.x - mDragOrigin.x );
|
||||
|
@@ -129,8 +129,7 @@ void cbRowLayoutPlugin::ExpandNotFixedBars( cbRowInfo* pRow )
|
||||
|
||||
double pcntSum = 0.0;
|
||||
|
||||
size_t i = 0;
|
||||
|
||||
size_t i;
|
||||
for ( i = 0; i != pRow->mBars.Count(); ++i )
|
||||
{
|
||||
if ( !pRow->mBars[i]->IsFixed() )
|
||||
@@ -161,7 +160,7 @@ void cbRowLayoutPlugin::ExpandNotFixedBars( cbRowInfo* pRow )
|
||||
|
||||
void cbRowLayoutPlugin::AdjustLengthOfInserted( cbRowInfo* pRow, cbBarInfo* pTheBar )
|
||||
{
|
||||
return;
|
||||
return; // TBD: Makes following code unreachable
|
||||
|
||||
// pTheBar is not-fixed
|
||||
|
||||
@@ -184,7 +183,6 @@ void cbRowLayoutPlugin::AdjustLengthOfInserted( cbRowInfo* pRow, cbBarInfo* pThe
|
||||
if ( pRow->mBars.Count() )
|
||||
|
||||
pTheBar->mBounds.width = int( mpPane->mPaneWidth * (curWidth / double(totalLen)) );
|
||||
|
||||
#else
|
||||
|
||||
double freeSpc = (double)GetRowFreeSpace( pRow );
|
||||
@@ -234,7 +232,6 @@ void cbRowLayoutPlugin::FitBarsToRange( int from, int till,
|
||||
while( pBar != pTillBar )
|
||||
{
|
||||
if ( pBar->IsFixed() )
|
||||
|
||||
freeSpc -= pBar->mBounds.width;
|
||||
else
|
||||
pcntSum += pBar->mLenRatio;
|
||||
@@ -249,13 +246,12 @@ void cbRowLayoutPlugin::FitBarsToRange( int from, int till,
|
||||
while ( pBar != pTillBar )
|
||||
{
|
||||
if ( !pBar->IsFixed() )
|
||||
|
||||
{
|
||||
pBar->mBounds.width =
|
||||
|
||||
wxMax( mpPane->mProps.mMinCBarDim.x,
|
||||
int( double(freeSpc) * (pBar->mLenRatio/pcntSum) )
|
||||
);
|
||||
|
||||
}
|
||||
pBar = pBar->mpNext;
|
||||
}
|
||||
|
||||
@@ -461,7 +457,6 @@ void cbRowLayoutPlugin::ApplyLengthRatios( cbRowInfo* pRow )
|
||||
} // for
|
||||
|
||||
if ( haveSquished )
|
||||
|
||||
unit = freeSpc / pcntSum;
|
||||
|
||||
for ( i = 0; i != pRow->mBars.Count(); ++i )
|
||||
|
@@ -289,3 +289,4 @@ void cbSimpleUpdatesMgr::UpdateNow()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user