// FontProperties.cpp : implementation file
//

#include "stdafx.h"
#include "fontedit.h"
#include "FontProperties.h"
#include "fontedoc.h"
#include "font.h"

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

/////////////////////////////////////////////////////////////////////////////
// CFontProperties dialog


CFontProperties::CFontProperties(CWnd* pParent /*=NULL*/)
	: CDialog(CFontProperties::IDD, pParent)
{
	//{{AFX_DATA_INIT(CFontProperties)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CFontProperties::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CFontProperties)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CFontProperties, CDialog)
	//{{AFX_MSG_MAP(CFontProperties)
		// NOTE: the ClassWizard will add message map macros here
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CFontProperties message handlers
/////////////////////////////////////////////////////////////////////////////
// FontProperties dialog


FontProperties::FontProperties(CWnd* pParent /*=NULL*/)
	: CDialog(FontProperties::IDD, pParent)
{
	//{{AFX_DATA_INIT(FontProperties)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void FontProperties::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(FontProperties)
	DDX_Control(pDX, IDC_FONTSIZE, m_Size);
	DDX_Control(pDX, IDC_FONTNAME, m_Name);
	DDX_Control(pDX, IDC_FONTITALIC, m_Italic);
	DDX_Control(pDX, IDC_FONTBOLD, m_Bold);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(FontProperties, CDialog)
	//{{AFX_MSG_MAP(FontProperties)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// FontProperties message handlers

void FontProperties::OnOK() 
{
	
	CDialog::OnOK();
}

BOOL FontProperties::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	char szOut[260];
	sprintf(szOut,"%d",theFont->PointSize());
	m_Size.SetWindowText(szOut);
	if (theFont->IsBold())
		m_Bold.SetWindowText("Yes");
	else
		m_Bold.SetWindowText("No");
	if (theFont->IsItalic())
		m_Italic.SetWindowText("Yes");
	else
		m_Italic.SetWindowText("No");
	m_Name.SetWindowText(theFont->FaceName());

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
