Repository navigation
Expand file tree
/
Copy pathCSeedDlg.cpp
More file actions
82 lines (67 loc) · 1.61 KB
/
Copy pathCSeedDlg.cpp
File metadata and controls
82 lines (67 loc) · 1.61 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// CSeedDlg.cpp : implementation file
//
#include "pch.h"
#include "NetDesigner.h"
#include "CSeedDlg.h"
#include "afxdialogex.h"
// CSeedDlg dialog
IMPLEMENT_DYNAMIC(CSeedDlg, CDialog)
CSeedDlg::CSeedDlg(CWnd* pParent /*=nullptr*/)
: CDialog(IDD_RANDOM_SEED, pParent)
{
m_seed = _T("");
}
CSeedDlg::~CSeedDlg()
{
}
void CSeedDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Text(pDX, IDC_EDIT1, m_seed);
}
BEGIN_MESSAGE_MAP(CSeedDlg, CDialog)
ON_WM_CTLCOLOR()
END_MESSAGE_MAP()
// CSeedDlg message handlers
BOOL CSeedDlg::OnInitDialog()
{
CDialog::OnInitDialog();
mbrush.CreateSolidBrush(GetGlobalData()->clrBarFace);
mbrush2.CreateSolidBrush(GetGlobalData()->clrActiveCaption);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
HBRUSH CSeedDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = mbrush;
switch (nCtlColor)
{
case CTLCOLOR_STATIC:
pDC->SetTextColor(GetGlobalData()->clrGrayedText);
pDC->SetBkMode(TRANSPARENT);
break;
case CTLCOLOR_BTN:
pDC->SetTextColor(RGB(255, 0, 0));
break;
case CTLCOLOR_DLG:
pDC->SetTextColor(RGB(255, 255, 0));
break;
case CTLCOLOR_EDIT:
hbr = mbrush2;
pDC->SetTextColor(GetGlobalData()->clrGrayedText);
pDC->SetBkMode(TRANSPARENT);
break;
case CTLCOLOR_LISTBOX:
pDC->SetTextColor(RGB(0, 255, 0));
break;
case CTLCOLOR_MSGBOX:
pDC->SetTextColor(RGB(255, 0, 255));
break;
case CTLCOLOR_SCROLLBAR:
pDC->SetTextColor(RGB(0, 0, 255));
break;
default:
pDC->SetTextColor(GetGlobalData()->clrGrayedText);
}
return hbr;
}