+ 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;
+ }
+
+ // Do we need to set a new size to a seperator object?
+ if ( info.mpToolWnd )
+ {
+ info.mpToolWnd->SetSize( info.mRect.x,
+ info.mRect.y,
+ info.mRect.width,
+ info.mRect.height);
+ }