#include  "stdafx.h"
#include  "CnfAsrt.h"
#include  "mainfrm.h"
#include  "Splitter.h"


BEGIN_MESSAGE_MAP(Splitter, CSplitterWnd)
     //{{AFX_MSG_MAP(Splitter)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


Splitter::Splitter() : CSplitterWnd()
{
}


Splitter::~Splitter()
{
}


void Splitter::ActivateNext( BOOL bPrev )
{
     CMainFrame *mfm = GetFrame();

     if (mfm == NULL)
     {
          CSplitterWnd::ActivateNext( bPrev );
     }
     else
     {
          mfm->ActivateNextView( ! bPrev );
     }
}


CMainFrame * Splitter::GetFrame()
{
     CWnd    *wnd = this;

     while (! wnd->IsKindOf( RUNTIME_CLASS( CMainFrame ) ))
     {
          wnd = wnd->GetParent();

          CnfAssert( wnd != NULL );
     }

     return( (CMainFrame *)wnd );
}
