📄 fontpage.cpp
字号:
// FontPage.cpp : implementation file
//
#include "stdafx.h"
#include "TabDlgDemo.h"
#include "FontPage.h"
#include "MyPropertySheet.h"
#include "MainFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CFontPage property page
IMPLEMENT_DYNCREATE(CFontPage, CPropertyPage)
CFontPage::CFontPage() : CPropertyPage(CFontPage::IDD)
{
//{{AFX_DATA_INIT(CFontPage)
m_height = 0;
m_radio = 0;
//}}AFX_DATA_INIT
}
CFontPage::~CFontPage()
{
}
void CFontPage::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CFontPage)
DDX_Text(pDX, IDC_EDIT1, m_height);
DDX_Radio(pDX, IDC_RADIO1, m_radio);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CFontPage, CPropertyPage)
//{{AFX_MSG_MAP(CFontPage)
ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
ON_BN_CLICKED(IDC_RADIO3, OnRadio3)
ON_BN_CLICKED(IDC_RADIO4, OnRadio4)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CFontPage message handlers
void CFontPage::OnRadio1()
{
// TODO: Add your control notification handler code here
SetModified();//激活应用按钮
m_radio=0;
GetDlgItem(IDC_EDIT1)->EnableWindow(false); //编辑框禁止输入
}
void CFontPage::OnRadio2()
{
// TODO: Add your control notification handler code here
SetModified();//激活应用按钮
m_radio=1;
GetDlgItem(IDC_EDIT1)->EnableWindow(false); //编辑框禁止输入
}
void CFontPage::OnRadio3()
{
// TODO: Add your control notification handler code here
SetModified();//激活应用按钮
m_radio=2;
GetDlgItem(IDC_EDIT1)->EnableWindow(false); //编辑框禁止输入
}
void CFontPage::OnRadio4()
{
// TODO: Add your control notification handler code here
SetModified();//激活应用按钮
m_radio=3;
GetDlgItem(IDC_EDIT1)->EnableWindow(true); //编辑框允许输入
}
BOOL CFontPage::OnInitDialog()
{
CPropertyPage::OnInitDialog();
// TODO: Add extra initialization here
GetDlgItem(IDC_EDIT1)->EnableWindow(false); //编辑框禁止输入
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
BOOL CFontPage::OnSetActive()
{
// TODO: Add your specialized code here and/or call the base class
CMyPropertySheet* p=(CMyPropertySheet*)GetParent();
//对于第一页,仅启用"下一步"按钮
p->SetWizardButtons(PSWIZB_FINISH|PSWIZB_BACK);
return CPropertyPage::OnSetActive();
}
BOOL CFontPage::OnWizardFinish()
{
// TODO: Add your specialized code here and/or call the base class
UpdateData(TRUE);//获取最后一页数据
CMainFrame* pMFrm=(CMainFrame*)AfxGetMainWnd();
//向视图类发送用户自定义消息
pMFrm->GetActiveView()->SendMessage(WM_USER_APPLY);
return CPropertyPage::OnWizardFinish();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -