forked from gopa810/gcal-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDlgGetEventSpec.cpp
156 lines (129 loc) · 4.79 KB
/
DlgGetEventSpec.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
// DlgGetEventSpec.cpp : implementation file
//
#include "stdafx.h"
#include "vcal5beta.h"
#include "DlgGetEventSpec.h"
#include "GCDisplaySettings.h"
/////////////////////////////////////////////////////////////////////////////
// DlgGetEventSpec dialog
DlgGetEventSpec::DlgGetEventSpec(CWnd* pParent /*=NULL*/)
: CDialog(DlgGetEventSpec::IDD, pParent)
{
//{{AFX_DATA_INIT(DlgGetEventSpec)
m_sun = FALSE;
m_tithi = FALSE;
m_naks = FALSE;
m_sank = FALSE;
m_conj = FALSE;
m_rahu_kalam = FALSE;
m_yama_ghanti = FALSE;
m_guli_kalam = FALSE;
//}}AFX_DATA_INIT
// m_off = _T("");
// m_off = 0.0;
}
void DlgGetEventSpec::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(DlgGetEventSpec)
DDX_Check(pDX, IDC_CHECK1, m_sun);
DDX_Check(pDX, IDC_CHECK2, m_tithi);
DDX_Check(pDX, IDC_CHECK3, m_naks);
DDX_Check(pDX, IDC_CHECK4, m_sank);
DDX_Check(pDX, IDC_CHECK5, m_conj);
//}}AFX_DATA_MAP
DDX_Check(pDX, IDC_CHECK6, m_rahu_kalam);
DDX_Check(pDX, IDC_CHECK7, m_yama_ghanti);
DDX_Check(pDX, IDC_CHECK8, m_guli_kalam);
DDX_Check(pDX, IDC_CHECK9, m_moon_rasi);
DDX_Check(pDX, IDC_CHECK10, m_moon_times);
DDX_Check(pDX, IDC_CHECK11, m_ascendent);
// DDX_Text(pDX, IDC_EDIT1, m_off);
// D// DV_MaxChars(p// DX, m_off, 3);
// DDX_Text(pDX, IDC_EDIT1, m_off);
// DDV_MinMaxDouble(pDX, m_off, -200, 200);
DDX_Check(pDX, IDC_CHECK12, m_muhurtaAbhijit);
// DDX_Control(pDX, IDC_CHECK13, m_yoga);
DDX_Check(pDX, IDC_CHECK13, m_yoga);
}
BEGIN_MESSAGE_MAP(DlgGetEventSpec, CDialog)
//{{AFX_MSG_MAP(DlgGetEventSpec)
ON_BN_CLICKED(IDC_BUTTON_BACK, OnButtonBack)
ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
//}}AFX_MSG_MAP
ON_BN_CLICKED(IDC_CHECK6, &DlgGetEventSpec::OnBnClickedCheck6)
ON_BN_CLICKED(IDC_CHECK12, &DlgGetEventSpec::OnBnClickedCheck12)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// DlgGetEventSpec message handlers
void DlgGetEventSpec::OnButtonBack()
{
m_nNextStep = -1;
CDialog::OnOK();
}
void DlgGetEventSpec::OnCancel()
{
m_nNextStep = 0;
CDialog::OnCancel();
}
void DlgGetEventSpec::OnOK()
{
UpdateData();
m_fOptions = 0;
GCDisplaySettings::setValue(COREEVENTS_SUN, m_sun);
GCDisplaySettings::setValue(COREEVENTS_NAKSATRA, m_naks);
GCDisplaySettings::setValue(COREEVENTS_SANKRANTI, m_sank);
GCDisplaySettings::setValue(COREEVENTS_TITHI, m_tithi);
GCDisplaySettings::setValue(COREEVENTS_CONJUNCTION, m_conj);
GCDisplaySettings::setValue(COREEVENTS_RAHUKALAM, m_rahu_kalam);
GCDisplaySettings::setValue(COREEVENTS_YAMAGHANTI, m_yama_ghanti);
GCDisplaySettings::setValue(COREEVENTS_GULIKALAM, m_guli_kalam);
GCDisplaySettings::setValue(COREEVENTS_MOONRASI, m_moon_rasi);
GCDisplaySettings::setValue(COREEVENTS_MOON, m_moon_times);
GCDisplaySettings::setValue(COREEVENTS_ASCENDENT, m_ascendent);
GCDisplaySettings::setValue(COREEVENTS_ABHIJIT_MUHURTA, m_muhurtaAbhijit);
GCDisplaySettings::setValue(COREEVENTS_YOGA, m_yoga);
GCDisplaySettings::setValue(COREEVENTS_SORT, m_fSort);
m_nNextStep = 1;
CDialog::OnOK();
}
void DlgGetEventSpec::OnRadio1()
{
CheckRadioButton(IDC_RADIO1, IDC_RADIO2, IDC_RADIO1);
m_fSort = 1;
}
void DlgGetEventSpec::OnRadio2()
{
CheckRadioButton(IDC_RADIO1, IDC_RADIO2, IDC_RADIO2);
m_fSort = 0;
}
BOOL DlgGetEventSpec::OnInitDialog()
{
m_conj = GCDisplaySettings::getValue(COREEVENTS_CONJUNCTION) ? TRUE : FALSE;
m_naks = GCDisplaySettings::getValue(COREEVENTS_NAKSATRA) ? TRUE : FALSE;
m_sank = GCDisplaySettings::getValue(COREEVENTS_SANKRANTI) ? TRUE : FALSE;
m_sun = GCDisplaySettings::getValue(COREEVENTS_SUN) ? TRUE : FALSE;
m_tithi = GCDisplaySettings::getValue(COREEVENTS_TITHI) ? TRUE : FALSE;
m_rahu_kalam = (GCDisplaySettings::getValue(COREEVENTS_RAHUKALAM)) ? TRUE : FALSE;
m_yama_ghanti = GCDisplaySettings::getValue(COREEVENTS_YAMAGHANTI) ? TRUE : FALSE;
m_guli_kalam = GCDisplaySettings::getValue(COREEVENTS_GULIKALAM) ? TRUE : FALSE;
m_moon_rasi = GCDisplaySettings::getValue(COREEVENTS_MOONRASI) ? true : false;
m_moon_times = GCDisplaySettings::getValue(COREEVENTS_MOON) ? true : false;
m_ascendent = GCDisplaySettings::getValue(COREEVENTS_ASCENDENT) ? true : false;
m_muhurtaAbhijit = GCDisplaySettings::getValue(COREEVENTS_ABHIJIT_MUHURTA) ? true : false;
m_yoga = GCDisplaySettings::getValue(COREEVENTS_YOGA) ? true : false;
CDialog::OnInitDialog();
m_fSort = GCDisplaySettings::getValue(COREEVENTS_SORT);
CheckRadioButton(IDC_RADIO1, IDC_RADIO2, (m_fSort ? IDC_RADIO1 : IDC_RADIO2));
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void DlgGetEventSpec::OnBnClickedCheck6()
{
// TODO: Add your control notification handler code here
}
void DlgGetEventSpec::OnBnClickedCheck12()
{
// TODO: Add your control notification handler code here
}