From 4d9d8d22e3666076988c30afb4e7c6fe365c19aa Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期二, 06 一月 2026 18:53:04 +0800
Subject: [PATCH] 1.修复一个回复错误的问题;
---
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