#include "xheaders.h"

#include XFrameControl_i
#include XFrameWindow_i
#include XFrame_i

#include "string.h"


XFrameControl :: XFrameControl( XFrameWindow * w, LONG st):XUserWindow( w->frame )
{
   style = st;
   w->frameWin->AddFrameControl( this );
}


void XFrameControl :: AdjustSize( PSWP pswpToolbar, PSWP pswpClient)
{
   if( ! (IsVisible()))
      {
          memset(pswpToolbar, 0, sizeof(SWP));
          pswpToolbar->hwnd = winhandle;
          pswpToolbar->fl = SWP_HIDE;
          return;
      }

   pswpClient->cy -= cy;
   pswpToolbar->cx = pswpClient->cx;
   pswpToolbar->x = pswpClient->x;

   if( style & TB_TOP)
      {
         pswpToolbar->y  = (pswpClient->y + pswpClient->cy);
      }
   if(style & TB_BOTTOM)
      {
         pswpToolbar->y = pswpClient->y;
         pswpClient->y += cy;
      }
   pswpToolbar->hwnd = winhandle;
   pswpToolbar->cy = cy;
   pswpToolbar->fl = SWP_SIZE|SWP_MOVE;
   Invalidate( TRUE );
}






