From 89cd7441c184d37f90d4d5311b348e938119765f Mon Sep 17 00:00:00 2001
From: zxd <zxdvslxy@gmail.com>
Date: 星期六, 21 十月 2023 12:28:04 +0800
Subject: [PATCH] 修改最后一个单元格不会被读取的问题

---
 MTerm2/MainFrm.cpp |  422 ++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 372 insertions(+), 50 deletions(-)

diff --git a/MTerm2/MainFrm.cpp b/MTerm2/MainFrm.cpp
index c1df827..404559b 100644
--- a/MTerm2/MainFrm.cpp
+++ b/MTerm2/MainFrm.cpp
@@ -13,6 +13,7 @@
 #include "MTerm2CtrlView.h"
 #include "MTerm2TestView.h"
 #include "MTerm2ProgTxt.h"
+#include <windows.h>
 
 #ifdef _DEBUG
 #define new DEBUG_NEW
@@ -20,11 +21,11 @@
 
 // CMainFrame
 
-IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWndEx)
 
-BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWndEx)
+IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
+
+BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
 	ON_WM_CREATE()
-
 	ON_COMMAND(ID_UPLOAD_FROM_PLC, &CMainFrame::OnUploadFromPlc)
 	ON_COMMAND(ID_VIEW_FUNCKEY_BAR, &CMainFrame::OnViewFunckeyBar)
 	ON_UPDATE_COMMAND_UI(ID_VIEW_FUNCKEY_BAR, &CMainFrame::OnUpdateViewFunckeyBar)
@@ -36,12 +37,34 @@
 	ON_UPDATE_COMMAND_UI(ID_VIEW_INPUTSEG_BAR, &CMainFrame::OnUpdateViewInputsegBar)
 	ON_COMMAND(ID_VIEW_COMMENTS_BAR, &CMainFrame::OnViewCommentsBar)
 	ON_UPDATE_COMMAND_UI(ID_VIEW_COMMENTS_BAR, &CMainFrame::OnUpdateViewCommentsBar)
-
+	ON_COMMAND(ID_BUTTON_0, &CMainFrame::OnBtn0)
+	ON_COMMAND(ID_BUTTON_1, &CMainFrame::OnBtn1)
+	ON_COMMAND(ID_BUTTON_2, &CMainFrame::OnBtn2)
+	ON_COMMAND(ID_BUTTON_3, &CMainFrame::OnBtn3)
+	ON_COMMAND(ID_BUTTON_4, &CMainFrame::OnBtn4)
+	ON_COMMAND(ID_BUTTON_5, &CMainFrame::OnBtn5)
+	ON_COMMAND(ID_BUTTON_6, &CMainFrame::OnBtn6)
+	ON_COMMAND(ID_BUTTON_7, &CMainFrame::OnBtn7)
+	ON_COMMAND(ID_BUTTON_8, &CMainFrame::OnBtn8)
+	ON_COMMAND(ID_BUTTON_9, &CMainFrame::OnBtn9)
+	ON_COMMAND(ID_BUTTON_A, &CMainFrame::OnBtnA)
+	ON_COMMAND(ID_BUTTON_B, &CMainFrame::OnBtnB)
+	ON_COMMAND(ID_BUTTON_C, &CMainFrame::OnBtnC)
+	ON_COMMAND(ID_BUTTON_D, &CMainFrame::OnBtnD)
+	ON_COMMAND(ID_BUTTON_E, &CMainFrame::OnBtnE)
+	ON_COMMAND(ID_BUTTON_F, &CMainFrame::OnBtnF)
+	ON_COMMAND(ID_BUTTON_MINUS, &CMainFrame::OnBtnMinus)
+	ON_COMMAND(ID_BUTTON_DOT, &CMainFrame::OnBtnDot)
+	ON_COMMAND(ID_BUTTON_RET, &CMainFrame::OnBtnRet)
+	ON_COMMAND(ID_BUTTON_INSERT, &CMainFrame::OnBtnInsert)
+	ON_COMMAND(ID_BUTTON_DELETE, &CMainFrame::OnBtnDelete)
+	ON_COMMAND(ID_BUTTON_ESC, &CMainFrame::OnBtnEsc)
 //	ON_COMMAND(ID_MENU_VIEW_LDS, &CMainFrame::OnMenuViewLds)
 //	ON_COMMAND(ID_MENU_VIEW_BLD, &CMainFrame::OnMenuViewBld)
 //	ON_COMMAND(ID_MENU_VIEW_BNL, &CMainFrame::OnMenuViewBnl)
 
 ON_COMMAND(ID_MENU_SHOW_LOG, &CMainFrame::OnMenuShowLog)
