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:
parent
df43c1d682
commit
11a68fa3af
@ -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 );
|
||||
|
||||
|
@ -112,7 +112,7 @@ void cbBarHintsPlugin::CreateBoxes()
|
||||
mBoxes[COLLAPSE_BOX_IDX] = box2;
|
||||
|
||||
int i;
|
||||
for( i = 0; i != BOXES_IN_HINT; ++i )
|
||||
for ( i = 0; i != BOXES_IN_HINT; ++i )
|
||||
{
|
||||
mBoxes[i]->mpLayout = mpLayout;
|
||||
mBoxes[i]->mpPlugin = this;
|
||||
@ -139,8 +139,8 @@ void cbBarHintsPlugin::DrawGrooves( wxDC& dc, const wxPoint& pos, int length )
|
||||
int ofs = 0;
|
||||
|
||||
int i;
|
||||
for( i = 0; i != mGrooveCount; ++i, ofs += ( GROOVE_WIDTH + GROOVE_TO_GROOVE_GAP ) )
|
||||
|
||||
for ( i = 0; i != mGrooveCount; ++i, ofs += ( GROOVE_WIDTH + GROOVE_TO_GROOVE_GAP ) )
|
||||
{
|
||||
if ( mpPane->IsHorizontal() )
|
||||
{
|
||||
dc.SetPen( mpLayout->mLightPen );
|
||||
@ -163,6 +163,7 @@ void cbBarHintsPlugin::DrawGrooves( wxDC& dc, const wxPoint& pos, int length )
|
||||
dc.DrawPoint( pos.x + length - 1, pos.y + ofs + 1 );
|
||||
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;
|
||||
|
||||
@ -298,10 +300,10 @@ void cbBarHintsPlugin::GetHintsLayout( wxRect& rect, cbBarInfo& info,
|
||||
mBoxes[COLLAPSE_BOX_IDX]->Enable( info.mpRow->mNotFixedBarsCnt > 1 );
|
||||
|
||||
int i;
|
||||
for( i = 0; i != BOXES_IN_HINT; ++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() );
|
||||
@ -464,7 +466,7 @@ void cbBarHintsPlugin::OnLeftDown( cbLeftDownEvent& event )
|
||||
if ( !bar.IsFixed() )
|
||||
{
|
||||
int i;
|
||||
for( i = 0; i != BOXES_IN_HINT; ++i )
|
||||
for ( i = 0; i != BOXES_IN_HINT; ++i )
|
||||
{
|
||||
mBoxes[i]->OnLeftDown( inFrame );
|
||||
|
||||
@ -496,19 +498,19 @@ void cbBarHintsPlugin::OnLeftUp( cbLeftUpEvent& event )
|
||||
int result = HitTestHints( *mpClickedBar, event.mPos );
|
||||
|
||||
int i;
|
||||
for( i = 0; i != BOXES_IN_HINT; ++i )
|
||||
for ( i = 0; i != BOXES_IN_HINT; ++i )
|
||||
{
|
||||
mBoxes[i]->OnLeftUp( inFrame );
|
||||
|
||||
if ( mBoxes[i]->WasClicked() )
|
||||
{
|
||||
if ( i == 0 )
|
||||
|
||||
{
|
||||
mpLayout->SetBarState( mpClickedBar, wxCBAR_HIDDEN, TRUE );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( mpClickedBar->IsExpanded() )
|
||||
|
||||
mpPane->ContractBar( mpClickedBar );
|
||||
else
|
||||
mpPane->ExpandBar( mpClickedBar );
|
||||
@ -533,10 +535,11 @@ void cbBarHintsPlugin::OnMotion( cbMotionEvent& event )
|
||||
mpPane = event.mpPane;
|
||||
|
||||
int i;
|
||||
for( i = 0; i != BOXES_IN_HINT; ++i )
|
||||
|
||||
for ( i = 0; i != BOXES_IN_HINT; ++i )
|
||||
{
|
||||
mBoxes[i]->OnMotion( inFrame );
|
||||
}
|
||||
}
|
||||
else
|
||||
event.Skip();
|
||||
}
|
||||
@ -548,7 +551,7 @@ void cbBarHintsPlugin::OnInitPlugin()
|
||||
cbDockPane** panes = mpLayout->GetPanesArray();
|
||||
|
||||
int i;
|
||||
for( i = 0; i != MAX_PANES; ++i )
|
||||
for ( i = 0; i != MAX_PANES; ++i )
|
||||
{
|
||||
if ( panes[i]->MatchesMask( mPaneMask ) )
|
||||
{
|
||||
|
@ -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];
|
||||
@ -207,7 +208,7 @@ void cbGCUpdatesMgr::UpdateNow()
|
||||
|
||||
cbBarInfo* pCurBar = pRow->GetFirstBar();
|
||||
|
||||
while( pCurBar )
|
||||
while ( pCurBar )
|
||||
{
|
||||
if ( WasChanged( pCurBar->mUMgrData,
|
||||
pCurBar->mBoundsInParent ) )
|
||||
@ -226,7 +227,7 @@ void cbGCUpdatesMgr::UpdateNow()
|
||||
else
|
||||
if ( nBars != 0 )
|
||||
{
|
||||
for( int i = 0; i != nBars; ++i )
|
||||
for ( int i = 0; i != nBars; ++i )
|
||||
|
||||
// postphone the resizement and refreshing the changed
|
||||
// bar windows
|
||||
|
@ -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,27 +728,27 @@ 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;
|
||||
rowBounds.height += 2;
|
||||
|
||||
--rowBounds.x;
|
||||
rowBounds.width += 2;
|
||||
}
|
||||
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;
|
||||
|
||||
--rowBounds.y;
|
||||
rowBounds.height +=2;
|
||||
rowBounds.height += 2;
|
||||
}
|
||||
|
||||
//#define TEST_BK_ERASING
|
||||
@ -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,9 +129,8 @@ void cbRowLayoutPlugin::ExpandNotFixedBars( cbRowInfo* pRow )
|
||||
|
||||
double pcntSum = 0.0;
|
||||
|
||||
size_t i = 0;
|
||||
|
||||
for( i = 0; i != pRow->mBars.Count(); ++i )
|
||||
size_t i;
|
||||
for ( i = 0; i != pRow->mBars.Count(); ++i )
|
||||
{
|
||||
if ( !pRow->mBars[i]->IsFixed() )
|
||||
pcntSum += pRow->mBars[i]->mLenRatio;
|
||||
@ -141,7 +140,7 @@ void cbRowLayoutPlugin::ExpandNotFixedBars( cbRowInfo* pRow )
|
||||
|
||||
int curX = 0;
|
||||
|
||||
for( i = 0; i != pRow->mBars.Count(); ++i )
|
||||
for ( i = 0; i != pRow->mBars.Count(); ++i )
|
||||
{
|
||||
cbBarInfo& bar = *pRow->mBars[i];
|
||||
|
||||
@ -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
|
||||
|
||||
@ -173,7 +172,7 @@ void cbRowLayoutPlugin::AdjustLengthOfInserted( cbRowInfo* pRow, cbBarInfo* pThe
|
||||
int totalLen = 0;
|
||||
|
||||
size_t i;
|
||||
for( i = 0; i != pRow->mBars.Count(); ++i )
|
||||
for ( i = 0; i != pRow->mBars.Count(); ++i )
|
||||
{
|
||||
if ( !pRow->mBars[i]->IsFixed() )
|
||||
totalLen += pRow->mBars[i]->mBounds.width;
|
||||
@ -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 );
|
||||
@ -192,7 +190,7 @@ void cbRowLayoutPlugin::AdjustLengthOfInserted( cbRowInfo* pRow, cbBarInfo* pThe
|
||||
double pcntSum = 0.0;
|
||||
|
||||
size_t i;
|
||||
for( i = 0; i != pRow->mBars.Count(); ++i )
|
||||
for ( i = 0; i != pRow->mBars.Count(); ++i )
|
||||
{
|
||||
if ( !pRow->mBars[i]->IsFixed() )
|
||||
pcntSum += pRow->mBars[i]->mLenRatio;
|
||||
@ -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;
|
||||
@ -246,16 +243,15 @@ void cbRowLayoutPlugin::FitBarsToRange( int from, int till,
|
||||
|
||||
pBar = pFromBar;
|
||||
|
||||
while( pBar != pTillBar )
|
||||
while ( pBar != pTillBar )
|
||||
{
|
||||
if ( !pBar->IsFixed() )
|
||||
|
||||
{
|
||||
pBar->mBounds.width =
|
||||
|
||||
wxMax( mpPane->mProps.mMinCBarDim.x,
|
||||
int( double(freeSpc) * (pBar->mLenRatio/pcntSum) )
|
||||
);
|
||||
|
||||
}
|
||||
pBar = pBar->mpNext;
|
||||
}
|
||||
|
||||
@ -315,7 +311,7 @@ void cbRowLayoutPlugin::FitBarsToRange( int from, int till,
|
||||
void cbRowLayoutPlugin::MinimzeNotFixedBars( cbRowInfo* pRow, cbBarInfo* pBarToPreserve )
|
||||
{
|
||||
size_t i;
|
||||
for( i = 0; i != pRow->mBars.Count(); ++i )
|
||||
for ( i = 0; i != pRow->mBars.Count(); ++i )
|
||||
{
|
||||
if ( !pRow->mBars[i]->IsFixed() && pRow->mBars[i] != pBarToPreserve )
|
||||
pRow->mBars[i]->mBounds.width = mpPane->mProps.mMinCBarDim.x;
|
||||
@ -327,7 +323,7 @@ int cbRowLayoutPlugin::GetRowFreeSpace( cbRowInfo* pRow )
|
||||
int freeSpc = mpPane->mPaneWidth;
|
||||
|
||||
size_t i;
|
||||
for( i = 0; i != pRow->mBars.Count(); ++i )
|
||||
for ( i = 0; i != pRow->mBars.Count(); ++i )
|
||||
{
|
||||
// not-fixed bars variable length, thus their
|
||||
// dimensions are ignored
|
||||
@ -352,7 +348,7 @@ void cbRowLayoutPlugin::RecalcLengthRatios( cbRowInfo* pRow )
|
||||
int totalLen = 0;
|
||||
|
||||
size_t i;
|
||||
for( i = 0; i != pRow->mBars.Count(); ++i )
|
||||
for ( i = 0; i != pRow->mBars.Count(); ++i )
|
||||
{
|
||||
if ( !pRow->mBars[i]->IsFixed() )
|
||||
totalLen += pRow->mBars[i]->mBounds.width;
|
||||
@ -360,7 +356,7 @@ void cbRowLayoutPlugin::RecalcLengthRatios( cbRowInfo* pRow )
|
||||
#endif
|
||||
|
||||
size_t i;
|
||||
for( i = 0; i != pRow->mBars.Count(); ++i )
|
||||
for ( i = 0; i != pRow->mBars.Count(); ++i )
|
||||
{
|
||||
cbBarInfo& bar = *pRow->mBars[i];
|
||||
|
||||
@ -398,7 +394,7 @@ void cbRowLayoutPlugin::ApplyLengthRatios( cbRowInfo* pRow )
|
||||
// FOR NOW:: all-in-one
|
||||
|
||||
size_t i = 0;
|
||||
for( i = 0; i != pRow->mBars.Count(); ++i )
|
||||
for ( i = 0; i != pRow->mBars.Count(); ++i )
|
||||
{
|
||||
if ( !pRow->mBars[i]->IsFixed() )
|
||||
pcntSum += pRow->mBars[i]->mLenRatio;
|
||||
@ -441,7 +437,7 @@ void cbRowLayoutPlugin::ApplyLengthRatios( cbRowInfo* pRow )
|
||||
|
||||
bool haveSquished = FALSE;
|
||||
|
||||
for( i = 0; i != pRow->mBars.Count(); ++i )
|
||||
for ( i = 0; i != pRow->mBars.Count(); ++i )
|
||||
{
|
||||
if ( !pRow->mBars[i]->IsFixed() )
|
||||
{
|
||||
@ -461,10 +457,9 @@ void cbRowLayoutPlugin::ApplyLengthRatios( cbRowInfo* pRow )
|
||||
} // for
|
||||
|
||||
if ( haveSquished )
|
||||
|
||||
unit = freeSpc / pcntSum;
|
||||
|
||||
for( i = 0; i != pRow->mBars.Count(); ++i )
|
||||
for ( i = 0; i != pRow->mBars.Count(); ++i )
|
||||
{
|
||||
cbBarInfo& bar = *pRow->mBars[i];
|
||||
|
||||
@ -501,7 +496,7 @@ void cbRowLayoutPlugin::DetectBarHandles( cbRowInfo* pRow )
|
||||
bool foundNotFixed = FALSE;
|
||||
|
||||
size_t i;
|
||||
for( i = 0; i != pRow->mBars.Count(); ++i )
|
||||
for ( i = 0; i != pRow->mBars.Count(); ++i )
|
||||
{
|
||||
cbBarInfo& bar = *pRow->mBars[i];
|
||||
|
||||
@ -579,7 +574,7 @@ void cbRowLayoutPlugin::RelayoutNotFixedBarsAround( cbBarInfo* pTheBar, cbRowInf
|
||||
void cbRowLayoutPlugin::LayoutItemsVertically( cbRowInfo& row )
|
||||
{
|
||||
size_t i;
|
||||
for( i = 0; i != row.mBars.Count(); ++i )
|
||||
for ( i = 0; i != row.mBars.Count(); ++i )
|
||||
{
|
||||
cbBarInfo& bar = *row.mBars[i];
|
||||
|
||||
@ -601,7 +596,7 @@ int cbRowLayoutPlugin::CalcRowHeight( cbRowInfo& row )
|
||||
int maxHeight = 0;
|
||||
|
||||
size_t i;
|
||||
for( i = 0; i != row.mBars.Count(); ++i )
|
||||
for ( i = 0; i != row.mBars.Count(); ++i )
|
||||
|
||||
maxHeight = wxMax( maxHeight, row.mBars[i]->mBounds.height );
|
||||
|
||||
@ -813,7 +808,7 @@ void cbRowLayoutPlugin::DoInsertBar( cbBarInfo* pTheBar, cbRowInfo& row )
|
||||
} */
|
||||
|
||||
size_t i;
|
||||
for( i = 0; i != row.mBars.Count(); ++i )
|
||||
for ( i = 0; i != row.mBars.Count(); ++i )
|
||||
{
|
||||
cbBarInfo& bar = *row.mBars[i];
|
||||
|
||||
@ -1037,7 +1032,7 @@ void cbRowLayoutPlugin::OnLayoutRows( cbLayoutRowsEvent& event )
|
||||
// RowArrayT& arr = mpPane->GetRowList();
|
||||
|
||||
size_t i;
|
||||
for( i = 0; i != mpPane->GetRowList().Count(); ++i )
|
||||
for ( i = 0; i != mpPane->GetRowList().Count(); ++i )
|
||||
{
|
||||
cbRowInfo& row = *mpPane->GetRowList()[ i ];
|
||||
|
||||
|
@ -289,3 +289,4 @@ void cbSimpleUpdatesMgr::UpdateNow()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user