From 8de338246a5c70210077ce1162e926cef5f39c70 Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期二, 25 三月 2025 17:09:16 +0800
Subject: [PATCH] Merge branch 'clh' into liuyang

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

diff --git a/SourceCode/Bond/Servo/EqsGraphWnd.cpp b/SourceCode/Bond/Servo/EqsGraphWnd.cpp
index 8b8d441..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;
@@ -1558,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