- cbBarInfo* pFromBar = NULL;
- cbBarInfo* pTillBar = NULL;
-
- if ( pTheBar->mBounds.x > from )
- {
- // it's range from the left
- pFromBar = pRow->mBars[0];
- pTillBar = pTheBar;
- }
- else
- {
- pFromBar = pTheBar->mpNext;
- pTillBar = NULL;
- }
-
- // calc free space in the range
-
- cbBarInfo* pBar = pFromBar;
- int freeSpc = till-from;
- double pcntSum = 0;
-
- while( pBar != pTillBar )
- {
- if ( pBar->IsFixed() )
-
- freeSpc -= pBar->mBounds.width;
- else
- pcntSum += pBar->mLenRatio;
-
- pBar = pBar->mpNext;
- }
-
- // adjust not-fixed bar sizes in the range
-
- pBar = pFromBar;
-
- while( pBar != pTillBar )
- {
- if ( !pBar->IsFixed() )
-
- pBar->mBounds.width =
-
- wxMax( mpPane->mProps.mMinCBarDim.x,
- int( double(freeSpc) * (pBar->mLenRatio/pcntSum) )
- );
-
- pBar = pBar->mpNext;
- }
-
- // layout range, starting from the left-most bar
-
- pBar = pFromBar;
- int prevX = from;
- bool hasNotFixedBars = FALSE;
-
- while ( pBar != pTillBar )
- {
- wxRect& bounds = pBar->mBounds;
-
- if ( !pBar->IsFixed() )
- {
- hasNotFixedBars = TRUE;
-
- freeSpc -= bounds.width;
- }
-
- bounds.x = prevX;
-
- prevX = bounds.x + bounds.width;
-
- pBar = pBar->mpNext;
- }
-
- // make width adjustment for the right-most bar in the range, due to
- // lost precision when seting widths using f.p. length-ratios
-
- if ( hasNotFixedBars )
- {
- if ( pTheBar->mBounds.x > from )
- {
- if ( pTillBar->mpPrev )
- {
- wxRect& tillBar = pTillBar->mpPrev->mBounds;
-
- //tillBar.width = bar.mBounds.x - tillBar.x;
- tillBar.width += freeSpc;
- }
- }
- else
- {
- cbBarInfo* pLast = pRow->mBars[ pRow->mBars.Count() - 1 ];
-
- if ( pLast != pTheBar )
- {
- pTheBar->mBounds.width += freeSpc;
-
- SlideRightSideBars( pTheBar );
- }
- }
- }
+ cbBarInfo* pFromBar;
+ cbBarInfo* pTillBar;
+
+ if ( pTheBar->mBounds.x > from )
+ {
+ // it's range from the left
+ pFromBar = pRow->mBars[0];
+ pTillBar = pTheBar;
+ }
+ else
+ {
+ pFromBar = pTheBar->mpNext;
+ pTillBar = NULL;
+ }
+
+ // calc free space in the range
+
+ cbBarInfo* pBar = pFromBar;
+ int freeSpc = till-from;
+ double pcntSum = 0;
+
+ while( pBar != pTillBar )
+ {
+ if ( pBar->IsFixed() )
+ freeSpc -= pBar->mBounds.width;
+ else
+ pcntSum += pBar->mLenRatio;
+
+ pBar = pBar->mpNext;
+ }
+
+ // adjust not-fixed bar sizes in the range
+
+ pBar = pFromBar;
+
+ while ( pBar != pTillBar )
+ {
+ if ( !pBar->IsFixed() )
+ {
+ pBar->mBounds.width =
+ wxMax( mpPane->mProps.mMinCBarDim.x,
+ (int)( ((double)freeSpc) * (pBar->mLenRatio/pcntSum) )
+ );
+ }
+ pBar = pBar->mpNext;
+ }
+
+ // layout range, starting from the left-most bar
+
+ pBar = pFromBar;
+ int prevX = from;
+ bool hasNotFixedBars = false;
+
+ while ( pBar != pTillBar )
+ {
+ wxRect& bounds = pBar->mBounds;
+
+ if ( !pBar->IsFixed() )
+ {
+ hasNotFixedBars = true;
+
+ freeSpc -= bounds.width;
+ }
+
+ bounds.x = prevX;
+
+ prevX = bounds.x + bounds.width;
+
+ pBar = pBar->mpNext;
+ }
+
+ // make width adjustment for the right-most bar in the range, due to
+ // lost precision when seting widths using f.p. length-ratios
+
+ if ( hasNotFixedBars )
+ {
+ if ( pTheBar->mBounds.x > from )
+ {
+ if ( pTillBar->mpPrev )
+ {
+ wxRect& tillBar = pTillBar->mpPrev->mBounds;
+
+ //tillBar.width = bar.mBounds.x - tillBar.x;
+ tillBar.width += freeSpc;
+ }
+ }
+ else
+ {
+ cbBarInfo* pLast = pRow->mBars[ pRow->mBars.Count() - 1 ];
+
+ if ( pLast != pTheBar )
+ {
+ pTheBar->mBounds.width += freeSpc;
+
+ SlideRightSideBars( pTheBar );
+ }
+ }
+ }