-
Notifications
You must be signed in to change notification settings - Fork 2
/
ChoosePriConDialog.cpp
83 lines (66 loc) · 1.92 KB
/
ChoosePriConDialog.cpp
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
83
// ChoosePriConDialog.cpp : implementation file
//
#include "stdafx.h"
#include "SCIPicEditor.h"
#include "ChoosePriConDialog.h"
// CChoosePriConDialog dialog
CChoosePriConDialog::CChoosePriConDialog(CWnd* pParent /*=NULL*/)
: CBaseColorDialog(CChoosePriConDialog::IDD, pParent)
{
// 16 things here.
m_wndStatic.SetRowsAndColumns(2, 8);
m_wndStatic.ShowSelection(TRUE);
m_wndStatic.ShowIndices(TRUE);
m_wndStatic.SetPalette(g_egaColorChooserPalette);// just provide a basic palette
_rgStatusText = NULL;
}
CChoosePriConDialog::~CChoosePriConDialog()
{
}
void CChoosePriConDialog::DoDataExchange(CDataExchange* pDX)
{
CBaseColorDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_CHOOSECOLORSTATIC, m_wndStatic);
m_wndStatic.SetCallback(this);
DDX_Control(pDX, IDC_DIALOGDESCRIPTION, m_wndStaticCaption);
DDX_Control(pDX, IDC_STATICSTATUS, m_wndStaticStatus);
if (_rgStatusText == NULL)
{
m_wndStaticStatus.ShowWindow(SW_HIDE);
}
GetDlgItem(IDC_CHECK_OPTION)->ShowWindow(SW_HIDE);
// Set the caption.
TCHAR szBuf[MAX_PATH];
LoadString(AfxGetResourceHandle(), _nID, szBuf, ARRAYSIZE(szBuf));
m_wndStaticCaption.SetWindowText(szBuf);
// Visuals
DDX_Control(pDX, IDCANCEL, m_wndCancel);
}
BEGIN_MESSAGE_MAP(CChoosePriConDialog, CBaseColorDialog)
END_MESSAGE_MAP()
// CChoosePriConDialog message handlers
void CChoosePriConDialog::OnColorClick(BYTE bIndex, int nID, BOOL fLeftClick)
{
if (fLeftClick)
{
// We only have one child - it must have been it.
SetColor(bIndex);
_fEnded = TRUE;
UpdateData(TRUE);
EndDialog(IDOK);
}
}
void CChoosePriConDialog::OnColorHover(BYTE bIndex)
{
if (_rgStatusText)
{
if (bIndex < 16)
{
m_wndStaticStatus.SetWindowText(_rgStatusText[bIndex]);
}
else
{
m_wndStaticStatus.SetWindowText("");
}
}
}