source: trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/ControlEvent.sbp@ 559

Last change on this file since 559 was 559, checked in by イグトランス (egtra), 16 years ago

UI_Sampleの追加。イベントのコメントアウト解除。Form.abからテスト部分を除去。Application.DoEventsを実装。MakeControlEventHandlerを静的メンバのイベント対応へ。WindowsExceptionの追加。

File size: 6.8 KB
Line 
1Public
2 Sub AddPaintDC(h As PaintDCHandler)
3 If IsNothing(paintDC) Then
4 paintDC = h
5 Else
6 paintDC += h
7 End If
8 End Sub
9 Sub RemovePaintDC(h As PaintDCHandler)
10 If Not IsNothing(paintDC) Then
11 paintDC -= h
12 End If
13 End Sub
14Protected
15 Sub OnPaintDC(e As PaintDCArgs)
16 If Not IsNothing(paintDC) Then
17 paintDC(This, e)
18 End If
19 End Sub
20Private
21 paintDC As PaintDCHandler
22
23Public
24 Sub AddClick(h As Handler)
25 If IsNothing(click) Then
26 click = h
27 Else
28 click += h
29 End If
30 End Sub
31 Sub RemoveClick(h As Handler)
32 If Not IsNothing(click) Then
33 click -= h
34 End If
35 End Sub
36Protected
37 Sub OnClick(e As Args)
38 If Not IsNothing(click) Then
39 click(This, e)
40 End If
41 End Sub
42Private
43 click As Handler
44
45Public
46 Sub AddDoubleClick(h As Handler)
47 If IsNothing(doubleClick) Then
48 doubleClick = h
49 Else
50 doubleClick += h
51 End If
52 End Sub
53 Sub RemoveDoubleClick(h As Handler)
54 If Not IsNothing(doubleClick) Then
55 doubleClick -= h
56 End If
57 End Sub
58Protected
59 Sub OnDoubleClick(e As Args)
60 If Not IsNothing(doubleClick) Then
61 doubleClick(This, e)
62 End If
63 End Sub
64Private
65 doubleClick As Handler
66
67Public
68 Sub AddMove(h As Handler)
69 If IsNothing(move) Then
70 move = h
71 Else
72 move += h
73 End If
74 End Sub
75 Sub RemoveMove(h As Handler)
76 If Not IsNothing(move) Then
77 move -= h
78 End If
79 End Sub
80Protected
81 Sub OnMove(e As Args)
82 If Not IsNothing(move) Then
83 move(This, e)
84 End If
85 End Sub
86Private
87 move As Handler
88
89Public
90 Sub AddMouseEnter(h As MouseHandler)
91 If IsNothing(mouseEnter) Then
92 mouseEnter = h
93 Else
94 mouseEnter += h
95 End If
96 End Sub
97 Sub RemoveMouseEnter(h As MouseHandler)
98 If Not IsNothing(mouseEnter) Then
99 mouseEnter -= h
100 End If
101 End Sub
102Protected
103 Sub OnMouseEnter(e As MouseArgs)
104 If Not IsNothing(mouseEnter) Then
105 mouseEnter(This, e)
106 End If
107 End Sub
108Private
109 mouseEnter As MouseHandler
110
111Public
112 Sub AddMouseMove(h As MouseHandler)
113 If IsNothing(mouseMove) Then
114 mouseMove = h
115 Else
116 mouseMove += h
117 End If
118 End Sub
119 Sub RemoveMouseMove(h As MouseHandler)
120 If Not IsNothing(mouseMove) Then
121 mouseMove -= h
122 End If
123 End Sub
124Protected
125 Sub OnMouseMove(e As MouseArgs)
126 If Not IsNothing(mouseMove) Then
127 mouseMove(This, e)
128 End If
129 End Sub
130Private
131 mouseMove As MouseHandler
132
133Public
134 Sub AddMouseHover(h As MouseHandler)
135 If IsNothing(mouseHover) Then
136 mouseHover = h
137 Else
138 mouseHover += h
139 End If
140 End Sub
141 Sub RemoveMouseHover(h As MouseHandler)
142 If Not IsNothing(mouseHover) Then
143 mouseHover -= h
144 End If
145 End Sub
146Protected
147 Sub OnMouseHover(e As MouseArgs)
148 If Not IsNothing(mouseHover) Then
149 mouseHover(This, e)
150 End If
151 End Sub
152Private
153 mouseHover As MouseHandler
154
155Public
156 Sub AddMouseLeave(h As MouseHandler)
157 If IsNothing(mouseLeave) Then
158 mouseLeave = h
159 Else
160 mouseLeave += h
161 End If
162 End Sub
163 Sub RemoveMouseLeave(h As MouseHandler)
164 If Not IsNothing(mouseLeave) Then
165 mouseLeave -= h
166 End If
167 End Sub
168Protected
169 Sub OnMouseLeave(e As MouseArgs)
170 If Not IsNothing(mouseLeave) Then
171 mouseLeave(This, e)
172 End If
173 End Sub
174Private
175 mouseLeave As MouseHandler
176
177Public
178 Sub AddMouseDown(h As MouseHandler)
179 If IsNothing(mouseDown) Then
180 mouseDown = h
181 Else
182 mouseDown += h
183 End If
184 End Sub
185 Sub RemoveMouseDown(h As MouseHandler)
186 If Not IsNothing(mouseDown) Then
187 mouseDown -= h
188 End If
189 End Sub
190Protected
191 Sub OnMouseDown(e As MouseArgs)
192 If Not IsNothing(mouseDown) Then
193 mouseDown(This, e)
194 End If
195 End Sub
196Private
197 mouseDown As MouseHandler
198
199Public
200 Sub AddMouseClick(h As MouseHandler)
201 If IsNothing(mouseClick) Then
202 mouseClick = h
203 Else
204 mouseClick += h
205 End If
206 End Sub
207 Sub RemoveMouseClick(h As MouseHandler)
208 If Not IsNothing(mouseClick) Then
209 mouseClick -= h
210 End If
211 End Sub
212Protected
213 Sub OnMouseClick(e As MouseArgs)
214 If Not IsNothing(mouseClick) Then
215 mouseClick(This, e)
216 End If
217 End Sub
218Private
219 mouseClick As MouseHandler
220
221Public
222 Sub AddMouseDoubleClick(h As MouseHandler)
223 If IsNothing(mouseDoubleClick) Then
224 mouseDoubleClick = h
225 Else
226 mouseDoubleClick += h
227 End If
228 End Sub
229 Sub RemoveMouseDoubleClick(h As MouseHandler)
230 If Not IsNothing(mouseDoubleClick) Then
231 mouseDoubleClick -= h
232 End If
233 End Sub
234Protected
235 Sub OnMouseDoubleClick(e As MouseArgs)
236 If Not IsNothing(mouseDoubleClick) Then
237 mouseDoubleClick(This, e)
238 End If
239 End Sub
240Private
241 mouseDoubleClick As MouseHandler
242
243Public
244 Sub AddMouseUp(h As MouseHandler)
245 If IsNothing(mouseUp) Then
246 mouseUp = h
247 Else
248 mouseUp += h
249 End If
250 End Sub
251 Sub RemoveMouseUp(h As MouseHandler)
252 If Not IsNothing(mouseUp) Then
253 mouseUp -= h
254 End If
255 End Sub
256Protected
257 Sub OnMouseUp(e As MouseArgs)
258 If Not IsNothing(mouseUp) Then
259 mouseUp(This, e)
260 End If
261 End Sub
262Private
263 mouseUp As MouseHandler
264
265Public
266 Sub AddKeyDown(h As KeyHandler)
267 If IsNothing(keyDown) Then
268 keyDown = h
269 Else
270 keyDown += h
271 End If
272 End Sub
273 Sub RemoveKeyDown(h As KeyHandler)
274 If Not IsNothing(keyDown) Then
275 keyDown -= h
276 End If
277 End Sub
278Protected
279 Sub OnKeyDown(e As KeyArgs)
280 If Not IsNothing(keyDown) Then
281 keyDown(This, e)
282 End If
283 End Sub
284Private
285 keyDown As KeyHandler
286
287Public
288 Sub AddKeyUp(h As KeyHandler)
289 If IsNothing(keyUp) Then
290 keyUp = h
291 Else
292 keyUp += h
293 End If
294 End Sub
295 Sub RemoveKeyUp(h As KeyHandler)
296 If Not IsNothing(keyUp) Then
297 keyUp -= h
298 End If
299 End Sub
300Protected
301 Sub OnKeyUp(e As KeyArgs)
302 If Not IsNothing(keyUp) Then
303 keyUp(This, e)
304 End If
305 End Sub
306Private
307 keyUp As KeyHandler
308
309Public
310 Sub AddKeyPress(h As KeyPressHandler)
311 If IsNothing(keyPress) Then
312 keyPress = h
313 Else
314 keyPress += h
315 End If
316 End Sub
317 Sub RemoveKeyPress(h As KeyPressHandler)
318 If Not IsNothing(keyPress) Then
319 keyPress -= h
320 End If
321 End Sub
322Protected
323 Sub OnKeyPress(e As KeyPressArgs)
324 If Not IsNothing(keyPress) Then
325 keyPress(This, e)
326 End If
327 End Sub
328Private
329 keyPress As KeyPressHandler
330
331Public
332 Sub AddCreate(h As CreateHandler)
333 If IsNothing(create) Then
334 create = h
335 Else
336 create += h
337 End If
338 End Sub
339 Sub RemoveCreate(h As CreateHandler)
340 If Not IsNothing(create) Then
341 create -= h
342 End If
343 End Sub
344Protected
345 Sub OnCreate(e As CreateArgs)
346 If Not IsNothing(create) Then
347 create(This, e)
348 End If
349 End Sub
350Private
351 create As CreateHandler
352
353Public
354 Sub AddDestroy(h As Handler)
355 If IsNothing(destroy) Then
356 destroy = h
357 Else
358 destroy += h
359 End If
360 End Sub
361 Sub RemoveDestroy(h As Handler)
362 If Not IsNothing(destroy) Then
363 destroy -= h
364 End If
365 End Sub
366Protected
367 Sub OnDestroy(e As Args)
368 If Not IsNothing(destroy) Then
369 destroy(This, e)
370 End If
371 End Sub
372Private
373 destroy As Handler
374
Note: See TracBrowser for help on using the repository browser.