📄 mxa_mep.cpp
字号:
// MXA_MEP.cpp : implementation file
//
#include "stdafx.h"
#include "HMIcan_usb.h"
#include "MXA_MEP.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMXA_MEP dialog
CMXA_MEP::CMXA_MEP(CWnd* pParent /*=NULL*/)
: CDialog(CMXA_MEP::IDD, pParent)
{
//{{AFX_DATA_INIT(CMXA_MEP)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CMXA_MEP::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMXA_MEP)
DDX_Control(pDX, IDC_STATIC_TIP_CANCEL, m_tip_CANCEL);
DDX_Control(pDX, IDC_STATIC_TIP_ENTER, m_tip_ENTER);
DDX_Control(pDX, IDC_STATIC_TIP_DG1, m_tip_DG11);
DDX_Control(pDX, IDC_STATIC_TIP_DG2, m_tip_DG21);
DDX_Control(pDX, IDC_STATIC_TIP_DG3, m_tip_DG31);
DDX_Control(pDX, IDC_STATIC_TIP_DG4, m_tip_DG41);
DDX_Control(pDX, IDC_STATIC_TIP_DG5, m_tip_DG51);
DDX_Control(pDX, IDC_STATIC_TIP_DG6, m_tip_DG61);
DDX_Control(pDX, IDC_STATIC_TIP_DG7, m_tip_DG71);
DDX_Control(pDX, IDC_STATIC_TIP_DG8, m_tip_DG81);
DDX_Control(pDX, IDC_STATIC_TIP_DG9, m_tip_DG91);
DDX_Control(pDX, IDC_STATIC_TIP_DG10, m_tip_DG101);
DDX_Control(pDX, IDC_STATIC_TIP_DG11, m_tip_DG111);
DDX_Control(pDX, IDC_STATIC_TIP_DG12, m_tip_DG121);
DDX_Control(pDX, IDC_STATIC_TIP_DG13, m_tip_DG131);
DDX_Control(pDX, IDC_STATIC_TIP_DG14, m_tip_DG141);
DDX_Control(pDX, IDC_STATIC_TIP_DG15, m_tip_DG151);
DDX_Control(pDX, IDC_STATIC_TIP_DG16, m_tip_DG161);
DDX_Control(pDX, IDC_STATIC_TIP_AORB, m_tip_AORB);
DDX_Control(pDX, IDC_DG11, m_Dg11);
DDX_Control(pDX, IDC_DG12, m_Dg12);
DDX_Control(pDX, IDC_DG21, m_Dg21);
DDX_Control(pDX, IDC_DG22, m_Dg22);
DDX_Control(pDX, IDC_DG31, m_Dg31);
DDX_Control(pDX, IDC_DG32, m_Dg32);
DDX_Control(pDX, IDC_DG41, m_Dg41);
DDX_Control(pDX, IDC_DG42, m_Dg42);
DDX_Control(pDX, IDC_DG51, m_Dg51);
DDX_Control(pDX, IDC_DG52, m_Dg52);
DDX_Control(pDX, IDC_DG61, m_Dg61);
DDX_Control(pDX, IDC_DG62, m_Dg62);
DDX_Control(pDX, IDC_DG71, m_Dg71);
DDX_Control(pDX, IDC_DG72, m_Dg72);
DDX_Control(pDX, IDC_DG81, m_Dg81);
DDX_Control(pDX, IDC_DG82, m_Dg82);
DDX_Control(pDX, IDC_DG91, m_Dg91);
DDX_Control(pDX, IDC_DG92, m_Dg92);
DDX_Control(pDX, IDC_DG101, m_Dg101);
DDX_Control(pDX, IDC_DG102, m_Dg102);
DDX_Control(pDX, IDC_DG111, m_Dg111);
DDX_Control(pDX, IDC_DG112, m_Dg112);
DDX_Control(pDX, IDC_DG121, m_Dg121);
DDX_Control(pDX, IDC_DG122, m_Dg122);
DDX_Control(pDX, IDC_DG131, m_Dg131);
DDX_Control(pDX, IDC_DG132, m_Dg132);
DDX_Control(pDX, IDC_DG141, m_Dg141);
DDX_Control(pDX, IDC_DG142, m_Dg142);
DDX_Control(pDX, IDC_DG151, m_Dg151);
DDX_Control(pDX, IDC_DG152, m_Dg152);
DDX_Control(pDX, IDC_DG161, m_Dg161);
DDX_Control(pDX, IDC_DG162, m_Dg162);
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMXA_MEP, CDialog)
//{{AFX_MSG_MAP(CMXA_MEP)
ON_WM_CTLCOLOR()
ON_EN_SETFOCUS(IDC_EDIT_DG14, OnSetfocusEditDg14)
ON_EN_SETFOCUS(IDC_EDIT_DG24, OnSetfocusEditDg24)
ON_EN_SETFOCUS(IDC_EDIT_DG34, OnSetfocusEditDg34)
ON_EN_SETFOCUS(IDC_EDIT_DG44, OnSetfocusEditDg44)
ON_EN_SETFOCUS(IDC_EDIT_DG54, OnSetfocusEditDg54)
ON_EN_SETFOCUS(IDC_EDIT_DG64, OnSetfocusEditDg64)
ON_EN_SETFOCUS(IDC_EDIT_DG74, OnSetfocusEditDg74)
ON_EN_SETFOCUS(IDC_EDIT_DG84, OnSetfocusEditDg84)
ON_EN_SETFOCUS(IDC_EDIT_DG94, OnSetfocusEditDg94)
ON_EN_SETFOCUS(IDC_EDIT_DG104, OnSetfocusEditDg104)
ON_EN_SETFOCUS(IDC_EDIT_DG114, OnSetfocusEditDg114)
ON_EN_SETFOCUS(IDC_EDIT_DG124, OnSetfocusEditDg124)
ON_EN_SETFOCUS(IDC_EDIT_DG134, OnSetfocusEditDg134)
ON_EN_SETFOCUS(IDC_EDIT_DG144, OnSetfocusEditDg144)
ON_EN_SETFOCUS(IDC_EDIT_DG154, OnSetfocusEditDg154)
ON_EN_SETFOCUS(IDC_EDIT_DG164, OnSetfocusEditDg164)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMXA_MEP message handlers
BOOL CMXA_MEP::PreTranslateMessage(MSG* pMsg)
{
//下移动
if(pMsg->message==WM_KEYDOWN && (pMsg->wParam==VK_DOWN))
{
//焦点在标头的时候
if(CMXA_MEP::GetFocus() == GetDlgItem(IDC_STATIC_AORB)||
CMXA_MEP::GetFocus() ==GetDlgItem(IDC_STATIC_ORDER1)||
CMXA_MEP::GetFocus() ==GetDlgItem(IDC_STATIC_ORDER2)||
CMXA_MEP::GetFocus() ==GetDlgItem(IDC_STATIC_ORDER3)||
CMXA_MEP::GetFocus() ==GetDlgItem(IDC_STATIC_ORDER4)||
CMXA_MEP::GetFocus() ==GetDlgItem(IDC_STATIC_ORDER5)||
CMXA_MEP::GetFocus() ==GetDlgItem(IDC_STATIC_ORDER6)||
CMXA_MEP::GetFocus() ==GetDlgItem(IDC_STATIC_ORDER7)||
CMXA_MEP::GetFocus() ==GetDlgItem(IDC_STATIC_ORDER8)||
CMXA_MEP::GetFocus() ==GetDlgItem(IDC_STATIC_ORDER9)||
CMXA_MEP::GetFocus() ==GetDlgItem(IDC_STATIC_ORDER10)||
CMXA_MEP::GetFocus() ==GetDlgItem(IDC_STATIC_ORDER11)||
CMXA_MEP::GetFocus() ==GetDlgItem(IDC_STATIC_ORDER12)||
CMXA_MEP::GetFocus() ==GetDlgItem(IDC_STATIC_ORDER13)||
CMXA_MEP::GetFocus() ==GetDlgItem(IDC_STATIC_ORDER14)||
CMXA_MEP::GetFocus() ==GetDlgItem(IDC_STATIC_ORDER15)||
CMXA_MEP::GetFocus() ==GetDlgItem(IDC_STATIC_ORDER16)||
CMXA_MEP::GetFocus() ==GetDlgItem(IDC_STATIC_ENTER)||
CMXA_MEP::GetFocus() ==GetDlgItem(IDC_STATIC_CANCEL))
{
index++;
if(index>18) index=0;
if(index==0)
{
m_static_AORB.SetFocus();
m_static_AORB.bkColor( bk1 );
m_static_CANCEL.bkColor( bk );
m_tip_AORB.ShowWindow(SW_SHOW);
m_tip_CANCEL.ShowWindow(SW_HIDE);
return TRUE;
}
if(index==1)
{
m_static_ORDER1.SetFocus();
m_static_ORDER1.bkColor( bk1 );
m_static_AORB.bkColor( bk );
m_tip_DG11.ShowWindow(SW_SHOW);
m_tip_AORB.ShowWindow(SW_HIDE);
return TRUE;
}
if(index==2)
{
m_static_ORDER2.SetFocus();
m_static_ORDER2.bkColor( bk1 );
m_static_ORDER1.bkColor( bk );
m_tip_DG21.ShowWindow(SW_SHOW);
m_tip_DG11.ShowWindow(SW_HIDE);
return TRUE;
}
if(index==3)
{
m_static_ORDER3.SetFocus();
m_static_ORDER3.bkColor( bk1 );
m_static_ORDER2.bkColor( bk );
m_tip_DG31.ShowWindow(SW_SHOW);
m_tip_DG21.ShowWindow(SW_HIDE);
return TRUE;
}
if(index==4)
{
m_static_ORDER4.SetFocus();
m_static_ORDER4.bkColor( bk1 );
m_static_ORDER3.bkColor( bk );
m_tip_DG41.ShowWindow(SW_SHOW);
m_tip_DG31.ShowWindow(SW_HIDE);
return TRUE;
}
if(index==5)
{
m_static_ORDER5.SetFocus();
m_static_ORDER5.bkColor( bk1 );
m_static_ORDER4.bkColor( bk );
m_tip_DG51.ShowWindow(SW_SHOW);
m_tip_DG41.ShowWindow(SW_HIDE);
return TRUE;
}
if(index==6)
{
m_static_ORDER6.SetFocus();
m_static_ORDER6.bkColor( bk1 );
m_static_ORDER5.bkColor( bk );
m_tip_DG61.ShowWindow(SW_SHOW);
m_tip_DG51.ShowWindow(SW_HIDE);
return TRUE;
}
if(index==7)
{
m_static_ORDER7.SetFocus();
m_static_ORDER7.bkColor( bk1 );
m_static_ORDER6.bkColor( bk );
m_tip_DG71.ShowWindow(SW_SHOW);
m_tip_DG61.ShowWindow(SW_HIDE);
return TRUE;
}
if(index==8)
{
m_static_ORDER8.SetFocus();
m_static_ORDER8.bkColor( bk1 );
m_static_ORDER7.bkColor( bk );
m_tip_DG81.ShowWindow(SW_SHOW);
m_tip_DG71.ShowWindow(SW_HIDE);
return TRUE;
}
if(index==9)
{
m_static_ORDER9.SetFocus();
m_static_ORDER9.bkColor( bk1 );
m_static_ORDER8.bkColor( bk );
m_tip_DG91.ShowWindow(SW_SHOW);
m_tip_DG81.ShowWindow(SW_HIDE);
return TRUE;
}
if(index==10)
{
m_static_ORDER10.SetFocus();
m_static_ORDER10.bkColor( bk1 );
m_static_ORDER9.bkColor( bk );
m_tip_DG101.ShowWindow(SW_SHOW);
m_tip_DG91.ShowWindow(SW_HIDE);
return TRUE;
}
if(index==11)
{
m_static_ORDER11.SetFocus();
m_static_ORDER11.bkColor( bk1 );
m_static_ORDER10.bkColor( bk );
m_tip_DG111.ShowWindow(SW_SHOW);
m_tip_DG101.ShowWindow(SW_HIDE);
return TRUE;
}
if(index==12)
{
m_static_ORDER12.SetFocus();
m_static_ORDER12.bkColor( bk1 );
m_static_ORDER11.bkColor( bk );
m_tip_DG121.ShowWindow(SW_SHOW);
m_tip_DG111.ShowWindow(SW_HIDE);
return TRUE;
}
if(index==13)
{
m_static_ORDER13.SetFocus();
m_static_ORDER13.bkColor( bk1 );
m_static_ORDER12.bkColor( bk );
m_tip_DG131.ShowWindow(SW_SHOW);
m_tip_DG121.ShowWindow(SW_HIDE);
return TRUE;
}
if(index==14)
{
m_static_ORDER14.SetFocus();
m_static_ORDER14.bkColor( bk1 );
m_static_ORDER13.bkColor( bk );
m_tip_DG141.ShowWindow(SW_SHOW);
m_tip_DG131.ShowWindow(SW_HIDE);
return TRUE;
}
if(index==15)
{
m_static_ORDER15.SetFocus();
m_static_ORDER15.bkColor( bk1 );
m_static_ORDER14.bkColor( bk );
m_tip_DG151.ShowWindow(SW_SHOW);
m_tip_DG141.ShowWindow(SW_HIDE);
return TRUE;
}
if(index==16)
{
m_static_ORDER16.SetFocus();
m_static_ORDER16.bkColor( bk1 );
m_static_ORDER15.bkColor( bk );
m_tip_DG161.ShowWindow(SW_SHOW);
m_tip_DG151.ShowWindow(SW_HIDE);
return TRUE;
}
if(index==17)
{
m_static_ENTER.SetFocus();
m_static_ENTER.bkColor( bk1 );
m_static_ORDER16.bkColor( bk );
m_tip_ENTER.ShowWindow(SW_SHOW);
m_tip_DG161.ShowWindow(SW_HIDE);
return TRUE;
}
if(index==18)
{
m_static_CANCEL.SetFocus();
m_static_CANCEL.bkColor( bk1 );
m_static_ENTER.bkColor( bk );
m_tip_CANCEL.ShowWindow(SW_SHOW);
m_tip_ENTER.ShowWindow(SW_HIDE);
return TRUE;
}
}
//在内部下
if(CMXA_MEP::GetFocus() == GetDlgItem(IDC_STATIC_DG13)||
CMXA_MEP::GetFocus() == GetDlgItem(IDC_EDIT_DG14))
{
CString temp1;
if(index1==0)
{
m_static_DG13.GetWindowText(temp1);
if(temp1=="大")
m_static_DG13.SetWindowText("小");
else
m_static_DG13.SetWindowText("大");
m_static_DG13.RedrawWindow();
return TRUE;
}
}
if(CMXA_MEP::GetFocus() == GetDlgItem(IDC_STATIC_DG23)||
CMXA_MEP::GetFocus() == GetDlgItem(IDC_EDIT_DG24))
{
CString temp1;
if(index2==0)
{
m_static_DG23.GetWindowText(temp1);
if(temp1=="大")
m_static_DG23.SetWindowText("小");
else
m_static_DG23.SetWindowText("大");
m_static_DG23.RedrawWindow();
return TRUE;
}
}
if(CMXA_MEP::GetFocus() == GetDlgItem(IDC_STATIC_DG33)||
CMXA_MEP::GetFocus() == GetDlgItem(IDC_EDIT_DG34))
{
CString temp1;
if(index3==0)
{
m_static_DG33.GetWindowText(temp1);
if(temp1=="大")
m_static_DG33.SetWindowText("小");
else
m_static_DG33.SetWindowText("大");
m_static_DG33.RedrawWindow();
return TRUE;
}
}
if(CMXA_MEP::GetFocus() == GetDlgItem(IDC_STATIC_DG43)||
CMXA_MEP::GetFocus() == GetDlgItem(IDC_EDIT_DG44))
{
CString temp1;
if(index4==0)
{
m_static_DG43.GetWindowText(temp1);
if(temp1=="大")
m_static_DG43.SetWindowText("小");
else
m_static_DG43.SetWindowText("大");
m_static_DG43.RedrawWindow();
return TRUE;
}
}
if(CMXA_MEP::GetFocus() == GetDlgItem(IDC_STATIC_DG53)||
CMXA_MEP::GetFocus() == GetDlgItem(IDC_EDIT_DG54))
{
CString temp1;
if(index5==0)
{
m_static_DG53.GetWindowText(temp1);
if(temp1=="大")
m_static_DG53.SetWindowText("小");
else
m_static_DG53.SetWindowText("大");
m_static_DG53.RedrawWindow();
return TRUE;
}
}
if(CMXA_MEP::GetFocus() == GetDlgItem(IDC_STATIC_DG63)||
CMXA_MEP::GetFocus() == GetDlgItem(IDC_EDIT_DG64))
{
CString temp1;
if(index6==0)
{
m_static_DG63.GetWindowText(temp1);
if(temp1=="大")
m_static_DG63.SetWindowText("小");
else
m_static_DG63.SetWindowText("大");
m_static_DG63.RedrawWindow();
return TRUE;
}
}
if(CMXA_MEP::GetFocus() == GetDlgItem(IDC_STATIC_DG73)||
CMXA_MEP::GetFocus() == GetDlgItem(IDC_EDIT_DG74))
{
CString temp1;
if(index7==0)
{
m_static_DG73.GetWindowText(temp1);
if(temp1=="大")
m_static_DG73.SetWindowText("小");
else
m_static_DG73.SetWindowText("大");
m_static_DG73.RedrawWindow();
return TRUE;
}
}
if(CMXA_MEP::GetFocus() == GetDlgItem(IDC_STATIC_DG83)||
CMXA_MEP::GetFocus() == GetDlgItem(IDC_EDIT_DG84))
{
CString temp1;
if(index8==0)
{
m_static_DG83.GetWindowText(temp1);
if(temp1=="大")
m_static_DG83.SetWindowText("小");
else
m_static_DG83.SetWindowText("大");
m_static_DG83.RedrawWindow();
return TRUE;
}
}
if(CMXA_MEP::GetFocus() == GetDlgItem(IDC_STATIC_DG93)||
CMXA_MEP::GetFocus() == GetDlgItem(IDC_EDIT_DG94))
{
CString temp1;
if(index9==0)
{
m_static_DG93.GetWindowText(temp1);
if(temp1=="大")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -