summaryrefslogtreecommitdiffabout
path: root/LogPatternReserved.cpp
blob: 3921694dce0ae6e69b38be64f9c6fb7545eaa7ec (plain)
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
// LogPatternReserved.cpp : implementation file
//

#include "stdafx.h"
#include "KLog.h"
#include "LogPatternReserved.h"

#include "SyslogSocket.h"
#include "LogPattern.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CLogPatternReserved property page

#define	PFROM CSyslogSocket::facReserved0
#define	PTO		CSyslogSocket::facReserved4

IMPLEMENT_DYNCREATE(CLogPatternReserved, CPropertyPage)

CLogPatternReserved::CLogPatternReserved(CLogPattern *daddy) : CPropertyPage(CLogPatternReserved::IDD), m_Daddy(daddy)
{
	//{{AFX_DATA_INIT(CLogPatternReserved)
	//}}AFX_DATA_INIT
}

CLogPatternReserved::~CLogPatternReserved()
{
}

void CLogPatternReserved::DoDataExchange(CDataExchange* pDX)
{
	CPropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CLogPatternReserved)
	//}}AFX_DATA_MAP
	m_Daddy->ExchangeData(pDX,PFROM,PTO);
}


BEGIN_MESSAGE_MAP(CLogPatternReserved, CPropertyPage)
	//{{AFX_MSG_MAP(CLogPatternReserved)
	ON_BN_CLICKED(IDC_ALERT_ON, OnAlertOn)
	ON_BN_CLICKED(IDC_ALERT_XOR, OnAlertXor)
	ON_BN_CLICKED(IDC_CRIT_ON, OnCritOn)
	ON_BN_CLICKED(IDC_CRIT_XOR, OnCritXor)
	ON_BN_CLICKED(IDC_DEBUG_ON, OnDebugOn)
	ON_BN_CLICKED(IDC_DEBUG_XOR, OnDebugXor)
	ON_BN_CLICKED(IDC_EMERG_ON, OnEmergOn)
	ON_BN_CLICKED(IDC_EMERG_XOR, OnEmergXor)
	ON_BN_CLICKED(IDC_ERR_ON, OnErrOn)
	ON_BN_CLICKED(IDC_ERR_XOR, OnErrXor)
	ON_BN_CLICKED(IDC_INFO_ON, OnInfoOn)
	ON_BN_CLICKED(IDC_INFO_XOR, OnInfoXor)
	ON_BN_CLICKED(IDC_NOTICE_ON, OnNoticeOn)
	ON_BN_CLICKED(IDC_NOTICE_XOR, OnNoticeXor)
	ON_BN_CLICKED(IDC_R0_ON, OnR0On)
	ON_BN_CLICKED(IDC_R0_XOR, OnR0Xor)
	ON_BN_CLICKED(IDC_R1_ON, OnR1On)
	ON_BN_CLICKED(IDC_R1_XOR, OnR1Xor)
	ON_BN_CLICKED(IDC_R2_ON, OnR2On)
	ON_BN_CLICKED(IDC_R2_XOR, OnR2Xor)
	ON_BN_CLICKED(IDC_R3_ON, OnR3On)
	ON_BN_CLICKED(IDC_R3_XOR, OnR3Xor)
	ON_BN_CLICKED(IDC_R4_ON, OnR4On)
	ON_BN_CLICKED(IDC_R4_XOR, OnR4Xor)
	ON_BN_CLICKED(IDC_WARN_ON, OnWarnOn)
	ON_BN_CLICKED(IDC_WARN_XOR, OnWarnXor)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CLogPatternReserved message handlers

void CLogPatternReserved::OnAlertOn() 
{
	m_Daddy->PriorityOn(this,CSyslogSocket::priAlert,PFROM,PTO);
}
void CLogPatternReserved::OnAlertXor() 
{
	m_Daddy->PriorityXor(this,CSyslogSocket::priAlert,PFROM,PTO);
}

void CLogPatternReserved::OnCritOn() 
{
	m_Daddy->PriorityOn(this,CSyslogSocket::priCritical,PFROM,PTO);
}
void CLogPatternReserved::OnCritXor() 
{
	m_Daddy->PriorityXor(this,CSyslogSocket::priCritical,PFROM,PTO);
}

void CLogPatternReserved::OnDebugOn() 
{
	m_Daddy->PriorityOn(this,CSyslogSocket::priDebug,PFROM,PTO);
}
void CLogPatternReserved::OnDebugXor() 
{
	m_Daddy->PriorityXor(this,CSyslogSocket::priDebug,PFROM,PTO);
}

void CLogPatternReserved::OnEmergOn() 
{
	m_Daddy->PriorityOn(this,CSyslogSocket::priEmergency,PFROM,PTO);
}
void CLogPatternReserved::OnEmergXor() 
{
	m_Daddy->PriorityXor(this,CSyslogSocket::priEmergency,PFROM,PTO);
}

void CLogPatternReserved::OnErrOn() 
{
	m_Daddy->PriorityOn(this,CSyslogSocket::priError,PFROM,PTO);
}
void CLogPatternReserved::OnErrXor() 
{
	m_Daddy->PriorityXor(this,CSyslogSocket::priError,PFROM,PTO);
}

void CLogPatternReserved::OnInfoOn() 
{
	m_Daddy->PriorityOn(this,CSyslogSocket::priInfo,PFROM,PTO);
}
void CLogPatternReserved::OnInfoXor() 
{
	m_Daddy->PriorityXor(this,CSyslogSocket::priInfo,PFROM,PTO);
}

