-rw-r--r-- | LogPatternLocal.cpp | 282 |
1 files changed, 282 insertions, 0 deletions
diff --git a/LogPatternLocal.cpp b/LogPatternLocal.cpp new file mode 100644 index 0000000..739eeed --- a/dev/null +++ b/LogPatternLocal.cpp | |||
@@ -0,0 +1,282 @@ | |||
1 | // LogPatternLocal.cpp : implementation file | ||
2 | // | ||
3 | |||
4 | #include "stdafx.h" | ||
5 | #include "KLog.h" | ||
6 | #include "LogPatternLocal.h" | ||
7 | |||
8 | #include "SyslogSocket.h" | ||
9 | #include "LogPattern.h" | ||
10 | |||
11 | #ifdef _DEBUG | ||
12 | #define new DEBUG_NEW | ||
13 | #undef THIS_FILE | ||
14 | static char THIS_FILE[] = __FILE__; | ||
15 | #endif | ||
16 | |||
17 | ///////////////////////////////////////////////////////////////////////////// | ||
18 | // CLogPatternLocal property page | ||
19 | |||
20 | #definePFROM CSyslogSocket::facLocal0 | ||
21 | #define PTO CSyslogSocket::facLocal7 | ||
22 | |||
23 | IMPLEMENT_DYNCREATE(CLogPatternLocal, CPropertyPage) | ||
24 | |||
25 | CLogPatternLocal::CLogPatternLocal(CLogPattern* daddy) : CPropertyPage(CLogPatternLocal::IDD), m_Daddy(daddy) | ||
26 | { | ||
27 | //{{AFX_DATA_INIT(CLogPatternLocal) | ||
28 | //}}AFX_DATA_INIT | ||
29 | } | ||
30 | |||
31 | CLogPatternLocal::~CLogPatternLocal() | ||
32 | { | ||
33 | } | ||
34 | |||
35 | void CLogPatternLocal::DoDataExchange(CDataExchange* pDX) | ||
36 | { | ||
37 | CPropertyPage::DoDataExchange(pDX); | ||
38 | //{{AFX_DATA_MAP(CLogPatternLocal) | ||
39 | //}}AFX_DATA_MAP | ||
40 | m_Daddy->ExchangeData(pDX,PFROM,PTO); | ||
41 | } | ||
42 | |||
43 | |||
44 | BEGIN_MESSAGE_MAP(CLogPatternLocal, CPropertyPage) | ||
45 | //{{AFX_MSG_MAP(CLogPatternLocal) | ||
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_L0_ON, OnL0On) | ||
59 | ON_BN_CLICKED(IDC_L0_XOR, OnL0Xor) | ||
60 | ON_BN_CLICKED(IDC_L1_ON, OnL1On) | ||
61 | ON_BN_CLICKED(IDC_L1_XOR, OnL1Xor) | ||
62 | ON_BN_CLICKED(IDC_L2_ON, OnL2On) | ||
63 | ON_BN_CLICKED(IDC_L2_XOR, OnL2Xor) | ||
64 | ON_BN_CLICKED(IDC_L3_ON, OnL3On) | ||
65 | ON_BN_CLICKED(IDC_L3_XOR, OnL3Xor) | ||
66 | ON_BN_CLICKED(IDC_L4_ON, OnL4On) | ||
67 | ON_BN_CLICKED(IDC_L4_XOR, OnL4Xor) | ||
68 | ON_BN_CLICKED(IDC_L5_ON, OnL5On) | ||
69 | ON_BN_CLICKED(IDC_L5_XOR, OnL5Xor) | ||
70 | ON_BN_CLICKED(IDC_L6_ON, OnL6On) | ||
71 | ON_BN_CLICKED(IDC_L6_XOR, OnL6Xor) | ||
72 | ON_BN_CLICKED(IDC_L7_ON, OnL7On) | ||
73 | ON_BN_CLICKED(IDC_L7_XOR, OnL7Xor) | ||
74 | ON_BN_CLICKED(IDC_NOTICE_ON, OnNoticeOn) | ||
75 | ON_BN_CLICKED(IDC_NOTICE_XOR, OnNoticeXor) | ||
76 | ON_BN_CLICKED(IDC_WARN_ON, OnWarnOn) | ||
77 | ON_BN_CLICKED(IDC_WARN_XOR, OnWarnXor) | ||
78 | //}}AFX_MSG_MAP | ||
79 | END_MESSAGE_MAP() | ||
80 | |||
81 | ///////////////////////////////////////////////////////////////////////////// | ||
82 | // CLogPatternLocal message handlers | ||
83 | |||
84 | void CLogPatternLocal::OnAlertOn() | ||
85 | { | ||
86 | m_Daddy->PriorityOn(this,CSyslogSocket::priAlert,PFROM,PTO); | ||
87 | } | ||
88 | void CLogPatternLocal::OnAlertXor() | ||
89 | { | ||
90 | m_Daddy->PriorityXor(this,CSyslogSocket::priAlert,PFROM,PTO); | ||
91 | } | ||
92 | |||
93 | void CLogPatternLocal::OnCritOn() | ||
94 | { | ||
95 | m_Daddy->PriorityOn(this,CSyslogSocket::priCritical,PFROM,PTO); | ||
96 | } | ||
97 | void CLogPatternLocal::OnCritXor() | ||
98 | { | ||
99 | m_Daddy->PriorityXor(this,CSyslogSocket::priCritical,PFROM,PTO); | ||
100 | } | ||
101 | |||
102 | void CLogPatternLocal::OnDebugOn() | ||
103 | { | ||
104 | m_Daddy->PriorityOn(this,CSyslogSocket::priDebug,PFROM,PTO); | ||
105 | } | ||
106 | void CLogPatternLocal::OnDebugXor() | ||
107 | { | ||
108 | m_Daddy->PriorityXor(this,CSyslogSocket::priDebug,PFROM,PTO); | ||
109 | } | ||
110 | |||
111 | void CLogPatternLocal::OnEmergOn() | ||
112 | { | ||
113 | m_Daddy->PriorityOn(this,CSyslogSocket::priEmergency,PFROM,PTO); | ||
114 | } | ||
115 | void CLogPatternLocal::OnEmergXor() | ||
116 | { | ||
117 | m_Daddy->PriorityXor(this,CSyslogSocket::priEmergency,PFROM,PTO); | ||
118 | } | ||
119 | |||
120 | void CLogPatternLocal::OnErrOn() | ||
121 | { | ||
122 | m_Daddy->PriorityOn(this,CSyslogSocket::priError,PFROM,PTO); | ||
123 | } | ||
124 | void CLogPatternLocal::OnErrXor() | ||
125 | { | ||
126 | m_Daddy->PriorityXor(this,CSyslogSocket::priError,PFROM,PTO); | ||
127 | } | ||
128 | |||
129 | void CLogPatternLocal::OnInfoOn() | ||
130 | { | ||
131 | m_Daddy->PriorityOn(this,CSyslogSocket::priInfo,PFROM,PTO); | ||
132 | } | ||
133 | void CLogPatternLocal::OnInfoXor() | ||
134 | { | ||
135 | m_Daddy->PriorityXor(this,CSyslogSocket::priInfo,PFROM,PTO); | ||
136 | } | ||
137 | |||
138 | void CLogPatternLocal::OnL0On() | ||
139 | { | ||
140 | m_Daddy->FacilityOn(this,CSyslogSocket::facLocal0); | ||
141 | } | ||
142 | void CLogPatternLocal::OnL0Xor() | ||
143 | { | ||
144 | m_Daddy->FacilityXor(this,CSyslogSocket::facLocal0); | ||
145 | } | ||
146 | |||
147 | void CLogPatternLocal::OnL1On() | ||
148 | { | ||
149 | m_Daddy->FacilityOn(this,CSyslogSocket::facLocal1); | ||
150 | } | ||
151 | void CLogPatternLocal::OnL1Xor() | ||
152 | { | ||
153 | m_Daddy->FacilityXor(this,CSyslogSocket::facLocal1); | ||
154 | } | ||
155 | |||
156 | void CLogPatternLocal::OnL2On() | ||
157 | { | ||
158 | m_Daddy->FacilityOn(this,CSyslogSocket::facLocal2); | ||
159 | } | ||
160 | void CLogPatternLocal::OnL2Xor() | ||
161 | { | ||
162 | m_Daddy->FacilityXor(this,CSyslogSocket::facLocal2); | ||
163 | } | ||
164 | |||
165 | void CLogPatternLocal::OnL3On() | ||
166 | { | ||
167 | m_Daddy->FacilityOn(this,CSyslogSocket::facLocal3); | ||
168 | } | ||
169 | void CLogPatternLocal::OnL3Xor() | ||
170 | { | ||
171 | m_Daddy->FacilityXor(this,CSyslogSocket::facLocal3); | ||
172 | } | ||
173 | |||
174 | void CLogPatternLocal::OnL4On() | ||
175 | { | ||
176 | m_Daddy->FacilityOn(this,CSyslogSocket::facLocal4); | ||
177 | } | ||
178 | void CLogPatternLocal::OnL4Xor() | ||
179 | { | ||
180 | m_Daddy->FacilityXor(this,CSyslogSocket::facLocal4); | ||
181 | } | ||
182 | |||
183 | void CLogPatternLocal::OnL5On() | ||
184 | { | ||
185 | m_Daddy->FacilityOn(this,CSyslogSocket::facLocal5); | ||
186 | } | ||
187 | void CLogPatternLocal::OnL5Xor() | ||
188 | { | ||
189 | m_Daddy->FacilityXor(this,CSyslogSocket::facLocal5); | ||
190 | } | ||
191 | |||
192 | void CLogPatternLocal::OnL6On() | ||
193 | { | ||
194 | m_Daddy->FacilityOn(this,CSyslogSocket::facLocal6); | ||
195 | |||
196 | } | ||
197 | void CLogPatternLocal::OnL6Xor() | ||
198 | { | ||
199 | m_Daddy->FacilityXor(this,CSyslogSocket::facLocal6); | ||
200 | } | ||
201 | |||
202 | void CLogPatternLocal::OnL7On() | ||
203 | { | ||
204 | m_Daddy->FacilityOn(this,CSyslogSocket::facLocal7); | ||
205 | } | ||
206 | void CLogPatternLocal::OnL7Xor() | ||
207 | { | ||
208 | m_Daddy->FacilityXor(this,CSyslogSocket::facLocal7); | ||
209 | } | ||
210 | |||
211 | void CLogPatternLocal::OnNoticeOn() | ||
212 | { | ||
213 | m_Daddy->PriorityOn(this,CSyslogSocket::priNotice,PFROM,PTO); | ||
214 | } | ||
215 | void CLogPatternLocal::OnNoticeXor() | ||
216 | { | ||
217 | m_Daddy->PriorityXor(this,CSyslogSocket::priNotice,PFROM,PTO); | ||
218 | } | ||
219 | |||
220 | void CLogPatternLocal::OnWarnOn() | ||
221 | { | ||
222 | m_Daddy->PriorityOn(this,CSyslogSocket::priWarning,PFROM,PTO); | ||
223 | } | ||
224 | void CLogPatternLocal::OnWarnXor() | ||
225 | { | ||
226 | m_Daddy->PriorityXor(this,CSyslogSocket::priWarning,PFROM,PTO); | ||
227 | } | ||
228 | |||
229 | BOOL CLogPatternLocal::OnInitDialog() | ||
230 | { | ||
231 | CPropertyPage::OnInitDialog(); | ||
232 | |||
233 | m_tooltip.Create(this); | ||
234 | m_tooltip.Activate(TRUE); | ||
235 | m_tooltip.AddTool(GetDlgItem(IDC_L0_ON),IDS_TIP_FACILITY_ON); | ||
236 | m_tooltip.AddTool(GetDlgItem(IDC_L1_ON),IDS_TIP_FACILITY_ON); | ||
237 | m_tooltip.AddTool(GetDlgItem(IDC_L2_ON),IDS_TIP_FACILITY_ON); | ||
238 | m_tooltip.AddTool(GetDlgItem(IDC_L3_ON),IDS_TIP_FACILITY_ON); | ||
239 | m_tooltip.AddTool(GetDlgItem(IDC_L4_ON),IDS_TIP_FACILITY_ON); | ||
240 | m_tooltip.AddTool(GetDlgItem(IDC_L5_ON),IDS_TIP_FACILITY_ON); | ||
241 | m_tooltip.AddTool(GetDlgItem(IDC_L6_ON),IDS_TIP_FACILITY_ON); | ||
242 | m_tooltip.AddTool(GetDlgItem(IDC_L7_ON),IDS_TIP_FACILITY_ON); | ||
243 | |||
244 | m_tooltip.AddTool(GetDlgItem(IDC_L0_XOR),IDS_TIP_FACILITY_XOR); | ||
245 | m_tooltip.AddTool(GetDlgItem(IDC_L1_XOR),IDS_TIP_FACILITY_XOR); | ||
246 | m_tooltip.AddTool(GetDlgItem(IDC_L2_XOR),IDS_TIP_FACILITY_XOR); | ||
247 | m_tooltip.AddTool(GetDlgItem(IDC_L3_XOR),IDS_TIP_FACILITY_XOR); | ||
248 | m_tooltip.AddTool(GetDlgItem(IDC_L4_XOR),IDS_TIP_FACILITY_XOR); | ||
249 | m_tooltip.AddTool(GetDlgItem(IDC_L5_XOR),IDS_TIP_FACILITY_XOR); | ||
250 | m_tooltip.AddTool(GetDlgItem(IDC_L6_XOR),IDS_TIP_FACILITY_XOR); | ||
251 | m_tooltip.AddTool(GetDlgItem(IDC_L7_XOR),IDS_TIP_FACILITY_XOR); | ||
252 | |||
253 | m_tooltip.AddTool(GetDlgItem(IDC_EMERG_ON),IDS_TIP_PRIORITY_ON); | ||
254 | m_tooltip.AddTool(GetDlgItem(IDC_ALERT_ON),IDS_TIP_PRIORITY_ON); | ||
255 | m_tooltip.AddTool(GetDlgItem(IDC_CRIT_ON),IDS_TIP_PRIORITY_ON); | ||
256 | m_tooltip.AddTool(GetDlgItem(IDC_ERR_ON),IDS_TIP_PRIORITY_ON); | ||
257 | m_tooltip.AddTool(GetDlgItem(IDC_WARN_ON),IDS_TIP_PRIORITY_ON); | ||
258 | m_tooltip.AddTool(GetDlgItem(IDC_NOTICE_ON),IDS_TIP_PRIORITY_ON); | ||
259 | m_tooltip.AddTool(GetDlgItem(IDC_INFO_ON),IDS_TIP_PRIORITY_ON); | ||
260 | m_tooltip.AddTool(GetDlgItem(IDC_DEBUG_ON),IDS_TIP_PRIORITY_ON); | ||
261 | |||
262 | m_tooltip.AddTool(GetDlgItem(IDC_EMERG_XOR),IDS_TIP_PRIORITY_XOR); | ||
263 | m_tooltip.AddTool(GetDlgItem(IDC_ALERT_XOR),IDS_TIP_PRIORITY_XOR); | ||
264 | m_tooltip.AddTool(GetDlgItem(IDC_CRIT_XOR),IDS_TIP_PRIORITY_XOR); | ||
265 | m_tooltip.AddTool(GetDlgItem(IDC_ERR_XOR),IDS_TIP_PRIORITY_XOR); | ||
266 | m_tooltip.AddTool(GetDlgItem(IDC_WARN_XOR),IDS_TIP_PRIORITY_XOR); | ||
267 | m_tooltip.AddTool(GetDlgItem(IDC_NOTICE_XOR),IDS_TIP_PRIORITY_XOR); | ||
268 | m_tooltip.AddTool(GetDlgItem(IDC_INFO_XOR),IDS_TIP_PRIORITY_XOR); | ||
269 | m_tooltip.AddTool(GetDlgItem(IDC_DEBUG_XOR),IDS_TIP_PRIORITY_XOR); | ||
270 | |||
271 | m_Daddy->AddTips(m_tooltip,this,PFROM,PTO); | ||
272 | |||
273 | return TRUE; // return TRUE unless you set the focus to a control | ||
274 | // EXCEPTION: OCX Property Pages should return FALSE | ||
275 | } | ||
276 | |||
277 | BOOL CLogPatternLocal::PreTranslateMessage(MSG* pMsg) | ||
278 | { | ||
279 | m_tooltip.RelayEvent(pMsg); | ||
280 | |||
281 | return CPropertyPage::PreTranslateMessage(pMsg); | ||
282 | } | ||