From 656228d05e6fa5200ae41621d2250de210d95600 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期二, 03 二月 2026 15:34:43 +0800
Subject: [PATCH] 1.Slot小方块大小用两种配置,LoadPort和其它的分开
---
SourceCode/Bond/Servo/ServoGraph.cpp | 24 +++++++++++++++++++++++-
1 files changed, 23 insertions(+), 1 deletions(-)
diff --git a/SourceCode/Bond/Servo/ServoGraph.cpp b/SourceCode/Bond/Servo/ServoGraph.cpp
index b14ed32..735f2c4 100644
--- a/SourceCode/Bond/Servo/ServoGraph.cpp
+++ b/SourceCode/Bond/Servo/ServoGraph.cpp
@@ -22,6 +22,8 @@
m_pHighItem = nullptr;
m_hWndTooltip = nullptr;
m_slotBarSize = 0;
+ m_slotBarSize8 = 0;
+ m_slotBarSizeOther = 0;
}
CServoGraph::~CServoGraph()
@@ -370,7 +372,18 @@
int slotSize = 4;
if (slotCount > 0) {
const int maxSize = (item.box1Width - gap * (slotCount - 1)) / slotCount;
- slotSize = (m_slotBarSize > 0) ? m_slotBarSize : maxSize;
+ if (slotCount == 8 && m_slotBarSize8 > 0) {
+ slotSize = m_slotBarSize8;
+ }
+ else if (slotCount != 8 && m_slotBarSizeOther > 0) {
+ slotSize = m_slotBarSizeOther;
+ }
+ else if (m_slotBarSize > 0) {
+ slotSize = m_slotBarSize;
+ }
+ else {
+ slotSize = maxSize;
+ }
if (slotSize < 2) slotSize = 2;
}
const int barWidth = slotCount * slotSize + gap * (slotCount - 1);
@@ -721,6 +734,15 @@
InvalidateRect(m_hWnd, nullptr, TRUE);
}
+void CServoGraph::SetSlotBarSizeByCount(int size8, int sizeOther)
+{
+ if (size8 < 0) size8 = 0;
+ if (sizeOther < 0) sizeOther = 0;
+ m_slotBarSize8 = size8;
+ m_slotBarSizeOther = sizeOther;
+ InvalidateRect(m_hWnd, nullptr, TRUE);
+}
+
void CServoGraph::DrawImage(HDC hMemDC, IMAGE& item)
{
// 载入BMP
--
Gitblit v1.9.3