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
RevLine 
[473]1Public
[551]2 Sub AddPaintDC(h As PaintDCHandler)
[473]3 If IsNothing(paintDC) Then
[542]4 paintDC = h
5 Else
6 paintDC += h
[473]7 End If
8 End Sub
[551]9 Sub RemovePaintDC(h As PaintDCHandler)
[473]10 If Not IsNothing(paintDC) Then
11 paintDC -= h
12 End If
13 End Sub
[551]14Protected
15 Sub OnPaintDC(e As PaintDCArgs)
[473]16 If Not IsNothing(paintDC) Then
17 paintDC(This, e)
18 End If
19 End Sub
20Private
[551]21 paintDC As PaintDCHandler
[473]22
23Public
[551]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)
[542]91 If IsNothing(mouseEnter) Then
92 mouseEnter = h
93 Else
94 mouseEnter += h
95 End If
96 End Sub
[551]97 Sub RemoveMouseEnter(h As MouseHandler)
[542]98 If Not IsNothing(mouseEnter) Then
99 mouseEnter -= h
100 End If
101 End Sub
[551]102Protected
103 Sub OnMouseEnter(e As MouseArgs)
[542]104 If Not IsNothing(mouseEnter) Then
105 mouseEnter(This, e)
106 End If
107 End Sub
108Private
[551]109 mouseEnter As MouseHandler
[542]110
111Public
[551]112 Sub AddMouseMove(h As MouseHandler)
[542]113 If IsNothing(mouseMove) Then
114 mouseMove = h
115 Else
116 mouseMove += h
117 End If
118 End Sub
[551]119 Sub RemoveMouseMove(h As MouseHandler)
[542]120 If Not IsNothing(mouseMove) Then
121 mouseMove -= h
122 End If
123 End Sub
[551]124Protected
125 Sub OnMouseMove(e As MouseArgs)
[542]126 If Not IsNothing(mouseMove) Then
127 mouseMove(This, e)
128 End If
129 End Sub
130Private
[551]131 mouseMove As MouseHandler
[542]132
133Public
[551]134 Sub AddMouseHover(h As MouseHandler)
[542]135 If IsNothing(mouseHover) Then
136 mouseHover = h
137 Else
138 mouseHover += h
139 End If
140 End Sub
[551]141 Sub RemoveMouseHover(h As MouseHandler)
[542]142 If Not IsNothing(mouseHover) Then
143 mouseHover -= h
144 End If
145 End Sub
[551]146Protected
147 Sub OnMouseHover(e As MouseArgs)
[542]148 If Not IsNothing(mouseHover) Then
149 mouseHover(This, e)
150 End If
151 End Sub
152Private
[551]153 mouseHover As MouseHandler
[542]154
155Public
[551]156 Sub AddMouseLeave(h As MouseHandler)
[542]157 If IsNothing(mouseLeave) Then
158 mouseLeave = h
159 Else
160 mouseLeave += h
161 End If
162 End Sub
[551]163 Sub RemoveMouseLeave(h As MouseHandler)
[542]164 If Not IsNothing(mouseLeave) Then
165 mouseLeave -= h
166 End If
167 End Sub
[551]168Protected
169 Sub OnMouseLeave(e As MouseArgs)
[542]170 If Not IsNothing(mouseLeave) Then
171 mouseLeave(This, e)
172 End If
173 End Sub
174Private
[551]175 mouseLeave As MouseHandler
[542]176
177Public
[551]178 Sub AddMouseDown(h As MouseHandler)
[473]179 If IsNothing(mouseDown) Then
[542]180 mouseDown = h
181 Else
182 mouseDown += h
[473]183 End If
184 End Sub
[551]185 Sub RemoveMouseDown(h As MouseHandler)
[473]186 If Not IsNothing(mouseDown) Then
187 mouseDown -= h
188 End If
189 End Sub
[551]190Protected
191 Sub OnMouseDown(e As MouseArgs)
[473]192 If Not IsNothing(mouseDown) Then
193 mouseDown(This, e)
194 End If
195 End Sub
196Private
[551]197 mouseDown As MouseHandler
[473]198
199Public
[551]200 Sub AddMouseClick(h As MouseHandler)
[542]201 If IsNothing(mouseClick) Then
202 mouseClick = h
203 Else
204 mouseClick += h
205 End If
206 End Sub
[551]207 Sub RemoveMouseClick(h As MouseHandler)
[542]208 If Not IsNothing(mouseClick) Then
209 mouseClick -= h
210 End If
211 End Sub
[551]212Protected
213 Sub OnMouseClick(e As MouseArgs)
[542]214 If Not IsNothing(mouseClick) Then
215 mouseClick(This, e)
216 End If
217 End Sub
218Private
[551]219 mouseClick As MouseHandler
[542]220
221Public
[551]222 Sub AddMouseDoubleClick(h As MouseHandler)
[542]223 If IsNothing(mouseDoubleClick) Then
224 mouseDoubleClick = h
225 Else
226 mouseDoubleClick += h
227 End If
228 End Sub
[551]229 Sub RemoveMouseDoubleClick(h As MouseHandler)
[542]230 If Not IsNothing(mouseDoubleClick) Then
231 mouseDoubleClick -= h
232 End If
233 End Sub
[551]234Protected
235 Sub OnMouseDoubleClick(e As MouseArgs)
[542]236 If Not IsNothing(mouseDoubleClick) Then
237 mouseDoubleClick(This, e)
238 End If
239 End Sub
240Private
[551]241 mouseDoubleClick As MouseHandler
[542]242
243Public
[551]244 Sub AddMouseUp(h As MouseHandler)
[473]245 If IsNothing(mouseUp) Then
[542]246 mouseUp = h
247 Else
248 mouseUp += h
[473]249 End If
250 End Sub
[551]251 Sub RemoveMouseUp(h As MouseHandler)
[473]252 If Not IsNothing(mouseUp) Then
253 mouseUp -= h
254 End If
255 End Sub
[551]256Protected
257 Sub OnMouseUp(e As MouseArgs)
[473]258 If Not IsNothing(mouseUp) Then
259 mouseUp(This, e)
260 End If
261 End Sub
262Private
[551]263 mouseUp As MouseHandler
[473]264
[542]265Public
[551]266 Sub AddKeyDown(h As KeyHandler)
[542]267 If IsNothing(keyDown) Then
268 keyDown = h
269 Else
270 keyDown += h
271 End If
272 End Sub
[551]273 Sub RemoveKeyDown(h As KeyHandler)
[542]274 If Not IsNothing(keyDown) Then
275 keyDown -= h
276 End If
277 End Sub
[551]278Protected
279 Sub OnKeyDown(e As KeyArgs)
[542]280 If Not IsNothing(keyDown) Then
281 keyDown(This, e)
282 End If
283 End Sub
284Private
[551]285 keyDown As KeyHandler
[542]286
287Public
[551]288 Sub AddKeyUp(h As KeyHandler)
[542]289 If IsNothing(keyUp) Then
290 keyUp = h
291 Else
292 keyUp += h
293 End If
294 End Sub
[551]295 Sub RemoveKeyUp(h As KeyHandler)
[542]296 If Not IsNothing(keyUp) Then
297 keyUp -= h
298 End If
299 End Sub
[551]300Protected
301 Sub OnKeyUp(e As KeyArgs)
[542]302 If Not IsNothing(keyUp) Then
303 keyUp(This, e)
304 End If
305 End Sub
306Private
[551]307 keyUp As KeyHandler
[542]308
309Public
[551]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
[559]330
[551]331Public
332 Sub AddCreate(h As CreateHandler)
[542]333 If IsNothing(create) Then
334 create = h
335 Else
336 create += h
337 End If
338 End Sub
[551]339 Sub RemoveCreate(h As CreateHandler)
[542]340 If Not IsNothing(create) Then
341 create -= h
342 End If
343 End Sub
[551]344Protected
345 Sub OnCreate(e As CreateArgs)
[542]346 If Not IsNothing(create) Then
347 create(This, e)
348 End If
349 End Sub
350Private
[551]351 create As CreateHandler
[544]352
[551]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
[559]374
Note: See TracBrowser for help on using the repository browser.