From 2d69213b1b41b5b039e5dc6f6b7c55d53fd03037 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期二, 13 五月 2025 09:34:04 +0800
Subject: [PATCH] Merge branch 'clh'

---
 SourceCode/Bond/Servo/EqsGraphWnd.cpp |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/SourceCode/Bond/Servo/EqsGraphWnd.cpp b/SourceCode/Bond/Servo/EqsGraphWnd.cpp
index 466ca8e..9aa534d 100644
--- a/SourceCode/Bond/Servo/EqsGraphWnd.cpp
+++ b/SourceCode/Bond/Servo/EqsGraphWnd.cpp
@@ -1911,10 +1911,12 @@
 	HBRUSH hbrItemBackground[2];
 	HBRUSH hbrItemFrame[2];
 	HBRUSH hbrPinBackground[3];
+	HBRUSH hbrIndicator;
 	hbrItemBackground[0] = CreateSolidBrush(m_crItemBackground[0]);
 	hbrItemBackground[1] = CreateSolidBrush(m_crItemBackground[1]);
 	hbrItemFrame[0] = CreateSolidBrush(m_crItemFrame[0]);
 	hbrItemFrame[1] = CreateSolidBrush(m_crItemFrame[1]);
+	hbrIndicator = CreateSolidBrush(RGB(34, 177, 76));
 	for (int i = 0; i < 3; i++) {
 		hbrPinBackground[i] = CreateSolidBrush(m_crPinBkgnd[i]);
 	}
@@ -1960,6 +1962,21 @@
 			HFONT hFontOld = (HFONT)::SelectObject(hMemDC, m_hFontName);
 			::SetTextColor(hMemDC, pItem->bHighlight ? m_crItemNameText[1] : m_crItemNameText[0]);
 			::DrawText(hMemDC, pItem->text, (int)strlen(pItem->text), &rcItem, DT_CENTER | DT_VCENTER | DT_SINGLELINE | DT_END_ELLIPSIS);
+
+			
+			// 添加一个小绿点指示器
+			if(pItem->bShowIndicator[0]){
+				RECT rcIndicator;
+				rcIndicator.left = rcItem.left + 5;
+				rcIndicator.top = rcItem.top + 5;
+				rcIndicator.right = rcIndicator.left + 12;
+				rcIndicator.bottom = rcIndicator.top + 12;
+				HRGN hRgn = CreateRoundRectRgn(rcIndicator.left, rcIndicator.top, rcIndicator.right, rcIndicator.bottom, 2, 2);
+				::FillRgn(hMemDC, hRgn, hbrIndicator);
+				::FrameRgn(hMemDC, hRgn, hbrItemFrame[0], 1, 1);
+				::DeleteObject(hRgn);
+			}
+
 
 			if (pItem->nShowType != ITEM_SMALL) {
 				RECT rcId = rcItem;
@@ -2074,6 +2091,7 @@
 		::DeleteObject(hbrItemBackground[1]);
 		::DeleteObject(hbrItemFrame[0]);
 		::DeleteObject(hbrItemFrame[1]);
+		::DeleteObject(hbrIndicator);		
 	}
 
 
@@ -2390,6 +2408,15 @@
 	SetTimer(m_hWnd, TIMER_ANIMATION_RECT, uElpase, NULL);
 }
 
+void CEqsGraphWnd::ShowItemIndicator(DWORD_PTR dwItemData, BOOL bShow)
+{
+	EQITEM* pItem = GetItem(dwItemData);
+	if (pItem != nullptr) {
+		pItem->bShowIndicator[0] = bShow;
+		::InvalidateRect(m_hWnd, nullptr, TRUE);
+	}
+}
+
 double CEqsGraphWnd::PointToSegDist(double x, double y, double x1, double y1, double x2, double y2)
 {
 	double cross = (x2 - x1) * (x - x1) + (y2 - y1) * (y - y1);

--
Gitblit v1.9.3