+ if ( !info.mIsSeparator )
+ {
+ // center real rectangle within the rectangle
+ // provided by the layout manager
+
+ int x = info.mRect.x;
+ int y = info.mRect.y + (info.mRect.height - info.mRealSize.y)/2;
+
+ // FOR NOW FOR NOW:: quick & dirty fix
+ if ( info.mpToolWnd->IsKindOf( CLASSINFO( wxChoice ) ) )
+ {
+ info.mpToolWnd->SetSize( x, y,
+ info.mRealSize.x - 3,
+ info.mRealSize.y);
+ }
+ else
+ {
+ info.mpToolWnd->SetSize( x, y,
+ info.mRealSize.x,
+ info.mRealSize.y );
+ }
+ }
+ else
+ {
+ // We performer this code here, so we only execute it when we have
+ // separators and we do it only once (all to do with performance...)
+ if (!bStateCheckDone)
+ {
+ bStateCheckDone = TRUE;
+
+ size_t j;
+ wxDynToolInfo *pInfo = NULL;
+ wxDynToolInfo *pPrevInfo = NULL;
+ int nVertSeparators = 0;
+
+ for( j = 0; j != mTools.Count(); ++j )
+ {
+ pInfo = mTools[j];
+
+ // Count all Vert Separators.
+ if ( pInfo->mIsSeparator )
+ nVertSeparators++;
+
+ // Check if the new row starts with a Separator.
+ if ( pPrevInfo && pInfo->mIsSeparator &&
+ // pPrevInfo->mRect.x >= pInfo->mRect.x &&
+ pPrevInfo->mRect.y < pInfo->mRect.y)
+ {
+ // If the Separator is shown on the next row and it's
+ // the only object on the row it would mean that the
+ // Separator should be shown as Horizontal one.
+ if (j+1 != mTools.Count())
+ {
+ if (pInfo->mRect.y < mTools[j+1]->mRect.y)
+ nVertSeparators--;
+ }
+ else
+ {
+ nVertSeparators--;
+ }
+ }
+
+ pPrevInfo = pInfo;
+
+ maxWidth = wxMax(pInfo->mRect.width, maxWidth);
+ maxHeight = wxMax(pInfo->mRect.height, maxHeight);
+ }
+
+ bHorzSeparator = nVertSeparators == 0;
+ }
+
+ // Check if we should draw Horz or Vert...
+ if ( !bHorzSeparator )
+ {
+ info.mRect.width = mSepartorSize;
+ info.mRect.height = maxHeight;
+ }
+ else
+ {
+ info.mRect.width = maxWidth;
+ info.mRect.height = mSepartorSize;
+ }