📄 spray.cpp
字号:
// Spray.cpp : implementation file
//
#include "stdafx.h"
#include "alfa.h"
#include "Spray.h"
#include "Main.h"
#include "Modes.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSpray dialog
CSpray::CSpray(CWnd* pParent /*=NULL*/)
: CDialog(CSpray::IDD, pParent)
{
//{{AFX_DATA_INIT(CSpray)
m_edt1 = 0.0f;
m_edt2 = 0.0f;
m_edt3 = 0.0f;
m_edt4 = 0;
m_edt5 = 0;
//}}AFX_DATA_INIT
}
void CSpray::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSpray)
DDX_Control(pDX, IDC_EDIT5, m_edit5);
DDX_Control(pDX, IDC_EDIT4, m_edit4);
DDX_Control(pDX, IDC_EDIT3, m_edit3);
DDX_Control(pDX, IDC_EDIT2, m_edit2);
DDX_Control(pDX, IDC_EDIT1, m_edit1);
DDX_Text(pDX, IDC_EDIT1, m_edt1);
DDX_Text(pDX, IDC_EDIT2, m_edt2);
DDX_Text(pDX, IDC_EDIT3, m_edt3);
DDX_Text(pDX, IDC_EDIT4, m_edt4);
DDX_Text(pDX, IDC_EDIT5, m_edt5);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSpray, CDialog)
//{{AFX_MSG_MAP(CSpray)
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
ON_WM_SHOWWINDOW()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSpray message handlers
void CSpray::OnButton1()
{
// TODO: Add your control notification handler code here
// UpdateData();
ShowWindow(FALSE);
CMain * main=(CMain *)GetParent();
main->dlgautocount->ShowWindow(TRUE);
}
void CSpray::OnButton2()
{
// TODO: Add your control notification handler code here
// UpdateData();
ShowWindow(FALSE);
CMain * main=(CMain *)GetParent();
main->dlgautotimer->ShowWindow(TRUE);
}
void CSpray::OnButton3()
{
// TODO: Add your control notification handler code here
// UpdateData();
ShowWindow(FALSE);
CMain * main=(CMain *)GetParent();
// main->dlgautofull->ShowWindow(TRUE);
main->dlgauto->ShowWindow(TRUE);
}
void CSpray::OnShowWindow(BOOL bShow, UINT nStatus)
{
CDialog::OnShowWindow(bShow, nStatus);
// TODO: Add your message handler code here
CMain * main=(CMain *)GetParent();
CString key=main->dlgauto->m_num;
CModes * pmode=NULL;
if(bShow==1)
{
main->dlgcur=this;
if(key!="")
{
main->dlgauto->m_Contacts.Lookup(key,pmode);
if(pmode)
{
m_edt1=pmode->s_t1a;
m_edt2=pmode->s_t2;
m_edt3=pmode->s_t1b;
m_edt4=pmode->s_c1;
m_edt5=pmode->s_c2;
UpdateData(FALSE);
}
}
}
else
{
UpdateData();
if(key!="")
{
main->dlgauto->m_Contacts.Lookup(key,pmode);
if(pmode)
{
pmode->s_t1a=m_edt1;
pmode->s_t2=m_edt2;
pmode->s_t1b=m_edt3;
pmode->s_c1=m_edt4;
pmode->s_c2=m_edt5;
main->dlgauto->SaveRecords();
}
}
}
}
BOOL CSpray::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
h_SkinDialog.SubClassDialog(m_hWnd);
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 + -