]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/fl/rowlayoutpl.cpp
Don't use a saved label size incase the size changes. Patch from Hong Yuan.
[wxWidgets.git] / contrib / src / fl / rowlayoutpl.cpp
index 92af22e8622c6195ab1239aebfe36f08b9241c31..1c78f4b5a27f1a885be3deb6cbbc78f258e174a7 100644 (file)
@@ -8,10 +8,6 @@
 // Copyright:   (c) Aleksandras Gluchovas
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 // Copyright:   (c) Aleksandras Gluchovas
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
-    #pragma implementation "rowlayoutpl.h"
-#endif
 
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
@@ -61,10 +57,10 @@ void cbRowLayoutPlugin::CheckIfAtTheBoundary( cbBarInfo* pTheBar, cbRowInfo& row
     // In this case we need to check if the pBarNode appears to be inserted
     // chain of fixed-bars on the very right or left side of the row,
     // then all the white-space, such chain should be eliminated,
     // In this case we need to check if the pBarNode appears to be inserted
     // chain of fixed-bars on the very right or left side of the row,
     // then all the white-space, such chain should be eliminated,
-    // and the resulting chain justified to the right or the left 
+    // and the resulting chain justified to the right or the left
     // side of the row
 
     // side of the row
 
-    if ( !pTheBar->IsFixed() || rowInfo.mHasOnlyFixedBars ) 
+    if ( !pTheBar->IsFixed() || rowInfo.mHasOnlyFixedBars )
 
         return;
 
 
         return;
 
@@ -76,7 +72,7 @@ void cbRowLayoutPlugin::CheckIfAtTheBoundary( cbBarInfo* pTheBar, cbRowInfo& row
 
     do
     {
 
     do
     {
-        if ( !pBar->IsFixed() ) 
+        if ( !pBar->IsFixed() )
             break;
 
         wxRect& bounds = pBar->mBounds;
             break;
 
         wxRect& bounds = pBar->mBounds;
@@ -91,15 +87,15 @@ void cbRowLayoutPlugin::CheckIfAtTheBoundary( cbBarInfo* pTheBar, cbRowInfo& row
     }
     while( 1 );
 
     }
     while( 1 );
 
-    // slide fixed bars to the left on the left side relative to the pBarNode   
+    // slide fixed bars to the left on the left side relative to the pBarNode
 
     pBar = rowInfo.mBars[0];
 
     prevX = 0;
 
     pBar = rowInfo.mBars[0];
 
     prevX = 0;
-    
+
     do
     {
     do
     {
-        if ( pBar->IsFixed() ) 
+        if ( pBar->IsFixed() )
 
             break;
 
 
             break;
 
@@ -120,9 +116,13 @@ void cbRowLayoutPlugin::ExpandNotFixedBars( cbRowInfo* pRow )
 {
     ApplyLengthRatios( pRow );
 
 {
     ApplyLengthRatios( pRow );
 
+    #if 1
+
    // FIXME:: something's wrong?
    return;
 
    // FIXME:: something's wrong?
    return;
 
+    #else
+
     double freeSpc = (double)GetRowFreeSpace( pRow );
 
     // calculate sum of precents
     double freeSpc = (double)GetRowFreeSpace( pRow );
 
     // calculate sum of precents
@@ -148,22 +148,26 @@ void cbRowLayoutPlugin::ExpandNotFixedBars( cbRowInfo* pRow )
         {
             bar.mLenRatio = bar.mLenRatio/(pcntSum);
 
         {
             bar.mLenRatio = bar.mLenRatio/(pcntSum);
 
-            bar.mBounds.width = 
-                
+            bar.mBounds.width =
+
                 wxMax( mpPane->mProps.mMinCBarDim.x, int( freeSpc*bar.mLenRatio ) );
         }
                 wxMax( mpPane->mProps.mMinCBarDim.x, int( freeSpc*bar.mLenRatio ) );
         }
-        
+
         bar.mBounds.x = curX;
         curX = bar.mBounds.x + bar.mBounds.width;
     }
         bar.mBounds.x = curX;
         curX = bar.mBounds.x + bar.mBounds.width;
     }
+    #endif
 }
 
 }
 
-void cbRowLayoutPlugin::AdjustLengthOfInserted( cbRowInfo* pRow, cbBarInfo* pTheBar )
+void cbRowLayoutPlugin::AdjustLengthOfInserted( cbRowInfo* WXUNUSED(pRow), cbBarInfo* WXUNUSED(pTheBar) )
 {
 {
-    return;  // TBD: Makes following code unreachable
+    return;
 
 
-    // pTheBar is not-fixed
+#if 0
+
+    // TBD: Makes following code unreachable
 
 
+    // pTheBar is not-fixed
 
     // FIXME:: what is this for??
 
 
     // FIXME:: what is this for??
 
@@ -203,13 +207,16 @@ void cbRowLayoutPlugin::AdjustLengthOfInserted( cbRowInfo* pRow, cbBarInfo* pThe
 
         pTheBar->mBounds.width = freeSpc * (1.0 - pcntSum);
 #endif
 
         pTheBar->mBounds.width = freeSpc * (1.0 - pcntSum);
 #endif
+
+#endif
+
 }
 
 void cbRowLayoutPlugin::FitBarsToRange( int from, int till,
                                         cbBarInfo* pTheBar, cbRowInfo* pRow )
 {
 }
 
 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 )
     {
 
     if ( pTheBar->mBounds.x > from )
     {
@@ -249,7 +256,7 @@ void cbRowLayoutPlugin::FitBarsToRange( int from, int till,
       {
             pBar->mBounds.width =
                 wxMax( mpPane->mProps.mMinCBarDim.x,
       {
             pBar->mBounds.width =
                 wxMax( mpPane->mProps.mMinCBarDim.x,
-                       int( double(freeSpc) * (pBar->mLenRatio/pcntSum) )
+                       (int)( ((double)freeSpc) * (pBar->mLenRatio/pcntSum) )
                      );
       }
         pBar = pBar->mpNext;
                      );
       }
         pBar = pBar->mpNext;
@@ -259,7 +266,7 @@ void cbRowLayoutPlugin::FitBarsToRange( int from, int till,
 
     pBar      = pFromBar;
     int prevX = from;
 
     pBar      = pFromBar;
     int prevX = from;
-    bool hasNotFixedBars = FALSE;
+    bool hasNotFixedBars = false;
 
     while ( pBar != pTillBar )
     {
 
     while ( pBar != pTillBar )
     {
@@ -267,7 +274,7 @@ void cbRowLayoutPlugin::FitBarsToRange( int from, int till,
 
         if ( !pBar->IsFixed() )
         {
 
         if ( !pBar->IsFixed() )
         {
-            hasNotFixedBars = TRUE;
+            hasNotFixedBars = true;
 
             freeSpc -= bounds.width;
         }
 
             freeSpc -= bounds.width;
         }
@@ -275,7 +282,7 @@ void cbRowLayoutPlugin::FitBarsToRange( int from, int till,
         bounds.x = prevX;
 
         prevX = bounds.x + bounds.width;
         bounds.x = prevX;
 
         prevX = bounds.x + bounds.width;
-        
+
         pBar = pBar->mpNext;
     }
 
         pBar = pBar->mpNext;
     }
 
@@ -378,10 +385,10 @@ void cbRowLayoutPlugin::RecalcLengthRatios( cbRowInfo* pRow )
     // attach remainder (the result of lost precision) to the
     // last not-fixed bar
 
     // attach remainder (the result of lost precision) to the
     // last not-fixed bar
 
-#if !defined(__EXPERIMENTAL)    
+#if !defined(__EXPERIMENTAL)
 
     if ( pLastNotFixed )
 
     if ( pLastNotFixed )
-        
+
         pLastNotFixed->mLenRatio += pcntLeft;
 #endif
 
         pLastNotFixed->mLenRatio += pcntLeft;
 #endif
 
@@ -389,11 +396,11 @@ void cbRowLayoutPlugin::RecalcLengthRatios( cbRowInfo* pRow )
 
 void cbRowLayoutPlugin::ApplyLengthRatios( cbRowInfo* pRow )
 {
 
 void cbRowLayoutPlugin::ApplyLengthRatios( cbRowInfo* pRow )
 {
+    size_t i;
     double pcntSum = 0;
 
     // FOR NOW:: all-in-one
 
     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() )
     for ( i = 0; i != pRow->mBars.Count(); ++i )
     {
         if ( !pRow->mBars[i]->IsFixed() )
@@ -402,13 +409,13 @@ void cbRowLayoutPlugin::ApplyLengthRatios( cbRowInfo* pRow )
 
     /*
     pBar = node_to_first_bar_node( pRow );
 
     /*
     pBar = node_to_first_bar_node( pRow );
-    
+
     while( pBar )
     {
         cbBarInfo& bar = node_to_bar( pBar );
 
         if ( !bar.IsFixed() )
     while( pBar )
     {
         cbBarInfo& bar = node_to_bar( pBar );
 
         if ( !bar.IsFixed() )
-        
+
             bar.mLenRatio = pcntSum / bar.mLenRatio;
 
         pBar = pBar->Next();
             bar.mLenRatio = pcntSum / bar.mLenRatio;
 
         pBar = pBar->Next();
@@ -426,10 +433,10 @@ void cbRowLayoutPlugin::ApplyLengthRatios( cbRowInfo* pRow )
     // is returned right back to the row - so that it would retain
     // it's original dimensions in this row (this is kind of AI...)
     //
     // is returned right back to the row - so that it would retain
     // it's original dimensions in this row (this is kind of AI...)
     //
-    // The problem is - when it's remvoed, the sum of 
+    // The problem is - when it's remvoed, the sum of
     // mLenRatio's is not in "balance", i.e. is < 1.0,
     // it's possible to restore balance, but instead of that
     // mLenRatio's is not in "balance", i.e. is < 1.0,
     // it's possible to restore balance, but instead of that
-    // we artifically ajdust freeSpc value in a way that it would 
+    // we artifically ajdust freeSpc value in a way that it would
     // look like total of mLetRatio's is 1.0, thus original
     // len. ratios are _preserved_:
 
     // look like total of mLetRatio's is 1.0, thus original
     // len. ratios are _preserved_:
 
@@ -438,17 +445,17 @@ void cbRowLayoutPlugin::ApplyLengthRatios( cbRowInfo* pRow )
 
     double unit = freeSpc / pcntSum;
 
 
     double unit = freeSpc / pcntSum;
 
-    bool haveSquished = FALSE;
+    bool haveSquished = false;
 
     for ( i = 0; i != pRow->mBars.Count(); ++i )
     {
         if ( !pRow->mBars[i]->IsFixed() )
         {
 
     for ( i = 0; i != pRow->mBars.Count(); ++i )
     {
         if ( !pRow->mBars[i]->IsFixed() )
         {
-            cbBarInfo& bar = *pRow->mBars[i];   
-            
+            cbBarInfo& bar = *pRow->mBars[i];
+
             if ( int( unit * bar.mLenRatio ) < mpPane->mProps.mMinCBarDim.x )
             {
             if ( int( unit * bar.mLenRatio ) < mpPane->mProps.mMinCBarDim.x )
             {
-                haveSquished = TRUE;
+                haveSquished = true;
 
                 bar.mBounds.width = -1; // mark as "squished"
 
 
                 bar.mBounds.width = -1; // mark as "squished"
 
@@ -476,8 +483,8 @@ void cbRowLayoutPlugin::ApplyLengthRatios( cbRowInfo* pRow )
             else
                 bar.mBounds.width = int( unit * bar.mLenRatio );
 
             else
                 bar.mBounds.width = int( unit * bar.mLenRatio );
 
-            // a little bit of AI: 
-            // memorize bar's height and width, when docked in 
+            // a little bit of AI:
+            // memorize bar's height and width, when docked in
             // the current orientation - by making the current
             // dimensions to be "preffered" ones for this docking state
 
             // the current orientation - by making the current
             // dimensions to be "preffered" ones for this docking state
 
@@ -496,37 +503,37 @@ void cbRowLayoutPlugin::DetectBarHandles( cbRowInfo* pRow )
 {
     // first pass from left to right (detect left-side handles)
 
 {
     // 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];
 
     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 ( foundNotFixed )
 
         if ( !bar.IsFixed() )
         {
             if ( foundNotFixed )
-        
+
                 if ( bar.mpPrev &&
                      bar.mpPrev->IsFixed() )
                 if ( bar.mpPrev &&
                      bar.mpPrev->IsFixed() )
-                
-                    bar.mHasLeftHandle = TRUE;
 
 
-            foundNotFixed = TRUE;
+                    bar.mHasLeftHandle = true;
+
+            foundNotFixed = true;
         }
     }
 
     // pass from right to left (detect right-side handles)
 
         }
     }
 
     // pass from right to left (detect right-side handles)
 
-    foundNotFixed = FALSE;
+    foundNotFixed = false;
 
     cbBarInfo* pBar = pRow->mBars[ pRow->mBars.Count() - 1 ];
 
     while( pBar )
     {
 
     cbBarInfo* pBar = pRow->mBars[ pRow->mBars.Count() - 1 ];
 
     while( pBar )
     {
-        pBar->mHasRightHandle = FALSE;
+        pBar->mHasRightHandle = false;
 
         if ( !pBar->IsFixed() )
         {
 
         if ( !pBar->IsFixed() )
         {
@@ -534,9 +541,9 @@ void cbRowLayoutPlugin::DetectBarHandles( cbRowInfo* pRow )
 
                 if ( pBar->mpNext )
 
 
                 if ( pBar->mpNext )
 
-                     pBar->mHasRightHandle = TRUE;
+                     pBar->mHasRightHandle = true;
 
 
-            foundNotFixed = TRUE;
+            foundNotFixed = true;
         }
 
         pBar = pBar->mpPrev;
         }
 
         pBar = pBar->mpPrev;
@@ -549,7 +556,7 @@ void cbRowLayoutPlugin::RelayoutNotFixedBarsAround( cbBarInfo* pTheBar, cbRowInf
     {
         if (  !pTheBar->IsFixed() )
         {
     {
         if (  !pTheBar->IsFixed() )
         {
-            // this bar the first in the row, move it's 
+            // this bar the first in the row, move it's
             // left edge to the very left
             pTheBar->mBounds.width += pTheBar->mBounds.x;
             pTheBar->mBounds.x      = 0;
             // left edge to the very left
             pTheBar->mBounds.width += pTheBar->mBounds.x;
             pTheBar->mBounds.x      = 0;
@@ -562,7 +569,7 @@ void cbRowLayoutPlugin::RelayoutNotFixedBarsAround( cbBarInfo* pTheBar, cbRowInf
     {
         if ( !pTheBar->IsFixed() )
         {
     {
         if ( !pTheBar->IsFixed() )
         {
-            // this bar is the last one, move it's 
+            // this bar is the last one, move it's
             // right edge to the very right
 
             pTheBar->mBounds.width = mpPane->mPaneWidth - pTheBar->mBounds.x;
             // right edge to the very right
 
             pTheBar->mBounds.width = mpPane->mPaneWidth - pTheBar->mBounds.x;
@@ -600,7 +607,7 @@ int cbRowLayoutPlugin::CalcRowHeight( cbRowInfo& row )
 
     size_t i;
     for ( i = 0; i != row.mBars.Count(); ++i )
 
     size_t i;
     for ( i = 0; i != row.mBars.Count(); ++i )
-    
+
         maxHeight = wxMax( maxHeight, row.mBars[i]->mBounds.height );
 
     return maxHeight;
         maxHeight = wxMax( maxHeight, row.mBars[i]->mBounds.height );
 
     return maxHeight;
@@ -667,7 +674,7 @@ void cbRowLayoutPlugin::SlideRightSideBars( cbBarInfo* pTheBar )
     }
 }
 
     }
 }
 
-void cbRowLayoutPlugin::ShiftLeftTrashold( cbBarInfo* pTheBar, cbRowInfo& row )
+void cbRowLayoutPlugin::ShiftLeftTrashold( cbBarInfo* WXUNUSED(pTheBar), cbRowInfo& row )
 {
     wxRect& first = row.mBars[0]->mBounds;
 
 {
     wxRect& first = row.mBars[0]->mBounds;
 
@@ -767,8 +774,8 @@ void cbRowLayoutPlugin::ShiftRightTrashold( cbBarInfo* pTheBar, cbRowInfo& row )
                 }
             }
 
                 }
             }
 
-            int leftShift = ( rightOverflow > leftFreeSpc ) 
-                            ? leftFreeSpc 
+            int leftShift = ( rightOverflow > leftFreeSpc )
+                            ? leftFreeSpc
                             : rightOverflow;
 
             theBar.x -= leftShift;
                             : rightOverflow;
 
             theBar.x -= leftShift;
@@ -785,7 +792,7 @@ void cbRowLayoutPlugin::ShiftRightTrashold( cbBarInfo* pTheBar, cbRowInfo& row )
     } while(1);
 }
 
     } while(1);
 }
 
-void cbRowLayoutPlugin::InsertBefore( cbBarInfo* pBeforeBar, 
+void cbRowLayoutPlugin::InsertBefore( cbBarInfo* pBeforeBar,
                                       cbBarInfo* pTheBar,
                                       cbRowInfo& row        )
 {
                                       cbBarInfo* pTheBar,
                                       cbRowInfo& row        )
 {
@@ -823,7 +830,7 @@ void cbRowLayoutPlugin::DoInsertBar( cbBarInfo* pTheBar, cbRowInfo& row )
             InsertBefore( &bar, pTheBar, row );
             return;
         }
             InsertBefore( &bar, pTheBar, row );
             return;
         }
-        
+
         else
         // if bar hits the right edge
         if ( theBar.x <= cur.x + cur.width )
         else
         // if bar hits the right edge
         if ( theBar.x <= cur.x + cur.width )
@@ -915,14 +922,14 @@ void cbRowLayoutPlugin::OnInsertBar( cbInsertBarEvent& event )
 
         DetectBarHandles( pIntoRow );
 
 
         DetectBarHandles( pIntoRow );
 
-        // do proportional resizing of not-fixed bars 
+        // do proportional resizing of not-fixed bars
         ApplyLengthRatios( pIntoRow );
     }
 
     // adjust the bar's docking state
 
         ApplyLengthRatios( pIntoRow );
     }
 
     // adjust the bar's docking state
 
-    // a little bit of AI: 
-    // memorize bar's height and width, when docked in 
+    // a little bit of AI:
+    // memorize bar's height and width, when docked in
     // the current orientation - by making the current
     // dimensions to be "preferred" ones for this docking state
 
     // the current orientation - by making the current
     // dimensions to be "preferred" ones for this docking state
 
@@ -951,8 +958,8 @@ void cbRowLayoutPlugin::OnRemoveBar ( cbRemoveBarEvent& event )
 
     // rest bar information after removing it from the row
     pBar->mpRow           = NULL;
 
     // 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
 
 
     mpPane->InitLinksForRow( pRow ); // relink "mpNext/mpPrev"s
 
@@ -971,7 +978,7 @@ void cbRowLayoutPlugin::OnRemoveBar ( cbRemoveBarEvent& event )
         // force repainting of bars, in the row, from which the bar was removed
 
         // FIXME:: really needed?
         // 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 );
 
         // re-setup mHasOnlyFixedBars flag for the row information
         event.mpPane->SyncRowFlags( pRow );
@@ -993,7 +1000,7 @@ void cbRowLayoutPlugin::OnLayoutRow( cbLayoutRowEvent& event )
 
     if ( !pRow->mHasOnlyFixedBars )
     {
 
     if ( !pRow->mHasOnlyFixedBars )
     {
-        // do proportional resizing of not-fixed bars 
+        // do proportional resizing of not-fixed bars
         ApplyLengthRatios( pRow );
     }
 
         ApplyLengthRatios( pRow );
     }
 
@@ -1040,7 +1047,7 @@ void cbRowLayoutPlugin::OnLayoutRows( cbLayoutRowsEvent& event )
         cbRowInfo& row = *mpPane->GetRowList()[ i ];
         //mpPane->CalcLengthRatios(& row);
 
         cbRowInfo& row = *mpPane->GetRowList()[ i ];
         //mpPane->CalcLengthRatios(& row);
 
-        // setup "has-handle" flags for rows, which depend on the existance 
+        // setup "has-handle" flags for rows, which depend on the existence
         // of not-fixed bars in the row
 
         if ( !row.mHasOnlyFixedBars )
         // of not-fixed bars in the row
 
         if ( !row.mHasOnlyFixedBars )
@@ -1048,22 +1055,22 @@ void cbRowLayoutPlugin::OnLayoutRows( cbLayoutRowsEvent& event )
             if ( mpPane->mAlignment == FL_ALIGN_TOP ||
                  mpPane->mAlignment == FL_ALIGN_LEFT   )
             {
             if ( mpPane->mAlignment == FL_ALIGN_TOP ||
                  mpPane->mAlignment == FL_ALIGN_LEFT   )
             {
-                row.mHasLowerHandle = TRUE;
+                row.mHasLowerHandle = true;
 
 
-                row.mHasUpperHandle = FALSE; 
+                row.mHasUpperHandle = false;
             }
             else
             {
             }
             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
             }
         }
         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
         }
 
         // setup vertical positions for items in the row
@@ -1098,8 +1105,6 @@ void cbRowLayoutPlugin::OnResizeRow( cbResizeRowEvent& event )
     // FIXME:: Next line not used.
     //int     newHeight      = pTheRow->mRowHeight;
 
     // FIXME:: Next line not used.
     //int     newHeight      = pTheRow->mRowHeight;
 
-    int     freeSpc        = 0;
-
     if ( forUpperHandle )
     {
         // calculate available free space from above,
     if ( forUpperHandle )
     {
         // calculate available free space from above,
@@ -1107,10 +1112,8 @@ void cbRowLayoutPlugin::OnResizeRow( cbResizeRowEvent& event )
 
         cbRowInfo* pRow = pTheRow->mpPrev;
 
 
         cbRowInfo* pRow = pTheRow->mpPrev;
 
-        while( pRow ) 
+        while( pRow )
         {
         {
-            freeSpc += pRow->mRowHeight - event.mpPane->GetMinimalRowHeight( pRow );
-
             pRow = pRow->mpPrev;
         }
     }
             pRow = pRow->mpPrev;
         }
     }
@@ -1121,10 +1124,8 @@ void cbRowLayoutPlugin::OnResizeRow( cbResizeRowEvent& event )
 
         cbRowInfo* pRow = pTheRow->mpNext;
 
 
         cbRowInfo* pRow = pTheRow->mpNext;
 
-        while( pRow ) 
+        while( pRow )
         {
         {
-            freeSpc += pRow->mRowHeight - mpPane->GetMinimalRowHeight( pRow );
-
             pRow = pRow->mpNext;
         }
     }
             pRow = pRow->mpNext;
         }
     }
@@ -1157,7 +1158,7 @@ void cbRowLayoutPlugin::OnResizeRow( cbResizeRowEvent& event )
             {
                 int prevHeight = pRow->mRowHeight;
 
             {
                 int prevHeight = pRow->mRowHeight;
 
-                int newHeight  = wxMax( event.mpPane->GetMinimalRowHeight( pRow ), 
+                int newHeight  = wxMax( event.mpPane->GetMinimalRowHeight( pRow ),
                                         prevHeight - needed );
 
                 if ( newHeight != prevHeight )
                                         prevHeight - needed );
 
                 if ( newHeight != prevHeight )
@@ -1190,7 +1191,7 @@ void cbRowLayoutPlugin::OnResizeRow( cbResizeRowEvent& event )
             {
                 int prevHeight = pRow->mRowHeight;
 
             {
                 int prevHeight = pRow->mRowHeight;
 
-                int newHeight  = wxMax( event.mpPane->GetMinimalRowHeight( pRow ), 
+                int newHeight  = wxMax( event.mpPane->GetMinimalRowHeight( pRow ),
                                         prevHeight - needed );
 
                 if ( newHeight != prevHeight )
                                         prevHeight - needed );
 
                 if ( newHeight != prevHeight )
@@ -1206,12 +1207,12 @@ void cbRowLayoutPlugin::OnResizeRow( cbResizeRowEvent& event )
     }
 
     if ( forUpperHandle )
     }
 
     if ( forUpperHandle )
-    
+
         event.mpPane->SetRowHeight( pTheRow, pTheRow->mRowHeight + (-ofs) );
     else
         event.mpPane->SetRowHeight( pTheRow, pTheRow->mRowHeight +   ofs  );
 
         event.mpPane->SetRowHeight( pTheRow, pTheRow->mRowHeight + (-ofs) );
     else
         event.mpPane->SetRowHeight( pTheRow, pTheRow->mRowHeight +   ofs  );
 
-    mpLayout->RecalcLayout(FALSE);
+    mpLayout->RecalcLayout(false);
 
     mpLayout->GetUpdatesManager().OnFinishChanges();
     mpLayout->GetUpdatesManager().UpdateNow();
 
     mpLayout->GetUpdatesManager().OnFinishChanges();
     mpLayout->GetUpdatesManager().UpdateNow();