void cbRowLayoutPlugin::FitBarsToRange( int from, int till,
cbBarInfo* pTheBar, cbRowInfo* pRow )
{
- cbBarInfo* pFromBar = NULL;
- cbBarInfo* pTillBar = NULL;
+ cbBarInfo* pFromBar;
+ cbBarInfo* pTillBar;
if ( pTheBar->mBounds.x > from )
{
{
pBar->mBounds.width =
wxMax( mpPane->mProps.mMinCBarDim.x,
- int( double(freeSpc) * (pBar->mLenRatio/pcntSum) )
+ (int)( double(freeSpc) * (pBar->mLenRatio/pcntSum) )
);
}
pBar = pBar->mpNext;
pBar = pFromBar;
int prevX = from;
- bool hasNotFixedBars = FALSE;
+ bool hasNotFixedBars = false;
while ( pBar != pTillBar )
{
if ( !pBar->IsFixed() )
{
- hasNotFixedBars = TRUE;
+ hasNotFixedBars = true;
freeSpc -= bounds.width;
}
void cbRowLayoutPlugin::ApplyLengthRatios( cbRowInfo* pRow )
{
+ size_t i;
double pcntSum = 0;
// FOR NOW:: all-in-one
- size_t i = 0;
for ( i = 0; i != pRow->mBars.Count(); ++i )
{
if ( !pRow->mBars[i]->IsFixed() )
double unit = freeSpc / pcntSum;
- bool haveSquished = FALSE;
+ bool haveSquished = false;
for ( i = 0; i != pRow->mBars.Count(); ++i )
{
if ( int( unit * bar.mLenRatio ) < mpPane->mProps.mMinCBarDim.x )
{
- haveSquished = TRUE;
+ haveSquished = true;
bar.mBounds.width = -1; // mark as "squished"
{
// first pass from left to right (detect left-side handles)
- bool foundNotFixed = FALSE;
+ bool foundNotFixed = false;
size_t i;
for ( i = 0; i != pRow->mBars.Count(); ++i )
{
cbBarInfo& bar = *pRow->mBars[i];
- bar.mHasLeftHandle = FALSE;
+ bar.mHasLeftHandle = false;
if ( !bar.IsFixed() )
{
if ( bar.mpPrev &&
bar.mpPrev->IsFixed() )
- bar.mHasLeftHandle = TRUE;
+ bar.mHasLeftHandle = true;
- foundNotFixed = TRUE;
+ foundNotFixed = true;
}
}
// pass from right to left (detect right-side handles)
- foundNotFixed = FALSE;
+ foundNotFixed = false;
cbBarInfo* pBar = pRow->mBars[ pRow->mBars.Count() - 1 ];
while( pBar )
{
- pBar->mHasRightHandle = FALSE;
+ pBar->mHasRightHandle = false;
if ( !pBar->IsFixed() )
{
if ( pBar->mpNext )
- pBar->mHasRightHandle = TRUE;
+ pBar->mHasRightHandle = true;
- foundNotFixed = TRUE;
+ foundNotFixed = true;
}
pBar = pBar->mpPrev;
// rest bar information after removing it from the row
pBar->mpRow = NULL;
- pBar->mHasLeftHandle = FALSE;
- pBar->mHasRightHandle = FALSE;
+ pBar->mHasLeftHandle = false;
+ pBar->mHasRightHandle = false;
mpPane->InitLinksForRow( pRow ); // relink "mpNext/mpPrev"s
// force repainting of bars, in the row, from which the bar was removed
// FIXME:: really needed?
- pRow->mBars[0]->mUMgrData.SetDirty(TRUE);
+ pRow->mBars[0]->mUMgrData.SetDirty(true);
// re-setup mHasOnlyFixedBars flag for the row information
event.mpPane->SyncRowFlags( pRow );
if ( mpPane->mAlignment == FL_ALIGN_TOP ||
mpPane->mAlignment == FL_ALIGN_LEFT )
{
- row.mHasLowerHandle = TRUE;
+ row.mHasLowerHandle = true;
- row.mHasUpperHandle = FALSE;
+ row.mHasUpperHandle = false;
}
else
{
- row.mHasUpperHandle = TRUE;
+ row.mHasUpperHandle = true;
- row.mHasLowerHandle = FALSE;
+ row.mHasLowerHandle = false;
}
}
else
{
// otherwise, rows with fixed-bars only, have no height-resizing handles
- row.mHasUpperHandle = FALSE;
- row.mHasLowerHandle = FALSE;
+ row.mHasUpperHandle = false;
+ row.mHasLowerHandle = false;
}
// setup vertical positions for items in the row
// FIXME:: Next line not used.
//int newHeight = pTheRow->mRowHeight;
- int freeSpc = 0;
-
if ( forUpperHandle )
{
// calculate available free space from above,
while( pRow )
{
- freeSpc += pRow->mRowHeight - event.mpPane->GetMinimalRowHeight( pRow );
-
pRow = pRow->mpPrev;
}
}
while( pRow )
{
- freeSpc += pRow->mRowHeight - mpPane->GetMinimalRowHeight( pRow );
-
pRow = pRow->mpNext;
}
}
else
event.mpPane->SetRowHeight( pTheRow, pTheRow->mRowHeight + ofs );
- mpLayout->RecalcLayout(FALSE);
+ mpLayout->RecalcLayout(false);
mpLayout->GetUpdatesManager().OnFinishChanges();
mpLayout->GetUpdatesManager().UpdateNow();