void CLogPatternReserved::OnNoticeOn() 
{
	m_Daddy->PriorityOn(this,CSyslogSocket::priNotice,PFROM,PTO);
}
void CLogPatternReserved::OnNoticeXor() 
{
	m_Daddy->PriorityXor(this,CSyslogSocket::priNotice,PFROM,PTO);
}

void CLogPatternReserved::OnR0On() 
{
	m_Daddy->FacilityOn(this,CSyslogSocket::facReserved0);
}
void CLogPatternReserved::OnR0Xor() 
{
	m_Daddy->FacilityXor(this,CSyslogSocket::facReserved0);
}

void CLogPatternReserved::OnR1On() 
{
	m_Daddy->FacilityOn(this,CSyslogSocket::facReserved1);
}
void CLogPatternReserved::OnR1Xor() 
{
	m_Daddy->FacilityXor(this,CSyslogSocket::facReserved1);
}

void CLogPatternReserved::OnR2On() 
{
	m_Daddy->FacilityOn(this,CSyslogSocket::facReserved2);
}
void CLogPatternReserved::OnR2Xor() 
{
	m_Daddy->FacilityXor(this,CSyslogSocket::facReserved2);
}

void CLogPatternReserved::OnR3On() 
{
	m_Daddy->FacilityOn(this,CSyslogSocket::facReserved3);
}
void CLogPatternReserved::OnR3Xor() 
{
	m_Daddy->FacilityXor(this,CSyslogSocket::facReserved3);
}

void CLogPatternReserved::OnR4On() 
{
	m_Daddy->FacilityOn(this,CSyslogSocket::facReserved4);
}
void CLogPatternReserved::OnR4Xor() 
{
	m_Daddy->FacilityXor(this,CSyslogSocket::facReserved4);
}

void CLogPatternReserved::OnWarnOn() 
{
	m_Daddy->PriorityOn(this,CSyslogSocket::priWarning,PFROM,PTO);
}
void CLogPatternReserved::OnWarnXor() 
{
	m_Daddy->PriorityXor(this,CSyslogSocket::priWarning,PFROM,PTO);
}

BOOL CLogPatternReserved::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();
	
	m_tooltip.Create(this);
	m_tooltip.Activate(TRUE);
	m_tooltip.AddTool(GetDlgItem(IDC_R0_ON),IDS_TIP_FACILITY_ON);
	m_tooltip.AddTool(GetDlgItem(IDC_R1_ON),IDS_TIP_FACILITY_ON);
	m_tooltip.AddTool(GetDlgItem(IDC_R2_ON),IDS_TIP_FACILITY_ON);
	m_tooltip.AddTool(GetDlgItem(IDC_R3_ON),IDS_TIP_FACILITY_ON);
	m_tooltip.AddTool(GetDlgItem(IDC_R4_ON),IDS_TIP_FACILITY_ON);

	m_tooltip.AddTool(GetDlgItem(IDC_R0_XOR),IDS_TIP_FACILITY_XOR);
	m_tooltip.AddTool(GetDlgItem(IDC_R1_XOR),IDS_TIP_FACILITY_XOR);
	m_tooltip.AddTool(GetDlgItem(IDC_R2_XOR),IDS_TIP_FACILITY_XOR);
	m_tooltip.AddTool(GetDlgItem(IDC_R3_XOR),IDS_TIP_FACILITY_XOR);

	m_tooltip.AddTool(GetDlgItem(IDC_EMERG_ON),IDS_TIP_PRIORITY_ON);
	m_tooltip.AddTool(GetDlgItem(IDC_ALERT_ON),IDS_TIP_PRIORITY_ON);
	m_tooltip.AddTool(GetDlgItem(IDC_CRIT_ON),IDS_TIP_PRIORITY_ON);
	m_tooltip.AddTool(GetDlgItem(IDC_ERR_ON),IDS_TIP_PRIORITY_ON);
	m_tooltip.AddTool(GetDlgItem(IDC_WARN_ON),IDS_TIP_PRIORITY_ON);
	m_tooltip.AddTool(GetDlgItem(IDC_NOTICE_ON),IDS_TIP_PRIORITY_ON);
	m_tooltip.AddTool(GetDlgItem(IDC_INFO_ON),IDS_TIP_PRIORITY_ON);
	m_tooltip.AddTool(GetDlgItem(IDC_DEBUG_ON),IDS_TIP_PRIORITY_ON);

	m_tooltip.AddTool(GetDlgItem(IDC_EMERG_XOR),IDS_TIP_PRIORITY_XOR);
	m_tooltip.AddTool(GetDlgItem(IDC_ALERT_XOR),IDS_TIP_PRIORITY_XOR);
	m_tooltip.AddTool(GetDlgItem(IDC_CRIT_XOR),IDS_TIP_PRIORITY_XOR);
	m_tooltip.AddTool(GetDlgItem(IDC_ERR_XOR),IDS_TIP_PRIORITY_XOR);
	m_tooltip.AddTool(GetDlgItem(IDC_WARN_XOR),IDS_TIP_PRIORITY_XOR);
	m_tooltip.AddTool(GetDlgItem(IDC_NOTICE_XOR),IDS_TIP_PRIORITY_XOR);
	m_tooltip.AddTool(GetDlgItem(IDC_INFO_XOR),IDS_TIP_PRIORITY_XOR);
	m_tooltip.AddTool(GetDlgItem(IDC_DEBUG_XOR),IDS_TIP_PRIORITY_XOR);

	m_Daddy->AddTips(m_tooltip,this,PFROM,PTO);

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

BOOL CLogPatternReserved::PreTranslateMessage(MSG* pMsg) 
{
	m_tooltip.RelayEvent(pMsg);

	return CPropertyPage::PreTranslateMessage(pMsg);
}