1
2
3 type vloc
4 {
5 int left
6 int top
7 uint width
8 uint height
9 }
10
11 define <export>{
12 e_winmsg = 1
13 e_winntf = 2
14 e_poschanging = 3
15 e_mouse = 4
16 e_key = 5
17 e_paint = 6
18 // e_ownersize = 7
19 e_poschanged = 8
20
21 e_create = 10
22 e_insert = 11
23 e_remove = 12
24 e_focus = 13
25 e_update = 14
26 }
27
28
29
30 type evparEvent
31 {
32 uint sender
33 uint eventtypeid
34 uint code
35 }
36
37 type evEvent
38 {
39 uint obj
40 uint id
41 uint eventtypeid
42 }
43
44 /*type descrevent {
45 str nameevent
46 str namemethod
47 }*/
48
49 method evEvent evEvent.init
50 {
51 this.eventtypeid = evparEvent
52 return this
53 }
54
55
56 define <export>{
57 evmMove = 1
58 evmLDown = 2
59 evmLDbl = 3
60 evmLUp = 4
61 evmRDown = 5
62 evmRDbl = 6
63 evmRUp = 7
64 evmMDown = 8
65 evmMDbl = 9
66 evmMUp = 10
67 evmWhellUp = 11
68 evmWhellDown = 12
69 evmLeave = 13
70 evmActivate = 14
71
72 evkDown = 1
73 evkPress = 2
74 evkUp = 3
75 //evmOn = 13
76 //evmOut = 14
77
78 mstAlt = 0x001
79 mstCtrl = 0x002
80 mstShift = 0x004
81 mstWin = 0x010
82 mstLBtn = 0x100
83 mstRBtn = 0x200
84 mstMBtn = 0x400
85 }
86
87 type eventwnd <inherit = evparEvent>
88 {
89 uint wnd
90 uint message
91 uint wpar
92 uint lpar
93 }
94
95 type oneventwnd <inherit=evEvent> :
96
97 method oneventwnd oneventwnd.init
98 {
99 this.eventtypeid = eventwnd
100 return this
101 }
102
103
104 type evparMouse <inherit = evparEvent>
105 {
106 uint evmtype
107 uint mstate
108 int x
109 int y
110 uint ret
111 }
112
113 type evMouse <inherit=evEvent> :
114
115 method evMouse evMouse.init
116 {
117 this.eventtypeid = evparMouse
118 return this
119 }
120
121
122 type evparKey <inherit = evparEvent>
123 {
124 uint evktype
125 uint key
126 uint mstate
127
128 }
129
130 type evKey <inherit=evEvent> :
131
132 method evKey evKey.init
133 {
134 this.eventtypeid = evparKey
135 return this
136 }
137
138
139 type eventpos <inherit = evparEvent>
140 {
141 vloc loc
142 uint move
143 uint par
144 }
145
146 type oneventpos <inherit=evEvent> :
147
148 method oneventpos oneventpos.init
149 {
150 this.eventtypeid = eventpos
151 return this
152 }
153
154 type evparValUstr <inherit=evparEvent>
155 {
156 ustr val
157 }
158
159 type evValUstr <inherit=evEvent> :
160
161 method evValUstr evValUstr.init
162 {
163 this.eventtypeid = evValUstr
164 return this
165 }
166
167 type evparValUint <inherit=evparEvent>
168 {
169 uint val
170 }
171
172 type evValUint <inherit=evEvent> :
173
174 method evValUint evValUint.init
175 {
176 this.eventtypeid = evparValUint
177 return this
178 }
179
180 type evparValColl <inherit=evparEvent>
181 {
182 collection val
183 }
184
185 type evValColl <inherit=evEvent> :
186
187 method evValColl evValColl.init
188 {
189 this.eventtypeid = evparValColl
190 return this
191 }
192
193 type evparQuery <inherit=evparValUint>
194 {
195 uint flgCancel
196 }
197
198 type evQuery <inherit=evValUint>
199 {
200 }
201
202 method evQuery evQuery.init
203 {
204 this.eventtypeid = evparQuery
205 return this
206 }
207
208
209 method uint evEvent.run( evparEvent ev )
210 {
211 if this.id
212 {
213 ev.eventtypeid = this.eventtypeid
214
215 return this.id->func( this.obj, ev )
216 }
217 return 0
218 }
219
220
221 method uint evEvent.run()
222 {
223 if this.id
224 {
225 evparEvent ev
226
227 ev.eventtypeid = this.eventtypeid
228 //print( "run=\(this.obj) \n" )
229 return this.id->func( this.obj, ev )
230 }
231 return 0
232 }
233
234
235
236
237 method uint evEvent.is()
238 {
239 return this.id
240 }
241 /*
242 method evEvent.set( any obj, uint funcid )
243 {
244 this.id = funcid
245 this.obj = obj
246 }*/
247
248 method uint evEvent.Run( /*any Sender,*/ evparEvent ev )
249 {
250 if this.id
251 {
252 ev->evparEvent.eventtypeid = this.eventtypeid
253 return this.id->func( this.obj, /*Sender,*/ ev )
254 }
255 return 0
256 }
257
258 method uint evEvent.Run( /*any Sender,*/ evparEvent ev, vComp sender )
259 {
260 if this.id
261 {
262 ev.eventtypeid = this.eventtypeid
263 ev.sender = &sender
264 return this.id->func( this.obj, /*Sender,*/ ev )
265 }
266 return 0
267 }
268
269 method uint evEvent.Run( vComp sender )
270 {
271 if this.id
272 {
273 evparEvent ev
274 ev.sender = &sender
275 ev.eventtypeid = this.eventtypeid
276 //print( "run=\(this.obj) \(&sender)\n" )
277 return this.id->func( this.obj, ev )
278 }
279 return 0
280 }
281
282 method evEvent.Set( any obj, uint funcid )
283 {
284 this.id = funcid
285 this.obj = obj
286 }
287
288 operator evEvent = ( evEvent dest, evEvent src )
289 {
290 dest.obj = src.obj
291 dest.id = src.id
292 return dest
293 }
294
295
296 type evparBeforeMove <inherit=evparEvent>
297 {
298 uint CurItem
299 uint DestItem
300 uint Flag
301 uint flgCancel
302 }
303 type evBeforeMove <inherit=evEvent> :
304
305 method evBeforeMove evBeforeMove.init
306 {
307 this.eventtypeid = evparBeforeMove
308 return this
309 }
310
311 type evparAfterMove <inherit=evparEvent>
312 {
313 uint CurItem
314 uint DestItem
315 uint Flag
316 }
317
318 type evAfterMove <inherit=evEvent> :
319
320 method evAfterMove evAfterMove.init
321 {
322 this.eventtypeid = evparAfterMove
323 return this
324 }