From b978bfa096fdde06a7659838cf81ed4477777737 Mon Sep 17 00:00:00 2001
From: QuakeGod <QuakeGod@sina.com>
Date: 星期五, 27 五月 2022 18:10:38 +0800
Subject: [PATCH] change frameex to frame, and add func_key dialogbar

---
 MTerm2/ChildFrm.cpp             |   14 
 MTerm2/MainFrm.cpp              |  165 ++++++++++----
 MTerm2/MTerm2.vcxproj.filters   |   27 ++
 MTerm2/MTerm2CtrlView.h         |    2 
 MTerm2/pch.h                    |    2 
 MTerm2/0prog3.kpg               |    6 
 MTerm2/CMyFuncKeyToolBar.h      |   22 ++
 MTerm2/ChildFrm.h               |    6 
 MTerm2/MyDlgBarInputShow.h      |   23 ++
 MTerm2/MyDialogLog.cpp          |    4 
 MTerm2/res/toolbar_.bmp         |    0 
 MTerm2/MTerm2View.cpp           |   34 +-
 MTerm2/MainFrm.h                |   27 +
 MTerm2/MTerm2View.h             |    2 
 MTerm2/resource.h               |   38 +++
 MTerm2/CMyFuncKeyToolBar.cpp    |   45 ++++
 MTerm2/MTerm2.vcxproj           |    9 
 MTerm2/MyDlgBarInputShow.cpp    |   33 +++
 MTerm2/res/bmp00004.bmp         |    0 
 MTerm2/MyDlgBarFuncKey.h        |   39 +++
 MTerm2/MyDlgBarFuncKey.cpp      |  108 +++++++++
 MTerm2/res/toolbar_func_key.bmp |    0 
 MTerm2/MTerm2.rc                |    0 
 23 files changed, 512 insertions(+), 94 deletions(-)

diff --git a/MTerm2/0prog3.kpg b/MTerm2/0prog3.kpg
index da52969..fba89ae 100644
--- a/MTerm2/0prog3.kpg
+++ b/MTerm2/0prog3.kpg
@@ -93,5 +93,11 @@
 DT35	绿灯2剩余秒数
 DT36	绿灯2 秒余数
 DT22	绿灯1剩余时间
+R7	R7
+R3	R3
+R70	R70
+R71	R71
+R72	R723
+R73	R73
 [MONCOILLIST]
 [MONDATALIST]
diff --git a/MTerm2/CMyFuncKeyToolBar.cpp b/MTerm2/CMyFuncKeyToolBar.cpp
new file mode 100644
index 0000000..8b3c4d5
--- /dev/null
+++ b/MTerm2/CMyFuncKeyToolBar.cpp
@@ -0,0 +1,45 @@
+#include "pch.h"
+#include "CMyFuncKeyToolBar.h"
+BEGIN_MESSAGE_MAP(CMyFuncKeyToolBar, CMFCToolBar)
+	ON_WM_CREATE()
+	ON_WM_SIZE()
+END_MESSAGE_MAP()
+
+structButton myButtons[] =
+{
+	{33001,_T("11") },
+	{33002,_T("12") },
+	{33003,_T("13") },
+	{33004,_T("14") },
+	{33005,_T("15") },
+	{33006,_T("16") },
+	{33007,_T("17") },
+	{33008,_T("18") },
+	{33009,_T("19") },
+	{33010,_T("110") },
+	{33011,_T("111") },
+	{33012,_T("112") },
+};
+static int myButtonCount = sizeof(myButtons) / sizeof(structButton);
+
+int CMyFuncKeyToolBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
+{
+	if (CMFCToolBar::OnCreate(lpCreateStruct) == -1)
+		return -1;
+	CRect rect1(0, 0, 100, 24);
+	// TODO:  在此添加您专用的创建代码
+	m_buttons[1].Create(myButtons[1].sCaption,WS_CHILD | WS_TABSTOP | WS_VISIBLE |BS_PUSHBUTTON ,rect1, this, myButtons[1].nID);
+
+	CRect rect0(0, 0, 500, 48);
+	this->MoveWindow(rect0);
+	return 0;
+}
+
+
+void CMyFuncKeyToolBar::OnSize(UINT nType, int cx, int cy)
+{
+	//CMFCToolBar::OnSize(nType, cx, cy);
+//	CRect rect0(0, 0, 500, 48);
+//	this->MoveWindow(rect0);
+	// TODO: 在此处添加消息处理程序代码
+}
diff --git a/MTerm2/CMyFuncKeyToolBar.h b/MTerm2/CMyFuncKeyToolBar.h
new file mode 100644
index 0000000..b4271db
--- /dev/null
+++ b/MTerm2/CMyFuncKeyToolBar.h
@@ -0,0 +1,22 @@
+#pragma once
+#include <afxtoolbar.h>
+
+typedef struct tagStructButton {
+	int nID;
+	CString sCaption;
+
+}structButton;
+
+class CMyFuncKeyToolBar :
+	public CMFCToolBar
+{
+public:
+	DECLARE_MESSAGE_MAP()
+	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
+
+	CButton m_buttons[100];
+	
+
+	afx_msg void OnSize(UINT nType, int cx, int cy);
+};
+
diff --git a/MTerm2/ChildFrm.cpp b/MTerm2/ChildFrm.cpp
index 187f69b..ea750d8 100644
--- a/MTerm2/ChildFrm.cpp
+++ b/MTerm2/ChildFrm.cpp
@@ -14,9 +14,9 @@
 
 // CChildFrame
 
-IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWndEx)
+IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)
 
-BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWndEx)
+BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
 	ON_WM_CREATE()
 END_MESSAGE_MAP()
 
@@ -46,7 +46,7 @@
 BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
 {
 	// TODO: 鍦ㄦ澶勯�氳繃淇敼 CREATESTRUCT cs 鏉ヤ慨鏀圭獥鍙g被鎴栨牱寮�
-	if( !CMDIChildWndEx::PreCreateWindow(cs) )
+	if( !CMDIChildWnd::PreCreateWindow(cs) )
 		return FALSE;
 	//淇敼绐楀彛鐨勭被鍨嬩负鏈�澶у寲鏍峰紡
 //	cs.style = cs.style | WS_MAXIMIZE | WS_VISIBLE;
@@ -58,12 +58,12 @@
 #ifdef _DEBUG
 void CChildFrame::AssertValid() const
 {
-	CMDIChildWndEx::AssertValid();
+	CMDIChildWnd::AssertValid();
 }
 
 void CChildFrame::Dump(CDumpContext& dc) const
 {
-	CMDIChildWndEx::Dump(dc);
+	CMDIChildWnd::Dump(dc);
 }
 #endif //_DEBUG
 
@@ -72,7 +72,7 @@
 
 int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
 {
-	if (CMDIChildWndEx::OnCreate(lpCreateStruct) == -1)
+	if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
 		return -1;
 
 	// TODO:  鍦ㄦ娣诲姞鎮ㄤ笓鐢ㄧ殑鍒涘缓浠g爜
@@ -144,7 +144,7 @@
 
 //	m_wndToolBar_InfoShow.EnableDocking(CBRS_ALIGN_ANY);
 //	this->RecalcLayout();
-//	DockPane(&m_wndToolBar_InputShow);
+//	DockPane(&m_wndTBar_InputShow);
 
 	return 0;
 }
diff --git a/MTerm2/ChildFrm.h b/MTerm2/ChildFrm.h
index eb7018b..a0bd570 100644
--- a/MTerm2/ChildFrm.h
+++ b/MTerm2/ChildFrm.h
@@ -4,7 +4,7 @@
 
 #pragma once
 #include "../MyLib/StaticEx.h"
-class CChildFrame : public CMDIChildWndEx
+class CChildFrame : public CMDIChildWnd
 {
 	DECLARE_DYNCREATE(CChildFrame)
 public:
@@ -13,7 +13,7 @@
 // 鐗规��
 protected:
 	CSplitterWnd m_wndSplitter;
-	CMFCStatusBar  m_wndStatusBar;
+	CStatusBar  m_wndStatusBar;
 	CToolBar m_wndToolBar_InfoShow;
 	CStaticEx	m_StaticShowMachine;
 	CStaticEx	m_StaticShowProgPos;
@@ -23,7 +23,7 @@
 	CStaticEx	m_StaticShowAddress;
 
 public:
-	CMFCStatusBar *GetStatusBar()
+	CStatusBar *GetStatusBar()
 	{
 		return &m_wndStatusBar;
 	}
diff --git a/MTerm2/MTerm2.rc b/MTerm2/MTerm2.rc
index 4ce617f..22911cf 100644
--- a/MTerm2/MTerm2.rc
+++ b/MTerm2/MTerm2.rc
Binary files differ
diff --git a/MTerm2/MTerm2.vcxproj b/MTerm2/MTerm2.vcxproj
index e133630..3ee90c1 100644
--- a/MTerm2/MTerm2.vcxproj
+++ b/MTerm2/MTerm2.vcxproj
@@ -191,6 +191,7 @@
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClInclude Include="AnsiParser.h" />
+    <ClInclude Include="CMyFuncKeyToolBar.h" />
     <ClInclude Include="DataParser1.h" />
     <ClInclude Include="DialogCoilMon.h" />
     <ClInclude Include="DialogCommSet1.h" />
@@ -211,6 +212,8 @@
     <ClInclude Include="DialogStatusShow.h" />
     <ClInclude Include="DialogSysRegSet.h" />
     <ClInclude Include="ChildFrm.h" />
+    <ClInclude Include="MyDlgBarFuncKey.h" />
+    <ClInclude Include="MyDlgBarInputShow.h" />
     <ClInclude Include="PropCommCfg.h" />
     <ClInclude Include="PropInputCfg.h" />
     <ClInclude Include="PropMemCfg.h" />
@@ -245,6 +248,7 @@
   <ItemGroup>
     <ClCompile Include="..\MyLib\StaticEx.cpp" />
     <ClCompile Include="AnsiParser.cpp" />
+    <ClCompile Include="CMyFuncKeyToolBar.cpp" />
     <ClCompile Include="DataParser1.cpp" />
     <ClCompile Include="DialogCoilMon.cpp" />
     <ClCompile Include="DialogCommSet1.cpp" />
@@ -264,6 +268,8 @@
     <ClCompile Include="DialogStatusShow.cpp" />
     <ClCompile Include="DialogSysRegSet.cpp" />
     <ClCompile Include="ChildFrm.cpp" />
+    <ClCompile Include="MyDlgBarFuncKey.cpp" />
+    <ClCompile Include="MyDlgBarInputShow.cpp" />
     <ClCompile Include="PropCommCfg.cpp" />
     <ClCompile Include="PropInputCfg.cpp" />
     <ClCompile Include="PropMemCfg.cpp" />
@@ -308,6 +314,7 @@
     <Image Include="res\bmp00001.bmp" />
     <Image Include="res\bmp00002.bmp" />
     <Image Include="res\bmp00003.bmp" />
+    <Image Include="res\bmp00004.bmp" />
     <Image Include="res\classview.bmp" />
     <Image Include="res\classview_hc.bmp" />
     <Image Include="res\class_view.ico" />
@@ -323,6 +330,8 @@
     <Image Include="res\Toolbar.bmp" />
     <Image Include="res\toolbar1.bmp" />
     <Image Include="res\toolbar2.bmp" />
+    <Image Include="res\toolbar_.bmp" />
+    <Image Include="res\toolbar_func_key.bmp" />
   </ItemGroup>
   <ItemGroup>
     <Text Include="design1.txt" />
diff --git a/MTerm2/MTerm2.vcxproj.filters b/MTerm2/MTerm2.vcxproj.filters
index e835c87..047b2c0 100644
--- a/MTerm2/MTerm2.vcxproj.filters
+++ b/MTerm2/MTerm2.vcxproj.filters
@@ -168,6 +168,15 @@
     <ClInclude Include="DialogFactCfg.h">
       <Filter>澶存枃浠�</Filter>
     </ClInclude>
+    <ClInclude Include="CMyFuncKeyToolBar.h">
+      <Filter>澶存枃浠�</Filter>
+    </ClInclude>
+    <ClInclude Include="MyDlgBarFuncKey.h">
+      <Filter>澶存枃浠�</Filter>
+    </ClInclude>
+    <ClInclude Include="MyDlgBarInputShow.h">
+      <Filter>澶存枃浠�</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="MainFrm.cpp">
@@ -311,6 +320,15 @@
     <ClCompile Include="DialogFactCfg.cpp">
       <Filter>婧愭枃浠�</Filter>
     </ClCompile>
+    <ClCompile Include="CMyFuncKeyToolBar.cpp">
+      <Filter>婧愭枃浠�</Filter>
+    </ClCompile>
+    <ClCompile Include="MyDlgBarFuncKey.cpp">
+      <Filter>婧愭枃浠�</Filter>
+    </ClCompile>
+    <ClCompile Include="MyDlgBarInputShow.cpp">
+      <Filter>婧愭枃浠�</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="MTerm2.rc">
@@ -381,6 +399,15 @@
     <Image Include="res\bitmap1.bmp">
       <Filter>璧勬簮鏂囦欢</Filter>
     </Image>
+    <Image Include="res\toolbar_.bmp">
+      <Filter>璧勬簮鏂囦欢</Filter>
+    </Image>
+    <Image Include="res\toolbar_func_key.bmp">
+      <Filter>璧勬簮鏂囦欢</Filter>
+    </Image>
+    <Image Include="res\bmp00004.bmp">
+      <Filter>璧勬簮鏂囦欢</Filter>
+    </Image>
   </ItemGroup>
   <ItemGroup>
     <Text Include="design1.txt" />
diff --git a/MTerm2/MTerm2CtrlView.h b/MTerm2/MTerm2CtrlView.h
index 50890f5..69fee06 100644
--- a/MTerm2/MTerm2CtrlView.h
+++ b/MTerm2/MTerm2CtrlView.h
@@ -14,7 +14,7 @@
 
 public:
 //	CMTerm2Doc* GetDocument() const;
-	CMFCStatusBar * m_pStatusBar;
+	CStatusBar * m_pStatusBar;
 #ifdef AFX_DESIGN_TIME
 	enum { IDD = IDD_MTerm2CtrlView };
 #endif
diff --git a/MTerm2/MTerm2View.cpp b/MTerm2/MTerm2View.cpp
index 1b960d2..8e84d07 100644
--- a/MTerm2/MTerm2View.cpp
+++ b/MTerm2/MTerm2View.cpp
@@ -1192,8 +1192,8 @@
 	s1.Format(_T("LD db Clk %d %d  %02X  Scroll %d %d  Total %d %d Row %d Col %d"),
 		point.x, point.y, nFlags, scroll1.x, scroll1.y, tx, ty, nRow, nCol);
 	m_pStatusBar->SetPaneText(6, s1);
-	m_pStatusBar->SetPaneBackgroundColor(6, RGB(255, 255, 0));
-	m_pStatusBar->SetPaneTextColor(6, RGB(0, 0, 255));
+//	m_pStatusBar->SetPaneBackgroundColor(6, RGB(255, 255, 0));
+//	m_pStatusBar->SetPaneTextColor(6, RGB(0, 0, 255));
 //	m_pStatusBar->EnablePaneProgressBar(6);
 //	m_pStatusBar->SetPaneProgress(6, 5);
 	SysLog(s1);
@@ -1535,17 +1535,17 @@
 		if (!pDoc->m_bOnline) {
 			s1 = _T("绂荤嚎");
 			m_pStatusBar->SetPaneText(idxOnline, s1);
-			m_pStatusBar->SetPaneBackgroundColor(idxOnline);
+//			m_pStatusBar->SetPaneBackgroundColor(idxOnline);
 		}
 		else if (pDoc->m_bOnline) {
 			if (pDoc->m_bSimulate)	{
 				s1 = _T("鍦ㄧ嚎(浠跨湡)");
 				m_pStatusBar->SetPaneText(2, s1);
-				m_pStatusBar->SetPaneBackgroundColor(idxOnline, OnlineColor);
+//				m_pStatusBar->SetPaneBackgroundColor(idxOnline, OnlineColor);
 			}else{
 				s1 = _T("鍦ㄧ嚎");
 				m_pStatusBar->SetPaneText(2, s1);
-				m_pStatusBar->SetPaneBackgroundColor(idxOnline, OnlineColor);
+//				m_pStatusBar->SetPaneBackgroundColor(idxOnline, OnlineColor);
 			}
 		}
 	}
@@ -1553,20 +1553,20 @@
 		if (!pDoc->m_bOnline)		{
 			s1 = _T("");
 			m_pStatusBar->SetPaneText(idxRunning, s1);
-			m_pStatusBar->SetPaneBackgroundColor(idxRunning);
-			m_pStatusBar->SetPaneWidth(idxRunning, 0);
+//			m_pStatusBar->SetPaneBackgroundColor(idxRunning);
+//			m_pStatusBar->SetPaneWidth(idxRunning, 0);
 			m_pStatusBar->SetPaneStyle(idxRunning, SBPS_DISABLED);
 
 		}else if (!pDoc->m_bPlcRunning) {
 			s1 = _T("PROG");
 			m_pStatusBar->SetPaneText(idxRunning, s1);
-			m_pStatusBar->SetPaneWidth(idxRunning, s1.GetLength()*8);
-			m_pStatusBar->SetPaneBackgroundColor(idxRunning, ProgColor);
+//			m_pStatusBar->SetPaneWidth(idxRunning, s1.GetLength()*8);
+//			m_pStatusBar->SetPaneBackgroundColor(idxRunning, ProgColor);
 		}else {
 			s1 = _T("RUN");
 			m_pStatusBar->SetPaneText(idxRunning, s1);
-			m_pStatusBar->SetPaneWidth(idxRunning, s1.GetLength() * 8);
-			m_pStatusBar->SetPaneBackgroundColor(idxRunning, RunningColor);
+//			m_pStatusBar->SetPaneWidth(idxRunning, s1.GetLength() * 8);
+//			m_pStatusBar->SetPaneBackgroundColor(idxRunning, RunningColor);
 		}
 	}
 	if (nIndex == idxMonitor || nIndex == -1) { // 鐩戞帶 //
@@ -1574,11 +1574,11 @@
 		if (!m_bMonitoring) {
 			s1 = _T("[鐩戞帶鍋滄]");
 			m_pStatusBar->SetPaneText(idxMonitor, s1);
-			m_pStatusBar->SetPaneBackgroundColor(idxMonitor);
+//			m_pStatusBar->SetPaneBackgroundColor(idxMonitor);
 		}else{
 			s1 = _T("[姝e湪鐩戞帶]");
 			m_pStatusBar->SetPaneText(idxMonitor, s1);
-			m_pStatusBar->SetPaneBackgroundColor(idxMonitor, MonitorColor);
+//			m_pStatusBar->SetPaneBackgroundColor(idxMonitor, MonitorColor);
 		}
 	}
 	if (nIndex == idxAddress || nIndex == -1) { // 鍦板潃锛屾湰绔�
@@ -1586,11 +1586,11 @@
 		if (!pDoc->m_bOnline) {
 			s1 = _T("鏈珯");
 			m_pStatusBar->SetPaneText(idxAddress, s1);
-			m_pStatusBar->SetPaneBackgroundColor(idxMonitor);
+//			m_pStatusBar->SetPaneBackgroundColor(idxMonitor);
 		}else {
 			s1 = _T("鏈珯");
 			m_pStatusBar->SetPaneText(idxAddress, s1);
-			m_pStatusBar->SetPaneBackgroundColor(idxMonitor, AddressColor);
+//			m_pStatusBar->SetPaneBackgroundColor(idxMonitor, AddressColor);
 		}
 
 	}
