From 829fe6c6bc33d53fda9c31fd45a37e1df87befff Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期五, 30 一月 2026 11:16:24 +0800
Subject: [PATCH] Merge branch 'clh' into liuyang
---
SourceCode/Bond/Servo/TopToolbar.cpp | 28 +++++++++++++++-------------
1 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/SourceCode/Bond/Servo/TopToolbar.cpp b/SourceCode/Bond/Servo/TopToolbar.cpp
index 47d5ee4..f2f37dd 100644
--- a/SourceCode/Bond/Servo/TopToolbar.cpp
+++ b/SourceCode/Bond/Servo/TopToolbar.cpp
@@ -8,9 +8,6 @@
#include "Common.h"
-#define SHOW_BATCH 1
-#define SHOW_CT 1
-
// CTopToolbar 对话框
IMPLEMENT_DYNAMIC(CTopToolbar, CDialogEx)
@@ -73,6 +70,11 @@
m_btnOperator.SetMenu(hMenu);
+ CString strIniFile;
+ strIniFile.Format(_T("%s\\configuration.ini"), (LPTSTR)(LPCTSTR)theApp.m_strAppDir);
+ bool bEnableRunCT = GetPrivateProfileInt("APP", _T("EnableRunCT"), 0, strIniFile) != 0;
+ m_btnRunCt.ShowWindow(bEnableRunCT ? SW_SHOW : SW_HIDE);
+
return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}
@@ -127,19 +129,19 @@
x += BTN_WIDTH;
x += 2;
-#ifdef SHOW_BATCH
pItem = GetDlgItem(IDC_BUTTON_RUN_BATCH);
- pItem->MoveWindow(x, y, BTN_WIDTH, nBthHeight);
- x += BTN_WIDTH;
- x += 2;
-#endif
+ if (::IsWindowVisible(pItem->GetSafeHwnd())) {
+ pItem->MoveWindow(x, y, BTN_WIDTH, nBthHeight);
+ x += BTN_WIDTH;
+ x += 2;
+ }
-#ifdef SHOW_CT
pItem = GetDlgItem(IDC_BUTTON_RUN_CT);
- pItem->MoveWindow(x, y, BTN_WIDTH, nBthHeight);
- x += BTN_WIDTH;
- x += 2;
-#endif
+ if (::IsWindowVisible(pItem->GetSafeHwnd())) {
+ pItem->MoveWindow(x, y, BTN_WIDTH, nBthHeight);
+ x += BTN_WIDTH;
+ x += 2;
+ }
pItem = GetDlgItem(IDC_BUTTON_STOP);
pItem->MoveWindow(x, y, BTN_WIDTH, nBthHeight);
--
Gitblit v1.9.3