forked from gopa810/gcal-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DPageGeneral.cpp
121 lines (102 loc) · 4.06 KB
/
DPageGeneral.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
// DPageGeneral.cpp : implementation file
//
#include "stdafx.h"
#include "vcal5beta.h"
#include "DPageGeneral.h"
#include "showset.h"
#include "GCStrings.h"
#include "GCDisplaySettings.h"
/////////////////////////////////////////////////////////////////////////////
// DPageGeneral property page
IMPLEMENT_DYNCREATE(DPageGeneral, CPropertyPage)
DPageGeneral::DPageGeneral() : CPropertyPage(DPageGeneral::IDD)
{
//{{AFX_DATA_INIT(DPageGeneral)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
DPageGeneral::~DPageGeneral()
{
}
void DPageGeneral::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(DPageGeneral)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(DPageGeneral, CPropertyPage)
//{{AFX_MSG_MAP(DPageGeneral)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// DPageGeneral message handlers
void DPageGeneral::OnOK()
{
CPropertyPage::OnOK();
}
BOOL DPageGeneral::OnSetActive()
{
int i;
SendDlgItemMessage(IDC_COMBO1, CB_RESETCONTENT);
SendDlgItemMessage(IDC_COMBO1, CB_ADDSTRING, 0, (LPARAM)LPCTSTR("Before New Masa"));
SendDlgItemMessage(IDC_COMBO1, CB_ADDSTRING, 0, (LPARAM)LPCTSTR("Before New Month"));
if (GCDisplaySettings::getValue(18) == 1)
i = 0;
else
i = 1;
SendDlgItemMessage(IDC_COMBO1, CB_SETCURSEL, i);
SendDlgItemMessage(IDC_COMBO2, CB_RESETCONTENT);
for(i=0; i<7; i++)
SendDlgItemMessage(IDC_COMBO2, CB_ADDSTRING, 0, (LPARAM)LPCTSTR(GCStrings::getString(i).c_str()));
SendDlgItemMessage(IDC_COMBO2, CB_SETCURSEL, GCDisplaySettings::getValue(40));
SendDlgItemMessage(IDC_COMBO3, CB_SETCURSEL, GCDisplaySettings::getValue(49));
CheckDlgButton(IDC_CHECK1, GCDisplaySettings::getValue(20));
CheckDlgButton(IDC_CHECK2, GCDisplaySettings::getValue(21));
CheckDlgButton(IDC_CHECK18, GCDisplaySettings::getValue(11));
CheckDlgButton(IDC_CHECK19, GCDisplaySettings::getValue(0));
CheckDlgButton(IDC_CHECK3, GCDisplaySettings::getValue(1));
CheckDlgButton(IDC_CHECK4, GCDisplaySettings::getValue(7));
CheckDlgButton(IDC_CHECK7, GCDisplaySettings::getValue(12));
CheckDlgButton(IDC_CHECK5, GCDisplaySettings::getValue(8));
CheckDlgButton(IDC_CHECK6, GCDisplaySettings::getValue(35));
CheckDlgButton(IDC_CHECK8, GCDisplaySettings::getValue(50));
SendDlgItemMessage(IDC_COMBO4, CB_SETCURSEL, GCDisplaySettings::getValue(51));
return CPropertyPage::OnSetActive();
}
BOOL DPageGeneral::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
LPNMHDR lp = (LPNMHDR)lParam;
if (lp->code == PSN_HELP)
{
MessageBox("This page allows to change the mode of display of the general information in the calendar.", "General Settings of Display", MB_OK);
return TRUE;
}
// TODO: Add your specialized code here and/or call the base class
return CPropertyPage::OnNotify(wParam, lParam, pResult);
}
BOOL DPageGeneral::OnKillActive()
{
int i = 0;
i = SendDlgItemMessage(IDC_COMBO1, CB_GETCURSEL);
GCDisplaySettings::setValue(20, IsDlgButtonChecked(IDC_CHECK1));
GCDisplaySettings::setValue(21, IsDlgButtonChecked(IDC_CHECK2));
if (i >= 0 && i < 2)
{
GCDisplaySettings::setValue(18 + i, 1);
GCDisplaySettings::setValue(19 - i, 0);
}
GCDisplaySettings::setValue(11, IsDlgButtonChecked(IDC_CHECK18));
GCDisplaySettings::setValue(0, IsDlgButtonChecked(IDC_CHECK19));
GCDisplaySettings::setValue(1, IsDlgButtonChecked(IDC_CHECK3));
GCDisplaySettings::setValue(7, IsDlgButtonChecked(IDC_CHECK4));
GCDisplaySettings::setValue(8, IsDlgButtonChecked(IDC_CHECK5));
GCDisplaySettings::setValue(12, IsDlgButtonChecked(IDC_CHECK7));
GCDisplaySettings::setValue(35, IsDlgButtonChecked(IDC_CHECK6));
GCDisplaySettings::setValue(40, SendDlgItemMessage(IDC_COMBO2, CB_GETCURSEL));
GCDisplaySettings::setValue(49, SendDlgItemMessage(IDC_COMBO3, CB_GETCURSEL));
GCDisplaySettings::setValue(50, IsDlgButtonChecked(IDC_CHECK8));
GCDisplaySettings::setValue(51, SendDlgItemMessage(IDC_COMBO4, CB_GETCURSEL));
return CPropertyPage::OnKillActive();
}