@@ -1659,12 +1659,12 @@
 	if (pDoc->m_bPlcRunning) {
 		s1 = _T("杩愯");
 		m_pStatusBar->SetPaneText(3, s1);
-		m_pStatusBar->SetPaneTextColor(3, RGB(0, 0, 0));
+//		m_pStatusBar->SetPaneTextColor(3, RGB(0, 0, 0));
 	}
 	else {
 		s1 = _T("鍋滄");
 		m_pStatusBar->SetPaneText(3, s1);
-		m_pStatusBar->SetPaneTextColor(3, RGB(0, 0, 0));
+//		m_pStatusBar->SetPaneTextColor(3, RGB(0, 0, 0));
 	}
 	s1.Format(_T("PCmdUI %d %d"), pCmdUI->m_nID, pCmdUI->m_nIndex);
 	DbgLog(s1);
diff --git a/MTerm2/MTerm2View.h b/MTerm2/MTerm2View.h
index 538a257..897654b 100644
--- a/MTerm2/MTerm2View.h
+++ b/MTerm2/MTerm2View.h
@@ -16,7 +16,7 @@
 
 // 鐗规��
 public:
-	CMFCStatusBar * m_pStatusBar;
+	CStatusBar * m_pStatusBar;
 	CMTerm2Doc* GetDocument() const;
 
 	//浠庢枃妗h幏鍙栫▼搴�
