// CFontPropDlg.cpp: 实现文件
//

#include "pch.h"
#include "FYEDrawDemoVC.h"
#include "FontPropDlg.h"
#include "afxdialogex.h"


// CFontPropDlg 对话框

IMPLEMENT_DYNAMIC(CFontPropDlg, CDialog)

CFontPropDlg::CFontPropDlg(CWnd* pParent /*=nullptr*/)
	: CDialog(IDD_DIALOG_PFONT, pParent)
	, m_iShapeID(0)
	, m_sFontType(_T(""))
	, m_iFontColor(0)
	, m_iFontSize(0)
{

}

CFontPropDlg::~CFontPropDlg()
{
}

void CFontPropDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Text(pDX, IDC_EDIT_PROP_SHAPEID, m_iShapeID);
	DDX_Control(pDX, IDC_COMBO_FONTTYPE, m_cmbFontStyle);
	DDX_CBString(pDX, IDC_COMBO_FONTTYPE, m_sFontType);
	DDX_Text(pDX, IDC_EDIT_PROP_FCOLOR, m_iFontColor);
	DDX_Text(pDX, IDC_EDIT_PROP_FSIZE, m_iFontSize);
}


BEGIN_MESSAGE_MAP(CFontPropDlg, CDialog)
	ON_BN_CLICKED(IDOK, &CFontPropDlg::OnBnClickedOk)
	ON_BN_CLICKED(IDCANCEL, &CFontPropDlg::OnBnClickedCancel)
END_MESSAGE_MAP()


// CFontPropDlg 消息处理程序


void CFontPropDlg::OnBnClickedOk()
{
	// TODO: 在此添加控件通知处理程序代码
	CDialog::OnOK();
}


void CFontPropDlg::OnBnClickedCancel()
{
	// TODO: 在此添加控件通知处理程序代码
	CDialog::OnCancel();
}


BOOL CFontPropDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// TODO:  在此添加额外的初始化
	m_cmbFontStyle.AddString(_T("Arial"));
	m_cmbFontStyle.AddString(_T("Candara"));
	m_cmbFontStyle.AddString(_T("Fixedsys"));
	m_cmbFontStyle.AddString(_T("System"));
	m_cmbFontStyle.AddString(_T("等线"));
	m_cmbFontStyle.AddString(_T("方正舒体"));
	m_cmbFontStyle.AddString(_T("黑体"));
	m_cmbFontStyle.AddString(_T("华文行楷"));
	m_cmbFontStyle.AddString(_T("楷体"));
	m_cmbFontStyle.AddString(_T("宋体"));
	m_cmbFontStyle.AddString(_T("微软雅黑"));
	m_cmbFontStyle.AddString(_T("幼圆"));

	return TRUE;  // return TRUE unless you set the focus to a control
				  // 异常: OCX 属性页应返回 FALSE
}
