/
callbackevent.go
807 lines (696 loc) · 25.1 KB
/
callbackevent.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
//----------------------------------------
//
// Copyright © ying32. All Rights Reserved.
//
// Licensed under Apache License 2.0
//
//----------------------------------------
package vcl
import (
"unsafe"
. "github.com/ying32/govcl/vcl/api"
. "github.com/ying32/govcl/vcl/types"
)
// 外部回调事件
// 参数一:函数地址
// 参数二:获取参数值的函数
// 返回值:如果为true则终止事件传递,如果为false则继续向后转发事件。
type TExtEventCallback func(fn interface{}, getVal func(idx int) uintptr) bool
// 外部扩展的事件回调,先不管重复注册的问题
var extEventCallback []TExtEventCallback
// 注册外部扩展回调事件
//
// Registering external extension callback events.
func RegisterExtEventCallback(callback TExtEventCallback) {
extEventCallback = append(extEventCallback, callback)
}
// getParam 从指定索引和地址获取事件中的参数
// 不再使用Delphi导出的了,直接在这处理
func getParamOf(index int, ptr uintptr) uintptr {
return *(*uintptr)(unsafe.Pointer(ptr + uintptr(index)*unsafe.Sizeof(ptr)))
}
// 回调过程
func eventCallbackProc(f uintptr, args uintptr, argcount int) uintptr {
v, ok := EventCallbackOf(f)
if ok {
getVal := func(i int) uintptr {
return getParamOf(i, args)
}
// 调用外部注册的事件回调过程
for n := 0; n < len(extEventCallback); n++ {
// 外部返回True则不继续下去了
if extEventCallback[n](v, getVal) {
return 0
}
}
switch v.(type) {
// func(sender IObject)
case TNotifyEvent:
v.(TNotifyEvent)(
AsForm(getVal(0)))
// func(sender IObject, button TUDBtnType)
case TUDClickEvent:
v.(TUDClickEvent)(
AsObject(getVal(0)),
TUDBtnType(getVal(1)))
// func(sender IObject, item *TListItem, change int32)
case TLVChangeEvent:
v.(TLVChangeEvent)(
AsObject(getVal(0)),
AsListItem(getVal(1)),
TItemChange(getVal(2)))
// func(sender IObject, action *TCloseAction) // Action *uintptr
case TCloseEvent:
v.(TCloseEvent)(
AsObject(getVal(0)),
(*TCloseAction)(unsafe.Pointer(getVal(1))))
// func(sender IObject, canClose *bool) //CanClose *uintptr
case TCloseQueryEvent:
v.(TCloseQueryEvent)(
AsObject(getVal(0)),
(*bool)(unsafe.Pointer(getVal(1))))
// func(sender IObject, source *TMenuItem, rebuild bool)
case TMenuChangeEvent:
v.(TMenuChangeEvent)(
AsObject(getVal(0)),
AsMenuItem(getVal(1)),
DBoolToGoBool(getVal(2)))
// func(sender IObject, node *TreeNode)
case TTVChangedEvent:
v.(TTVChangedEvent)(
AsObject(getVal(0)),
AsTreeNode(getVal(1)))
// func(sender IObject, link string, linkType TSysLinkType) // TSysLinkType
case TSysLinkEvent:
v.(TSysLinkEvent)(
AsObject(getVal(0)),
DStrToGoStr(getVal(1)),
TSysLinkType(getVal(2)))
// func(sender, e IObject)
case TExceptionEvent:
v.(TExceptionEvent)(
AsObject(getVal(0)),
AsException(getVal(1)))
// func(sender IObject, key *Char, shift TShiftState)
case TKeyEvent:
v.(TKeyEvent)(
AsObject(getVal(0)),
(*Char)(unsafe.Pointer(getVal(1))),
TShiftState(getVal(2)))
// func(sender IObject, key *Char)
case TKeyPressEvent:
v.(TKeyPressEvent)(
AsObject(getVal(0)),
(*Char)(unsafe.Pointer(getVal(1))))
// func(sender IObject, button TMouseButton, shift TShiftState, x, y int32)
case TMouseEvent:
v.(TMouseEvent)(
AsObject(getVal(0)),
TMouseButton(getVal(1)),
TShiftState(getVal(2)),
int32(getVal(3)),
int32(getVal(4)))
// func(sender IObject, shift TShiftState, x, y int32)
case TMouseMoveEvent:
v.(TMouseMoveEvent)(
AsObject(getVal(0)),
TShiftState(getVal(1)),
int32(getVal(2)),
int32(getVal(3)))
// func(sender IObject, shift TShiftState, wheelDelta, x, y int32, handled *bool)
case TMouseWheelEvent:
v.(TMouseWheelEvent)(
AsObject(getVal(0)),
TShiftState(getVal(1)),
int32(getVal(2)),
int32(getVal(3)),
int32(getVal(4)),
(*bool)(unsafe.Pointer(getVal(5))))
// func(control IWinControl, index int32, aRect TRect, state TOwnerDrawState)
case TDrawItemEvent:
v.(TDrawItemEvent)(
AsWinControl(getVal(0)),
int32(getVal(1)),
*(*TRect)(unsafe.Pointer(getVal(2))),
TOwnerDrawState(getVal(3)))
// func(sender IObject, aCanvas *TCanvas, aRect TRect, selected bool)
case TMenuDrawItemEvent:
v.(TMenuDrawItemEvent)(
AsObject(getVal(0)),
AsCanvas(getVal(1)),
*(*TRect)(unsafe.Pointer(getVal(2))),
DBoolToGoBool(getVal(3)))
// type TLVNotifyEvent func(sender IObject, item *TListItem)
case TLVNotifyEvent:
v.(TLVNotifyEvent)(
AsObject(getVal(0)),
AsListItem(getVal(1)))
// type TLVColumnClickEvent func(sender IObject, column *TListColumn)
case TLVColumnClickEvent:
v.(TLVColumnClickEvent)(
AsObject(getVal(0)),
AsListColumn(getVal(1)))
// type TLVColumnRClickEvent func(sender IObject, column *TListColumn, point TPoint)
case TLVColumnRClickEvent:
v.(TLVColumnRClickEvent)(
AsObject(getVal(0)),
AsListColumn(getVal(1)),
TPoint{X: int32(getVal(2)), Y: int32(getVal(3))})
// type TLVSelectItemEvent func(sender IObject, item *TListItem, selected bool)
case TLVSelectItemEvent:
v.(TLVSelectItemEvent)(
AsObject(getVal(0)),
AsListItem(getVal(1)),
DBoolToGoBool(getVal(2)))
// type TLVCheckedItemEvent func(sender IObject, item *TListItem)
case TLVCheckedItemEvent:
v.(TLVCheckedItemEvent)(
AsObject(getVal(0)),
AsListItem(getVal(1)))
// type TTabGetImageEvent func(sender IObject, tabIndex int32, imageIndex *int32)
case TTabGetImageEvent:
v.(TTabGetImageEvent)(
AsObject(getVal(0)),
int32(getVal(1)),
(*int32)(unsafe.Pointer(getVal(2))))
// type TTVExpandedEvent func(sender IObject, node *TTreeNode)
case TTVExpandedEvent:
v.(TTVExpandedEvent)(
AsObject(getVal(0)),
AsTreeNode(getVal(1)))
//type TLVCompareEvent func(sender IObject, item1, item2 *TListItem, data int32, compare *int32)
case TLVCompareEvent:
v.(TLVCompareEvent)(
AsObject(getVal(0)),
AsListItem(getVal(1)),
AsListItem(getVal(2)),
int32(getVal(3)),
(*int32)(unsafe.Pointer(getVal(4))))
//type TTVCompareEvent func(sender IObject, node1, node2 *TTreeNode, data int32, compare *int32)
case TTVCompareEvent:
v.(TTVCompareEvent)(
AsObject(getVal(0)),
AsTreeNode(getVal(1)),
AsTreeNode(getVal(2)),
int32(getVal(3)),
(*int32)(unsafe.Pointer(getVal(4))))
//type TTVAdvancedCustomDrawEvent func(sender *TTreeView, aRect TRect, stage TCustomDrawStage, defaultDraw *bool)
case TTVAdvancedCustomDrawEvent:
v.(TTVAdvancedCustomDrawEvent)(
AsTreeView(getVal(0)),
*(*TRect)(unsafe.Pointer(getVal(1))),
TCustomDrawStage(getVal(2)),
(*bool)(unsafe.Pointer(getVal(3))))
//type TTVAdvancedCustomDrawItemEvent func(sender *TTreeView, node *TTreeNode, state TCustomDrawState, stage TCustomDrawStage, paintImages, defaultDraw *bool)
case TTVAdvancedCustomDrawItemEvent:
v.(TTVAdvancedCustomDrawItemEvent)(
AsTreeView(getVal(0)),
AsTreeNode(getVal(1)),
TCustomDrawState(getVal(2)),
TCustomDrawStage(getVal(3)),
(*bool)(unsafe.Pointer(getVal(4))),
(*bool)(unsafe.Pointer(getVal(5))))
//---------------------------------------
//type TLVAdvancedCustomDrawEvent func(sender *TListView, aRect TRect, stage TCustomDrawStage, defaultDraw *bool)
case TLVAdvancedCustomDrawEvent:
v.(TLVAdvancedCustomDrawEvent)(
AsListView(getVal(0)),
*(*TRect)(unsafe.Pointer(getVal(1))),
TCustomDrawStage(getVal(2)),
(*bool)(unsafe.Pointer(getVal(3))))
//type TLVAdvancedCustomDrawItemEvent func(sender *TListView, item *TListItem, state TCustomDrawState, Stage TCustomDrawStage, defaultDraw *bool)
case TLVAdvancedCustomDrawItemEvent:
v.(TLVAdvancedCustomDrawItemEvent)(
AsListView(getVal(0)),
AsListItem(getVal(1)),
TCustomDrawState(getVal(2)),
TCustomDrawStage(getVal(3)),
(*bool)(unsafe.Pointer(getVal(4))))
//type TLVAdvancedCustomDrawSubItemEvent func(sender *TListView, item *TListItem, subItem int32, state TCustomDrawState, stage TCustomDrawStage, defaultDraw *bool)
case TLVAdvancedCustomDrawSubItemEvent:
v.(TLVAdvancedCustomDrawSubItemEvent)(
AsListView(getVal(0)),
AsListItem(getVal(1)),
int32(getVal(2)),
TCustomDrawState(getVal(3)),
TCustomDrawStage(getVal(4)),
(*bool)(unsafe.Pointer(getVal(5))))
//-----------------------------
//type TTBAdvancedCustomDrawEvent func(sender *TToolBar, aRect TRect, stage TCustomDrawStage, defaultDraw *bool)
case TTBAdvancedCustomDrawEvent:
v.(TTBAdvancedCustomDrawEvent)(
AsToolBar(getVal(0)),
*(*TRect)(unsafe.Pointer(getVal(1))),
TCustomDrawStage(getVal(2)),
(*bool)(unsafe.Pointer(getVal(3))))
//type TTBAdvancedCustomDrawBtnEvent func(sender *TToolBar, button *TToolButton, state TCustomDrawState, stage TCustomDrawStage, flags *TTBCustomDrawFlags, defaultDraw *bool)
case TTBAdvancedCustomDrawBtnEvent:
v.(TTBAdvancedCustomDrawBtnEvent)(
AsToolBar(getVal(0)),
AsToolButton(getVal(1)),
TCustomDrawState(getVal(2)),
TCustomDrawStage(getVal(3)),
(*TTBCustomDrawFlags)(unsafe.Pointer(getVal(4))),
(*bool)(unsafe.Pointer(getVal(5))))
// TDropFilesEvent
case TDropFilesEvent:
nLen := int(getVal(2))
tempArr := make([]string, nLen)
p := getVal(1)
for i := 0; i < nLen; i++ {
tempArr[i] = DGetStringArrOf(p, i)
}
v.(TDropFilesEvent)(
AsObject(getVal(0)),
tempArr)
// TConstrainedResizeEvent
case TConstrainedResizeEvent:
v.(TConstrainedResizeEvent)(
AsObject(getVal(0)),
(*int32)(unsafe.Pointer(getVal(1))),
(*int32)(unsafe.Pointer(getVal(2))),
(*int32)(unsafe.Pointer(getVal(3))),
(*int32)(unsafe.Pointer(getVal(4))))
// func(command uint16, data THelpEventData, callhelp *bool) bool
case THelpEvent:
v.(THelpEvent)(
uint16(getVal(0)),
THelpEventData(getVal(1)),
(*bool)(unsafe.Pointer(getVal(2))),
(*bool)(unsafe.Pointer(getVal(3))))
// func(msg *TWMKey, handled *bool)
case TShortCutEvent:
v.(TShortCutEvent)(
(*TWMKey)(unsafe.Pointer(getVal(0))),
(*bool)(unsafe.Pointer(getVal(1))))
// func(sender IObject, mousePos TPoint, handled *bool)
case TContextPopupEvent:
v.(TContextPopupEvent)(
AsObject(getVal(0)),
*(*TPoint)(unsafe.Pointer(getVal(1))),
(*bool)(unsafe.Pointer(getVal(2))))
// func(sender, source IObject, x, y int32, state TDragState, accept *bool)
case TDragOverEvent:
v.(TDragOverEvent)(
AsObject(getVal(0)),
AsObject(getVal(1)),
int32(getVal(2)),
int32(getVal(3)),
TDragState(getVal(4)),
(*bool)(unsafe.Pointer(getVal(5))))
//func(sender, source IObject, x, y int32)
case TDragDropEvent:
v.(TDragDropEvent)(
AsObject(getVal(0)),
AsObject(getVal(1)),
int32(getVal(2)),
int32(getVal(3)))
//func(sender IObject, dragObject *TDragObject)
case TStartDragEvent:
v.(TStartDragEvent)(
AsObject(getVal(0)),
AsDragObject(getVal(1)))
//func(sender, target IObject, x, y int32)
case TEndDragEvent:
v.(TEndDragEvent)(
AsObject(getVal(0)),
AsObject(getVal(1)),
int32(getVal(2)),
int32(getVal(3)))
// func(sender IObject, source *TDragDockObject, x, y int32)
case TDockDropEvent:
v.(TDockDropEvent)(
AsObject(getVal(0)),
AsDragDockObject(getVal(1)),
int32(getVal(2)),
int32(getVal(3)))
//func(sender IObject, source *TDragDockObject, x, y int32, state TDragState, accept *bool)
case TDockOverEvent:
v.(TDockOverEvent)(
AsObject(getVal(0)),
AsDragDockObject(getVal(1)),
int32(getVal(2)),
int32(getVal(3)),
TDragState(getVal(4)),
(*bool)(unsafe.Pointer(getVal(5))))
//func(sender IObject, client *TControl, newTarget *TControl, allow *bool)
case TUnDockEvent:
v.(TUnDockEvent)(
AsObject(getVal(0)),
AsControl(getVal(1)),
AsControl(getVal(2)),
(*bool)(unsafe.Pointer(getVal(3))))
//func(sender IObject, dragObject *TDragDockObject)
case TStartDockEvent:
v.(TStartDockEvent)(
AsObject(getVal(0)),
AsDragDockObject(getVal(1)))
//func(sender IObject, dockClient *TControl, influenceRect *TRect, mousePos TPoint, canDock *bool)
case TGetSiteInfoEvent:
v.(TGetSiteInfoEvent)(
AsObject(getVal(0)),
AsControl(getVal(1)),
(*TRect)(unsafe.Pointer(getVal(2))),
*(*TPoint)(unsafe.Pointer(getVal(3))),
(*bool)(unsafe.Pointer(getVal(4))))
//func(sender IObject, shift TShiftState, mousePos TPoint, handled *bool)
case TMouseWheelUpDownEvent:
v.(TMouseWheelUpDownEvent)(
AsObject(getVal(0)),
TShiftState(getVal(1)),
*(*TPoint)(unsafe.Pointer(getVal(2))),
(*bool)(unsafe.Pointer(getVal(3))))
// ---- grid
//type TMovedEvent func(sender IObject, isColumn bool, sIndex, tIndex int32)
case TMovedEvent:
v.(TMovedEvent)(
AsObject(getVal(0)),
DBoolToGoBool(getVal(1)),
int32(getVal(2)),
int32(getVal(3)))
//type TDrawCellEvent func(sender IObject, aCol, aRow int32, aRect TRect, state TGridDrawState)
case TDrawCellEvent:
v.(TDrawCellEvent)(
AsObject(getVal(0)),
int32(getVal(1)),
int32(getVal(2)),
*(*TRect)(unsafe.Pointer(getVal(3))),
TGridDrawState(getVal(4)))
//type TFixedCellClickEvent func(sender IObject, aCol, aRow int32)
case TFixedCellClickEvent:
v.(TFixedCellClickEvent)(
AsObject(getVal(0)),
int32(getVal(1)),
int32(getVal(2)))
//type TGetEditEvent func(sender IObject, aCol, aRow int32, value *string)
case TGetEditEvent:
str := DStrToGoStr(*(*uintptr)(unsafe.Pointer(getVal(3))))
v.(TGetEditEvent)(
AsObject(getVal(0)),
int32(getVal(1)),
int32(getVal(2)),
&str)
*(*uintptr)(unsafe.Pointer(getVal(3))) = GoStrToDStr(str)
//type TSelectCellEvent func(sender IObject, aCol, aRow int32, canSelect *bool)
case TSelectCellEvent:
v.(TSelectCellEvent)(
AsObject(getVal(0)),
int32(getVal(1)),
int32(getVal(2)),
(*bool)(unsafe.Pointer(getVal(3))))
//type TSetEditEvent func(sender IObject, aCol, aRow int32, value string)
case TSetEditEvent:
v.(TSetEditEvent)(
AsObject(getVal(0)),
int32(getVal(1)),
int32(getVal(2)),
DStrToGoStr(getVal(3)))
// ---- headercontrol
//type TDrawSectionEvent func(headerControl *THeaderControl, section *THeaderSection, aRect TRect, pressed bool)
case TDrawSectionEvent:
v.(TDrawSectionEvent)(
AsHeaderControl(getVal(0)),
AsHeaderSection(getVal(1)),
*(*TRect)(unsafe.Pointer(getVal(2))),
getVal(3) != 0)
//type TSectionNotifyEvent func(headerControl *THeaderControl, section *THeaderSection)
case TSectionNotifyEvent:
v.(TSectionNotifyEvent)(
AsHeaderControl(getVal(0)),
AsHeaderSection(getVal(1)))
//type TSectionTrackEvent func(headerControl *THeaderControl, section *THeaderSection, width int32, state TSectionTrackState)
case TSectionTrackEvent:
v.(TSectionTrackEvent)(
AsHeaderControl(getVal(0)),
AsHeaderSection(getVal(1)),
int32(getVal(2)),
TSectionTrackState(getVal(3)))
//type TSectionDragEvent func(sender IObject, fromSection, toSection *THeaderSection, allowDrag *bool)
case TSectionDragEvent:
v.(TSectionDragEvent)(
AsObject(getVal(0)),
AsHeaderSection(getVal(1)),
AsHeaderSection(getVal(2)),
(*bool)(unsafe.Pointer(getVal(3))))
//type TCustomSectionNotifyEvent func(headerControl *THeaderControl, section *THeaderSection)
case TCustomSectionNotifyEvent:
v.(TCustomSectionNotifyEvent)(
AsHeaderControl(getVal(0)),
AsHeaderSection(getVal(1)))
//type TMouseActivateEvent func(sender IObject, button TMouseButton, shift TShiftState, x, y int32, hitTest int32, mouseActivate *TMouseActivate)
case TMouseActivateEvent:
v.(TMouseActivateEvent)(
AsObject(getVal(0)),
TMouseButton(getVal(1)),
TShiftState(getVal(2)),
int32(getVal(3)),
int32(getVal(4)),
int32(getVal(5)),
(*TMouseActivate)(unsafe.Pointer(getVal(6))))
//type TLBGetDataEvent func(control *TWinControl, index int32, data *string)
case TLBGetDataEvent:
str := DStrToGoStr(*(*uintptr)(unsafe.Pointer(getVal(2))))
v.(TLBGetDataEvent)(
AsWinControl(getVal(0)),
int32(getVal(1)),
&str)
*(*uintptr)(unsafe.Pointer(getVal(2))) = GoStrToDStr(str)
//type TLBGetDataObjectEvent func(control *TWinControl, index int32, dataObject IObject)
case TLBGetDataObjectEvent:
//ptr := *(*uintptr)(unsafe.Pointer(getVal(2)))
v.(TLBGetDataObjectEvent)(
AsWinControl(getVal(0)),
int32(getVal(1)),
AsObject(getVal(2))) // 这个参数要改,先这样
//type TLBFindDataEvent func(control *TWinControl, findString string) int32
case TLBFindDataEvent:
result := v.(TLBFindDataEvent)(
AsWinControl(getVal(0)),
DStrToGoStr(getVal(1)))
*(*int32)(unsafe.Pointer(getVal(2))) = result
//type TMeasureItemEvent func(control *TWinControl, index int32, height *int32)
case TMeasureItemEvent:
v.(TMeasureItemEvent)(
AsWinControl(getVal(0)),
int32(getVal(1)),
(*int32)(unsafe.Pointer(getVal(2))))
//type TLVChangingEvent func(sender IObject, item *TListItem, change TItemChange, allowChange *bool)
case TLVChangingEvent:
v.(TLVChangingEvent)(
AsObject(getVal(0)),
AsListItem(getVal(1)),
TItemChange(getVal(2)),
(*bool)(unsafe.Pointer(getVal(3))))
//type TLVOwnerDataEvent func(sender IObject, item *TListItem)
case TLVOwnerDataEvent:
v.(TLVOwnerDataEvent)(
AsObject(getVal(0)),
AsListItem(getVal(1)))
//type TLVOwnerDataFindEvent func(sender IObject, find TItemFind, findString string, findPosition TPoint, findData TCustomData, startIndex int32,
// direction TSearchDirection, warp bool, index *int32)
case TLVOwnerDataFindEvent:
v.(TLVOwnerDataFindEvent)(
AsObject(getVal(0)),
TItemFind(getVal(1)),
DStrToGoStr(getVal(2)),
*(*TPoint)(unsafe.Pointer(getVal(3))),
TCustomData(getVal(4)),
int32(getVal(5)),
TSearchDirection(getVal(6)),
DBoolToGoBool(getVal(7)),
(*int32)(unsafe.Pointer(getVal(8))))
//type TLVDeletedEvent func(sender IObject, item *TListItem)
case TLVDeletedEvent:
v.(TLVDeletedEvent)(
AsObject(getVal(0)),
AsListItem(getVal(1)))
//type TLVEditingEvent func(sender IObject, item *TListItem, allowEdit *bool)
case TLVEditingEvent:
v.(TLVEditingEvent)(
AsObject(getVal(0)),
AsListItem(getVal(1)),
(*bool)(unsafe.Pointer(getVal(2))))
//type TLVEditedEvent func(sender IObject, item *TListItem, s *string)
case TLVEditedEvent:
str := DStrToGoStr(*(*uintptr)(unsafe.Pointer(getVal(2))))
v.(TLVEditedEvent)(
AsObject(getVal(0)),
AsListItem(getVal(1)),
&str)
*(*uintptr)(unsafe.Pointer(getVal(2))) = GoStrToDStr(str)
//type TMenuMeasureItemEvent func(sender IObject, aCanvas *TCanvas, width, height *int32)
case TMenuMeasureItemEvent:
v.(TMenuMeasureItemEvent)(
AsObject(getVal(0)),
AsCanvas(getVal(1)),
(*int32)(unsafe.Pointer(getVal(2))),
(*int32)(unsafe.Pointer(getVal(3))))
//type TTabChangingEvent func(sender IObject, allowChange *bool)
case TTabChangingEvent:
v.(TTabChangingEvent)(
AsObject(getVal(0)),
(*bool)(unsafe.Pointer(getVal(1))))
//type TTVChangingEvent func(sender IObject, node *TTreeNode, allowChange *bool)
case TTVChangingEvent:
v.(TTVChangingEvent)(
AsObject(getVal(0)),
AsTreeNode(getVal(1)),
(*bool)(unsafe.Pointer(getVal(2))))
//type TTVCollapsingEvent func(sender IObject, node *TTreeNode, allowCollapse *bool)
case TTVCollapsingEvent:
v.(TTVCollapsingEvent)(
AsObject(getVal(0)),
AsTreeNode(getVal(1)),
(*bool)(unsafe.Pointer(getVal(2))))
//type TTVEditedEvent func(sender IObject, node *TTreeNode, s *string)
case TTVEditedEvent:
str := DStrToGoStr(*(*uintptr)(unsafe.Pointer(getVal(2))))
v.(TTVEditedEvent)(
AsObject(getVal(0)),
AsTreeNode(getVal(1)),
&str)
*(*uintptr)(unsafe.Pointer(getVal(2))) = GoStrToDStr(str)
//type TTVEditingEvent func(sender IObject, node *TTreeNode, allowEdit *bool)
case TTVEditingEvent:
v.(TTVEditingEvent)(
AsObject(getVal(0)),
AsTreeNode(getVal(1)),
(*bool)(unsafe.Pointer(getVal(2))))
//type TTVExpandingEvent func(sender IObject, node *TTreeNode, allowExpansion *bool)
case TTVExpandingEvent:
v.(TTVExpandingEvent)(
AsObject(getVal(0)),
AsTreeNode(getVal(1)),
(*bool)(unsafe.Pointer(getVal(2))))
//type TTVHintEvent func(sender IObject, node *TTreeNode, hint *string)
case TTVHintEvent:
str := DStrToGoStr(*(*uintptr)(unsafe.Pointer(getVal(2))))
v.(TTVHintEvent)(
AsObject(getVal(0)),
AsTreeNode(getVal(1)),
&str)
*(*uintptr)(unsafe.Pointer(getVal(2))) = GoStrToDStr(str)
//type TUDChangingEvent func(sender IObject, allowChange *bool)
case TUDChangingEvent:
v.(TUDChangingEvent)(
AsObject(getVal(0)),
(*bool)(unsafe.Pointer(getVal(1))))
//type TCreatingListErrorEvent func(sender IObject, winErrorCode uint32, errorDescription string, handled *bool)
case TCreatingListErrorEvent:
v.(TCreatingListErrorEvent)(
AsObject(getVal(0)),
uint32(getVal(1)),
DStrToGoStr(getVal(2)),
(*bool)(unsafe.Pointer(getVal(3))))
//type TThumbPreviewItemRequestEvent func(sender IObject, aPreviewHeight, aPreviewWidth int32, previewBitmap *TBitmap)
case TThumbPreviewItemRequestEvent:
v.(TThumbPreviewItemRequestEvent)(
AsObject(getVal(0)),
int32(getVal(1)),
int32(getVal(2)),
AsBitmap(getVal(3)))
//type TWindowPreviewItemRequestEvent func(sender IObject, position *TPoint, previewBitmap *TBitmap)
case TWindowPreviewItemRequestEvent:
v.(TWindowPreviewItemRequestEvent)(
AsObject(getVal(0)),
(*TPoint)(unsafe.Pointer(getVal(1))),
AsBitmap(getVal(2)))
//type TThumbButtonNotifyEvent func(sender IObject, aButtonID int32)
case TThumbButtonNotifyEvent:
v.(TThumbButtonNotifyEvent)(
AsObject(getVal(0)),
int32(getVal(1)))
//--
//type TLVCustomDrawEvent func(sender *TListView, aRect TRect, defaultDraw *bool)
case TLVCustomDrawEvent:
v.(TLVCustomDrawEvent)(
AsListView(getVal(0)),
*(*TRect)(unsafe.Pointer(getVal(1))),
(*bool)(unsafe.Pointer(getVal(2))))
//type TLVCustomDrawItemEvent func(sender *TListView, item *TListItem, state TCustomDrawStage, defaultDraw *bool)
case TLVCustomDrawItemEvent:
v.(TLVCustomDrawItemEvent)(
AsListView(getVal(0)),
AsListItem(getVal(1)),
TCustomDrawStage(getVal(2)),
(*bool)(unsafe.Pointer(getVal(3))))
//type TLVCustomDrawSubItemEvent func(sender *TListView, item *TListItem, subItem int32, state TCustomDrawStage, defaultDraw *bool)
case TLVCustomDrawSubItemEvent:
v.(TLVCustomDrawSubItemEvent)(
AsListView(getVal(0)),
AsListItem(getVal(1)),
int32(getVal(2)),
TCustomDrawStage(getVal(3)),
(*bool)(unsafe.Pointer(getVal(4))))
//type TLVDrawItemEvent func(sender *TListView, item *TListItem, rect TRect, state TOwnerDrawState)
case TLVDrawItemEvent:
v.(TLVDrawItemEvent)(
AsListView(getVal(0)),
AsListItem(getVal(1)),
*(*TRect)(unsafe.Pointer(getVal(2))),
TOwnerDrawState(getVal(3)))
//type TLVDataHintEvent = func(sender IObject, startIndex, endIndex int32)
case TLVDataHintEvent:
v.(TLVDataHintEvent)(
AsObject(getVal(0)),
int32(getVal(1)),
int32(getVal(2)))
//type TTVCustomDrawEvent func(sender *TTreeView, aRect TRect, defaultDraw *bool)
case TTVCustomDrawEvent:
v.(TTVCustomDrawEvent)(
AsTreeView(getVal(0)),
*(*TRect)(unsafe.Pointer(getVal(1))),
(*bool)(unsafe.Pointer(getVal(2))))
//type TTVCustomDrawItemEvent func(sender *TTreeView, node *TTreeNode, state TCustomDrawStage, defaultDraw *bool)
case TTVCustomDrawItemEvent:
v.(TTVCustomDrawItemEvent)(
AsTreeView(getVal(0)),
AsTreeNode(getVal(1)),
TCustomDrawStage(getVal(2)),
(*bool)(unsafe.Pointer(getVal(3))))
// type TWebTitleChangeEvent func(sender IObject, text string)
case TWebTitleChangeEvent:
v.(TWebTitleChangeEvent)(
AsObject(getVal(0)),
DStrToGoStr(getVal(1)))
case TWebJSExternalEvent:
str := DStrToGoStr(*(*uintptr)(unsafe.Pointer(getVal(3))))
v.(TWebJSExternalEvent)(
AsObject(getVal(0)),
DStrToGoStr(getVal(1)),
DStrToGoStr(getVal(2)),
&str)
*(*uintptr)(unsafe.Pointer(getVal(3))) = GoStrToDStr(str)
//type TTaskDlgClickEvent func(sender IObject, modalResult TModalResult, canClose *bool)
case TTaskDlgClickEvent:
v.(TTaskDlgClickEvent)(
AsObject(getVal(0)),
TModalResult(getVal(1)),
(*bool)(unsafe.Pointer(getVal(2))))
//type TTaskDlgTimerEvent func(sender IObject, tickCount uint32, reset *bool)
case TTaskDlgTimerEvent:
v.(TTaskDlgTimerEvent)(
AsObject(getVal(0)),
uint32(getVal(1)),
(*bool)(unsafe.Pointer(getVal(2))))
// type TAlignPositionEvent func(sender *TWinControl, control *TControl, newLeft, newTop, newWidth, newHeight *int32, alignRect *TRect, alignInfo TAlignInfo)
case TAlignPositionEvent:
v.(TAlignPositionEvent)(
AsWinControl(getVal(0)),
AsControl(getVal(1)),
(*int32)(unsafe.Pointer(getVal(2))),
(*int32)(unsafe.Pointer(getVal(3))),
(*int32)(unsafe.Pointer(getVal(4))),
(*int32)(unsafe.Pointer(getVal(5))),
(*TRect)(unsafe.Pointer(getVal(6))),
*(*TAlignInfo)(unsafe.Pointer(getVal(7))))
// type TCheckGroupClicked func(sender IObject, index int32)
case TCheckGroupClicked:
v.(TCheckGroupClicked)(
AsObject(getVal(0)),
int32(getVal(1)))
default:
}
}
return 0
}