diff --git a/MTerm2/MainFrm.cpp b/MTerm2/MainFrm.cpp
index 0786029..80b08c2 100644
--- a/MTerm2/MainFrm.cpp
+++ b/MTerm2/MainFrm.cpp
@@ -20,9 +20,9 @@
 
 // CMainFrame
 
-IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWndEx)
+IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
 
-BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWndEx)
+BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
 	ON_WM_CREATE()
 
 	ON_COMMAND(ID_UPLOAD_FROM_PLC, &CMainFrame::OnUploadFromPlc)
@@ -64,9 +64,19 @@
 {
 }
 
+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);
@@ -77,13 +87,17 @@
 	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))
 	{
@@ -91,37 +105,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;
@@ -129,30 +143,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))
 	{
@@ -161,52 +202,61 @@
 	}
 	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
+/*
+	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);
 
-	m_wndNavView.EnableDocking(CBRS_ALIGN_ANY);
-	DockPane(&m_wndNavView);
+
+
 //	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被鎴栨牱寮�
@@ -219,12 +269,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
 
@@ -236,18 +286,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"));
 
 }
 
@@ -255,18 +303,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爜
+
 }
 
 
@@ -285,6 +342,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);
+
 }
 
 
diff --git a/MTerm2/MainFrm.h b/MTerm2/MainFrm.h
index 7265ef7..6d23b0a 100644
--- a/MTerm2/MainFrm.h
+++ b/MTerm2/MainFrm.h
@@ -9,7 +9,12 @@
 //class CMyPaneLog;
 #include "MyDialogLog.h"
 #include "../MyLib/StaticEx.h"
-class CMainFrame : public CMDIFrameWndEx
+#include "CMyFuncKeyToolBar.h"
+#include "MyDlgBarFuncKey.h"
+#include "MyDialogLog.h"
+#include "MyDlgBarInputShow.h"
+
+class CMainFrame : public CMDIFrameWnd
 {
 	DECLARE_DYNAMIC(CMainFrame)
 public:
@@ -34,22 +39,25 @@
 #endif
 
 protected:  // 鎺т欢鏉″祵鍏ユ垚鍛�
-	CMFCToolBar          m_wndToolBar;
+	CToolBar          m_wndToolBar;
 
-	CMFCToolBar          m_wndToolBar_FuncKey;
-	CMFCToolBar          m_wndToolBar_Edit;
-	CMFCToolBar          m_wndToolBar_Num;
-	CMFCToolBar          m_wndToolBar_InputShow;
-	CMFCToolBar          m_wndToolBar_Comments;
+//	CMyFuncKeyToolBar   m_wndToolBar_Func_Key;
+	CMyDlgBarFuncKey	m_wndDlgBar_Func_Key;
+	CToolBar          m_wndTBar_Edit_Key;
+	CToolBar          m_wndTBar_Num_Key;
+//	CToolBar          m_wndTBar_InputShow;
+	CMyDlgBarInputShow m_wndDlgBar_InputShow;
+
+	CToolBar          m_wndToolBar_Comments;
 	
 	CNavView        m_wndNavView;
 
 	CEdit				m_InputShowEdit;
 	CStaticEx			m_InputShowStatic;
-	CMFCStatusBar        m_wndStatusBar;
+	CStatusBar        m_wndStatusBar;
 
 	CMyPaneLog		m_wndMyPaneLog;
-//	CMyDialogLog	m_dlgMyLog;
+	CMyDialogLog	m_dlgMyLog;
 
 // 鐢熸垚鐨勬秷鎭槧灏勫嚱鏁�
 protected:
@@ -73,6 +81,7 @@
 //	afx_msg void OnMenuViewBnl();
 
 	afx_msg void OnMenuShowLog();
+	virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
 };
 
 
diff --git a/MTerm2/MyDialogLog.cpp b/MTerm2/MyDialogLog.cpp
index 7a2161d..05f2948 100644
--- a/MTerm2/MyDialogLog.cpp
+++ b/MTerm2/MyDialogLog.cpp
@@ -115,7 +115,7 @@
 		CRect rect1;
 		GetDlgItem(IDC_CHECK_PAUSEUPDATE)->GetWindowRect(rect1);
 		ScreenToClient(&rect1);
-		GetDlgItem(IDC_CHECK_PAUSEUPDATE)->SetWindowPos(NULL,0,cy-rect1.Height(),rect1.Width(),rect1.Height(),NULL);
+		GetDlgItem(IDC_CHECK_PAUSEUPDATE)->SetWindowPos(NULL,4,cy-rect1.Height()-4,rect1.Width(),rect1.Height(),NULL);
 	}
 	pwnd=GetDlgItem(IDC_CHECK_NOSCROLL);
 	if (pwnd!=NULL)
@@ -123,7 +123,7 @@
 		CRect rect1;
 		GetDlgItem(IDC_CHECK_NOSCROLL)->GetWindowRect(rect1);
 		ScreenToClient(&rect1);
-		GetDlgItem(IDC_CHECK_NOSCROLL)->SetWindowPos(NULL,cx-rect1.Width(),cy-rect1.Height(),rect1.Width(),rect1.Height(),NULL);
+		GetDlgItem(IDC_CHECK_NOSCROLL)->SetWindowPos(NULL,cx-rect1.Width()-4,cy-rect1.Height()-4,rect1.Width(),rect1.Height(),NULL);
 	}
 }
 
diff --git a/MTerm2/MyDlgBarFuncKey.cpp b/MTerm2/MyDlgBarFuncKey.cpp
new file mode 100644
index 0000000..a50d9f7
--- /dev/null
+++ b/MTerm2/MyDlgBarFuncKey.cpp
@@ -0,0 +1,108 @@
+锘�// MyDlgBarFuncKey.cpp: 瀹炵幇鏂囦欢
+//
+
+#include "pch.h"
+#include "MTerm2.h"
+#include "MyDlgBarFuncKey.h"
+#include "afxdialogex.h"
+
+
+// CMyDlgBarFuncKey 瀵硅瘽妗�
+CMyDlgBarFuncKey::structButton myButtons[3][12] =
+{
+	{33101,_T("11"), 33102,_T("12") ,33103,_T("13"), 33104,_T("14") ,33105,_T("15") ,33106,_T("16") ,33107,_T("17") ,33108,_T("18") ,33109,_T("19") ,33110,_T("110") ,33111,_T("111"), 33112,_T("112") },
+	{33201,_T("21"), 33202,_T("22") ,33203,_T("23"), 33204,_T("24") ,33205,_T("25") ,33206,_T("26") ,33207,_T("27") ,33208,_T("28") ,33209,_T("29") ,33210,_T("210") ,33211,_T("211"), 33212,_T("212") },
+	{33301,_T("31"), 33302,_T("32") ,33303,_T("33"), 33304,_T("34") ,33305,_T("35") ,33306,_T("36") ,33307,_T("37") ,33308,_T("38") ,33309,_T("39") ,33310,_T("310") ,33311,_T("311"), 33312,_T("312") },
+};
+static int myButtonCount = sizeof(myButtons) / sizeof(CMyDlgBarFuncKey::structButton);
+
+IMPLEMENT_DYNAMIC(CMyDlgBarFuncKey, CDialogBar)
+
+CMyDlgBarFuncKey::CMyDlgBarFuncKey(CWnd* pParent /*=nullptr*/)
+{
+
+}
+
+CMyDlgBarFuncKey::~CMyDlgBarFuncKey()
+{
+}
+
+void CMyDlgBarFuncKey::DoDataExchange(CDataExchange* pDX)
+{
+	
+}
+
+
+BEGIN_MESSAGE_MAP(CMyDlgBarFuncKey, CDialogBar)
+		ON_MESSAGE(WM_INITDIALOG, CMyDlgBarFuncKey::OnInitDialog)
+	ON_BN_CLICKED(IDC_BUTTON1, &CMyDlgBarFuncKey::OnBnClickedButton1)
+END_MESSAGE_MAP()
+
+
+// CMyDlgBarFuncKey 娑堟伅澶勭悊绋嬪簭
+
+
+LRESULT CMyDlgBarFuncKey::OnInitDialog(WPARAM wParam, LPARAM lParam)
+{
+	// TODO: 鍦ㄦ澶勬坊鍔犲疄鐜颁唬鐮�.
+ //CDialogBar::OnInitDialog();
+	// TODO: Add extra initialization here
+	CString(s1);
+
+	s1.Format(_T(" MyDlgBarFuncKey OnInitDialog "));
+	SysLog(s1);
+
+	LRESULT bRet = HandleInitDialog(wParam, lParam);
+	if (!UpdateData(FALSE))
+	{
+		TRACE("InitDialogBar Failed锛�");
+	}
+	CRect rect0;
+	GetClientRect(&rect0);
+	int nWidth = rect0.Width();
+	int nHeight = rect0.Height();
+	int nLeftMargin = 48;
+	int nSpace = nWidth - nLeftMargin;
+	int x1, y1, x2, y2;
+	CRect rect1(0, 0, 100, 24);
+	for (int i = 0; i < m_Lines; i++) {
+		for (int j = 0; j < 12; j++) {
+			x1 = nLeftMargin + j * nSpace / 12;
+			y1 = i * nHeight / 3;
+			x2 = x1 + nSpace / 12;
+			y2 = y1 + nHeight / 3;
+			rect1.SetRect(x1, y1, x2, y2);
+			m_buttons[i][j].Create(myButtons[i][j].sCaption, BS_FLAT | WS_CHILD | WS_TABSTOP | WS_VISIBLE | BS_PUSHBUTTON, rect1, this, myButtons[i][j].nID);
+		}
+	}
+	return bRet;   // return TRUE unless you set the focus to a control
+				  // EXCEPTION: OCX Property Pages should return FALSE
+	return false;
+}
+
+
+BOOL CMyDlgBarFuncKey::Create(CWnd* pParentWnd, UINT nIDTemplate, UINT nStyle, UINT nID)
+{
+	// TODO: 鍦ㄦ娣诲姞涓撶敤浠g爜鍜�/鎴栬皟鐢ㄥ熀绫�
+	BOOL bRes = CDialogBar::Create(pParentWnd, nIDTemplate, nStyle, nID);
+//	OnInitDialog(0,0);
+	return bRes;
+//
+//	return CDialogBar::Create(pParentWnd, nIDTemplate, nStyle, nID);
+}
+
+
+void CMyDlgBarFuncKey::OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHandler)
+{
+	// TODO: 鍦ㄦ娣诲姞涓撶敤浠g爜鍜�/鎴栬皟鐢ㄥ熀绫�
+		CDialogBar::OnUpdateCmdUI(pTarget, FALSE);
+}
+
+
+void CMyDlgBarFuncKey::OnBnClickedButton1()
+{
+	// TODO: 鍦ㄦ娣诲姞鎺т欢閫氱煡澶勭悊绋嬪簭浠g爜
+	CString s1;
+	s1.Format(_T("Button1 Clicked"));
+	SysLog(s1);
+}
diff --git a/MTerm2/MyDlgBarFuncKey.h b/MTerm2/MyDlgBarFuncKey.h
new file mode 100644
index 0000000..c450263
--- /dev/null
+++ b/MTerm2/MyDlgBarFuncKey.h
@@ -0,0 +1,39 @@
+锘�#pragma once
+
+
+// CMyDlgBarFuncKey 瀵硅瘽妗�
+
+
+
+class CMyDlgBarFuncKey : public CDialogBar
+{
+	DECLARE_DYNAMIC(CMyDlgBarFuncKey)
+	typedef struct tagStructButton {
+		int nID;
+		CString sCaption;
+
+	}structButton;
+
+public:
+	CMyDlgBarFuncKey(CWnd* pParent = nullptr);   // 鏍囧噯鏋勯�犲嚱鏁�
+	virtual ~CMyDlgBarFuncKey();
+
+// 瀵硅瘽妗嗘暟鎹�
+#ifdef AFX_DESIGN_TIME
+	enum { IDD = IDD_DIALOGBAR_FUNC_KEYS };
+#endif
+
+protected:
+	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 鏀寔
+
+	DECLARE_MESSAGE_MAP()
+public:
+	CButton m_buttons[3][12];
+
+	int m_Lines=3;
+
+	LRESULT OnInitDialog(WPARAM wParam, LPARAM lParam);
+	virtual BOOL Create(CWnd* pParentWnd, UINT nIDTemplate, UINT nStyle, UINT nID);
+	virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHandler);
+	afx_msg void OnBnClickedButton1();
+};
diff --git a/MTerm2/MyDlgBarInputShow.cpp b/MTerm2/MyDlgBarInputShow.cpp
new file mode 100644
index 0000000..e706277
--- /dev/null
+++ b/MTerm2/MyDlgBarInputShow.cpp
@@ -0,0 +1,33 @@
+锘�// MyDlgBarInputShow.cpp: 瀹炵幇鏂囦欢
+//
+
+#include "pch.h"
+#include "MTerm2.h"
+#include "MyDlgBarInputShow.h"
+#include "afxdialogex.h"
+
+
+// CMyDlgBarInputShow 瀵硅瘽妗�
+
+IMPLEMENT_DYNAMIC(CMyDlgBarInputShow, CDialogBar)
+
+CMyDlgBarInputShow::CMyDlgBarInputShow(CWnd* pParent /*=nullptr*/)
+{
+
+}
+
+CMyDlgBarInputShow::~CMyDlgBarInputShow()
+{
+}
+
+void CMyDlgBarInputShow::DoDataExchange(CDataExchange* pDX)
+{
+	CDialogBar::DoDataExchange(pDX);
+}
+
+
+BEGIN_MESSAGE_MAP(CMyDlgBarInputShow, CDialogBar)
+END_MESSAGE_MAP()
+
+
+// CMyDlgBarInputShow 娑堟伅澶勭悊绋嬪簭
diff --git a/MTerm2/MyDlgBarInputShow.h b/MTerm2/MyDlgBarInputShow.h
new file mode 100644
index 0000000..de7c40e
--- /dev/null
+++ b/MTerm2/MyDlgBarInputShow.h
@@ -0,0 +1,23 @@
+锘�#pragma once
+
+
+// CMyDlgBarInputShow 瀵硅瘽妗�
+
+class CMyDlgBarInputShow : public CDialogBar
+{
+	DECLARE_DYNAMIC(CMyDlgBarInputShow)
+
+public:
+	CMyDlgBarInputShow(CWnd* pParent = nullptr);   // 鏍囧噯鏋勯�犲嚱鏁�
+	virtual ~CMyDlgBarInputShow();
+
+// 瀵硅瘽妗嗘暟鎹�
+#ifdef AFX_DESIGN_TIME
+	enum { IDD = IDD_DIALOGBAR_INPUT_SHOW };
+#endif
+
+protected:
+	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 鏀寔
+
+	DECLARE_MESSAGE_MAP()
+};
diff --git a/MTerm2/pch.h b/MTerm2/pch.h
index 47a715b..b3785c9 100644
--- a/MTerm2/pch.h
+++ b/MTerm2/pch.h
@@ -26,5 +26,7 @@
 #include <afxcontrolbars.h>
 #include <afxcontrolbars.h>
 #include <afxcontrolbars.h>
+#include <afxwin.h>
+#include <afxwin.h>
 
 #endif //PCH_H
diff --git a/MTerm2/res/bmp00004.bmp b/MTerm2/res/bmp00004.bmp
new file mode 100644
index 0000000..f547d53
--- /dev/null
+++ b/MTerm2/res/bmp00004.bmp
Binary files differ
diff --git a/MTerm2/res/toolbar_.bmp b/MTerm2/res/toolbar_.bmp
new file mode 100644
index 0000000..f2cfc77
--- /dev/null
+++ b/MTerm2/res/toolbar_.bmp
Binary files differ
diff --git a/MTerm2/res/toolbar_func_key.bmp b/MTerm2/res/toolbar_func_key.bmp
new file mode 100644
index 0000000..198330f
--- /dev/null
+++ b/MTerm2/res/toolbar_func_key.bmp
Binary files differ
diff --git a/MTerm2/resource.h b/MTerm2/resource.h
index c8b2c8a..d437f8d 100644
--- a/MTerm2/resource.h
+++ b/MTerm2/resource.h
@@ -42,6 +42,7 @@
 #define IDB_CLASS_VIEW                  177
 #define IDB_CLASS_VIEW_24               178
 #define IDR_TOOLBAR_NUM                 310
+#define IDR_TOOLBAR_NUM_KEY             310
 #define IDD_MTerm2TestView              311
 #define IDD_MTerm2CtrlView              312
 #define IDD_MTerm2DataView              313
@@ -50,11 +51,13 @@
 #define IDD_DIALOG1                     316
 #define IDW_TOOL_BAR_EDIT               316
 #define ID_VIEW_NAVVIEW                 317
+#define IDW_TOOL_BAR_FUNC_KEY           318
 #define IDD_DIALOG_SET_COIL             320
 #define IDD_DIALOG_SET_DATA             321
 #define IDR_MENU1                       324
 #define IDD_DIALOG_IO_COMMENT           325
 #define IDR_TOOLBAR_EDIT                327
+#define IDR_TOOLBAR_EDIT_KEY            327
 #define IDR_TOOLBAR_INPUT_SHOW          329
 #define IDR_TOOLBAR_COMMENT             332
 #define IDR_TOOLBAR_INFO_SHOW           334
@@ -68,6 +71,11 @@
 #define IDD_PROP_COMM_CFG1              344
 #define IDD_PROP_MODE_CFG1              344
 #define IDD_DIALOG_FACT_CFG             345
+#define IDD_DIALOGBAR_FUNC_KEYS         349
+#define IDD_DIALOGBAR2                  350
+#define IDR_TOOLBAR_FUNC_KEY2           351
+#define IDD_DIALOGBAR                   351
+#define IDD_DIALOGBAR_INPUT_SHOW        351
 #define IDC_EDIT1                       1000
 #define IDC_BUTTON1                     1001
 #define IDC_BUTTON_LOAD                 1001
@@ -269,23 +277,40 @@
 #define IDC_RICHEDIT2_LOG               1717
 #define IDC_EDIT_LOG1                   1719
 #define ID_BUTTON32771                  32771
+#define ID_BUTTON_0                     32771
 #define ID_BUTTON32772                  32772
+#define ID_BUTTON_1                     32772
 #define ID_BUTTON32773                  32773
+#define ID_BUTTON_2                     32773
 #define ID_BUTTON32774                  32774
+#define ID_BUTTON_3                     32774
 #define ID_BUTTON32775                  32775
+#define ID_BUTTON_4                     32775
 #define ID_BUTTON32776                  32776
+#define ID_BUTTON_5                     32776
 #define ID_BUTTON32777                  32777
+#define ID_BUTTON_6                     32777
 #define ID_BUTTON32778                  32778
+#define ID_BUTTON_7                     32778
 #define ID_BUTTON32779                  32779
+#define ID_BUTTON_8                     32779
 #define ID_BUTTON32780                  32780
 #define ID_BUTTON32781                  32781
+#define ID_BUTTON_A                     32781
 #define ID_BUTTON32782                  32782
+#define ID_BUTTON_B                     32782
 #define ID_BUTTON32783                  32783
+#define ID_BUTTON_C                     32783
 #define ID_BUTTON32784                  32784