+ON_COMMAND(ID_MENU_SHOW_DEV, &CMainFrame::OnMenuShowDev)
 END_MESSAGE_MAP()
 
 static UINT indicators[] =
@@ -64,13 +87,40 @@
 {
 }
 
+BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
+{
+	// TODO: 鍦ㄦ娣诲姞涓撶敤浠g爜鍜�/鎴栬皟鐢ㄥ熀绫�
+	if (m_wndDlgBar_Func_Key.OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))
+
+		return     TRUE;
+
+	return CMDIFrameWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
+}
+
 int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
 {
-	if (CMDIFrameWndEx::OnCreate(lpCreateStruct) == -1)
+	if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
 		return -1;
 //	m_dlgMyLog.Create(m_dlgMyLog.IDD, GetParent());
 //	m_dlgMyLog.ShowWindow(SW_SHOW);
 
+//	BOOL bNameValid;
+
+	// 鍒涘缓绫昏鍥�
+	CString strNavView;
+//	bNameValid = strNavView.LoadString(IDS_CLASS_VIEW);
+//	ASSERT(bNameValid);
+/*
+	strNavView = _T("瀵艰埅瑙嗗浘");
+	if (!m_wndNavView.Create(strNavView, this, CRect(0, 0, 200, 200), TRUE, ID_VIEW_NAVVIEW, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI))
+	{
+		TRACE0("鏈兘鍒涘缓鈥滃鑸鍥锯�濈獥鍙n");
+		return FALSE; // 鏈兘鍒涘缓
+	}
+	m_wndNavView.EnableDocking(CBRS_ALIGN_ANY);
+	//DockPane(&m_wndNavView);
+	//DockControlBar(&m_wndNavView);
+*/
 	if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
 		!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
 	{
@@ -78,37 +128,37 @@
 		return -1;      // 鏈兘鍒涘缓
 	}
 
-	///*   杈撳叆鏍�
-	if (!m_wndToolBar_InputShow.CreateEx(this, TBSTYLE_FLAT,
+	/*   杈撳叆鏍�
+	if (!m_wndTBar_InputShow.CreateEx(this, TBSTYLE_FLAT,
 		WS_CHILD | WS_VISIBLE | CBRS_BOTTOM | CBRS_FLOAT_MULTI | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC,
 		CRect(1, 1, 1, 1), IDW_TOOL_BAR2) ||
-		!m_wndToolBar_InputShow.LoadToolBar(IDR_TOOLBAR_INPUT_SHOW))
+		!m_wndTBar_InputShow.LoadToolBar(IDR_TOOLBAR_INPUT_SHOW))
 	{
 		TRACE0("鏈兘鍒涘缓鏁板瓧宸ュ叿鏍廫n");
 		return -1;      // 鏈兘鍒涘缓
 	}
-	//*/
 	CRect rect1;
-	int index = m_wndToolBar_InputShow.CommandToIndex(ID_BUTTON_INPUT_SHOW);
+	int index = m_wndTBar_InputShow.CommandToIndex(ID_BUTTON_INPUT_SHOW);
 	UINT nID,nStyle;
 	int iImage;
-	m_wndToolBar_InputShow.GetButtonInfo(0, nID, nStyle, iImage);
-	m_wndToolBar_InputShow.SetButtonInfo(index, ID_BUTTON_INPUT_SHOW, TBBS_SEPARATOR, 100);
-	m_wndToolBar_InputShow.GetItemRect(index, &rect1);
+	m_wndTBar_InputShow.GetButtonInfo(0, nID, nStyle, iImage);
+	m_wndTBar_InputShow.SetButtonInfo(index, ID_BUTTON_INPUT_SHOW, TBBS_SEPARATOR, 100);
+	m_wndTBar_InputShow.GetItemRect(index, &rect1);
 	rect1.left = 1;
 	rect1.top = 2;
 	rect1.right = rect1.left + 100;
 	rect1.bottom = rect1.top + 20;
+	//*/
 /*
 	if (!m_InputShowEdit.Create(WS_CHILD | WS_VISIBLE | WS_BORDER, rect1, \
-		&m_wndToolBar_InputShow, ID_BUTTON_INPUT_SHOW))
+		&m_wndTBar_InputShow, ID_BUTTON_INPUT_SHOW))
 	{
 		TRACE(_T("Failed to create CEdit\n"));
 		return FALSE;
 	}
-//*/
+
 	if (!m_InputShowStatic.Create(_T("Test1"),WS_CHILD | WS_VISIBLE |WS_EX_CLIENTEDGE, rect1, \
-		&m_wndToolBar_InputShow, ID_BUTTON_INPUT_SHOW))
+		&m_wndTBar_InputShow, ID_BUTTON_INPUT_SHOW))
 	{
 		TRACE(_T("Failed to create CStaticEx\n"));
 		return FALSE;
@@ -116,30 +166,57 @@
 	m_InputShowStatic.SetBkColor(RGB(255, 255, 255));
 	m_InputShowStatic.SetTextColor(RGB(255, 128, 128));
 	m_InputShowStatic.SetTextSize(20);
-
+//*/
 	//m_InputShowEdit.SetReadOnly(true);
 ///*
-	if (!m_wndToolBar_Num.CreateEx(this, TBSTYLE_FLAT, 
+	if (!m_wndTBar_Num_Key.CreateEx(this, TBSTYLE_FLAT, 
 		WS_CHILD | WS_VISIBLE | CBRS_BOTTOM | CBRS_FLOAT_MULTI | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC,
 		CRect(1,1,1,1),IDW_TOOL_BAR2) ||
-		!m_wndToolBar_Num.LoadToolBar(IDR_TOOLBAR_NUM))
+		!m_wndTBar_Num_Key.LoadToolBar(IDR_TOOLBAR_NUM_KEY))
 	{
-		TRACE0("鏈兘鍒涘缓鏁板瓧宸ュ叿鏍廫n");
+		TRACE0("鏈兘鍒涘缓鏁板瓧閿伐鍏锋爮\n");
 		return -1;      // 鏈兘鍒涘缓
 	}
 //*/
 
 ///*
-	if (!m_wndToolBar_Edit.CreateEx(this, TBSTYLE_FLAT,
+	if (!m_wndTBar_Edit_Key.CreateEx(this, TBSTYLE_FLAT,
 		WS_CHILD | WS_VISIBLE | CBRS_BOTTOM | CBRS_FLOAT_MULTI | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC,
-		CRect(1, 1, 1, 1), IDW_TOOL_BAR_EDIT) ||
-		!m_wndToolBar_Edit.LoadToolBar(IDR_TOOLBAR_EDIT))
+		CRect(1, 1, 1, 1), IDR_TOOLBAR_EDIT_KEY) ||
+		!m_wndTBar_Edit_Key.LoadToolBar(IDR_TOOLBAR_EDIT_KEY))
 	{
-		TRACE0("鏈兘鍒涘缓鏁板瓧宸ュ叿鏍廫n");
+		TRACE0("鏈兘鍒涘缓缂栬緫閿伐鍏锋爮\n");
 		return -1;      // 鏈兘鍒涘缓
 	}
 	//*/
-	
+/*
+	if (!m_wndToolBar_Func_Key.CreateEx(this, TBSTYLE_FLAT,
+		WS_CHILD | WS_VISIBLE | CBRS_BOTTOM | CBRS_FLOAT_MULTI | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC,
+		CRect(1, 1, 1, 1), IDW_TOOL_BAR_FUNC_KEY) ||
+		!m_wndToolBar_Func_Key.LoadToolBar(IDR_TOOLBAR_FUNC_KEY2))
+	{
+		TRACE0("鏈兘鍒涘缓鍔熻兘閿伐鍏锋爮\n");
+		return -1;      // 鏈兘鍒涘缓
+	}
+	//m_wndToolBar_Func_Key.SetTwoRowsWithSibling();
+	//*/
+	if (!m_wndDlgBar_InputShow.Create(this, IDD_DIALOGBAR_INPUT_SHOW, WS_CHILD | WS_VISIBLE | CBRS_BOTTOM | CBRS_FLOAT_MULTI | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC,
+		IDD_DIALOGBAR_INPUT_SHOW))
+	{
+		TRACE0("鏈兘鍒涘缓鍔熻兘閿�2宸ュ叿鏍廫n");
+		return -1;      // 鏈兘鍒涘缓
+	}
+
+	///*
+	if (!m_wndDlgBar_Func_Key.Create(this, IDD_DIALOGBAR_FUNC_KEYS,WS_CHILD | WS_VISIBLE | CBRS_BOTTOM | CBRS_FLOAT_MULTI | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC,
+		IDD_DIALOGBAR_FUNC_KEYS))
+	{
+		TRACE0("鏈兘鍒涘缓鍔熻兘閿�2宸ュ叿鏍廫n");
+		return -1;      // 鏈兘鍒涘缓
+	}
+//	ShowControlBar(&m_wndDlgBar_Func_Key, TRUE, TRUE);
+//	m_wndDlgBar_Func_Key.MoveWindow(100, 100, 200, 200);
+	//*/
 
 	if (!m_wndStatusBar.Create(this))
 	{
@@ -148,47 +225,63 @@
 	}
 	m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT));
 	m_wndStatusBar.SetPaneStyle(0, SBPS_STRETCH);
-//	/*
-
-	if (!m_wndMyPaneLog.Create(_T("鏃ュ織绐楀彛"), this, CRect(0, 0, 200, 200), TRUE, 1235, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS
+	//m_wndStatusBar.OnCtlColor();
+/*
+	if (!m_wndMyPaneLog.Create(_T("鏃ュ織绐楀彛"), this->GetParent(), CRect(0, 0, 200, 200), TRUE, 1235, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS
 		| WS_CLIPCHILDREN | CBRS_RIGHT | CBRS_FLOAT_MULTI))
 	{
 		TRACE0("鏈兘鍒涘缓鈥淢yPaneLog绐楀彛\n");
 		return FALSE;
 	}
+//	m_wndMyPaneLog.EnableDocking(CBRS_ALIGN_ANY);
 
 //*/
+	m_dlgMyLog.Create(m_dlgMyLog.IDD, this);
+//	m_dlgMyLog.ModifyStyle(0, WS_POPUPWINDOW);
+	m_dlgMyLog.ShowWindow(SW_SHOW);
+
 	// TODO: 濡傛灉涓嶉渶瑕佸彲鍋滈潬宸ュ叿鏍忥紝鍒欏垹闄よ繖涓夎
 	m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
 	EnableDocking(CBRS_ALIGN_ANY);
-	DockPane(&m_wndToolBar);
+	//DockPane(&m_wndToolBar);
+	DockControlBar(&m_wndToolBar);
 
-
-	m_wndMyPaneLog.EnableDocking(CBRS_ALIGN_ANY);
 //	EnableDocking(CBRS_ALIGN_ANY);
 
 
+
+//	CDockablePane* pTabbedBar = nullptr;
+//	m_wndNavView.AttachToTabWnd(&m_wndFileView, DM_SHOW, TRUE, &pTabbedBar);
+
+
 ///*
-	m_wndToolBar_InputShow.EnableDocking(CBRS_ALIGN_ANY);
-	m_wndToolBar_Num.EnableDocking(CBRS_ALIGN_ANY);
-	m_wndToolBar_Edit.EnableDocking(CBRS_ALIGN_ANY);
+	m_wndDlgBar_InputShow.EnableDocking(CBRS_ALIGN_TOP | CBRS_ALIGN_BOTTOM);
+	m_wndTBar_Num_Key.EnableDocking(CBRS_ALIGN_ANY);
+	m_wndTBar_Edit_Key.EnableDocking(CBRS_ALIGN_ANY);
+//	m_wndToolBar_Func_Key.EnableDocking(CBRS_ALIGN_ANY);
+	m_wndDlgBar_Func_Key.EnableDocking(CBRS_ALIGN_TOP| CBRS_ALIGN_BOTTOM);
 
 	EnableDocking(CBRS_ALIGN_ANY);
 
 //	DockPane(&m_wndToolBar);
 
-	DockPane(&m_wndToolBar_InputShow);
-	DockPane(&m_wndToolBar_Num);
-	DockPane(&m_wndToolBar_Edit);
-	
-	DockPane(&m_wndMyPaneLog);
+	DockControlBar(&m_wndDlgBar_InputShow);
+	DockControlBar(&m_wndTBar_Num_Key);
+	DockControlBar(&m_wndTBar_Edit_Key);
+//	DockPane(&m_wndToolBar_Func_Key);
+//	DockPane(&m_wndDlgBar_Func_Key);
+	DockControlBar(&m_wndDlgBar_Func_Key);
+//	DockPane(&m_wndMyPaneLog);
+
+
 //*/
 	return 0;
 }
 
+
 BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
 {
-	if( !CMDIFrameWndEx::PreCreateWindow(cs) )
+	if( !CMDIFrameWnd::PreCreateWindow(cs) )
 		return FALSE;
 	// TODO: 鍦ㄦ澶勯�氳繃淇敼
 	//  CREATESTRUCT cs 鏉ヤ慨鏀圭獥鍙g被鎴栨牱寮�
@@ -201,12 +294,12 @@
 #ifdef _DEBUG
 void CMainFrame::AssertValid() const
 {
-	CMDIFrameWndEx::AssertValid();
+	CMDIFrameWnd::AssertValid();
 }
 
 void CMainFrame::Dump(CDumpContext& dc) const
 {
-	CMDIFrameWndEx::Dump(dc);
+	CMDIFrameWnd::Dump(dc);
 }
 #endif //_DEBUG
 
@@ -218,18 +311,16 @@
 void CMainFrame::OnUploadFromPlc()
 {
 	// TODO: 鍦ㄦ娣诲姞鍛戒护澶勭悊绋嬪簭浠g爜
+	SysLog(_T("Upload from PLC, (From mainframe)"));
 	CWinAppEx* pApp = &theApp;
-	POSITION curTemplatePos = pApp->GetFirstDocTemplatePosition();
+	
+	POSITION curTemplatePos = theApp.m_pDocManager->GetFirstDocTemplatePosition();
 	if (curTemplatePos != NULL)
 	{
-		CDocTemplate* curTemplate = pApp->GetNextDocTemplate(curTemplatePos);
-		curTemplate->OpenDocumentFile(NULL);
-		//CView* thisView = GetActiveView();
-		CMTerm2Doc* pDoc = (CMTerm2Doc*)GetActiveDocument();
-//		pDoc->OnNewDocument();
-		pDoc->OnUploadFromPlc();
+		CDocTemplate* curTemplate = theApp.m_pDocManager->GetNextDocTemplate(curTemplatePos);
+		CMTerm2Doc* pDoc = (CMTerm2Doc* ) curTemplate->OpenDocumentFile(NULL);
+		if (pDoc) 	pDoc->OnUploadFromPlc();
 	}
-	//SysLog(_T("From mainframe"));
 
 }
 
@@ -237,18 +328,27 @@
 {
 	// TODO: 鍦ㄦ娣诲姞鍛戒护澶勭悊绋嬪簭浠g爜
 	m_wndMyPaneLog.ShowWindow(SW_SHOW);
+	m_wndNavView.ShowWindow(SW_SHOW);
 }
 
 
 void CMainFrame::OnViewFunckeyBar()
 {
 	// TODO: 鍦ㄦ娣诲姞鍛戒护澶勭悊绋嬪簭浠g爜
+	CString s1;
+	s1.Format(_T("鏄剧ず鍔熻兘閿爮"));
+	SysLog(s1);
+	m_wndDlgBar_Func_Key.ShowWindow(SW_HIDE);
+	m_wndDlgBar_Func_Key.ShowWindow(SW_SHOW);
+	ShowControlBar(&m_wndDlgBar_Func_Key, TRUE, FALSE);
+	
 }
 
 
 void CMainFrame::OnUpdateViewFunckeyBar(CCmdUI *pCmdUI)
 {
 	// TODO: 鍦ㄦ娣诲姞鍛戒护鏇存柊鐢ㄦ埛鐣岄潰澶勭悊绋嬪簭浠g爜
+
 }
 
 
@@ -267,6 +367,12 @@
 void CMainFrame::OnViewNumkeyBar()
 {
 	// TODO: 鍦ㄦ娣诲姞鍛戒护澶勭悊绋嬪簭浠g爜
+	CString s1;
+	s1.Format(_T("鏄剧ず鏁板瓧閿爮"));
+	SysLog(s1);
+	m_wndTBar_Num_Key.ShowWindow(SW_HIDE);
+	m_wndTBar_Num_Key.ShowWindow(SW_SHOW);
+
 }
 
 
@@ -318,3 +424,219 @@
 }
 */
 
+int CMainFrame::GetInputInfo(int inputInfo)
+{
+	// TODO: 鍦ㄦ澶勬坊鍔犲疄鐜颁唬鐮�.
+	CString        m_InputInfo;
+
+	CString s1;
+	s1.Format(_T("From MainFrame , input %s"), m_InputInfo);
+	SysLog(s1);
+
+	m_wndDlgBar_InputShow.SetDisplay(inputInfo);
+
+	return 0;
+}
+
+void CMainFrame::OnBtn0()
+{
+	// TODO: 鍦ㄦ娣诲姞鍛戒护澶勭悊绋嬪簭浠g爜
+	m_wndDlgBar_InputShow.SetDisplay(0x00030000);
+}
+void CMainFrame::OnBtn1()
+{
+	// TODO: 鍦ㄦ娣诲姞鍛戒护澶勭悊绋嬪簭浠g爜
+	m_wndDlgBar_InputShow.SetDisplay(0x00030001);
+}
+void CMainFrame::OnBtn2()
+{
+	// TODO: 鍦ㄦ娣诲姞鍛戒护澶勭悊绋嬪簭浠g爜
+	m_wndDlgBar_InputShow.SetDisplay(0x00030002);
+}
+void CMainFrame::OnBtn3()
+{
+	// TODO: 鍦ㄦ娣诲姞鍛戒护澶勭悊绋嬪簭浠g爜
+	m_wndDlgBar_InputShow.SetDisplay(0x00030003);
+}
+void CMainFrame::OnBtn4()
+{
+	// TODO: 鍦ㄦ娣诲姞鍛戒护澶勭悊绋嬪簭浠g爜
+	m_wndDlgBar_InputShow.SetDisplay(0x00030004);
+}
+void CMainFrame::OnBtn5()
+{
+	// TODO: 鍦ㄦ娣诲姞鍛戒护澶勭悊绋嬪簭浠g爜
+	m_wndDlgBar_InputShow.SetDisplay(0x00030005);
+}
+void CMainFrame::OnBtn6()
+{
+	// TODO: 鍦ㄦ娣诲姞鍛戒护澶勭悊绋嬪簭浠g爜
+	m_wndDlgBar_InputShow.SetDisplay(0x00030006);
+}
+void CMainFrame::OnBtn7()
+{
+	// TODO: 鍦ㄦ娣诲姞鍛戒护澶勭悊绋嬪簭浠g爜
+	m_wndDlgBar_InputShow.SetDisplay(0x00030007);
+}
+void CMainFrame::OnBtn8()
+{
+	// TODO: 鍦ㄦ娣诲姞鍛戒护澶勭悊绋嬪簭浠g爜
+	m_wndDlgBar_InputShow.SetDisplay(0x00030008);
+}
+void CMainFrame::OnBtn9()
+{
+	// TODO: 鍦ㄦ娣诲姞鍛戒护澶勭悊绋嬪簭浠g爜
+	m_wndDlgBar_InputShow.SetDisplay(0x00030009);
+}
+void CMainFrame::OnBtnA()
+{
+	// TODO: 鍦ㄦ娣诲姞鍛戒护澶勭悊绋嬪簭浠g爜
+	m_wndDlgBar_InputShow.SetDisplay(0x0003000A);
+}
+void CMainFrame::OnBtnB()
+{
+	// TODO: 鍦ㄦ娣诲姞鍛戒护澶勭悊绋嬪簭浠g爜
+	m_wndDlgBar_InputShow.SetDisplay(0x0003000B);
+}
+void CMainFrame::OnBtnC()
+{
+	// TODO: 鍦ㄦ娣诲姞鍛戒护澶勭悊绋嬪簭浠g爜
+	m_wndDlgBar_InputShow.SetDisplay(0x0003000C);
+}
+
+void CMainFrame::OnBtnD()
+{
+	// TODO: 鍦ㄦ娣诲姞鍛戒护澶勭悊绋嬪簭浠g爜
+	m_wndDlgBar_InputShow.SetDisplay(0x0003000D);
+}
+void CMainFrame::OnBtnE()
+{
+	// TODO: 鍦ㄦ娣诲姞鍛戒护澶勭悊绋嬪簭浠g爜
+	m_wndDlgBar_InputShow.SetDisplay(0x0003000E);
+}
+void CMainFrame::OnBtnF()
+{
+	// TODO: 鍦ㄦ娣诲姞鍛戒护澶勭悊绋嬪簭浠g爜
+
+	m_wndDlgBar_InputShow.SetDisplay(0x0003000F);
+
+
+
+}
+void CMainFrame::OnBtnMinus()
+{
+	// TODO: 鍦ㄦ娣诲姞鍛戒护澶勭悊绋嬪簭浠g爜
+	//m_wndDlgBar_InputShow.SetDisplay(_T("-"));
+}
+void CMainFrame::OnBtnDot()
+{
+	// TODO: 鍦ㄦ娣诲姞鍛戒护澶勭悊绋嬪簭浠g爜
+	//m_wndDlgBar_InputShow.SetDisplay(_T("."));
+}
+
+
+
+
+int CMainFrame::GetInputCell(CMyDlgBarInputShow::tagInputCell inputCell)
+{
+	
+	localInputCell = inputCell;
+	return 0;
+}
+
+
+void CMainFrame::OnBtnRet()
+{
+	// TODO: 鍦ㄦ娣诲姞鍛戒护澶勭悊绋嬪簭浠g爜
+	CString strName;
+	 CMTerm2View::stCell cell1;
+
+	CMDIChildWnd  *pChild = (CMDIChildWnd   *)GetActiveFrame();
+	CView   *p1 = (CView*)pChild->GetActiveView();
+	if (p1 == NULL) return;
+	CMTerm2View * p2 = (CMTerm2View *)p1;
+	m_wndDlgBar_InputShow.SetDisplay(0x00140000);
+
+	switch (localInputCell.OP)
+	{
+	case CMTerm2View::typeNO:
+	case CMTerm2View::typeNC:
+	case CMTerm2View::typeOUT:
+	case CMTerm2View::typeSET:
+	case CMTerm2View::typeRESET:
+	case CMTerm2View::typeTM:
+		switch (localInputCell.param)
+		{
+		case KLCoilTypeX:
+			strName = "X";
+			break;
+		case KLCoilTypeY:
+			strName = "Y";
+			break;
+		case KLCoilTypeR:
+			strName = "R";
+			break;
+		case KLCoilTypeLR:
+			strName = "L";
+			break;
+		case KLCoilTypeT:
+			strName = "T";
+			break;
+		case KLCoilTypeC:
+			strName = "C";
+			break;
+		case OP_TMX:
+			strName = "TMX   ";
+		case OP_TMY:
+			strName = "TMY   ";
+		case OP_TMR:
+			strName = "TMR   ";
+		case OP_TML:
+			strName = "TML   ";
+		default:
+			break;
+		}
+	default:
+		break;		
+	}
+
+
+
+	cell1.sCoilName = strName + localInputCell.num;
+	cell1.nType = localInputCell.OP;
+	//cell1.sCoilName = "R555";
+	cell1.nProgStep = 0;
+	cell1.bEditing = 1;
+	cell1.sParam = "D88";
+	cell1.bLeftLineUp = 0;
+	cell1.nDataType = CMTerm2View::typeCoil;
+
+	p2->GetIncToView(cell1);   
+
+	
+	m_wndDlgBar_Func_Key.SetBtnDisplayESC();
+}
+void CMainFrame::OnBtnInsert()
+{
+	// TODO: 鍦ㄦ娣诲姞鍛戒护澶勭悊绋嬪簭浠g爜
+	m_wndDlgBar_InputShow.SetDisplay(0x00240000);
+	m_wndDlgBar_Func_Key.SetBtnDisplayESC();
+}
+void CMainFrame::OnBtnDelete()
+{
+	// TODO: 鍦ㄦ娣诲姞鍛戒护澶勭悊绋嬪簭浠g爜
+	m_wndDlgBar_InputShow.SetDisplay(0x00340000);
+	m_wndDlgBar_Func_Key.SetBtnDisplayESC();
+}
+void CMainFrame::OnBtnEsc()
+{
+	// TODO: 鍦ㄦ娣诲姞鍛戒护澶勭悊绋嬪簭浠g爜
+	//m_wndDlgBar_InputShow.SetDisplay(_T("Esc"));
+	m_wndDlgBar_Func_Key.SetBtnDisplayESC();
+}
+
+void CMainFrame::OnMenuShowDev()
+{
+	// TODO: 鍦ㄦ娣诲姞鍛戒护澶勭悊绋嬪簭浠g爜
+
+}

--
Gitblit v1.9.1