chenluhua1980
2 天以前 351086486441b80cfe71550b43cbe1e4dc440f5d
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