summaryrefslogtreecommitdiffabout
path: root/LogPatternReserved.cpp
authorMichael Krelin <hacker@klever.net>2004-07-05 01:53:09 (UTC)
committer Michael Krelin <hacker@klever.net>2004-07-05 01:53:09 (UTC)
commita1487b3fc0313408525cd5b2f3bc4a462df351f7 (patch) (unidiff)
tree010aec6c2abd5ada2f909ac6798c93bf22508bf5 /LogPatternReserved.cpp
downloadklog-a1487b3fc0313408525cd5b2f3bc4a462df351f7.zip
klog-a1487b3fc0313408525cd5b2f3bc4a462df351f7.tar.gz
klog-a1487b3fc0313408525cd5b2f3bc4a462df351f7.tar.bz2
initial commit into svn repository
git-svn-id: http://svn.klever.net/kin/klog/trunk@1 fe716a7a-6dde-0310-88d9-d003556173a8
Diffstat (limited to 'LogPatternReserved.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--LogPatternReserved.cpp241
1 files changed, 241 insertions, 0 deletions
diff --git a/LogPatternReserved.cpp b/LogPatternReserved.cpp
new file mode 100644
index 0000000..3921694
--- a/dev/null
+++ b/LogPatternReserved.cpp
@@ -0,0 +1,241 @@
1// LogPatternReserved.cpp : implementation file
2//
3
4#include "stdafx.h"
5#include "KLog.h"
6#include "LogPatternReserved.h"
7
8#include "SyslogSocket.h"
9#include "LogPattern.h"
10
11#ifdef _DEBUG
12#define new DEBUG_NEW
13#undef THIS_FILE
14static char THIS_FILE[] = __FILE__;
15#endif
16
17/////////////////////////////////////////////////////////////////////////////
18// CLogPatternReserved property page
19
20 #definePFROM CSyslogSocket::facReserved0
21 #define PTO CSyslogSocket::facReserved4
22
23IMPLEMENT_DYNCREATE(CLogPatternReserved, CPropertyPage)
24
25CLogPatternReserved::CLogPatternReserved(CLogPattern *daddy) : CPropertyPage(CLogPatternReserved::IDD), m_Daddy(daddy)
26{
27 //{{AFX_DATA_INIT(CLogPatternReserved)
28 //}}AFX_DATA_INIT
29}
30
31CLogPatternReserved::~CLogPatternReserved()
32{
33}
34
35void CLogPatternReserved::DoDataExchange(CDataExchange* pDX)
36{
37 CPropertyPage::DoDataExchange(pDX);
38 //{{AFX_DATA_MAP(CLogPatternReserved)
39 //}}AFX_DATA_MAP
40 m_Daddy->ExchangeData(pDX,PFROM,PTO);
41}
42
43
44BEGIN_MESSAGE_MAP(CLogPatternReserved, CPropertyPage)
45 //{{AFX_MSG_MAP(CLogPatternReserved)
46 ON_BN_CLICKED(IDC_ALERT_ON, OnAlertOn)
47 ON_BN_CLICKED(IDC_ALERT_XOR, OnAlertXor)
48 ON_BN_CLICKED(IDC_CRIT_ON, OnCritOn)
49 ON_BN_CLICKED(IDC_CRIT_XOR, OnCritXor)
50 ON_BN_CLICKED(IDC_DEBUG_ON, OnDebugOn)
51 ON_BN_CLICKED(IDC_DEBUG_XOR, OnDebugXor)
52 ON_BN_CLICKED(IDC_EMERG_ON, OnEmergOn)
53 ON_BN_CLICKED(IDC_EMERG_XOR, OnEmergXor)
54 ON_BN_CLICKED(IDC_ERR_ON, OnErrOn)
55 ON_BN_CLICKED(IDC_ERR_XOR, OnErrXor)
56 ON_BN_CLICKED(IDC_INFO_ON, OnInfoOn)
57 ON_BN_CLICKED(IDC_INFO_XOR, OnInfoXor)
58 ON_BN_CLICKED(IDC_NOTICE_ON, OnNoticeOn)
59 ON_BN_CLICKED(IDC_NOTICE_XOR, OnNoticeXor)
60 ON_BN_CLICKED(IDC_R0_ON, OnR0On)
61 ON_BN_CLICKED(IDC_R0_XOR, OnR0Xor)
62 ON_BN_CLICKED(IDC_R1_ON, OnR1On)
63 ON_BN_CLICKED(IDC_R1_XOR, OnR1Xor)
64 ON_BN_CLICKED(IDC_R2_ON, OnR2On)
65 ON_BN_CLICKED(IDC_R2_XOR, OnR2Xor)
66 ON_BN_CLICKED(IDC_R3_ON, OnR3On)
67 ON_BN_CLICKED(IDC_R3_XOR, OnR3Xor)
68 ON_BN_CLICKED(IDC_R4_ON, OnR4On)
69 ON_BN_CLICKED(IDC_R4_XOR, OnR4Xor)
70 ON_BN_CLICKED(IDC_WARN_ON, OnWarnOn)
71 ON_BN_CLICKED(IDC_WARN_XOR, OnWarnXor)
72 //}}AFX_MSG_MAP
73END_MESSAGE_MAP()
74
75/////////////////////////////////////////////////////////////////////////////
76// CLogPatternReserved message handlers
77
78void CLogPatternReserved::OnAlertOn()
79{
80 m_Daddy->PriorityOn(this,CSyslogSocket::priAlert,PFROM,PTO);
81}
82void CLogPatternReserved::OnAlertXor()
83{
84 m_Daddy->PriorityXor(this,CSyslogSocket::priAlert,PFROM,PTO);
85}
86
87void CLogPatternReserved::OnCritOn()
88{
89 m_Daddy->PriorityOn(this,CSyslogSocket::priCritical,PFROM,PTO);
90}
91void CLogPatternReserved::OnCritXor()
92{
93 m_Daddy->PriorityXor(this,CSyslogSocket::priCritical,PFROM,PTO);
94}
95
96void CLogPatternReserved::OnDebugOn()
97{
98 m_Daddy->PriorityOn(this,CSyslogSocket::priDebug,PFROM,PTO);
99}
100void CLogPatternReserved::OnDebugXor()
101{
102 m_Daddy->PriorityXor(this,CSyslogSocket::priDebug,PFROM,PTO);
103}
104
105void CLogPatternReserved::OnEmergOn()
106{
107 m_Daddy->PriorityOn(this,CSyslogSocket::priEmergency,PFROM,PTO);
108}
109void CLogPatternReserved::OnEmergXor()
110{
111 m_Daddy->PriorityXor(this,CSyslogSocket::priEmergency,PFROM,PTO);
112}
113
114void CLogPatternReserved::OnErrOn()
115{
116 m_Daddy->PriorityOn(this,CSyslogSocket::priError,PFROM,PTO);
117}
118void CLogPatternReserved::OnErrXor()
119{
120 m_Daddy->PriorityXor(this,CSyslogSocket::priError,PFROM,PTO);
121}
122
123void CLogPatternReserved::OnInfoOn()
124{
125 m_Daddy->PriorityOn(this,CSyslogSocket::priInfo,PFROM,PTO);
126}
127void CLogPatternReserved::OnInfoXor()
128{
129 m_Daddy->PriorityXor(this,CSyslogSocket::priInfo,PFROM,PTO);
130}
131
132void CLogPatternReserved::OnNoticeOn()
133{
134 m_Daddy->PriorityOn(this,CSyslogSocket::priNotice,PFROM,PTO);
135}
136void CLogPatternReserved::OnNoticeXor()
137{
138 m_Daddy->PriorityXor(this,CSyslogSocket::priNotice,PFROM,PTO);
139}
140
141void CLogPatternReserved::OnR0On()
142{
143 m_Daddy->FacilityOn(this,CSyslogSocket::facReserved0);
144}
145void CLogPatternReserved::OnR0Xor()
146{
147 m_Daddy->FacilityXor(this,CSyslogSocket::facReserved0);
148}
149
150void CLogPatternReserved::OnR1On()
151{
152 m_Daddy->FacilityOn(this,CSyslogSocket::facReserved1);
153}
154void CLogPatternReserved::OnR1Xor()
155{
156 m_Daddy->FacilityXor(this,CSyslogSocket::facReserved1);
157}
158
159void CLogPatternReserved::OnR2On()
160{
161 m_Daddy->FacilityOn(this,CSyslogSocket::facReserved2);
162}
163void CLogPatternReserved::OnR2Xor()
164{
165 m_Daddy->FacilityXor(this,CSyslogSocket::facReserved2);
166}
167
168void CLogPatternReserved::OnR3On()
169{
170 m_Daddy->FacilityOn(this,CSyslogSocket::facReserved3);
171}
172void CLogPatternReserved::OnR3Xor()
173{
174 m_Daddy->FacilityXor(this,CSyslogSocket::facReserved3);
175}
176
177void CLogPatternReserved::OnR4On()
178{
179 m_Daddy->FacilityOn(this,CSyslogSocket::facReserved4);
180}
181void CLogPatternReserved::OnR4Xor()
182{
183 m_Daddy->FacilityXor(this,CSyslogSocket::facReserved4);
184}
185
186void CLogPatternReserved::OnWarnOn()
187{
188 m_Daddy->PriorityOn(this,CSyslogSocket::priWarning,PFROM,PTO);
189}
190void CLogPatternReserved::OnWarnXor()
191{
192 m_Daddy->PriorityXor(this,CSyslogSocket::priWarning,PFROM,PTO);
193}
194
195BOOL CLogPatternReserved::OnInitDialog()
196{
197 CPropertyPage::OnInitDialog();
198
199 m_tooltip.Create(this);
200 m_tooltip.Activate(TRUE);
201 m_tooltip.AddTool(GetDlgItem(IDC_R0_ON),IDS_TIP_FACILITY_ON);
202 m_tooltip.AddTool(GetDlgItem(IDC_R1_ON),IDS_TIP_FACILITY_ON);
203 m_tooltip.AddTool(GetDlgItem(IDC_R2_ON),IDS_TIP_FACILITY_ON);
204 m_tooltip.AddTool(GetDlgItem(IDC_R3_ON),IDS_TIP_FACILITY_ON);
205 m_tooltip.AddTool(GetDlgItem(IDC_R4_ON),IDS_TIP_FACILITY_ON);
206
207 m_tooltip.AddTool(GetDlgItem(IDC_R0_XOR),IDS_TIP_FACILITY_XOR);
208 m_tooltip.AddTool(GetDlgItem(IDC_R1_XOR),IDS_TIP_FACILITY_XOR);
209 m_tooltip.AddTool(GetDlgItem(IDC_R2_XOR),IDS_TIP_FACILITY_XOR);
210 m_tooltip.AddTool(GetDlgItem(IDC_R3_XOR),IDS_TIP_FACILITY_XOR);
211
212 m_tooltip.AddTool(GetDlgItem(IDC_EMERG_ON),IDS_TIP_PRIORITY_ON);
213 m_tooltip.AddTool(GetDlgItem(IDC_ALERT_ON),IDS_TIP_PRIORITY_ON);
214 m_tooltip.AddTool(GetDlgItem(IDC_CRIT_ON),IDS_TIP_PRIORITY_ON);
215 m_tooltip.AddTool(GetDlgItem(IDC_ERR_ON),IDS_TIP_PRIORITY_ON);
216 m_tooltip.AddTool(GetDlgItem(IDC_WARN_ON),IDS_TIP_PRIORITY_ON);
217 m_tooltip.AddTool(GetDlgItem(IDC_NOTICE_ON),IDS_TIP_PRIORITY_ON);
218 m_tooltip.AddTool(GetDlgItem(IDC_INFO_ON),IDS_TIP_PRIORITY_ON);
219 m_tooltip.AddTool(GetDlgItem(IDC_DEBUG_ON),IDS_TIP_PRIORITY_ON);
220
221 m_tooltip.AddTool(GetDlgItem(IDC_EMERG_XOR),IDS_TIP_PRIORITY_XOR);
222 m_tooltip.AddTool(GetDlgItem(IDC_ALERT_XOR),IDS_TIP_PRIORITY_XOR);
223 m_tooltip.AddTool(GetDlgItem(IDC_CRIT_XOR),IDS_TIP_PRIORITY_XOR);
224 m_tooltip.AddTool(GetDlgItem(IDC_ERR_XOR),IDS_TIP_PRIORITY_XOR);
225 m_tooltip.AddTool(GetDlgItem(IDC_WARN_XOR),IDS_TIP_PRIORITY_XOR);
226 m_tooltip.AddTool(GetDlgItem(IDC_NOTICE_XOR),IDS_TIP_PRIORITY_XOR);
227 m_tooltip.AddTool(GetDlgItem(IDC_INFO_XOR),IDS_TIP_PRIORITY_XOR);
228 m_tooltip.AddTool(GetDlgItem(IDC_DEBUG_XOR),IDS_TIP_PRIORITY_XOR);
229
230 m_Daddy->AddTips(m_tooltip,this,PFROM,PTO);
231
232 return TRUE; // return TRUE unless you set the focus to a control
233 // EXCEPTION: OCX Property Pages should return FALSE
234}
235
236BOOL CLogPatternReserved::PreTranslateMessage(MSG* pMsg)
237{
238 m_tooltip.RelayEvent(pMsg);
239
240 return CPropertyPage::PreTranslateMessage(pMsg);
241}