// MySplitterWnd.cpp : implementation file
//

#include "stdafx.h"
#include "mushclient.h"
#include "doc.h"

#include "MySplitterWnd.h"
#include "childfrm.h"
#include "MUSHview.h"
#include "sendvw.h"

#ifdef _DEBUG
//#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMySplitterWnd

CMySplitterWnd::CMySplitterWnd()
{
  m_pDoc = NULL;
}

CMySplitterWnd::~CMySplitterWnd()
{
}


BEGIN_MESSAGE_MAP(CMySplitterWnd, CSplitterWnd)
	//{{AFX_MSG_MAP(CMySplitterWnd)
	ON_WM_LBUTTONUP()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CMySplitterWnd message handlers

void CMySplitterWnd::OnLButtonUp(UINT nFlags, CPoint point) 
{
  CSplitterWnd::OnLButtonUp(nFlags, point);
   
  // this hideous code is so that we know when the user has resized the
  // input pane, so we don't snap the size back to what it was
  if (m_pDoc)
    {
    int cyCur,
        cyMin;
    GetRowInfo (1, cyCur, cyMin);
    if (!(m_pDoc->m_mush_name.IsEmpty ()))
      App.WriteProfileInt(m_pDoc->m_mush_name, "Bottom Height", cyCur);
//    TRACE1 ("Bottom height (saved) = %i\n", cyCur);

    if (m_pDoc->m_pActiveCommandView)
      m_pDoc->m_pActiveCommandView->m_owner_frame->FixUpSplitterBar ();
    else if (m_pDoc->m_pActiveOutputView)
      m_pDoc->m_pActiveOutputView->m_owner_frame->FixUpSplitterBar ();

	  }

}

