// CRemoteEqUnitView.cpp: 实现文件 // #include "stdafx.h" #include "BondEq.h" #include "afxdialogex.h" #include "CRemoteEqUnitView.h" #include "Log.h" #include "ToolUnits.h" #include "Common.h" // CRemoteEqUnitView 对话框 IMPLEMENT_DYNAMIC(CRemoteEqUnitView, CBaseView) CRemoteEqUnitView::CRemoteEqUnitView(CWnd* pParent /*=nullptr*/) : CBaseView(IDD_COMPONENT_REMOTE_EQ_UNIT, pParent) { m_pObserver = nullptr; m_crBkgnd = REMOTE_EQ_VIEW_BACKGROUND; m_hbrBkgnd = nullptr; } CRemoteEqUnitView::~CRemoteEqUnitView() { } void CRemoteEqUnitView::DoDataExchange(CDataExchange* pDX) { CBaseView::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(CRemoteEqUnitView, CBaseView) END_MESSAGE_MAP() // CRemoteEqUnitView 消息处理程序 HBRUSH CRemoteEqUnitView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { HBRUSH hbr = CDialogEx::OnCtlColor(pDC, pWnd, nCtlColor); if (nCtlColor == CTLCOLOR_STATIC) { pDC->SetBkColor(m_crBkgnd); } if (m_hbrBkgnd == nullptr) { m_hbrBkgnd = CreateSolidBrush(m_crBkgnd); } return m_hbrBkgnd; } void CRemoteEqUnitView::OnDestroy() { CBaseView::OnDestroy(); if (m_hbrBkgnd != nullptr) { ::DeleteObject(m_hbrBkgnd); } ASSERT(m_pObserver != NULL); m_pObserver->unsubscribe(); m_pObserver = NULL; }