From b76cfabb985d364850a04c8a70f5c04293357da4 Mon Sep 17 00:00:00 2001
From: LAPTOP-T815PCOQ\25526 <mr.liuyang@126.com>
Date: 星期五, 15 十一月 2024 10:06:29 +0800
Subject: [PATCH] 1. 添加控件库 2.Axis设定界面文本字体不跟对话框大小变化3.修复修改用户界面的bug
---
SourceCode/Bond/BondEq/AxisSettingsDlg.cpp | 25 ++++++++++++++-----------
1 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/SourceCode/Bond/BondEq/AxisSettingsDlg.cpp b/SourceCode/Bond/BondEq/AxisSettingsDlg.cpp
index 9bd1482..e92cb8c 100644
--- a/SourceCode/Bond/BondEq/AxisSettingsDlg.cpp
+++ b/SourceCode/Bond/BondEq/AxisSettingsDlg.cpp
@@ -210,16 +210,6 @@
pWnd->MoveWindow(newX, newY, newWidth, newHeight);
AdjustControlFont(pWnd, newWidth, newHeight);
- if (pWnd->IsKindOf(RUNTIME_CLASS(CComboBox))) {
- CComboBox* pComboBox = (CComboBox*)pWnd;
- pComboBox->SetItemHeight(-1, newHeight); // -1 琛ㄧず鎵�鏈夐」鐨勯珮搴�
- }
-
- if (pWnd->IsKindOf(RUNTIME_CLASS(CStatic))) {
- CStatic* pStatic = (CStatic*)pWnd;
- pStatic->ModifyStyle(0, SS_CENTER | SS_CENTERIMAGE);
- }
-
// 鑾峰彇涓嬩竴涓帶浠�
pWnd = pWnd->GetNextWindow();
}
@@ -227,8 +217,21 @@
void CAxisSettingsDlg::AdjustControlFont(CWnd* pWnd, int nWidth, int nHeight)
{
- int fontSize = nHeight - 10;
+ TCHAR szClassName[256];
+ GetClassName(pWnd->m_hWnd, szClassName, sizeof(szClassName));
+ if (_tcsicmp(szClassName, _T("Static")) == 0) {
+ CStatic* pStatic = (CStatic*)pWnd;
+ pStatic->ModifyStyle(0, SS_CENTER | SS_CENTERIMAGE);
+ return;
+ }
+
+ if (_tcsicmp(szClassName, _T("ComboBox")) == 0) {
+ CComboBox* pComboBox = (CComboBox*)pWnd;
+ pComboBox->SetItemHeight(-1, nHeight); // -1 琛ㄧず鎵�鏈夐」鐨勯珮搴�
+ }
+
+ int fontSize = nHeight - 10;
CFont* pCurrentFont = pWnd->GetFont();
LOGFONT logFont;
pCurrentFont->GetLogFont(&logFont);
--
Gitblit v1.9.3