/////////////////////////////////////////////////////////////////////////////
-// Name: No names yet.
-// Purpose: Contrib. demo
+// Name: rowlayoutpl.cpp
+// Purpose: cbRowLayoutPlugin implementation.
// Author: Aleksandras Gluchovas
// Modified by:
// Created: 09/09/98
// RCS-ID: $Id$
// Copyright: (c) Aleksandras Gluchovas
-// Licence: wxWindows license
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
{
ApplyLengthRatios( pRow );
+ #if 1
+
// FIXME:: something's wrong?
return;
+ #else
+
double freeSpc = (double)GetRowFreeSpace( pRow );
// calculate sum of precents
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??
pTheBar->mBounds.width = freeSpc * (1.0 - pcntSum);
#endif
+
+#endif
+
}
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 )
{
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() )
// look like total of mLetRatio's is 1.0, thus original
// len. ratios are _preserved_:
+ if (pcntSum == 0.0)
+ pcntSum = 1.0;
+
double unit = freeSpc / pcntSum;
bool haveSquished = FALSE;
}
}
-void cbRowLayoutPlugin::ShiftLeftTrashold( cbBarInfo* pTheBar, cbRowInfo& row )
+void cbRowLayoutPlugin::ShiftLeftTrashold( cbBarInfo* WXUNUSED(pTheBar), cbRowInfo& row )
{
wxRect& first = row.mBars[0]->mBounds;
for ( i = 0; i != mpPane->GetRowList().Count(); ++i )
{
cbRowInfo& row = *mpPane->GetRowList()[ i ];
+ //mpPane->CalcLengthRatios(& row);
// setup "has-handle" flags for rows, which depend on the existance
// of not-fixed bars 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;
}
}