From e15e0d2f9305e71cd160f1ddceab93c7889eab20 Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期四, 05 六月 2025 17:37:33 +0800
Subject: [PATCH] 1. 解决自定义按钮资源泄露问题 2. 增加Slot点击回调和鼠标悬停/点击高亮效果
---
SourceCode/Bond/Servo/CGlass.cpp | 37 ++++++++++++++++++++++++++++++++++++-
1 files changed, 36 insertions(+), 1 deletions(-)
diff --git a/SourceCode/Bond/Servo/CGlass.cpp b/SourceCode/Bond/Servo/CGlass.cpp
index e2b6259..029f39f 100644
--- a/SourceCode/Bond/Servo/CGlass.cpp
+++ b/SourceCode/Bond/Servo/CGlass.cpp
@@ -12,6 +12,11 @@
CGlass::~CGlass()
{
+
+ }
+
+ void CGlass::reset()
+ {
CPath* pPath = m_pPath;
while (pPath != nullptr) {
CPath* pTemp = pPath->getNext();
@@ -20,7 +25,7 @@
}
m_pPath = nullptr;
- if (m_pBuddy != nullptr && m_type == MaterialsType::G1) {
+ if (m_pBuddy != nullptr) {
m_pBuddy->release();
}
}
@@ -77,6 +82,20 @@
CPath* CGlass::getPath()
{
return m_pPath;
+ }
+
+ CPath* CGlass::getPathWithSiteId(unsigned int nSiteId)
+ {
+ CPath* pTemp = m_pPath;
+ while (pTemp != nullptr) {
+ if (pTemp->getSiteID() == nSiteId) {
+ return pTemp;
+ }
+
+ pTemp = pTemp->getNext();
+ }
+
+ return nullptr;
}
void CGlass::addPath(unsigned int nSiteId)
@@ -177,4 +196,20 @@
{
return m_strBuddyId;
}
+
+ void CGlass::processEnd(unsigned int nSiteId)
+ {
+ CPath* pPath = getPathWithSiteID(nSiteId);
+ if (pPath != nullptr) {
+ pPath->processEnd();
+ }
+ }
+
+ BOOL CGlass::isProcessed(unsigned int nSiteId)
+ {
+ CPath* pPath = getPathWithSiteID(nSiteId);
+ if (pPath == nullptr) return FALSE;
+
+ return pPath->isProcessEnd();
+ }
}
--
Gitblit v1.9.3