| | |
| | | for (int i = 0; i < BTN_MAX; i++) { |
| | | m_pBlBtns[i] = new CBlButton(); |
| | | } |
| | | m_crPlcNameBack = RGB(228, 228, 228); |
| | | |
| | | } |
| | | |
| | | CPlcView::~CPlcView() |
| | | { |
| | | for (int i = 0; i < BTN_MAX; i++) { |
| | | delete m_pBlBtns[i]; |
| | | } |
| | | if (m_hbrPlcName != nullptr) { |
| | | ::DeleteObject(m_hbrPlcName); |
| | | m_hbrPlcName = nullptr; |
| | | } |
| | | } |
| | | |
| | |
| | | HBRUSH CPlcView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) |
| | | { |
| | | HBRUSH hbr = CBaseView::OnCtlColor(pDC, pWnd, nCtlColor); |
| | | int nCtrlId = pWnd->GetDlgCtrlID(); |
| | | |
| | | if (nCtlColor == CTLCOLOR_STATIC) { |
| | | pDC->SetBkColor(m_crBkgnd); |
| | | } |
| | | |
| | | if (IDC_LABEL_PLC_NAME == nCtrlId) { |
| | | pDC->SetBkColor(m_crPlcNameBack); |
| | | m_hbrPlcName = CreateSolidBrush(m_crPlcNameBack); |
| | | return m_hbrPlcName; |
| | | } |
| | | |
| | | if (m_hbrBkgnd == nullptr) { |
| | | m_hbrBkgnd = CreateSolidBrush(m_crBkgnd); |
| | | } |