?? count.cpp
字號:
// Count.cpp : implementation file
//
#include "stdafx.h"
#include "alfa.h"
#include "Count.h"
#include "Main.h"
#include "Modes.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCount dialog
CCount::CCount(CWnd* pParent /*=NULL*/)
: CDialog(CCount::IDD, pParent)
{
//{{AFX_DATA_INIT(CCount)
m_edt1 = 0;
m_edt2 = 0;
m_edt3 = 0;
m_edt4 = 0.0f;
//}}AFX_DATA_INIT
}
void CCount::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCount)
DDX_Control(pDX, IDC_EDITQC, m_edit8);
DDX_Control(pDX, IDC_EDITNG, m_edit7);
DDX_Control(pDX, IDC_EDITS2, m_edit6);
DDX_Control(pDX, IDC_EDITS1, 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_EDITS1, m_edtS1);
DDX_Text(pDX, IDC_EDITS2, m_edtS2);
DDX_Text(pDX, IDC_EDITNG, m_edtNG);
DDX_Text(pDX, IDC_EDITQC, m_edtQC);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CCount, CDialog)
//{{AFX_MSG_MAP(CCount)
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
ON_BN_CLICKED(IDC_BUTTON4, OnButton4)
ON_BN_CLICKED(IDC_BUTTON5, OnButton5)
ON_WM_SHOWWINDOW()
ON_WM_TIMER()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCount message handlers
void CCount::OnButton1()
{
// TODO: Add your control notification handler code here
ShowWindow(FALSE);
CMain * main=(CMain *)GetParent();
main->dlgautotimer->ShowWindow(TRUE);
}
// Speed
void CCount::OnButton2()
{
// TODO: Add your control notification handler code here
ShowWindow(FALSE);
CMain * main=(CMain *)GetParent();
main->dlgautofixspeed->ShowWindow(TRUE);
}
// Position
void CCount::OnButton5()
{
// TODO: Add your control notification handler code here
ShowWindow(FALSE);
CMain * main=(CMain *)GetParent();
main->dlgautofixpos->ShowWindow(TRUE);
}
void CCount::OnButton3()
{
// TODO: Add your control notification handler code here
CString Temp_str;
UpdateData();
MoldCountCur=0;
MoldStack1=0;
MoldStack2=0;
NG_Num=0;
QC_Num=0;
m_edt2=0;
m_edtS1=0;
m_edtS2=0;
m_edtNG=0;
m_edtQC=0;
UpdateData(FALSE);
Temp_str.Format("%6.2f", m_edt4);
GetDlgItem(IDC_EDIT4)->SetWindowText(Temp_str);
}
void CCount::OnButton4()
{
// TODO: Add your control notification handler code here
ShowWindow(FALSE);
CMain * main=(CMain *)GetParent();
// main->dlgautofull->ShowWindow(TRUE);
main->dlgauto->ShowWindow(TRUE);
}
void CCount::OnShowWindow(BOOL bShow, UINT nStatus)
{
CDialog::OnShowWindow(bShow, nStatus);
CString Temp_str;
// 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->c_enactedm;
m_edt1=MoldSet;
m_edt2=MoldCountCur;
// m_edt2=pmode->c_nowm ;
m_edt3=pmode->c_belt ;
m_edt4=pmode->c_time ;
m_edtS1=MoldStack1;
m_edtS2=MoldStack2;
m_edtNG=NG_Num;
m_edtQC=QC_Num;
UpdateData(FALSE);
}
}
Temp_str.Format("%6.2f", m_edt4);
GetDlgItem(IDC_EDIT4)->SetWindowText(Temp_str);
SetTimer(51, 100, NULL);
}
else {
UpdateData();
if(key!="") {
main->dlgauto->m_Contacts.Lookup(key, pmode);
if(pmode) {
pmode->c_enactedm =m_edt1;
MoldSet=m_edt1;
pmode->c_nowm =m_edt2;
MoldCountCur=m_edt2;
pmode->c_belt =m_edt3;
pmode->c_time =m_edt4;
MoldStack1=m_edtS1;
MoldStack2=m_edtS2;
NG_Num=m_edtNG;
QC_Num=m_edtQC;
main->dlgauto->SaveRecords();
}
}
KillTimer(51);
}
}
BOOL CCount::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
}
void CCount::OnTimer(UINT nIDEvent)
{
CString Temp_str;
if(DataChanged==1) {
DataChanged=0;
// m_edt2=MoldCountCur;
UpdateData();
MoldCountCur=m_edt2;
MoldStack1=m_edtS1;
MoldStack2=m_edtS2;
NG_Num=m_edtNG;
QC_Num=m_edtQC;
Temp_str.Format("%6.2f", m_edt4);
GetDlgItem(IDC_EDIT4)->SetWindowText(Temp_str);
}
CDialog::OnTimer(nIDEvent);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -