LAPTOP-T815PCOQ\25526
2024-12-11 43419b86d6a4a2d879454938fb7db7cc84d8c011
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// 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;
}