From 8e14271d976826c5ef727a1c86acc2da4ecad14a Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期二, 11 三月 2025 09:53:41 +0800
Subject: [PATCH] 1.修复窗口最大化时,屏幕残留黑块的问题; 2.左侧master面板,未加载时显示"Loading..."

---
 SourceCode/Bond/Servo/resource.h       |    0 
 SourceCode/Bond/Servo/ServoGraph.cpp   |   11 +++++++++++
 SourceCode/Bond/Servo/Servo.rc         |    0 
 SourceCode/Bond/Servo/CPanelMaster.cpp |    8 +++++++-
 SourceCode/Bond/Servo/ServoGraph.h     |    1 +
 SourceCode/Bond/Servo/ServoDlg.cpp     |    3 ++-
 6 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/SourceCode/Bond/Servo/CPanelMaster.cpp b/SourceCode/Bond/Servo/CPanelMaster.cpp
index 014819d..d30a62a 100644
--- a/SourceCode/Bond/Servo/CPanelMaster.cpp
+++ b/SourceCode/Bond/Servo/CPanelMaster.cpp
@@ -108,11 +108,15 @@
 	if (GetDlgItem(IDC_LINE1) == nullptr) return;
 
 	CWnd* pItem;
-	CRect rcClient;
+	CRect rcClient, rcItem;
 
 	GetClientRect(&rcClient);
 	pItem = GetDlgItem(IDC_LINE1);
 	pItem->MoveWindow(rcClient.right - 3, 0, 3, rcClient.Height());
+
+	pItem = GetDlgItem(IDC_LABEL_LOADING);
+	pItem->GetWindowRect(&rcItem);
+	pItem->MoveWindow(12, (rcClient.Height() - rcItem.Height()) / 2, rcClient.Width() - 24, rcItem.Height());
 
 	m_treeCtrl.MoveWindow(5, 5, rcClient.Width() - 13, rcClient.Height() - 10);
 }
@@ -143,6 +147,8 @@
 {
 	if (1 == nIDEvent) {
 		KillTimer(1);
+		GetDlgItem(IDC_LABEL_LOADING)->ShowWindow(SW_HIDE);
+		m_treeCtrl.ShowWindow(SW_SHOW);
 		loadEquipmentList();
 	}
 
diff --git a/SourceCode/Bond/Servo/Servo.rc b/SourceCode/Bond/Servo/Servo.rc
index d486869..974cd51 100644
--- a/SourceCode/Bond/Servo/Servo.rc
+++ b/SourceCode/Bond/Servo/Servo.rc
Binary files differ
diff --git a/SourceCode/Bond/Servo/ServoDlg.cpp b/SourceCode/Bond/Servo/ServoDlg.cpp
index b46a746..b29713e 100644
--- a/SourceCode/Bond/Servo/ServoDlg.cpp
+++ b/SourceCode/Bond/Servo/ServoDlg.cpp
@@ -692,7 +692,7 @@
 	}
 	ASSERT(m_pLogDlg);
 	m_pLogDlg->ShowWindow(m_bShowLogWnd ? SW_SHOW : SW_HIDE);
-
+	
 	UpdateLogBtn();
 }
 
@@ -855,6 +855,7 @@
 	CDialogEx::OnSize(nType, cx, cy);
 	if (GetDlgItem(IDC_SERVO_GRAPH1) == nullptr) return;
 	Resize();
+	Invalidate();
 }
 
 void CServoDlg::Resize()
diff --git a/SourceCode/Bond/Servo/ServoGraph.cpp b/SourceCode/Bond/Servo/ServoGraph.cpp
index 63bfab7..8e037e1 100644
--- a/SourceCode/Bond/Servo/ServoGraph.cpp
+++ b/SourceCode/Bond/Servo/ServoGraph.cpp
@@ -125,6 +125,9 @@
 	case WM_LBUTTONDOWN:
 		return pServoGraph->OnLButtonDown(wParam, lParam);
 
+	case WM_SIZE:
+		return pServoGraph->OnSize(wParam, lParam);
+
 	case WM_GETDLGCODE:
 		return DLGC_WANTALLKEYS;
 
@@ -273,6 +276,14 @@
 	return ::DefWindowProc(m_hWnd, WM_LBUTTONDOWN, wParam, lParam);
 }
 
+/*
+ *  WM_SIZE
+ */
+LRESULT CServoGraph::OnSize(WPARAM wParam, LPARAM lParam)
+{
+	return ::DefWindowProc(m_hWnd, WM_SIZE, wParam, lParam);
+}
+
 ///////////////////////////////
 // WM_PAINT
 LRESULT CServoGraph::OnPaint(WPARAM wParam, LPARAM lParam)
diff --git a/SourceCode/Bond/Servo/ServoGraph.h b/SourceCode/Bond/Servo/ServoGraph.h
index 3dc0518..0440181 100644
--- a/SourceCode/Bond/Servo/ServoGraph.h
+++ b/SourceCode/Bond/Servo/ServoGraph.h
@@ -144,6 +144,7 @@
 	LRESULT OnTimer(WPARAM wParam, LPARAM lParam);
 	LRESULT OnPaint(WPARAM wParam, LPARAM lParam);
 	LRESULT OnMouseMove(WPARAM wParam, LPARAM lParam);
+	LRESULT OnSize(WPARAM wParam, LPARAM lParam);
 	LRESULT OnLButtonDown(WPARAM wParam, LPARAM lParam);
 
 public:
diff --git a/SourceCode/Bond/Servo/resource.h b/SourceCode/Bond/Servo/resource.h
index 722f11b..7f2b3fb 100644
--- a/SourceCode/Bond/Servo/resource.h
+++ b/SourceCode/Bond/Servo/resource.h
Binary files differ

--
Gitblit v1.9.3