📄 parsetdlg.cpp
字号:
// ParSetDlg.cpp : implementation file
//
#include "stdafx.h"
#include "PosManager.h"
#include "ParSetDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CParSetDlg dialog
CParSetDlg::CParSetDlg(CWnd* pParent /*=NULL*/)
: CDialog(CParSetDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CParSetDlg)
m_scm = 0;
m_floor = 0;
m_probe = 0;
m_region = 0;
//}}AFX_DATA_INIT
m_bPrtRBtnDown=false;
m_bFlagDel=false;
isVip=false;
}
void CParSetDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CParSetDlg)
DDX_Text(pDX, IDC_EDIT2, m_scm);
DDV_MinMaxInt(pDX, m_scm, 0, 256);
DDX_Text(pDX, IDC_EDIT3, m_floor);
DDX_Text(pDX, IDC_EDIT1, m_probe);
DDV_MinMaxInt(pDX, m_probe, 0, 256);
DDX_Text(pDX, IDC_EDIT4, m_region);
DDV_MinMaxInt(pDX, m_region, 0, 50);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CParSetDlg, CDialog)
//{{AFX_MSG_MAP(CParSetDlg)
//}}AFX_MSG_MAP
ON_BN_CLICKED(IDC_BTN_DEL, OnDel)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CParSetDlg message handlers
void CParSetDlg::OnOK()
{
// TODO: Add extra validation here
if(((CButton *)GetDlgItem(IDC_RADIO1))->GetCheck())isVip=false;
else isVip=true;
UpdateData(true);
CDialog::OnOK();
}
void CParSetDlg::ShowBtnDel()
{
CButton * pBtn=new CButton();
ASSERT_VALID(pBtn);
CRect rect(30,165,110,185);
CString m_Caption;
m_Caption.LoadString( IDC_BTN_DEL ); //取按钮标题
pBtn->Create( m_Caption, WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON , rect, this, IDC_BTN_DEL ); //创建按钮
}
void CParSetDlg::OnDel()
{
m_bFlagDel=true;
CDialog::OnOK();
}
BOOL CParSetDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
if(m_bPrtRBtnDown) {ShowBtnDel();}
if(isVip)((CButton *)GetDlgItem(IDC_RADIO2))->SetCheck(1);
else ((CButton *)GetDlgItem(IDC_RADIO1))->SetCheck(1);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CParSetDlg::GetParam(BYTE scm,BYTE prob,int region,int floor,bool vip,bool flag,bool rdown)
{
isVip=vip;
m_bFlagDel=flag;
m_bPrtRBtnDown=rdown;
m_scm = scm;
m_floor = floor;
m_probe = prob;
m_region = region;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -