From b8a705515cd307bd46e04eeccc0bf0e158133402 Mon Sep 17 00:00:00 2001
From: LAPTOP-T815PCOQ\25526 <mr.liuyang@126.com>
Date: 星期三, 18 十二月 2024 16:27:37 +0800
Subject: [PATCH] 1. 提取对话框动态变化控件大小的函数(新建对话框基类)

---
 SourceCode/Bond/BondEq/View/RecipeListDlg.h           |   17 
 SourceCode/Bond/BondEq/View/UserManagerDlg.h          |   15 
 SourceCode/Bond/BondEq/BondEq.rc                      |    0 
 SourceCode/Bond/BondEq/CBaseDlg.cpp                   |  209 +++++++++++
 SourceCode/Bond/BondEq/CBaseDlg.h                     |   29 +
 SourceCode/Bond/BondEq/BondEq.vcxproj                 |    2 
 SourceCode/Bond/BondEq/View/SystemLogManagerDlg.h     |   19 
 SourceCode/Bond/BondEq/View/SystemLogManagerDlg.cpp   |  219 -----------
 SourceCode/Bond/BondEq/View/AxisDetailSettingsDlg.cpp |   12 
 SourceCode/Bond/BondEq/View/AxisSettingsDlg.h         |   15 
 SourceCode/Bond/BondEq/View/UserManagerDlg.cpp        |  198 ----------
 SourceCode/Bond/BondEq/View/AxisSettingsDlg.cpp       |  188 ---------
 SourceCode/Bond/BondEq/View/AxisDetailSettingsDlg.h   |    6 
 SourceCode/Bond/BondEq/View/RecipeListDlg.cpp         |  162 -------
 14 files changed, 306 insertions(+), 785 deletions(-)

diff --git a/SourceCode/Bond/BondEq/BondEq.rc b/SourceCode/Bond/BondEq/BondEq.rc
index 250728b..e9a56f2 100644
--- a/SourceCode/Bond/BondEq/BondEq.rc
+++ b/SourceCode/Bond/BondEq/BondEq.rc
Binary files differ
diff --git a/SourceCode/Bond/BondEq/BondEq.vcxproj b/SourceCode/Bond/BondEq/BondEq.vcxproj
index 32e3fdd..11f7d20 100644
--- a/SourceCode/Bond/BondEq/BondEq.vcxproj
+++ b/SourceCode/Bond/BondEq/BondEq.vcxproj
@@ -192,6 +192,7 @@
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="AlarmPopupDlg.h" />
+    <ClInclude Include="CBaseDlg.h" />
     <ClInclude Include="CComponentDlg.h" />
     <ClInclude Include="CComponentPLCDlg.h" />
     <ClInclude Include="CPLC.h" />
@@ -269,6 +270,7 @@
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="AlarmPopupDlg.cpp" />
+    <ClCompile Include="CBaseDlg.cpp" />
     <ClCompile Include="CComponentDlg.cpp" />
     <ClCompile Include="CComponentPLCDlg.cpp" />
     <ClCompile Include="CPLC.cpp" />
diff --git a/SourceCode/Bond/BondEq/CBaseDlg.cpp b/SourceCode/Bond/BondEq/CBaseDlg.cpp
new file mode 100644
index 0000000..d424513
--- /dev/null
+++ b/SourceCode/Bond/BondEq/CBaseDlg.cpp
@@ -0,0 +1,209 @@
+#include "stdafx.h"
+#include "CBaseDlg.h"
+#include "GridCtrl.h"
+
+IMPLEMENT_DYNAMIC(CBaseDlg, CDialogEx)
+
+CBaseDlg::CBaseDlg(UINT id, CWnd* pPage) : CDialogEx(id, pPage)
+{
+	m_nInitialWidth = 0;
+	m_nInitialHeight = 0;
+}
+
+CBaseDlg::~CBaseDlg()
+{
+	for (auto& pair : m_mapFonts) {
+		if (pair.second) {
+			pair.second->DeleteObject();
+			delete pair.second;
+		}
+	}
+	m_mapFonts.clear();
+}
+
+CFont* CBaseDlg::GetOrCreateFont(int nFontSize)
+{
+	auto it = m_mapFonts.find(nFontSize);
+	if (it != m_mapFonts.end()) {
+		return it->second;
+	}
+
+	CFont* font = new CFont();
+	LOGFONT logFont = { 0 };
+	_tcscpy_s(logFont.lfFaceName, _T("Segoe UI"));
+	logFont.lfHeight = -nFontSize;
+	logFont.lfQuality = CLEARTYPE_QUALITY;
+	font->CreateFontIndirect(&logFont);
+	m_mapFonts[nFontSize] = font;
+
+	return font;
+}
+
+void CBaseDlg::SetDefaultFont()
+{
+	CFont* defaultFont = GetOrCreateFont(12);
+
+	// 遍历所有控件,应用默认字体
+	CWnd* pWnd = GetWindow(GW_CHILD);
+	while (pWnd) {
+		// 跳过特殊控件(如 MFCGridCtrl)
+		TCHAR szClassName[256];
+		GetClassName(pWnd->m_hWnd, szClassName, sizeof(szClassName));
+		if (_tcsicmp(szClassName, _T("MFCGridCtrl")) == 0) {
+			pWnd = pWnd->GetNextWindow();
+			continue;
+		}
+
+		pWnd->SetFont(defaultFont, TRUE);
+		pWnd = pWnd->GetNextWindow();
+	}
+}
+
+void CBaseDlg::AdjustControls(float dScaleX, float dScaleY)
+{
+	CWnd* pWnd = GetWindow(GW_CHILD);
+	while (pWnd) {
+		int nCtrlID = pWnd->GetDlgCtrlID();
+		if (nCtrlID != -1 && m_mapCtrlLayouts.find(nCtrlID) != m_mapCtrlLayouts.end())
+		{
+			CRect originalRect = m_mapCtrlLayouts[nCtrlID];
+			CRect newRect(
+				static_cast<int>(originalRect.left * dScaleX),
+				static_cast<int>(originalRect.top * dScaleY),
+				static_cast<int>(originalRect.right * dScaleX),
+				static_cast<int>(originalRect.bottom * dScaleY));
+
+			TCHAR szClassName[256];
+			GetClassName(pWnd->m_hWnd, szClassName, sizeof(szClassName));
+
+			if (_tcsicmp(szClassName, _T("ComboBox")) == 0) {
+				CComboBox* pComboBox = (CComboBox*)pWnd;
+				pComboBox->SetItemHeight(-1, newRect.Height());  // -1 表示所有项的高度
+			}
+
+			if (_tcsicmp(szClassName, _T("MFCGridCtrl")) == 0) {
+				CGridCtrl* pGridCtrl = (CGridCtrl*)pWnd;
+				pGridCtrl->SetDefCellHeight(newRect.Height() / 21);
+				pGridCtrl->ExpandColumnsToFit(TRUE);
+				pGridCtrl->ExpandLastColumn();
+				pGridCtrl->Invalidate();
+				pGridCtrl->UpdateWindow();
+			}
+
+			pWnd->MoveWindow(&newRect);
+			AdjustControlFont(pWnd, newRect.Width(), newRect.Height());
+		}
+		pWnd = pWnd->GetNextWindow();
+	}
+}
+
+void CBaseDlg::AdjustControlFont(CWnd* pWnd, int nWidth, int nHeight)
+{
+	TCHAR szClassName[256];
+	GetClassName(pWnd->m_hWnd, szClassName, sizeof(szClassName));
+
+	// 跳过特殊控件(如 MFCGridCtrl)
+	if (_tcsicmp(szClassName, _T("MFCGridCtrl")) == 0) {
+		return;
+	}
+
+	// 根据控件高度动态调整字体大小
+	int fontSize = nHeight / 2;
+	if (fontSize < 8) fontSize = 8;
+	if (fontSize > 32) fontSize = 32;
+
+	// 获取或创建字体
+	CFont* pFont = GetOrCreateFont(fontSize);
+
+	pWnd->SetFont(pFont);
+	pWnd->Invalidate(); // 刷新控件显示
+}
+
+BEGIN_MESSAGE_MAP(CBaseDlg, CDialogEx)
+	ON_WM_SIZE()
+	ON_WM_GETMINMAXINFO()
+END_MESSAGE_MAP()
+
+BOOL CBaseDlg::OnInitDialog()
+{
+	CDialogEx::OnInitDialog();
+
+	// TODO:  在此添加额外的初始化
+	CRect screenRect, dlgRect, clientRect;
+	SystemParametersInfo(SPI_GETWORKAREA, 0, &screenRect, 0);
+
+	GetClientRect(&clientRect);
+	m_nInitialWidth = clientRect.Width();
+	m_nInitialHeight = clientRect.Height();
+
+	// 初始化默认字体
+	CFont* pDefaultFont = GetOrCreateFont(12);
+
+	// 遍历所有子控件,记录初始位置并设置默认字体
+	CWnd* pWnd = GetWindow(GW_CHILD);
+	while (pWnd) {
+		int nCtrlID = pWnd->GetDlgCtrlID();
+		if (nCtrlID != -1) {
+			// 记录控件初始布局
+			CRect ctrlRect;
+			pWnd->GetWindowRect(&ctrlRect);
+			ScreenToClient(&ctrlRect);
+			m_mapCtrlLayouts[nCtrlID] = ctrlRect;
+
+			// 跳过特殊控件(如 MFCGridCtrl)
+			TCHAR szClassName[256];
+			GetClassName(pWnd->m_hWnd, szClassName, sizeof(szClassName));
+			if (_tcsicmp(szClassName, _T("MFCGridCtrl")) == 0) {
+				pWnd = pWnd->GetNextWindow();
+				continue;
+			}
+
+			// 设置默认字体
+			pWnd->SetFont(pDefaultFont);
+		}
+		pWnd = pWnd->GetNextWindow();
+	}
+
+	GetWindowRect(&dlgRect);
+	int dlgWidth = dlgRect.Width() * 2;
+	int dlgHeight = dlgRect.Height() * 2;
+
+	if (dlgWidth > screenRect.Width()) {
+		dlgWidth = screenRect.Width();
+	}
+	if (dlgHeight > screenRect.Height()) {
+		dlgHeight = screenRect.Height();
+	}
+
+	int centerX = screenRect.left + (screenRect.Width() - dlgWidth) / 2;
+	int centerY = screenRect.top + (screenRect.Height() - dlgHeight) / 2;
+	MoveWindow(centerX, centerY, dlgWidth, dlgHeight);
+
+	return TRUE;  // return TRUE unless you set the focus to a control
+	// 异常: OCX 属性页应返回 FALSE
+}
+
+void CBaseDlg::OnSize(UINT nType, int cx, int cy)
+{
+	CDialogEx::OnSize(nType, cx, cy);
+
+	// TODO: 在此处添加消息处理程序代码
+	if (nType == SIZE_MINIMIZED || m_mapCtrlLayouts.empty()) {
+		return;
+	}
+
+	float dScaleX = static_cast<float>(cx) / m_nInitialWidth;
+	float dScaleY = static_cast<float>(cy) / m_nInitialHeight;
+
+	// 遍历对话框中的所有控件
+	AdjustControls(dScaleX, dScaleY);
+}
+
+void CBaseDlg::OnGetMinMaxInfo(MINMAXINFO* lpMMI)
+{
+	// TODO: 在此添加消息处理程序代码和/或调用默认值
+	lpMMI->ptMinTrackSize.x = 400; // 最小宽度
+	lpMMI->ptMinTrackSize.y = 300; // 最小高度
+
+	CDialogEx::OnGetMinMaxInfo(lpMMI);
+}
\ No newline at end of file
diff --git a/SourceCode/Bond/BondEq/CBaseDlg.h b/SourceCode/Bond/BondEq/CBaseDlg.h
new file mode 100644
index 0000000..053cd99
--- /dev/null
+++ b/SourceCode/Bond/BondEq/CBaseDlg.h
@@ -0,0 +1,29 @@
+#pragma once
+
+class CBaseDlg : public CDialogEx
+{
+	DECLARE_DYNAMIC(CBaseDlg)
+
+public:
+	CBaseDlg(UINT id, CWnd* pPage);				// 标准构造函数
+	virtual ~CBaseDlg();						// 析构函数
+
+	CFont* GetOrCreateFont(int nFontSize);		// 获取或创建字体
+	void SetDefaultFont();						// 设置默认字体
+
+private:
+	void AdjustControls(float dScaleX, float dScaleY);				// 调整控件大小
+	void AdjustControlFont(CWnd* pWnd, int nWidth, int nHeight);	// 调整控件字体
+
+private:
+	int m_nInitialWidth;						// 对话框初始宽度
+	int m_nInitialHeight;						// 对话框初始高度	
+	std::map<int, CFont*> m_mapFonts;			// 控件字体
+	std::map<int, CRect> m_mapCtrlLayouts;		// 控件布局
+
+	DECLARE_MESSAGE_MAP()
+public:
+	virtual BOOL OnInitDialog();
+	afx_msg void OnSize(UINT nType, int cx, int cy);
+	afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI);
+};
\ No newline at end of file
diff --git a/SourceCode/Bond/BondEq/View/AxisDetailSettingsDlg.cpp b/SourceCode/Bond/BondEq/View/AxisDetailSettingsDlg.cpp
index e010f8b..f0907b8 100644
--- a/SourceCode/Bond/BondEq/View/AxisDetailSettingsDlg.cpp
+++ b/SourceCode/Bond/BondEq/View/AxisDetailSettingsDlg.cpp
@@ -11,17 +11,15 @@
 
 // CAxisDetailSettingsDlg 瀵硅瘽妗�
 
-IMPLEMENT_DYNAMIC(CAxisDetailSettingsDlg, CDialogEx)
+IMPLEMENT_DYNAMIC(CAxisDetailSettingsDlg, CBaseDlg)
 
 CAxisDetailSettingsDlg::CAxisDetailSettingsDlg(const CString& strRecipeName, int nAxisNO, CWnd* pParent /*=nullptr*/)
-	: CDialogEx(IDD_DIALOG_AXIS_DETAIL_SETTINGS, pParent)
+	: CBaseDlg(IDD_DIALOG_AXIS_DETAIL_SETTINGS, pParent)
 {
 	m_strRecipeName = strRecipeName;
 	m_nAxisNO = nAxisNO;
 
 	m_pPLC = nullptr;
-	m_nInitialWidth = 0;
-	m_nInitialHeight = 0;
 }
 
 CAxisDetailSettingsDlg::~CAxisDetailSettingsDlg()
@@ -208,7 +206,7 @@
 
 void CAxisDetailSettingsDlg::DoDataExchange(CDataExchange* pDX)
 {
-	CDialogEx::DoDataExchange(pDX);
+	CBaseDlg::DoDataExchange(pDX);
 	DDX_Control(pDX, IDC_STATIC_AXIS_NUMBER, m_staticAxisNO);
 	DDX_Control(pDX, IDC_STATIC_AXIS_DESCRIP, m_staticAxisDescription);
 	DDX_Control(pDX, IDC_STATIC_START_ADDRESS, m_staticStartAddress);
@@ -216,7 +214,7 @@
 }
 
 
-BEGIN_MESSAGE_MAP(CAxisDetailSettingsDlg, CDialogEx)
+BEGIN_MESSAGE_MAP(CAxisDetailSettingsDlg, CBaseDlg)
 	ON_NOTIFY(NM_CLICK, IDC_CUSTOM_AXIS_ANCHOR_POINT, &CAxisDetailSettingsDlg::OnGridItemChanged)
 	ON_BN_CLICKED(IDC_BUTTON_AXIS_DETAIL_SETTINGS_SAVE, &CAxisDetailSettingsDlg::OnBnClickedButtonAxisDetailSettingsSave)
 	ON_BN_CLICKED(IDC_BUTTON_SET_AXIS_POSITIONING_POINTS, &CAxisDetailSettingsDlg::OnBnClickedButtonSetAxisPositioningPoints)
@@ -228,7 +226,7 @@
 
 BOOL CAxisDetailSettingsDlg::OnInitDialog()
 {
-	CDialogEx::OnInitDialog();
+	CBaseDlg::OnInitDialog();
 
 	// TODO:  鍦ㄦ娣诲姞棰濆鐨勫垵濮嬪寲
 	CString strTitle;
diff --git a/SourceCode/Bond/BondEq/View/AxisDetailSettingsDlg.h b/SourceCode/Bond/BondEq/View/AxisDetailSettingsDlg.h
index c3422e7..60dda11 100644
--- a/SourceCode/Bond/BondEq/View/AxisDetailSettingsDlg.h
+++ b/SourceCode/Bond/BondEq/View/AxisDetailSettingsDlg.h
@@ -1,11 +1,12 @@
 锘�#pragma once
 #include "afxdialogex.h"
 #include "GridCtrl.h"
+#include "CBaseDlg.h"
 
 
 // CAxisDetailSettingsDlg 瀵硅瘽妗�
 
-class CAxisDetailSettingsDlg : public CDialogEx
+class CAxisDetailSettingsDlg : public CBaseDlg
 {
 	DECLARE_DYNAMIC(CAxisDetailSettingsDlg)
 
@@ -26,11 +27,8 @@
 	void FillAnchorPontManager();
 	void UpdateAxisDetailSettings();
 
-
 private:
 	CPLC* m_pPLC;
-	int m_nInitialWidth;
-	int m_nInitialHeight;
 
 	// 鏁版嵁
 	int m_nAxisNO;
diff --git a/SourceCode/Bond/BondEq/View/AxisSettingsDlg.cpp b/SourceCode/Bond/BondEq/View/AxisSettingsDlg.cpp
index bc96b29..7cf9480 100644
--- a/SourceCode/Bond/BondEq/View/AxisSettingsDlg.cpp
+++ b/SourceCode/Bond/BondEq/View/AxisSettingsDlg.cpp
@@ -21,13 +21,11 @@
 
 // CAxisSettingsDlg 瀵硅瘽妗�
 
-IMPLEMENT_DYNAMIC(CAxisSettingsDlg, CDialogEx)
+IMPLEMENT_DYNAMIC(CAxisSettingsDlg, CBaseDlg)
 
 CAxisSettingsDlg::CAxisSettingsDlg(CWnd* pParent /*=nullptr*/)
-	: CDialogEx(IDD_DIALOG_AXIS_SETTINGS, pParent)
+	: CBaseDlg(IDD_DIALOG_AXIS_SETTINGS, pParent)
 {
-	m_nInitialWidth = 0;
-	m_nInitialHeight = 0;
 	m_pPLC = nullptr;
 
 	m_bSEV = FALSE;
@@ -63,14 +61,6 @@
 
 CAxisSettingsDlg::~CAxisSettingsDlg()
 {
-	for (auto& pair : m_mapFonts) {
-		if (pair.second) {
-			pair.second->DeleteObject();
-			delete pair.second;
-		}
-	}
-	m_mapFonts.clear();
-
 	for (int i = 0; i < BTN_MAX; i++) {
 		delete m_pBlBtns[i];
 	}
@@ -97,7 +87,7 @@
 
 void CAxisSettingsDlg::DoDataExchange(CDataExchange* pDX)
 {
-	CDialogEx::DoDataExchange(pDX);
+	CBaseDlg::DoDataExchange(pDX);
 	DDX_Control(pDX, IDC_COMBO_AXIS_NAME, m_comboAxisNO);
 	DDX_Control(pDX, IDC_STATIC_AXIS_NUMBER, m_staticAxisNO);
 	DDX_Control(pDX, IDC_STATIC_AXIS_DESCRIP, m_staticAxisDescription);
@@ -130,79 +120,6 @@
 	return 0;
 }
 
-CFont* CAxisSettingsDlg::GetOrCreateFont(int nFontSize)
-{
-	auto it = m_mapFonts.find(nFontSize);
-	if (it != m_mapFonts.end()) {
-		return it->second;
-	}
-
-	CFont* font = new CFont();
-	LOGFONT logFont = { 0 };
-	_tcscpy_s(logFont.lfFaceName, _T("Segoe UI"));
-	logFont.lfHeight = -nFontSize;
-	logFont.lfQuality = CLEARTYPE_QUALITY;
-	font->CreateFontIndirect(&logFont);
-	m_mapFonts[nFontSize] = font;
-
-	return font;
-}
-
-void CAxisSettingsDlg::SetDefaultFont()
-{
-	CFont* defaultFont = GetOrCreateFont(12);
-
-	// 閬嶅巻鎵�鏈夋帶浠讹紝搴旂敤榛樿瀛椾綋
-	CWnd* pWnd = GetWindow(GW_CHILD);
-	while (pWnd) {
-		pWnd->SetFont(defaultFont, TRUE);
-		pWnd = pWnd->GetNextWindow();
-	}
-}
-
-void CAxisSettingsDlg::AdjustControls(float dScaleX, float dScaleY)
-{
-	CWnd* pWnd = GetWindow(GW_CHILD);
-	while (pWnd) {
-		int nCtrlID = pWnd->GetDlgCtrlID();
-		if (nCtrlID != -1 && m_mapCtrlLayouts.find(nCtrlID) != m_mapCtrlLayouts.end())
-		{
-			CRect originalRect = m_mapCtrlLayouts[nCtrlID];
-			CRect newRect(
-				static_cast<int>(originalRect.left * dScaleX),
-				static_cast<int>(originalRect.top * dScaleY),
-				static_cast<int>(originalRect.right * dScaleX),
-				static_cast<int>(originalRect.bottom * dScaleY));
-
-			TCHAR szClassName[256];
-			GetClassName(pWnd->m_hWnd, szClassName, sizeof(szClassName));
-
-			if (_tcsicmp(szClassName, _T("ComboBox")) == 0) {
-				CComboBox* pComboBox = (CComboBox*)pWnd;
-				pComboBox->SetItemHeight(-1, newRect.Height());  // -1 琛ㄧず鎵�鏈夐」鐨勯珮搴�
-			}
-
-			pWnd->MoveWindow(&newRect);
-			AdjustControlFont(pWnd, newRect.Width(), newRect.Height());
-		}
-		pWnd = pWnd->GetNextWindow();
-	}
-}
-
-void CAxisSettingsDlg::AdjustControlFont(CWnd* pWnd, int nWidth, int nHeight)
-{
-	// 鏍规嵁鎺т欢楂樺害鍔ㄦ�佽皟鏁村瓧浣撳ぇ灏�
-	int fontSize = nHeight / 2;
-	if (fontSize < 8) fontSize = 8;
-	if (fontSize > 24) fontSize = 24;  // 鏈�澶у瓧浣撳ぇ灏�
-
-	// 鑾峰彇鎴栧垱寤哄瓧浣�
-	CFont* pFont = GetOrCreateFont(fontSize);
-
-	pWnd->SetFont(pFont);
-	pWnd->Invalidate(); // 鍒锋柊鎺т欢鏄剧ず
-}
-
 void CAxisSettingsDlg::AdjustLabelFont(CBLLabel& label)
 {
 	if (label.m_hWnd == nullptr) {
@@ -216,7 +133,7 @@
 	// 鍔ㄦ�佽绠楀瓧浣撳ぇ灏忥紝鍩轰簬鎺т欢鐨勯珮搴�
 	int fontSize = rect.Height() / 2; // 鎺т欢楂樺害鐨勪竴鍗婁綔涓哄瓧浣撳ぇ灏�
 	if (fontSize < 8) fontSize = 8;   // 鏈�灏忓瓧浣撳ぇ灏�
-	if (fontSize > 30) fontSize = 30; // 鏈�澶у瓧浣撳ぇ灏�
+	if (fontSize > 20) fontSize = 20; // 鏈�澶у瓧浣撳ぇ灏�
 
 	// 璁剧疆瀛椾綋澶у皬
 	label.SetFontSize(fontSize);
@@ -832,7 +749,7 @@
 }
 
 
-BEGIN_MESSAGE_MAP(CAxisSettingsDlg, CDialogEx)
+BEGIN_MESSAGE_MAP(CAxisSettingsDlg, CBaseDlg)
 	ON_BN_CLICKED(IDC_BUTTON_AXIS_LAST, &CAxisSettingsDlg::OnBnClickedButtonAxisLast)
 	ON_BN_CLICKED(IDC_BUTTON_AXIS_NEXT, &CAxisSettingsDlg::OnBnClickedButtonAxisNext)
 	ON_BN_CLICKED(IDC_BUTTON_AXIS_ANCHOR_POINT_GROUP1, &CAxisSettingsDlg::OnBnClickedButtonAxisAnchorPointGroup1)
@@ -854,8 +771,6 @@
 	ON_BN_CLICKED(IDC_BUTTON_AXIS_DETAIL_SETTINGS, &CAxisSettingsDlg::OnBnClickedButtonAxisDetailSettings)
 	ON_MESSAGE(ID_MSG_UPDATA_DATA_TO_UI, &CAxisSettingsDlg::OnUpdateDataToUI)
 	ON_WM_SIZE()
-	ON_WM_CTLCOLOR()
-	ON_WM_SIZING()
 	ON_WM_TIMER()
 	ON_WM_CLOSE()
 END_MESSAGE_MAP()
@@ -866,7 +781,7 @@
 
 BOOL CAxisSettingsDlg::OnInitDialog()
 {
-	CDialogEx::OnInitDialog();
+	CBaseDlg::OnInitDialog();
 
 	// TODO:  鍦ㄦ娣诲姞棰濆鐨勫垵濮嬪寲
 	CString strTitle;
@@ -896,6 +811,8 @@
 		pLabel->SetTextColor(RGB(255, 255, 255));
 		pLabel->SetAlignment(AlignCenter);
 		pLabel->SetDynamicFont(TRUE);
+
+		AdjustLabelFont(*pLabel);
 	}
 	
 	// 鍒濆鍖栫紪杈戞
@@ -970,47 +887,6 @@
 	initializeAxisIDCombo();
 	refreshAxisDetails(1);
 	refreshPositionDetails(1, m_currentPage);
-
-	CRect screenRect, dlgRect, clientRect;
-	GetClientRect(&clientRect);
-	m_nInitialWidth = clientRect.Width();
-	m_nInitialHeight = clientRect.Height();
-
-	// 鍒濆鍖栭粯璁ゅ瓧浣�
-	CFont* pDefaultFont = GetOrCreateFont(12);
-
-	// 閬嶅巻鎵�鏈夊瓙鎺т欢锛岃褰曞垵濮嬩綅缃苟璁剧疆榛樿瀛椾綋
-	CWnd* pWnd = GetWindow(GW_CHILD);
-	while (pWnd) {
-		int nCtrlID = pWnd->GetDlgCtrlID();
-		if (nCtrlID != -1) {
-			// 璁板綍鎺т欢鍒濆甯冨眬
-			CRect ctrlRect;
-			pWnd->GetWindowRect(&ctrlRect);
-			ScreenToClient(&ctrlRect);
-			m_mapCtrlLayouts[nCtrlID] = ctrlRect;
-
-			// 璁剧疆榛樿瀛椾綋
-			pWnd->SetFont(pDefaultFont);
-		}
-		pWnd = pWnd->GetNextWindow();
-	}
-
-	GetWindowRect(&dlgRect);
-	int dlgWidth = dlgRect.Width() * 2;
-	int dlgHeight = dlgRect.Height() * 2;
-
-	SystemParametersInfo(SPI_GETWORKAREA, 0, &screenRect, 0);
-	if (dlgWidth > screenRect.Width()) {
-		dlgWidth = screenRect.Width();
-	}
-	if (dlgHeight > screenRect.Height()) {
-		dlgHeight = screenRect.Height();
-	}
-
-	int centerX = screenRect.left + (screenRect.Width() - dlgWidth) / 2;
-	int centerY = screenRect.top + (screenRect.Height() - dlgHeight) / 2;
-	MoveWindow(centerX, centerY, dlgWidth, dlgHeight);
 	
 	SetTimer(TIMER_READ_PLC_DATA, 500, nullptr);
 
@@ -1056,7 +932,7 @@
 			}
 
 			if (currentIndex == -1) {
-				return CDialogEx::PreTranslateMessage(pMsg);
+				return CBaseDlg::PreTranslateMessage(pMsg);
 			}
 
 			CString descriptionCtrlName, positionCtrlName;
@@ -1070,7 +946,7 @@
 			CWnd* pPositionCtrl = GetDlgItem(positionCtrlId);
 
 			if (pDescriptionCtrl == nullptr || pPositionCtrl == nullptr) {
-				return CDialogEx::PreTranslateMessage(pMsg);
+				return CBaseDlg::PreTranslateMessage(pMsg);
 			}
 
 			PositionRange& position = recipeManager.getPositionByIndex(getCurrentSelectedAxisID(), m_currentPage, AXIS_PAGE_SIZE, currentIndex);
@@ -1082,7 +958,7 @@
 				CString strText;
 				GetDlgItem(IDC_EDIT_AXIS_CURR_POS)->GetWindowText(strText);
 				if (strText.IsEmpty()) {
-					return CDialogEx::PreTranslateMessage(pMsg);;
+					return CBaseDlg::PreTranslateMessage(pMsg);;
 				}
 
 				double enteredValue = _ttof(strText);
@@ -1138,24 +1014,14 @@
 		}
 	}
 
-	return CDialogEx::PreTranslateMessage(pMsg);
+	return CBaseDlg::PreTranslateMessage(pMsg);
 }
 
 void CAxisSettingsDlg::OnSize(UINT nType, int cx, int cy)
 {
-	CDialogEx::OnSize(nType, cx, cy);
+	CBaseDlg::OnSize(nType, cx, cy);
 
 	// TODO: 鍦ㄦ澶勬坊鍔犳秷鎭鐞嗙▼搴忎唬鐮�
-	if (nType == SIZE_MINIMIZED || m_mapCtrlLayouts.empty()) {
-		return;
-	}
-
-	float dScaleX = static_cast<float>(cx) / m_nInitialWidth;
-	float dScaleY = static_cast<float>(cy) / m_nInitialHeight;
-
-	// 閬嶅巻瀵硅瘽妗嗕腑鐨勬墍鏈夋帶浠�
-	AdjustControls(dScaleX, dScaleY);
-
 	// 鍔ㄦ�佽皟鏁村悇涓� CBLLabel 鐨勫瓧浣撳ぇ灏�
 	for (auto pLabel : m_pBlLabels) {
 		AdjustLabelFont(*pLabel);
@@ -1182,30 +1048,6 @@
 		pComboBox->MoveWindow(&rectComboBox);
 		pComboBox->SetItemHeight(-1, rectButton.Height() - 6);
 	}
-}
-
-void CAxisSettingsDlg::OnSizing(UINT fwSide, LPRECT pRect)
-{
-	if (fwSide == WMSZ_BOTTOMRIGHT) {
-		if (pRect->right - pRect->left < 200) {
-			pRect->right = pRect->left + 200;
-		}
-		if (pRect->bottom - pRect->top < 150) {
-			pRect->bottom = pRect->top + 150;
-		}
-	}
-
-	CDialogEx::OnSizing(fwSide, pRect);
-}
-
-HBRUSH CAxisSettingsDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
-{
-	HBRUSH hbr = CDialogEx::OnCtlColor(pDC, pWnd, nCtlColor);
-
-	// TODO:  鍦ㄦ鏇存敼 DC 鐨勪换浣曠壒鎬�
-
-	// TODO:  濡傛灉榛樿鐨勪笉鏄墍闇�鐢荤瑪锛屽垯杩斿洖鍙︿竴涓敾绗�
-	return hbr;
 }
 
 void CAxisSettingsDlg::OnBnClickedButtonAxisLast()
@@ -1516,7 +1358,7 @@
 		readPLCDataToUI(nAxisId);
 	}	
 
-	CDialogEx::OnTimer(nIDEvent);
+	CBaseDlg::OnTimer(nIDEvent);
 }
 
 void CAxisSettingsDlg::OnClose()
@@ -1524,5 +1366,5 @@
 	// TODO: 鍦ㄦ娣诲姞娑堟伅澶勭悊绋嬪簭浠g爜鍜�/鎴栬皟鐢ㄩ粯璁ゅ��
 	KillTimer(TIMER_READ_PLC_DATA);
 
-	CDialogEx::OnClose();
+	CBaseDlg::OnClose();
 }
diff --git a/SourceCode/Bond/BondEq/View/AxisSettingsDlg.h b/SourceCode/Bond/BondEq/View/AxisSettingsDlg.h
index ed1e674..ef66b8f 100644
--- a/SourceCode/Bond/BondEq/View/AxisSettingsDlg.h
+++ b/SourceCode/Bond/BondEq/View/AxisSettingsDlg.h
@@ -4,6 +4,7 @@
 #include "BLLabel.h"
 #include "RegexEdit.h"
 #include "CPLC.h"
+#include "CBaseDlg.h"
 
 // 姣忛〉瀹氫綅鐐规樉绀轰釜鏁�
 #define AXIS_PAGE_SIZE	5
@@ -63,7 +64,7 @@
 	POSITION_5  // 瀹氫綅鐐�5
 };
 
-class CAxisSettingsDlg : public CDialogEx
+class CAxisSettingsDlg : public CBaseDlg
 {
 	DECLARE_DYNAMIC(CAxisSettingsDlg)
 
@@ -82,10 +83,6 @@
 
 private:
 	UINT FindIDByName(const CString& strControlID);
-	CFont* GetOrCreateFont(int nFontSize);
-	void SetDefaultFont();
-	void AdjustControls(float dScaleX, float dScaleY);
-	void AdjustControlFont(CWnd* pWnd, int nWidth, int nHeight);
 	void AdjustLabelFont(CBLLabel& label);
 	void SetLabelColor(CBLLabel& label, COLORREF color);
 	void SetLabelColorBasedOnState(CBLLabel& label, BOOL bState, COLORREF colorTrue, COLORREF colorFalse);
@@ -108,8 +105,6 @@
 
 private:
 	CPLC* m_pPLC;
-	int m_nInitialWidth;
-	int m_nInitialHeight;
 
 	// 褰撳墠閫変腑鐨勫畾浣嶉〉闈㈢储寮�
 	int m_currentPage;
@@ -123,10 +118,6 @@
 	CRegexEdit* m_pRegexEdit[EDIT_MAX];
 	CComboBox m_comboAxisNO;
 	CStatic m_staticAxisNO, m_staticAxisDescription, m_staticStartAddress;
-	//CEdit m_editManualSpeed, m_editAutoSpeed, m_editAccelerationTime, m_editDecelerationTime, m_editJogDistance;
-	
-	std::map<int, CRect> m_mapCtrlLayouts;
-	std::map<int, CFont*> m_mapFonts;
 
 	// 璇诲埌鐨勬暟鎹�
 	BOOL m_bSEV;
@@ -151,8 +142,6 @@
 	virtual BOOL OnInitDialog();
 	virtual BOOL PreTranslateMessage(MSG* pMsg);
 	afx_msg void OnSize(UINT nType, int cx, int cy);
-	afx_msg void OnSizing(UINT fwSide, LPRECT pRect);
-	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
 	afx_msg void OnBnClickedButtonAxisLast();
 	afx_msg void OnBnClickedButtonAxisNext();
 	afx_msg void OnBnClickedButtonAxisAnchorPointGroup1();
diff --git a/SourceCode/Bond/BondEq/View/RecipeListDlg.cpp b/SourceCode/Bond/BondEq/View/RecipeListDlg.cpp
index 5838e70..9546dca 100644
--- a/SourceCode/Bond/BondEq/View/RecipeListDlg.cpp
+++ b/SourceCode/Bond/BondEq/View/RecipeListDlg.cpp
@@ -14,13 +14,11 @@
 
 // CRecipeListDlg 瀵硅瘽妗�
 
-IMPLEMENT_DYNAMIC(CRecipeListDlg, CDialogEx)
+IMPLEMENT_DYNAMIC(CRecipeListDlg, CBaseDlg)
 
 CRecipeListDlg::CRecipeListDlg(CWnd* pParent /*=nullptr*/)
-	: CDialogEx(IDD_DIALOG_RECIPE_LIST, pParent)
+	: CBaseDlg(IDD_DIALOG_RECIPE_LIST, pParent)
 {
-	m_nInitialWidth = 0;
-	m_nInitialHeight = 0;
 	m_staticCurrRecipe = new CBLLabel();
 }
 
@@ -30,86 +28,6 @@
 		delete m_staticCurrRecipe;
 		m_staticCurrRecipe = nullptr;
 	}
-
-	for (auto& pair : m_mapFonts) {
-		if (pair.second) {
-			pair.second->DeleteObject();
-			delete pair.second;
-		}
-	}
-	m_mapFonts.clear();
-}
-
-CFont* CRecipeListDlg::GetOrCreateFont(int nFontSize)
-{
-	auto it = m_mapFonts.find(nFontSize);
-	if (it != m_mapFonts.end()) {
-		return it->second;
-	}
-
-	CFont* font = new CFont();
-	LOGFONT logFont = { 0 };
-	_tcscpy_s(logFont.lfFaceName, _T("Segoe UI"));
-	logFont.lfHeight = -nFontSize;
-	logFont.lfQuality = CLEARTYPE_QUALITY;
-	font->CreateFontIndirect(&logFont);
-	m_mapFonts[nFontSize] = font;
-
-	return font;
-}
-
-void CRecipeListDlg::AdjustControls(float dScaleX, float dScaleY)
-{
-	CWnd* pWnd = GetWindow(GW_CHILD);
-	while (pWnd) {
-		int nCtrlID = pWnd->GetDlgCtrlID();
-		if (nCtrlID != -1 && m_mapCtrlLayouts.find(nCtrlID) != m_mapCtrlLayouts.end()) {
-			CRect originalRect = m_mapCtrlLayouts[nCtrlID];
-			CRect newRect(
-				static_cast<int>(originalRect.left * dScaleX),
-				static_cast<int>(originalRect.top * dScaleY),
-				static_cast<int>(originalRect.right * dScaleX),
-				static_cast<int>(originalRect.bottom * dScaleY));
-
-			TCHAR szClassName[256];
-			GetClassName(pWnd->m_hWnd, szClassName, sizeof(szClassName));
-
-			if (_tcsicmp(szClassName, _T("MFCGridCtrl")) == 0) {
-				CGridCtrl* pGridCtrl = (CGridCtrl*)pWnd;
-				pGridCtrl->SetDefCellHeight(newRect.Height() / 21);
-				pGridCtrl->ExpandColumnsToFit(TRUE);
-				pGridCtrl->ExpandLastColumn();
-				pGridCtrl->Invalidate();
-				pGridCtrl->UpdateWindow();
-			}
-
-			pWnd->MoveWindow(&newRect);
-			AdjustControlFont(pWnd, newRect.Width(), newRect.Height());
-		}
-		pWnd = pWnd->GetNextWindow();
-	}
-}
-
-void CRecipeListDlg::AdjustControlFont(CWnd* pWnd, int nWidth, int nHeight)
-{
-	TCHAR szClassName[256];
-	GetClassName(pWnd->m_hWnd, szClassName, sizeof(szClassName));
-
-	// 璺宠繃鐗规畩鎺т欢锛堝 MFCGridCtrl锛�
-	if (_tcsicmp(szClassName, _T("MFCGridCtrl")) == 0) {
-		return;
-	}
-
-	// 鏍规嵁鎺т欢楂樺害鍔ㄦ�佽皟鏁村瓧浣撳ぇ灏�
-	int fontSize = nHeight / 2;
-	if (fontSize < 8) fontSize = 8;
-	if (fontSize < 24) fontSize = 24;
-
-	// 鑾峰彇鎴栧垱寤哄瓧浣�
-	CFont* pFont = GetOrCreateFont(fontSize);
-
-	pWnd->SetFont(pFont);
-	pWnd->Invalidate(); // 鍒锋柊鎺т欢鏄剧ず
 }
 
 void CRecipeListDlg::AdjustLabelFont(CBLLabel& label)
@@ -310,12 +228,12 @@
 
 void CRecipeListDlg::DoDataExchange(CDataExchange* pDX)
 {
-	CDialogEx::DoDataExchange(pDX);
+	CBaseDlg::DoDataExchange(pDX);
 	DDX_Control(pDX, IDC_CUSTOM_RECIPE_LIST, m_grid);
 }
 
 
-BEGIN_MESSAGE_MAP(CRecipeListDlg, CDialogEx)
+BEGIN_MESSAGE_MAP(CRecipeListDlg, CBaseDlg)
 	ON_BN_CLICKED(IDC_BUTTON_CREATE_RECIPE, &CRecipeListDlg::OnBnClickedButtonCreateRecipe)
 	ON_BN_CLICKED(IDC_BUTTON_DELETE_RECIPE, &CRecipeListDlg::OnBnClickedButtonDeleteRecipe)
 	ON_BN_CLICKED(IDC_BUTTON_SELECT_RECIPE, &CRecipeListDlg::OnBnClickedButtonSelectRecipe)
@@ -329,7 +247,7 @@
 
 BOOL CRecipeListDlg::OnInitDialog()
 {
-	CDialogEx::OnInitDialog();
+	CBaseDlg::OnInitDialog();
 
 	// TODO:  鍦ㄦ娣诲姞棰濆鐨勫垵濮嬪寲
 	m_staticCurrRecipe->SubclassDlgItem(IDC_STATIC_CURR_RECIPE, this);
@@ -340,55 +258,7 @@
 	m_staticCurrRecipe->SetDynamicFont(TRUE);
 	m_staticCurrRecipe->SetWindowText(RecipeManager::getInstance().getCurrentRecipeName().c_str());
 
-	CRect screenRect, dlgRect, clientRect;
-	SystemParametersInfo(SPI_GETWORKAREA, 0, &screenRect, 0);
-
-	GetClientRect(&clientRect);
-	m_nInitialWidth = clientRect.Width();
-	m_nInitialHeight = clientRect.Height();
-
-	// 鍒濆鍖栭粯璁ゅ瓧浣�
-	CFont* pDefaultFont = GetOrCreateFont(12);
-
-	// 閬嶅巻鎵�鏈夊瓙鎺т欢锛岃褰曞垵濮嬩綅缃苟璁剧疆榛樿瀛椾綋
-	CWnd* pWnd = GetWindow(GW_CHILD);
-	while (pWnd) {
-		int nCtrlID = pWnd->GetDlgCtrlID();
-		if (nCtrlID != -1) {
-			// 璁板綍鎺т欢鍒濆甯冨眬
-			CRect ctrlRect;
-			pWnd->GetWindowRect(&ctrlRect);
-			ScreenToClient(&ctrlRect);
-			m_mapCtrlLayouts[nCtrlID] = ctrlRect;
-
-			// 璺宠繃鐗规畩鎺т欢锛堝 MFCGridCtrl锛�
-			TCHAR szClassName[256];
-			GetClassName(pWnd->m_hWnd, szClassName, sizeof(szClassName));
-			if (_tcsicmp(szClassName, _T("MFCGridCtrl")) == 0) {
-				pWnd = pWnd->GetNextWindow();
-				continue;
-			}
-
-			// 璁剧疆榛樿瀛椾綋
-			pWnd->SetFont(pDefaultFont);
-		}
-		pWnd = pWnd->GetNextWindow();
-	}
-
-	GetWindowRect(&dlgRect);
-	int dlgWidth = dlgRect.Width() * 2;
-	int dlgHeight = dlgRect.Height() * 2;
-
-	if (dlgWidth > screenRect.Width()) {
-		dlgWidth = screenRect.Width();
-	}
-	if (dlgHeight > screenRect.Height()) {
-		dlgHeight = screenRect.Height();
-	}
-
-	int centerX = screenRect.left + (screenRect.Width() - dlgWidth) / 2;
-	int centerY = screenRect.top + (screenRect.Height() - dlgHeight) / 2;
-	MoveWindow(centerX, centerY, dlgWidth, dlgHeight);
+	AdjustLabelFont(*m_staticCurrRecipe);
 
 	InitRecipeLise();
 
@@ -398,21 +268,11 @@
 
 void CRecipeListDlg::OnSize(UINT nType, int cx, int cy)
 {
-	CDialogEx::OnSize(nType, cx, cy);
+	CBaseDlg::OnSize(nType, cx, cy);
 
 	// TODO: 鍦ㄦ澶勬坊鍔犳秷鎭鐞嗙▼搴忎唬鐮�
-	if (nType == SIZE_MINIMIZED || m_mapCtrlLayouts.empty()) {
-		return;
-	}
-
-	float dScaleX = static_cast<float>(cx) / m_nInitialWidth;
-	float dScaleY = static_cast<float>(cy) / m_nInitialHeight;
-
-	// 閬嶅巻瀵硅瘽妗嗕腑鐨勬墍鏈夋帶浠�
-	AdjustControls(dScaleX, dScaleY);
 	AdjustLabelFont(*m_staticCurrRecipe);
 }
-
 
 void CRecipeListDlg::OnBnClickedButtonCreateRecipe()
 {
@@ -588,7 +448,15 @@
 			return;
 		}
 		CString strText = inputDialog.GetInputText();
+		m_grid.SetItemText(nRow, nCol, strText);
 		UpdateDataFile(strRecipeName, strText);
+
+		m_grid.ExpandColumnsToFit(FALSE);   // 鑷姩璋冩暣鍒楀
+		m_grid.ExpandLastColumn();			// 鏈�鍚庝竴鍒楀~鍏呯綉鏍�
+
+		// 鍒锋柊缃戞牸鎺т欢
+		m_grid.Invalidate();
+		m_grid.UpdateWindow();
 	}
 
 	*pResult = 0;
diff --git a/SourceCode/Bond/BondEq/View/RecipeListDlg.h b/SourceCode/Bond/BondEq/View/RecipeListDlg.h
index 66ea463..2dafd08 100644
--- a/SourceCode/Bond/BondEq/View/RecipeListDlg.h
+++ b/SourceCode/Bond/BondEq/View/RecipeListDlg.h
@@ -1,12 +1,13 @@
 锘�#pragma once
 #include "afxdialogex.h"
 #include "GridCtrl.h"
+#include "CBaseDlg.h"
 #include "BLLabel.h"
 
 
 // CRecipeListDlg 瀵硅瘽妗�
 
-class CRecipeListDlg : public CDialogEx
+class CRecipeListDlg : public CBaseDlg
 {
 	DECLARE_DYNAMIC(CRecipeListDlg)
 
@@ -20,19 +21,19 @@
 #endif
 
 private:
-	CFont* GetOrCreateFont(int nFontSize);
-	void AdjustControls(float dScaleX, float dScaleY);
-	void AdjustControlFont(CWnd* pWnd, int nWidth, int nHeight);
+	//CFont* GetOrCreateFont(int nFontSize);
+	//void AdjustControls(float dScaleX, float dScaleY);
+	//void AdjustControlFont(CWnd* pWnd, int nWidth, int nHeight);
 	void AdjustLabelFont(CBLLabel& label);
 	void InitRecipeLise();
 	void FillRecipeLise();
 	void UpdateDataFile(const CString& strRecipeName, const CString& strNewDescription);
 
 private:
-	int m_nInitialWidth;
-	int m_nInitialHeight;
-	std::map<int, CFont*> m_mapFonts;		// 瀛椾綋鏄犲皠
-	std::map<int, CRect> m_mapCtrlLayouts;	// 鎺т欢甯冨眬鏄犲皠
+	//int m_nInitialWidth;
+	//int m_nInitialHeight;
+	//std::map<int, CFont*> m_mapFonts;		// 瀛椾綋鏄犲皠
+	//std::map<int, CRect> m_mapCtrlLayouts;	// 鎺т欢甯冨眬鏄犲皠
 
 	// 鎺т欢
 	CBLLabel* m_staticCurrRecipe;
diff --git a/SourceCode/Bond/BondEq/View/SystemLogManagerDlg.cpp b/SourceCode/Bond/BondEq/View/SystemLogManagerDlg.cpp
index f5603fb..72a9a03 100644
--- a/SourceCode/Bond/BondEq/View/SystemLogManagerDlg.cpp
+++ b/SourceCode/Bond/BondEq/View/SystemLogManagerDlg.cpp
@@ -9,29 +9,20 @@
 
 // CSystemLogManagerDlg 瀵硅瘽妗�
 
-IMPLEMENT_DYNAMIC(CSystemLogManagerDlg, CDialogEx)
+IMPLEMENT_DYNAMIC(CSystemLogManagerDlg, CBaseDlg)
 
 CSystemLogManagerDlg::CSystemLogManagerDlg(CWnd* pParent /*=nullptr*/)
-	: CDialogEx(IDD_DIALOG_SYSTEM_LOG_MANAGER, pParent)
+	: CBaseDlg(IDD_DIALOG_SYSTEM_LOG_MANAGER, pParent)
 {
-	m_nInitialWidth = 0;
-	m_nInitialHeight = 0;
 }
 
 CSystemLogManagerDlg::~CSystemLogManagerDlg()
 {
-	for (auto& pair : m_mapFonts) {
-		if (pair.second) {
-			pair.second->DeleteObject();
-			delete pair.second;
-		}
-	}
-	m_mapFonts.clear();
 }
 
 void CSystemLogManagerDlg::DoDataExchange(CDataExchange* pDX)
 {
-	CDialogEx::DoDataExchange(pDX);
+	CBaseDlg::DoDataExchange(pDX);
 	DDX_Control(pDX, IDC_COMBO_TYPE, m_comboType);
 	DDX_Control(pDX, IDC_COMBO_USER, m_comboUser);
 	DDX_Control(pDX, IDC_DATETIMEPICKER_START, m_dateTimeStart);
@@ -161,24 +152,6 @@
 	UpdatePageInfo();
 }
 
-CFont* CSystemLogManagerDlg::GetOrCreateFont(int nFontSize)
-{
-	auto it = m_mapFonts.find(nFontSize);
-	if (it != m_mapFonts.end()) {
-		return it->second;
-	}
-
-	CFont* font = new CFont();
-	LOGFONT logFont = { 0 };
-	_tcscpy_s(logFont.lfFaceName, _T("Segoe UI"));
-	logFont.lfHeight = -nFontSize;
-	logFont.lfQuality = CLEARTYPE_QUALITY;
-	font->CreateFontIndirect(&logFont);
-	m_mapFonts[nFontSize] = font;
-
-	return font;
-}
-
 void CSystemLogManagerDlg::UpdatePageInfo()
 {
 	// 鏍煎紡鍖栭〉鐮佷俊鎭负 "褰撳墠椤�/鎬婚〉鏁�"
@@ -187,112 +160,13 @@
 	m_staticPageNum.SetWindowText(pageInfo);
 }
 
-void CSystemLogManagerDlg::SetDefaultFont()
-{
-	CFont* defaultFont = GetOrCreateFont(12);
 
-	// 閬嶅巻鎵�鏈夋帶浠讹紝搴旂敤榛樿瀛椾綋
-	CWnd* pWnd = GetWindow(GW_CHILD);
-	while (pWnd) {
-		// 璺宠繃鐗规畩鎺т欢锛堝 MFCGridCtrl锛�
-		TCHAR szClassName[256];
-		GetClassName(pWnd->m_hWnd, szClassName, sizeof(szClassName));
-		if (_tcsicmp(szClassName, _T("MFCGridCtrl")) == 0) {
-			pWnd = pWnd->GetNextWindow();
-			continue;
-		}
-
-		pWnd->SetFont(defaultFont, TRUE);
-		pWnd = pWnd->GetNextWindow();
-	}
-}
-
-void CSystemLogManagerDlg::AdjustControls(float dScaleX, float dScaleY)
-{
-	CWnd* pWnd = GetWindow(GW_CHILD);
-	while (pWnd) {
-		int nCtrlID = pWnd->GetDlgCtrlID();
-		if (nCtrlID != -1 && m_mapCtrlLayouts.find(nCtrlID) != m_mapCtrlLayouts.end())
-		{
-			CRect originalRect = m_mapCtrlLayouts[nCtrlID];
-			CRect newRect(
-				static_cast<int>(originalRect.left * dScaleX),
-				static_cast<int>(originalRect.top * dScaleY),
-				static_cast<int>(originalRect.right * dScaleX),
-				static_cast<int>(originalRect.bottom * dScaleY));
-
-			TCHAR szClassName[256];
-			GetClassName(pWnd->m_hWnd, szClassName, sizeof(szClassName));
-
-			if (_tcsicmp(szClassName, _T("ComboBox")) == 0) {
-				CComboBox* pComboBox = (CComboBox*)pWnd;
-				pComboBox->SetItemHeight(-1, newRect.Height());  // -1 琛ㄧず鎵�鏈夐」鐨勯珮搴�
-			}
-
-			if (_tcsicmp(szClassName, _T("MFCGridCtrl")) == 0) {
-				CGridCtrl* pGridCtrl = (CGridCtrl*)pWnd;
-				pGridCtrl->SetDefCellHeight(newRect.Height() / 21);
-				pGridCtrl->ExpandColumnsToFit(TRUE);
-				pGridCtrl->ExpandLastColumn();
-				pGridCtrl->Invalidate();
-				pGridCtrl->UpdateWindow();
-			}
-
-			pWnd->MoveWindow(&newRect);
-			AdjustControlFont(pWnd, newRect.Width(), newRect.Height());
-		}
-		pWnd = pWnd->GetNextWindow();
-	}
-}
-
-void CSystemLogManagerDlg::AdjustControlFont(CWnd* pWnd, int nWidth, int nHeight)
-{
-	TCHAR szClassName[256];
-	GetClassName(pWnd->m_hWnd, szClassName, sizeof(szClassName));
-
-	// 璺宠繃鐗规畩鎺т欢锛堝 MFCGridCtrl锛�
-	if (_tcsicmp(szClassName, _T("MFCGridCtrl")) == 0) {
-		return;
-	}
-
-	// 鏍规嵁鎺т欢楂樺害鍔ㄦ�佽皟鏁村瓧浣撳ぇ灏�
-	int fontSize = nHeight / 2;
-	if (fontSize < 8) fontSize = 8;
-
-	// 鑾峰彇鎴栧垱寤哄瓧浣�
-	CFont* pFont = GetOrCreateFont(fontSize);
-
-	pWnd->SetFont(pFont);
-	pWnd->Invalidate(); // 鍒锋柊鎺т欢鏄剧ず
-}
-
-
-void CSystemLogManagerDlg::AdjustComboBoxStyle(CComboBox& comboBox)
-{
-	DWORD dwStyle = comboBox.GetStyle();
-	comboBox.ModifyStyle(0, CBS_DROPDOWNLIST | CBS_HASSTRINGS | CBS_OWNERDRAWFIXED);
-
-	comboBox.Invalidate();
-	comboBox.UpdateWindow();
-}
-
-
-void CSystemLogManagerDlg::AdjustDateTimeCtrlStyle(CDateTimeCtrl& dateTimeCtrl)
-{
-	dateTimeCtrl.ModifyStyle(0, DTS_RIGHTALIGN);
-	dateTimeCtrl.Invalidate();
-	dateTimeCtrl.UpdateWindow();
-}
-
-
-BEGIN_MESSAGE_MAP(CSystemLogManagerDlg, CDialogEx)
+BEGIN_MESSAGE_MAP(CSystemLogManagerDlg, CBaseDlg)
 	ON_BN_CLICKED(IDC_BUTTON_SEARCH, &CSystemLogManagerDlg::OnBnClickedButtonSearch)
 	ON_BN_CLICKED(IDC_BUTTON_PREV_PAGE, &CSystemLogManagerDlg::OnBnClickedButtonPrevPage)
 	ON_BN_CLICKED(IDC_BUTTON_NEXT_PAGE, &CSystemLogManagerDlg::OnBnClickedButtonNextPage)
 	ON_CBN_SELCHANGE(IDC_COMBO_TYPE, &CSystemLogManagerDlg::OnSelchangeComboType)
 	ON_CBN_SELCHANGE(IDC_COMBO_USER, &CSystemLogManagerDlg::OnSelchangeComboUser)
-	ON_WM_SIZE()
-	ON_WM_GETMINMAXINFO()
 END_MESSAGE_MAP()
 
 
@@ -301,7 +175,7 @@
 
 BOOL CSystemLogManagerDlg::OnInitDialog()
 {
-	CDialogEx::OnInitDialog();
+	CBaseDlg::OnInitDialog();
 
 	// TODO:  鍦ㄦ娣诲姞棰濆鐨勫垵濮嬪寲
 	SetWindowText(_T("绯荤粺杩愯鏃ュ織"));
@@ -330,88 +204,11 @@
 	COleDateTime defaultStartTime = currentTime - COleDateTimeSpan(30, 0, 0, 0);
 	m_dateTimeStart.SetTime(defaultStartTime);
 
-	CRect screenRect, dlgRect, clientRect;
-	GetClientRect(&clientRect);
-	m_nInitialWidth = clientRect.Width();
-	m_nInitialHeight = clientRect.Height();
-
-	// 鍒濆鍖栭粯璁ゅ瓧浣�
-	CFont* pDefaultFont = GetOrCreateFont(12);
-
-	// 閬嶅巻鎵�鏈夊瓙鎺т欢锛岃褰曞垵濮嬩綅缃苟璁剧疆榛樿瀛椾綋
-	CWnd* pWnd = GetWindow(GW_CHILD);
-	while (pWnd) {
-		int nCtrlID = pWnd->GetDlgCtrlID();
-		if (nCtrlID != -1) {
-			// 璁板綍鎺т欢鍒濆甯冨眬
-			CRect ctrlRect;
-			pWnd->GetWindowRect(&ctrlRect);
-			ScreenToClient(&ctrlRect);
-			m_mapCtrlLayouts[nCtrlID] = ctrlRect;
-
-			// 璺宠繃鐗规畩鎺т欢锛堝 MFCGridCtrl锛�
-			TCHAR szClassName[256];
-			GetClassName(pWnd->m_hWnd, szClassName, sizeof(szClassName));
-			if (_tcsicmp(szClassName, _T("MFCGridCtrl")) == 0) {
-				pWnd = pWnd->GetNextWindow();
-				continue;
-			}
-
-			// 璁剧疆榛樿瀛椾綋
-			pWnd->SetFont(pDefaultFont);
-		}
-		pWnd = pWnd->GetNextWindow();
-	}
-
-	GetWindowRect(&dlgRect);
-	int dlgWidth = dlgRect.Width() * 2;
-	int dlgHeight = dlgRect.Height() * 2;
-
-	SystemParametersInfo(SPI_GETWORKAREA, 0, &screenRect, 0);
-	if (dlgWidth > screenRect.Width()) {
-		dlgWidth = screenRect.Width();
-	}
-	if (dlgHeight > screenRect.Height()) {
-		dlgHeight = screenRect.Height();
-	}
-
-	int centerX = screenRect.left + (screenRect.Width() - dlgWidth) / 2;
-	int centerY = screenRect.top + (screenRect.Height() - dlgHeight) / 2;
-	MoveWindow(centerX, centerY, dlgWidth, dlgHeight);
-
 	InitSystemLogManager();
 
 	return TRUE;  // return TRUE unless you set the focus to a control
 	// 寮傚父: OCX 灞炴�ч〉搴旇繑鍥� FALSE
 }
-
-
-void CSystemLogManagerDlg::OnSize(UINT nType, int cx, int cy)
-{
-	CDialogEx::OnSize(nType, cx, cy);
-
-	// TODO: 鍦ㄦ澶勬坊鍔犳秷鎭鐞嗙▼搴忎唬鐮�
-	if (nType == SIZE_MINIMIZED || m_mapCtrlLayouts.empty()) {
-		return;
-	}
-
-	float dScaleX = static_cast<float>(cx) / m_nInitialWidth;
-	float dScaleY = static_cast<float>(cy) / m_nInitialHeight;
-
-	// 閬嶅巻瀵硅瘽妗嗕腑鐨勬墍鏈夋帶浠�
-	AdjustControls(dScaleX, dScaleY);
-}
-
-
-void CSystemLogManagerDlg::OnGetMinMaxInfo(MINMAXINFO* lpMMI)
-{
-	// TODO: 鍦ㄦ娣诲姞娑堟伅澶勭悊绋嬪簭浠g爜鍜�/鎴栬皟鐢ㄩ粯璁ゅ��
-	lpMMI->ptMinTrackSize.x = 400; // 鏈�灏忓搴�
-	lpMMI->ptMinTrackSize.y = 300; // 鏈�灏忛珮搴�
-
-	CDialogEx::OnGetMinMaxInfo(lpMMI);
-}
-
 
 void CSystemLogManagerDlg::OnBnClickedButtonSearch()
 {
@@ -426,7 +223,6 @@
 		AfxMessageBox(errorMsg, MB_ICONERROR);
 	}
 }
-
 
 void CSystemLogManagerDlg::OnBnClickedButtonPrevPage()
 {
@@ -447,7 +243,6 @@
 	}
 }
 
-
 void CSystemLogManagerDlg::OnBnClickedButtonNextPage()
 {
 	// TODO: 鍦ㄦ娣诲姞鎺т欢閫氱煡澶勭悊绋嬪簭浠g爜
@@ -467,7 +262,6 @@
 	}
 }
 
-
 void CSystemLogManagerDlg::OnSelchangeComboType()
 {
 	// TODO: 鍦ㄦ娣诲姞鎺т欢閫氱煡澶勭悊绋嬪簭浠g爜
@@ -482,7 +276,6 @@
 	}
 }
 
-
 void CSystemLogManagerDlg::OnSelchangeComboUser()
 {
 	// TODO: 鍦ㄦ娣诲姞鎺т欢閫氱煡澶勭悊绋嬪簭浠g爜
@@ -495,4 +288,4 @@
 		errorMsg.Format(_T("鍒囨崲瑙掕壊澶辫触锛�%s"), CString(ex.what()));
 		AfxMessageBox(errorMsg, MB_ICONERROR);
 	}
-}
\ No newline at end of file
+}
diff --git a/SourceCode/Bond/BondEq/View/SystemLogManagerDlg.h b/SourceCode/Bond/BondEq/View/SystemLogManagerDlg.h
index 9cd5ea5..e5d1396 100644
--- a/SourceCode/Bond/BondEq/View/SystemLogManagerDlg.h
+++ b/SourceCode/Bond/BondEq/View/SystemLogManagerDlg.h
@@ -1,10 +1,11 @@
 锘�#pragma once
 #include "afxdialogex.h"
 #include "GridCtrl.h"
+#include "CBaseDlg.h"
 
 // CSystemLogManagerDlg 瀵硅瘽妗�
 
-class CSystemLogManagerDlg : public CDialogEx
+class CSystemLogManagerDlg : public CBaseDlg
 {
 	DECLARE_DYNAMIC(CSystemLogManagerDlg)
 
@@ -20,21 +21,11 @@
 private:
 	void InitSystemLogManager();
 	void FillSystemLogManager();
-	CFont* GetOrCreateFont(int nFontSize);
 	void UpdatePageInfo();
-	void SetDefaultFont();
-	void AdjustControls(float dScaleX, float dScaleY);
-	void AdjustControlFont(CWnd* pWnd, int nWidth, int nHeight);
-	void AdjustComboBoxStyle(CComboBox& comboBox);
-	void AdjustDateTimeCtrlStyle(CDateTimeCtrl& dateTimeCtrl);
 
 private:
-	int m_nInitialWidth;   // 鍒濆瀹藉害
-	int m_nInitialHeight;  // 鍒濆楂樺害
 	int m_nCurrentPage;    // 褰撳墠椤电爜
 	int m_nTotalPages;     // 鎬婚〉鏁�
-	std::map<int, CRect> m_mapCtrlLayouts;	// 瀛樺偍鎺т欢鐨勫垵濮嬪竷灞�淇℃伅
-	std::map<int, CFont*> m_mapFonts;		// 绠$悊瀛椾綋鐨勫鍣紝閿负瀛椾綋澶у皬
 
 private:
 	CComboBox m_comboType;
@@ -47,15 +38,11 @@
 
 protected:
 	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 鏀寔
-
-	DECLARE_MESSAGE_MAP()
-public:
 	virtual BOOL OnInitDialog();
-	afx_msg void OnSize(UINT nType, int cx, int cy);
-	afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI);
 	afx_msg void OnBnClickedButtonSearch();
 	afx_msg void OnBnClickedButtonPrevPage();
 	afx_msg void OnBnClickedButtonNextPage();
 	afx_msg void OnSelchangeComboType();
 	afx_msg void OnSelchangeComboUser();
+	DECLARE_MESSAGE_MAP()
 };
diff --git a/SourceCode/Bond/BondEq/View/UserManagerDlg.cpp b/SourceCode/Bond/BondEq/View/UserManagerDlg.cpp
index 849c4a9..a3de9ff 100644
--- a/SourceCode/Bond/BondEq/View/UserManagerDlg.cpp
+++ b/SourceCode/Bond/BondEq/View/UserManagerDlg.cpp
@@ -8,37 +8,27 @@
 #include "InputDialog.h"
 #include "NewCellTypes/GridCellCombo.h"
 #include "NewCellTypes/GridCellNumeric.h"
-
 #include <set>
 
 const COLORREF CURR_USER_BK_COLOR = RGB(0, 255, 0);
 
 // CUserManagerDlg 瀵硅瘽妗�
 
-IMPLEMENT_DYNAMIC(CUserManagerDlg, CDialogEx)
+IMPLEMENT_DYNAMIC(CUserManagerDlg, CBaseDlg)
 
 CUserManagerDlg::CUserManagerDlg(CWnd* pParent /*=nullptr*/)
-	: CDialogEx(IDD_DIALOG_USER_MANAGER, pParent)
+	: CBaseDlg(IDD_DIALOG_USER_MANAGER, pParent)
 {
-	m_nInitialWidth = 0;
-	m_nInitialHeight = 0;
 }
 
 CUserManagerDlg::~CUserManagerDlg()
 {
-	for (auto& pair : m_mapFonts) {
-		if (pair.second) {
-			pair.second->DeleteObject();
-			delete pair.second;
-		}
-	}
-	m_mapFonts.clear();
 }
 
 void CUserManagerDlg::DoDataExchange(CDataExchange* pDX)
 {
 	DDX_Control(pDX, IDC_CUSTOM_USER, m_gridUserManager);
-	CDialogEx::DoDataExchange(pDX);
+	CBaseDlg::DoDataExchange(pDX);
 }
 
 void CUserManagerDlg::InitUserManager()
@@ -350,111 +340,12 @@
 	return false;
 }
 
-CFont* CUserManagerDlg::GetOrCreateFont(int nFontSize)
-{
-	auto it = m_mapFonts.find(nFontSize);
-	if (it != m_mapFonts.end()) {
-		return it->second;
-	}
-
-	CFont* font = new CFont();
-	LOGFONT logFont = { 0 };
-	_tcscpy_s(logFont.lfFaceName, _T("Segoe UI"));
-	logFont.lfHeight = -nFontSize;
-	logFont.lfQuality = CLEARTYPE_QUALITY;
-	font->CreateFontIndirect(&logFont);
-	m_mapFonts[nFontSize] = font;
-
-	return font;
-}
-
-void CUserManagerDlg::SetDefaultFont()
-{
-	CFont* defaultFont = GetOrCreateFont(12);
-
-	// 閬嶅巻鎵�鏈夋帶浠讹紝搴旂敤榛樿瀛椾綋
-	CWnd* pWnd = GetWindow(GW_CHILD);
-	while (pWnd) {
-		// 璺宠繃鐗规畩鎺т欢锛堝 MFCGridCtrl锛�
-		TCHAR szClassName[256];
-		GetClassName(pWnd->m_hWnd, szClassName, sizeof(szClassName));
-		if (_tcsicmp(szClassName, _T("MFCGridCtrl")) == 0) {
-			pWnd = pWnd->GetNextWindow();
-			continue;
-		}
-
-		pWnd->SetFont(defaultFont, TRUE);
-		pWnd = pWnd->GetNextWindow();
-	}
-}
-
-void CUserManagerDlg::AdjustControls(float dScaleX, float dScaleY)
-{
-	CWnd* pWnd = GetWindow(GW_CHILD);
-	while (pWnd) {
-		int nCtrlID = pWnd->GetDlgCtrlID();
-		if (nCtrlID != -1 && m_mapCtrlLayouts.find(nCtrlID) != m_mapCtrlLayouts.end())
-		{
-			CRect originalRect = m_mapCtrlLayouts[nCtrlID];
-			CRect newRect(
-				static_cast<int>(originalRect.left * dScaleX),
-				static_cast<int>(originalRect.top * dScaleY),
-				static_cast<int>(originalRect.right * dScaleX),
-				static_cast<int>(originalRect.bottom * dScaleY));
-
-			TCHAR szClassName[256];
-			GetClassName(pWnd->m_hWnd, szClassName, sizeof(szClassName));
-
-			if (_tcsicmp(szClassName, _T("ComboBox")) == 0) {
-				CComboBox* pComboBox = (CComboBox*)pWnd;
-				pComboBox->SetItemHeight(-1, newRect.Height());  // -1 琛ㄧず鎵�鏈夐」鐨勯珮搴�
-			}
-
-			if (_tcsicmp(szClassName, _T("MFCGridCtrl")) == 0) {
-				CGridCtrl* pGridCtrl = (CGridCtrl*)pWnd;
-				pGridCtrl->SetDefCellHeight(newRect.Height() / 21);
-				pGridCtrl->ExpandColumnsToFit(TRUE);
-				pGridCtrl->ExpandLastColumn();
-				pGridCtrl->Invalidate();
-				pGridCtrl->UpdateWindow();
-			}
-
-			pWnd->MoveWindow(&newRect);
-			AdjustControlFont(pWnd, newRect.Width(), newRect.Height());
-		}
-		pWnd = pWnd->GetNextWindow();
-	}
-}
-
-void CUserManagerDlg::AdjustControlFont(CWnd* pWnd, int nWidth, int nHeight)
-{
-	TCHAR szClassName[256];
-	GetClassName(pWnd->m_hWnd, szClassName, sizeof(szClassName));
-
-	// 璺宠繃鐗规畩鎺т欢锛堝 MFCGridCtrl锛�
-	if (_tcsicmp(szClassName, _T("MFCGridCtrl")) == 0) {
-		return;
-	}
-
-	// 鏍规嵁鎺т欢楂樺害鍔ㄦ�佽皟鏁村瓧浣撳ぇ灏�
-	int fontSize = nHeight / 2;
-	if (fontSize < 8) fontSize = 8;
-
-	// 鑾峰彇鎴栧垱寤哄瓧浣�
-	CFont* pFont = GetOrCreateFont(fontSize);
-
-	pWnd->SetFont(pFont);
-	pWnd->Invalidate(); // 鍒锋柊鎺т欢鏄剧ず
-}
-
-BEGIN_MESSAGE_MAP(CUserManagerDlg, CDialogEx)
-	ON_WM_SIZE()
+BEGIN_MESSAGE_MAP(CUserManagerDlg, CBaseDlg)
 	ON_NOTIFY(GVN_COMBOSELCHANGE, IDC_CUSTOM_USER, &CUserManagerDlg::OnGridComboSelChange)
 	ON_BN_CLICKED(IDC_BUTTON_ADD, &CUserManagerDlg::OnBnClickedButtonAdd)
 	ON_BN_CLICKED(IDC_BUTTON_DEL, &CUserManagerDlg::OnBnClickedButtonDel)
 	ON_BN_CLICKED(IDOK, &CUserManagerDlg::OnBnClickedOk)
 	ON_BN_CLICKED(IDC_BUTTON_INSERT, &CUserManagerDlg::OnBnClickedButtonInsert)
-	ON_WM_GETMINMAXINFO()
 END_MESSAGE_MAP()
 
 
@@ -463,59 +354,10 @@
 
 BOOL CUserManagerDlg::OnInitDialog()
 {
-	CDialogEx::OnInitDialog();
+	CBaseDlg::OnInitDialog();
 
 	// TODO:  鍦ㄦ娣诲姞棰濆鐨勫垵濮嬪寲
-	CRect screenRect, dlgRect, clientRect;
 	SetWindowText(_T("鐢ㄦ埛绠$悊"));
-	SystemParametersInfo(SPI_GETWORKAREA, 0, &screenRect, 0);
-
-	GetClientRect(&clientRect);
-	m_nInitialWidth = clientRect.Width();
-	m_nInitialHeight = clientRect.Height();
-
-	// 鍒濆鍖栭粯璁ゅ瓧浣�
-	CFont* pDefaultFont = GetOrCreateFont(12);
-
-	// 閬嶅巻鎵�鏈夊瓙鎺т欢锛岃褰曞垵濮嬩綅缃苟璁剧疆榛樿瀛椾綋
-	CWnd* pWnd = GetWindow(GW_CHILD);
-	while (pWnd) {
-		int nCtrlID = pWnd->GetDlgCtrlID();
-		if (nCtrlID != -1) {
-			// 璁板綍鎺т欢鍒濆甯冨眬
-			CRect ctrlRect;
-			pWnd->GetWindowRect(&ctrlRect);
-			ScreenToClient(&ctrlRect);
-			m_mapCtrlLayouts[nCtrlID] = ctrlRect;
-
-			// 璺宠繃鐗规畩鎺т欢锛堝 MFCGridCtrl锛�
-			TCHAR szClassName[256];
-			GetClassName(pWnd->m_hWnd, szClassName, sizeof(szClassName));
-			if (_tcsicmp(szClassName, _T("MFCGridCtrl")) == 0) {
-				pWnd = pWnd->GetNextWindow();
-				continue;
-			}
-
-			// 璁剧疆榛樿瀛椾綋
-			pWnd->SetFont(pDefaultFont);
-		}
-		pWnd = pWnd->GetNextWindow();
-	}
-
-	GetWindowRect(&dlgRect);
-	int dlgWidth = dlgRect.Width() * 3;
-	int dlgHeight = dlgRect.Height() * 3;
-
-	if (dlgWidth > screenRect.Width()) {
-		dlgWidth = screenRect.Width(); 
-	}
-	if (dlgHeight > screenRect.Height()) {
-		dlgHeight = screenRect.Height();
-	}
-
-	int centerX = screenRect.left + (screenRect.Width() - dlgWidth) / 2;
-	int centerY = screenRect.top + (screenRect.Height() - dlgHeight) / 2;
-	MoveWindow(centerX, centerY, dlgWidth, dlgHeight);
 
 	// 鍒濆鍖栫敤鎴风鐞嗚〃鏍�
 	InitUserManager();
@@ -523,34 +365,6 @@
 	return TRUE;  // return TRUE unless you set the focus to a control
 	// 寮傚父: OCX 灞炴�ч〉搴旇繑鍥� FALSE
 }
-
-
-void CUserManagerDlg::OnSize(UINT nType, int cx, int cy)
-{
-	CDialogEx::OnSize(nType, cx, cy);
-
-	// TODO: 鍦ㄦ澶勬坊鍔犳秷鎭鐞嗙▼搴忎唬鐮�
-	if (nType == SIZE_MINIMIZED || m_mapCtrlLayouts.empty()) {
-		return;
-	}
-
-	float dScaleX = static_cast<float>(cx) / m_nInitialWidth;
-	float dScaleY = static_cast<float>(cy) / m_nInitialHeight;
-
-	// 閬嶅巻瀵硅瘽妗嗕腑鐨勬墍鏈夋帶浠�
-	AdjustControls(dScaleX, dScaleY);
-}
-
-
-void CUserManagerDlg::OnGetMinMaxInfo(MINMAXINFO* lpMMI)
-{
-	// TODO: 鍦ㄦ娣诲姞娑堟伅澶勭悊绋嬪簭浠g爜鍜�/鎴栬皟鐢ㄩ粯璁ゅ��
-	lpMMI->ptMinTrackSize.x = 400; // 鏈�灏忓搴�
-	lpMMI->ptMinTrackSize.y = 300; // 鏈�灏忛珮搴�
-
-	CDialogEx::OnGetMinMaxInfo(lpMMI);
-}
-
 
 void CUserManagerDlg::OnGridComboSelChange(NMHDR* pNMHDR, LRESULT* pResult)
 {
@@ -726,5 +540,5 @@
 	}
 
 	userManager.setUsers(vecData);
-	CDialogEx::OnOK();
+	CBaseDlg::OnOK();
 }
diff --git a/SourceCode/Bond/BondEq/View/UserManagerDlg.h b/SourceCode/Bond/BondEq/View/UserManagerDlg.h
index c311784..545a019 100644
--- a/SourceCode/Bond/BondEq/View/UserManagerDlg.h
+++ b/SourceCode/Bond/BondEq/View/UserManagerDlg.h
@@ -1,10 +1,11 @@
 锘�#pragma once
 #include "afxdialogex.h"
 #include "GridCtrl.h"
+#include "CBaseDlg.h"
 
 // CUserManagerDlg 瀵硅瘽妗�
 
-class CUserManagerDlg : public CDialogEx
+class CUserManagerDlg : public CBaseDlg
 {
 	DECLARE_DYNAMIC(CUserManagerDlg)
 
@@ -23,19 +24,11 @@
 	void AddRow(CGridCtrl* pGridCtrl);
 	void DeleteSelectedRow(CGridCtrl* pGridCtrl);
 	bool IsUsernameDuplicate(const CString& username);
-	CFont* GetOrCreateFont(int nFontSize);
-	void SetDefaultFont();
-	void AdjustControls(float dScaleX, float dScaleY);
-	void AdjustControlFont(CWnd* pWnd, int nWidth, int nHeight);
 
 private:
-	int m_nInitialWidth;
-	int m_nInitialHeight;
-	std::map<int, CRect> m_mapCtrlLayouts;
-	std::map<int, CFont*> m_mapFonts;
 	std::map<CString, CString> m_mapRoleDescriptions;
 
-private:
+	// 鎺т欢
 	CGridCtrl m_gridUserManager;
 
 protected:
@@ -44,8 +37,6 @@
 	DECLARE_MESSAGE_MAP()
 public:
 	virtual BOOL OnInitDialog();
-	afx_msg void OnSize(UINT nType, int cx, int cy);
-	afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI);
 	afx_msg void OnGridComboSelChange(NMHDR* pNMHDR, LRESULT* pResult);
 	afx_msg void OnBnClickedButtonAdd();
 	afx_msg void OnBnClickedButtonInsert();

--
Gitblit v1.9.3