📄 worksdlg.cpp
字号:
// WorksDlg.cpp : implementation file
//
#include "stdafx.h"
#include "opp.h"
#include "WorksDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CWorksDlg dialog
CWorksDlg::CWorksDlg(CWnd* pParent /*=NULL*/)
: CDialog(CWorksDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CWorksDlg)
m_size = 0;
m_name = 0;
//}}AFX_DATA_INIT
}
void CWorksDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CWorksDlg)
DDX_Text(pDX, IDC_EDIT_SIZE, m_size);
DDX_Text(pDX, IDC_EDIT_NAME, m_name);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CWorksDlg, CDialog)
//{{AFX_MSG_MAP(CWorksDlg)
ON_BN_CLICKED(IDC_RADIOWORK1, OnRadiowork1)
ON_BN_CLICKED(IDC_RADIOWORK2, OnRadiowork2)
ON_BN_CLICKED(IDC_RADIOWORK3, OnRadiowork3)
ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CWorksDlg message handlers
void CWorksDlg::OnRadiowork1()
{
// TODO: Add your control notification handler code here
work = 1;
CEdit* pEdit=(CEdit*) GetDlgItem(IDC_EDIT_NAME);
pEdit->SetReadOnly(true);
pEdit=(CEdit*) GetDlgItem(IDC_EDIT_SIZE);
pEdit->SetReadOnly(true);
}
void CWorksDlg::OnRadiowork2()
{
// TODO: Add your control notification handler code here
work = 2;
CEdit* pEdit=(CEdit*) GetDlgItem(IDC_EDIT_NAME);
pEdit->SetReadOnly(true);
pEdit=(CEdit*) GetDlgItem(IDC_EDIT_SIZE);
pEdit->SetReadOnly(true);
}
void CWorksDlg::OnRadiowork3()
{
// TODO: Add your control notification handler code here
work = 3;
CEdit* pEdit=(CEdit*) GetDlgItem(IDC_EDIT_NAME);
pEdit->SetReadOnly(true);
pEdit=(CEdit*) GetDlgItem(IDC_EDIT_SIZE);
pEdit->SetReadOnly(true);
}
void CWorksDlg::OnRadio1()
{
// TODO: Add your control notification handler code here
work = 4;
CEdit* pEdit=(CEdit*) GetDlgItem(IDC_EDIT_NAME);
pEdit->SetReadOnly(false);
pEdit=(CEdit*) GetDlgItem(IDC_EDIT_SIZE);
pEdit->SetReadOnly(false);
}
void CWorksDlg::OnRadio2()
{
// TODO: Add your control notification handler code here
work = 5;
CEdit* pEdit=(CEdit*) GetDlgItem(IDC_EDIT_NAME);
pEdit->SetReadOnly(false);
pEdit=(CEdit*) GetDlgItem(IDC_EDIT_SIZE);
pEdit->SetReadOnly(true);
}
BOOL CWorksDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CEdit* pEdit=(CEdit*) GetDlgItem(IDC_RADIO1);
pEdit->GetFocus();
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -