From 60fce85863e07388db589bd26da73c3bbc1c7299 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期一, 24 三月 2025 10:16:25 +0800
Subject: [PATCH] 1.选中连接图中的节点,更新显示属性,为方便快速调试;

---
 SourceCode/Bond/Servo/EqsGraphWnd.cpp |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/SourceCode/Bond/Servo/EqsGraphWnd.cpp b/SourceCode/Bond/Servo/EqsGraphWnd.cpp
index 9c0af84..50d569d 100644
--- a/SourceCode/Bond/Servo/EqsGraphWnd.cpp
+++ b/SourceCode/Bond/Servo/EqsGraphWnd.cpp
@@ -42,6 +42,7 @@
 	m_listener.onEqItemPosChanged = nullptr;
 	m_listener.onDblckEqItem = nullptr;
 	m_listener.onRclickEqItem = nullptr;
+	m_listener.onSelectEqItem = nullptr;
 	m_crItemBackground[0] = RGB(218, 218, 218);
 	m_crItemBackground[1] = RGB(193, 208, 227);
 	m_crItemFrame[0] = RGB(128, 128, 128);
@@ -492,6 +493,7 @@
 	m_listener.onEqItemPosChanged = listener.onEqItemPosChanged;
 	m_listener.onDblckEqItem = listener.onDblckEqItem;
 	m_listener.onRclickEqItem = listener.onRclickEqItem;
+	m_listener.onSelectEqItem = listener.onSelectEqItem;
 }
 
 BOOL CEqsGraphWnd::SetCurSel(int nSel)
@@ -1286,6 +1288,7 @@
 	PIN *pLastPin = m_pCurPin;
 	PIN *pLastSelLineOutPin = m_pSelLineOutPin;
 	BOOL bChanged = FALSE;
+	BOOL bSelectChanged = FALSE;
 	EQITEM* pHitItem = NULL;
 	PIN *pHitPin = NULL;
 	PIN *pPin2 = NULL;
@@ -1309,8 +1312,11 @@
 	}
 
 	if (nRet == HT_ITEM) {
-		m_pCurItem = pHitItem;
-		m_pCurItem->bHighlight = TRUE;
+		if (m_pCurItem != pHitItem) {
+			m_pCurItem = pHitItem;
+			m_pCurItem->bHighlight = TRUE;
+			bSelectChanged = TRUE;
+		}
 	}
 	else if (nRet == HT_PIN) {
 		m_pCurPin = pHitPin;
@@ -1394,6 +1400,8 @@
 
 			ReleaseCapture();
 		ExitLoop:
+			m_nMagneticLinHoz = 0;
+			m_nMagneticLinVer = 0;
 			AfxUnlockTempMaps(FALSE);
 		}
 	}
@@ -1556,6 +1564,13 @@
 	}
 
 
+	if (bSelectChanged) {
+		if (m_listener.onSelectEqItem != nullptr) {
+			m_listener.onSelectEqItem(m_pCurItem);
+		}
+	}
+
+
 	return ::DefWindowProc(m_hWnd, WM_LBUTTONDOWN, wParam, lParam);
 }
 

--
Gitblit v1.9.3