📄 sizedlg.cpp
字号:
// Get needed include files
#include "SizeDlg.h"
#include "Resource.h"
#include "Utility.h"
// Constructor
CSizeDialog::CSizeDialog(CSharedData& NewSharedData)
: CPropertyPage(IDD_SIZE),
m_pSharedData(&NewSharedData)
{ }
BOOL CSizeDialog::OnInitDialog()
{
CPropertyPage::OnInitDialog();
// Select the "Individual" radio button
CheckRadioButton(IDC_RAD_INDIVIDUAL, IDC_RAD_LARGE, IDC_RAD_INDIVIDUAL);
return TRUE;
}
BOOL CSizeDialog::OnSetActive()
{
CPropertyPage::OnSetActive();
CPropertySheet* pSheet = DYNAMIC_DOWNCAST(CPropertySheet, GetParent());
if (pSheet != NULL)
pSheet->SetWizardButtons(PSWIZB_NEXT);
return TRUE;
}
BOOL CSizeDialog::OnKillActive()
{
HRESULT hResult;
CPropertyPage::OnKillActive();
// Retrieve the pizza size requested
PizzaSize ePizzaSize;
int iCheckRadioButton = GetCheckedRadioButton(IDC_RAD_INDIVIDUAL,
IDC_RAD_LARGE);
switch(iCheckRadioButton)
{
case IDC_RAD_INDIVIDUAL: ePizzaSize = Individual; break;
case IDC_RAD_SMALL: ePizzaSize = Small; break;
case IDC_RAD_LARGE: ePizzaSize = Large; break;
// There should always be a selected radio button
default:
ASSERT(FALSE);
}
// Set the COM PizzaOrderTaker's pizza size
ASSERT(m_pSharedData);
hResult = m_pSharedData->GetPizzaOrderTaker()->SetPizzaSize(ePizzaSize);
if (FAILED(hResult)) {
ReportError("Error setting new pizza size.", hResult);
return FALSE;
}
return TRUE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -