-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathGeneralPropPage.cpp
204 lines (186 loc) · 7.38 KB
/
GeneralPropPage.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
/////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2005-2011 Association Homecinema Francophone. All rights reserved.
/////////////////////////////////////////////////////////////////////////////
//
// This file is subject to the terms of the GNU General Public License as
// published by the Free Software Foundation. A copy of this license is
// included with this software distribution in the file COPYING.htm. If you
// do not have a copy, you may obtain a copy by writing to the Free
// Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
//
// This software is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details
/////////////////////////////////////////////////////////////////////////////
// Author(s):
// François-Xavier CHABOUD
// Georges GALLERAND
/////////////////////////////////////////////////////////////////////////////
// GeneralPropPage.cpp : implementation file
//
#include "stdafx.h"
#include "ColorHCFR.h"
#include "GeneralPropPage.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CGeneralPropPage property page
IMPLEMENT_DYNCREATE(CGeneralPropPage, CPropertyPageWithHelp)
CGeneralPropPage::CGeneralPropPage() : CPropertyPageWithHelp(CGeneralPropPage::IDD)
{
//{{AFX_DATA_INIT(CGeneralPropPage)
m_doMultipleInstance = FALSE;
m_doUpdateCheck = FALSE;
m_bDisplayTestColors = TRUE;
m_latencyTime = 0;
m_ablFreq = 10;
m_ablDuration = 500;
m_ablLevel = 50;
m_doSavePosition = FALSE;
m_bContinuousMeasures = TRUE;
m_bLatencyBeep = FALSE;
bDisplayRT = TRUE;
m_bABL = FALSE;
m_BWColorsToAdd = -1;
m_bDetectPrimaries = TRUE;
m_useHSV = FALSE;
m_isSettling = FALSE;
m_bUseRoundDown = FALSE;
m_bUse10bit = FALSE;
m_bDisableHighDPI = FALSE;
//}}AFX_DATA_INIT
m_isModified = FALSE;
}
CGeneralPropPage::~CGeneralPropPage()
{
}
void CGeneralPropPage::DoDataExchange(CDataExchange* pDX)
{
CPropertyPageWithHelp::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CGeneralPropPage)
DDX_Check(pDX, IDC_CHECK_MULTIPLEINSTANCE, m_doMultipleInstance);
DDX_Check(pDX, IDC_CHECK_UPDATE, m_doUpdateCheck);
DDX_Check(pDX, IDC_CHECK_COLORS, m_bDisplayTestColors);
DDX_Text(pDX, IDC_EDIT_IRIS_TIME, m_latencyTime);
DDX_Text(pDX, IDC_EDIT_IRIS_TIME2, m_ablFreq);
DDX_Text(pDX, IDC_EDIT_IRIS_TIME3, m_ablDuration);
DDX_Text(pDX, IDC_EDIT_IRIS_TIME4, m_ablLevel);
DDV_MinMaxInt(pDX, m_latencyTime, -30000, 30000);
DDV_MinMaxInt(pDX, m_ablFreq, 1, 100);
DDV_MinMaxInt(pDX, m_ablDuration, 100, 10000);
DDV_MinMaxInt(pDX, m_ablLevel, 0, 100);
DDX_Check(pDX, IDC_CHECK_SAVEPOSITION, m_doSavePosition);
DDX_Check(pDX, IDC_CHECK_CONTINUOUS, m_bContinuousMeasures);
DDX_Check(pDX, IDC_CHECK_BEEP, m_bLatencyBeep);
DDX_Check(pDX, IDC_CHECK_DISPLAYRT, bDisplayRT);
DDX_Check(pDX, IDC_CHECK_DISABLEDPI, m_bDisableHighDPI);
DDX_Check(pDX, IDC_CHECK_ABL, m_bABL);
DDX_Radio(pDX, IDC_RADIO1, m_BWColorsToAdd);
DDX_Check(pDX, IDC_CHECK_DETECT_PRIMARIES, m_bDetectPrimaries);
DDX_Check(pDX, IDC_IS_SETTLING, m_isSettling);
DDX_Check(pDX, IDC_CHECK_USE_HSV, m_useHSV);
DDX_Control(pDX, IDC_CHECK_USE_ROUNDDOWN, m_bUseRoundDownCtrl);
DDX_Control(pDX, IDC_CHECK_USE_10bit, m_bUse10bitCtrl);
DDX_Check(pDX, IDC_CHECK_USE_10bit, m_bUse10bit);
DDX_Check(pDX, IDC_CHECK_USE_ROUNDDOWN, m_bUseRoundDown);
bool DVD = (GetConfig()->GetGeneratorType() == CColorHCFRConfig::enumManual);
if (DVD)
{
if (GetConfig()->m_GammaOffsetType == 5)
{
m_bUse10bitCtrl.EnableWindow(TRUE);
m_bUseRoundDownCtrl.EnableWindow(FALSE);
m_bUseRoundDown = FALSE;
}
else
{
m_bUseRoundDownCtrl.EnableWindow(TRUE);
m_bUse10bitCtrl.EnableWindow(FALSE);
m_bUse10bit = FALSE;
}
}
else
{
m_bUse10bitCtrl.EnableWindow(FALSE);
m_bUseRoundDownCtrl.EnableWindow(FALSE);
m_bUse10bit = FALSE;
m_bUseRoundDown = FALSE;
}
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CGeneralPropPage, CPropertyPageWithHelp)
ON_CONTROL_RANGE(BN_CLICKED, IDC_CHECK_MULTIPLEINSTANCE, IDC_CHECK_MULTIPLEINSTANCE, OnControlClicked)
ON_CONTROL_RANGE(BN_CLICKED, IDC_CHECK_MULTIPLEINSTANCE, IDC_CHECK_UPDATE, OnControlClicked)
ON_CONTROL_RANGE(BN_CLICKED, IDC_CHECK_SAVEPOSITION, IDC_CHECK_SAVEPOSITION, OnControlClicked)
ON_CONTROL_RANGE(BN_CLICKED, IDC_CHECK_COLORS, IDC_CHECK_COLORS, OnControlClicked)
ON_CONTROL_RANGE(BN_CLICKED, IDC_CHECK_CONTINUOUS, IDC_CHECK_CONTINUOUS, OnControlClicked)
ON_CONTROL_RANGE(EN_CHANGE, IDC_EDIT_IRIS_TIME, IDC_EDIT_IRIS_TIME, OnControlClicked)
ON_CONTROL_RANGE(EN_CHANGE, IDC_EDIT_IRIS_TIME2, IDC_EDIT_IRIS_TIME2, OnControlClicked)
ON_CONTROL_RANGE(BN_CLICKED, IDC_RADIO1, IDC_RADIO3, OnControlClicked)
ON_CONTROL_RANGE(BN_CLICKED, IDC_CHECK_BEEP, IDC_CHECK_BEEP, OnControlClicked)
ON_CONTROL_RANGE(BN_CLICKED, IDC_CHECK_DISPLAYRT, IDC_CHECK_DISPLAYRT, OnControlClicked)
ON_CONTROL_RANGE(BN_CLICKED, IDC_CHECK_DISABLEDPI, IDC_CHECK_DISABLEDPI, OnControlClicked)
ON_CONTROL_RANGE(BN_CLICKED, IDC_CHECK_ABL, IDC_CHECK_ABL, OnControlClicked)
ON_CONTROL_RANGE(BN_CLICKED, IDC_CHECK_DETECT_PRIMARIES, IDC_CHECK_DETECT_PRIMARIES, OnControlClicked)
ON_CONTROL_RANGE(BN_CLICKED, IDC_CHECK_USE_HSV, IDC_CHECK_USE_HSV, OnControlClicked)
ON_CONTROL_RANGE(BN_CLICKED, IDC_IS_SETTLING, IDC_IS_SETTLING, OnControlClicked)
ON_CONTROL_RANGE(BN_CLICKED, IDC_CHECK_USE_ROUNDDOWN, IDC_CHECK_USE_ROUNDDOWN, OnControlClicked)
ON_CONTROL_RANGE(BN_CLICKED, IDC_CHECK_USE_10bit, IDC_CHECK_USE_10bit, OnControlClicked)
//{{AFX_MSG_MAP(CGeneralPropPage)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CGeneralPropPage message handlers
void CGeneralPropPage::OnControlClicked(UINT nID)
{
// m_isModified becomes true only when Continuous Reading flag changes. This flag
// allow parent dialog to send a WM_SYSCOLORCHANGE message to all DataSetView to change
// measurement button look (camera or start icon).
bool DVD = (GetConfig()->GetGeneratorType() == CColorHCFRConfig::enumManual);
if (DVD)
{
if (GetConfig()->m_GammaOffsetType == 5)
{
m_bUse10bitCtrl.EnableWindow(TRUE);
m_bUseRoundDownCtrl.EnableWindow(FALSE);
m_bUseRoundDown = FALSE;
}
else
{
m_bUseRoundDownCtrl.EnableWindow(TRUE);
m_bUse10bitCtrl.EnableWindow(FALSE);
m_bUse10bit = FALSE;
}
}
else
{
m_bUse10bitCtrl.EnableWindow(FALSE);
m_bUseRoundDownCtrl.EnableWindow(FALSE);
m_bUse10bit = FALSE;
m_bUseRoundDown = FALSE;
}
if ( nID == IDC_CHECK_CONTINUOUS || IDC_CHECK_USE_ROUNDDOWN || IDC_CHECK_USE_10bit )
{
m_isModified=TRUE;
SetModified(TRUE);
}
}
BOOL CGeneralPropPage::OnApply()
{
if (m_bDisableHighDPI)
GetConfig()->isHighDPI = FALSE;
else
GetConfig()->isHighDPI = ((GetSystemMetrics(SM_CXSCREEN) > 1920)&&(GetSystemMetrics(SM_CYSCREEN) > 1080));
GetConfig()->ApplySettings(FALSE);
m_isModified=FALSE;
return CPropertyPageWithHelp::OnApply();
}
UINT CGeneralPropPage::GetHelpId ( LPSTR lpszTopic )
{
return HID_PREF_GENERAL;
}