| | |
| | | m_pHighItem = nullptr; |
| | | m_hWndTooltip = nullptr; |
| | | m_slotBarSize = 0; |
| | | m_slotBarSize8 = 0; |
| | | m_slotBarSizeOther = 0; |
| | | } |
| | | |
| | | CServoGraph::~CServoGraph() |
| | |
| | | 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); |
| | |
| | | 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 |