// MyDrawWnd.cpp : Defines the class behaviors for the application.
//

#include "stdafx.h"
#include "MyDrawWnd.h"

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

/////////////////////////////////////////////////////////////////////////////
// CMyDrawWnd

IMPLEMENT_DYNCREATE(CMyDrawWnd, CFOPDrawWnd)

BEGIN_MESSAGE_MAP(CMyDrawWnd, CFOPDrawWnd)
	//{{AFX_MSG_MAP(CMyDrawWnd)
	ON_WM_CREATE()
	ON_WM_KEYDOWN()
	//}}AFX_MSG_MAP
	// Standard printing actions
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMyDrawWnd construction/destruction

CMyDrawWnd::CMyDrawWnd()
{
	// TODO: add construction code here
	m_bHorzVisible = FALSE;
	m_bVertVisible = FALSE;
	pParent = NULL;
}

CMyDrawWnd::~CMyDrawWnd()
{
}

BOOL CMyDrawWnd::IsShareScroll() const
{
	return FALSE;
}

BOOL CMyDrawWnd::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CFOPDrawWnd::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CMyDrawWnd drawing

/////////////////////////////////////////////////////////////////////////////
// CMyDrawWnd diagnostics

#ifdef _DEBUG
void CMyDrawWnd::AssertValid() const
{
	CFOPDrawWnd::AssertValid();
}

void CMyDrawWnd::Dump(CDumpContext& dc) const
{
	CFOPDrawWnd::Dump(dc);
}

#endif //_DEBUG

BOOL CMyDrawWnd::UpdateObserver( CObject * pModel,LPARAM lHint, CObject*pHint)
{
	CFOPDrawWnd::UpdateObserver(pModel,lHint,pHint);
	
	// FODO: Add your specialized code here.

	return TRUE;
}


int CMyDrawWnd::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CFOPDrawWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	// TODO: Add your specialized creation code here
	CDC *pDC = GetDC();

	m_pX = pDC->GetDeviceCaps(HORZRES);
	m_pY = pDC->GetDeviceCaps(VERTRES);

	MoveWindow(0,0,m_pX, m_pY);
	return 0;
}

void CMyDrawWnd::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) 
{
	// TODO: Add your message handler code here and/or call default
	if(nChar == VK_ESCAPE)
	{
		ShowWindow(SW_HIDE);
	}
	CFOPDrawWnd::OnKeyDown(nChar, nRepCnt, nFlags);
}