+#define ID_BUTTON_D                     32784
 #define ID_BUTTON32785                  32785
+#define ID_BUTTON_E                     32785
 #define ID_BUTTON32786                  32786
+#define ID_BUTTON_F                     32786
 #define ID_BUTTON32787                  32787
+#define ID_BUTTON_MINUS                 32787
 #define ID_BUTTON32788                  32788
+#define ID_BUTTON_DOT                   32788
 #define ID_RECT_SELECT                  32791
 #define ID_BUTTON32793                  32793
 #define ID_BUTTON32795                  32795
@@ -473,9 +498,13 @@
 #define ID_INPUT_IO_COMMENT             33049
 #define ID_BUTTON33052                  33052
 #define ID_BUTTON33053                  33053
+#define ID_BUTTON_RET                   33053
 #define ID_BUTTON33054                  33054
+#define ID_BUTTON_INSERT                33054
 #define ID_BUTTON33055                  33055
+#define ID_BUTTON_DELETE                33055
 #define ID_BUTTON33056                  33056
+#define ID_BUTTON_ESC                   33056
 #define ID_BUTTON_INPUT_SHOW            33057
 #define ID_BUTTON33058                  33058
 #define ID_BUTTON33059                  33059
@@ -501,6 +530,9 @@
 #define ID_DATETIME_SET                 33081
 #define ID_MENU_DATETIME_SET            33082
 #define ID_MENU_EVENT_LOG               33083
+#define ID_BUTTON_9                     33084
+#define ID_BUTTON33085                  33085
+#define ID_BUTTON33086                  33086
 #define ID_INDICATOR_SEL_TYPE           59135
 #define ID_INDICATOR_MACHINE_TYPE       59142
 #define ID_INDICATOR_PROGRAM_POS        59143
@@ -514,9 +546,9 @@
 // 
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE        349
-#define _APS_NEXT_COMMAND_VALUE         33084
+#define _APS_NEXT_RESOURCE_VALUE        356
+#define _APS_NEXT_COMMAND_VALUE         33087
 #define _APS_NEXT_CONTROL_VALUE         1061
-#define _APS_NEXT_SYMED_VALUE           318
+#define _APS_NEXT_SYMED_VALUE           319
 #endif
 #endif

--
Gitblit v1.9.1