// mymfc7View.cpp : implementation of the CMymfc7View class
//

#include "stdafx.h"
#include "mymfc7.h"

#include "mymfc7Doc.h"
#include "mymfc7View.h"
#include "mymfc7Dialog.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMymfc7View

IMPLEMENT_DYNCREATE(CMymfc7View, CView)

BEGIN_MESSAGE_MAP(CMymfc7View, CView)
	//{{AFX_MSG_MAP(CMymfc7View)
	ON_WM_LBUTTONDOWN()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMymfc7View construction/destruction

CMymfc7View::CMymfc7View()
{
	// TODO: add construction code here

}

CMymfc7View::~CMymfc7View()
{
}

BOOL CMymfc7View::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CMymfc7View drawing

void CMymfc7View::OnDraw(CDC* pDC)
{
	pDC->TextOut(50, 50, "Press the left mouse button to launch the funny dialog box.");
}

/////////////////////////////////////////////////////////////////////////////
// CMymfc7View diagnostics

#ifdef _DEBUG
void CMymfc7View::AssertValid() const
{
	CView::AssertValid();
}

void CMymfc7View::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}

CMymfc7Doc* CMymfc7View::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMymfc7Doc)));
	return (CMymfc7Doc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CMymfc7View message handlers

void CMymfc7View::OnLButtonDown(UINT nFlags, CPoint point) 
{
	CMymfc7Dialog dlg;
    dlg.m_strName  = "Porter, Harry";
    dlg.m_nSsn     = 12345678;
    dlg.m_nCat     = 1;  // 0 = hourly, 1 = salary
    dlg.m_strBio   = "Like to do programming for fun";
    dlg.m_bInsLife = FALSE;
    dlg.m_bInsDis  = TRUE;
    dlg.m_bInsMed  = TRUE;
    dlg.m_strDept  = "Documentation";
    dlg.m_strSkill = "Executive";
    dlg.m_nLang    = 1;
    dlg.m_strEduc  = "High School";
    dlg.m_nLoyal   = dlg.m_nRely = 50;

   int ret = dlg.DoModal();

    TRACE("DoModal return = %d\n", ret);
    TRACE("name = %s, ssn = %d, cat = %d\n", 
		  dlg.m_strName, dlg.m_nSsn, dlg.m_nCat);
    TRACE("dept = %s, skill = %s, lang = %d, educ = %s\n",
          dlg.m_strDept, dlg.m_strSkill, dlg.m_nLang, dlg.m_strEduc);
    TRACE("life = %d, dis = %d, med = %d, bio = %s\n",
          dlg.m_bInsLife, dlg.m_bInsDis, dlg.m_bInsMed, dlg.m_strBio);
    TRACE("loyalty = %d, reliability = %d\n", dlg.m_nLoyal, dlg.m_nRely);

}

