forked from ying32/govcl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcallbackevent.go
956 lines (826 loc) · 24.9 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
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
//----------------------------------------
//
// 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"
)
// TExtEventCallback
//
// 外部回调事件
// 参数一:函数地址
// 参数二:获取参数值的函数
// 返回值:如果为true则终止事件传递,如果为false则继续向后转发事件。
type TExtEventCallback func(fn interface{}, getVal func(idx int) uintptr) bool
// 外部扩展的事件回调,先不管重复注册的问题
var extEventCallback []TExtEventCallback
// RegisterExtEventCallback
//
// 注册外部扩展回调事件
//
// Registering external extension callback events.
func RegisterExtEventCallback(callback TExtEventCallback) {
extEventCallback = append(extEventCallback, callback)
}
// getParam 从指定索引和地址获取事件中的参数
// 不再使用FreePascal导出的了,直接在这处理
func getParamOf(index int, ptr uintptr) uintptr {
return *(*uintptr)(unsafe.Pointer(ptr + uintptr(index)*unsafe.Sizeof(ptr)))
}
// 移除事件,释放相关的引用
func removeEventCallbackProc(f uintptr) uintptr {
//RemoveEventElement(PtrToElementPtr(f))
RemoveEventElement(f)
return 0
}
// 回调过程
func eventCallbackProc(f uintptr, args uintptr, _ int) uintptr {
v := PtrToElementValue(f)
if v != nil {
// 获取值
getVal := func(i int) uintptr {
return getParamOf(i, args)
}
// 指针
getPtr := func(i int) unsafe.Pointer {
return unsafe.Pointer(getVal(i))
}
// 指针的值
getPtrVal := func(i int) uintptr {
return *(*uintptr)(getPtr(i))
}
setPtrVal := func(i int, val uintptr) {
*(*uintptr)(getPtr(i)) = val
}
getBoolPtr := func(i int) *bool {
return (*bool)(getPtr(i))
}
getI32Ptr := func(i int) *int32 {
return (*int32)(getPtr(i))
}
getRectPtr := func(i int) *TRect {
return (*TRect)(getPtr(i))
}
getPointPtr := func(i int) *TPoint {
return (*TPoint)(getPtr(i))
}
// 调用外部注册的事件回调过程
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)(
AsObject(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)(getPtr(1)))
// func(sender IObject, canClose *bool) //CanClose *uintptr
case TCloseQueryEvent:
v.(TCloseQueryEvent)(
AsObject(getVal(0)),
getBoolPtr(1))
// func(sender IObject, source *TMenuItem, rebuild bool)
case TMenuChangeEvent:
v.(TMenuChangeEvent)(
AsObject(getVal(0)),
AsMenuItem(getVal(1)),
GoBool(getVal(2)))
// func(sender IObject, node *TreeNode)
case TTVChangedEvent:
v.(TTVChangedEvent)(
AsObject(getVal(0)),
AsTreeNode(getVal(1)))
// func(sender IObject, link string, linkType TSysLinkType)
case TSysLinkEvent:
v.(TSysLinkEvent)(
AsObject(getVal(0)),
GoStr(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)(getPtr(1)),
TShiftState(getVal(2)))
// func(sender IObject, key *Char)
case TKeyPressEvent:
v.(TKeyPressEvent)(
AsObject(getVal(0)),
(*Char)(getPtr(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)),
getBoolPtr(5))
// func(control IWinControl, index int32, aRect TRect, state TOwnerDrawState)
case TDrawItemEvent:
v.(TDrawItemEvent)(
AsWinControl(getVal(0)),
int32(getVal(1)),
*getRectPtr(2),
TOwnerDrawState(getVal(3)))
// func(sender IObject, aCanvas *TCanvas, aRect TRect, selected bool)
case TMenuDrawItemEvent:
v.(TMenuDrawItemEvent)(
AsObject(getVal(0)),
AsCanvas(getVal(1)),
*getRectPtr(2),
TOwnerDrawState(getVal(3)))
// func(sender IObject, item *TListItem)
case TLVNotifyEvent:
v.(TLVNotifyEvent)(
AsObject(getVal(0)),
AsListItem(getVal(1)))
// func(sender IObject, column *TListColumn)
case TLVColumnClickEvent:
v.(TLVColumnClickEvent)(
AsObject(getVal(0)),
AsListColumn(getVal(1)))
// 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))})
// func(sender IObject, item *TListItem, selected bool)
case TLVSelectItemEvent:
v.(TLVSelectItemEvent)(
AsObject(getVal(0)),
AsListItem(getVal(1)),
GoBool(getVal(2)))
// func(sender IObject, item *TListItem)
case TLVCheckedItemEvent:
v.(TLVCheckedItemEvent)(
AsObject(getVal(0)),
AsListItem(getVal(1)))
// func(sender IObject, tabIndex int32, imageIndex *int32)
case TTabGetImageEvent:
v.(TTabGetImageEvent)(
AsObject(getVal(0)),
int32(getVal(1)),
getI32Ptr(2))
// func(sender IObject, node *TTreeNode)
case TTVExpandedEvent:
v.(TTVExpandedEvent)(
AsObject(getVal(0)),
AsTreeNode(getVal(1)))
// 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)),
getI32Ptr(4))
// 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)),
getI32Ptr(4))
// func(sender *TTreeView, aRect TRect, stage TCustomDrawStage, defaultDraw *bool)
case TTVAdvancedCustomDrawEvent:
v.(TTVAdvancedCustomDrawEvent)(
AsTreeView(getVal(0)),
*getRectPtr(1),
TCustomDrawStage(getVal(2)),
getBoolPtr(3))
// 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)),
getBoolPtr(4),
getBoolPtr(5))
// func(sender *TListView, aRect TRect, stage TCustomDrawStage, defaultDraw *bool)
case TLVAdvancedCustomDrawEvent:
v.(TLVAdvancedCustomDrawEvent)(
AsListView(getVal(0)),
*getRectPtr(1),
TCustomDrawStage(getVal(2)),
getBoolPtr(3))
// 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)),
getBoolPtr(4))
// 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)),
getBoolPtr(5))
// func(sender *TToolBar, aRect TRect, stage TCustomDrawStage, defaultDraw *bool)
case TTBAdvancedCustomDrawEvent:
v.(TTBAdvancedCustomDrawEvent)(
AsToolBar(getVal(0)),
*getRectPtr(1),
TCustomDrawStage(getVal(2)),
getBoolPtr(3))
// func(sender IObject, aFileNames []string)
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)
// func(sender IObject, minWidth, minHeight, maxWidth, maxHeight *int32)
case TConstrainedResizeEvent:
v.(TConstrainedResizeEvent)(
AsObject(getVal(0)),
getI32Ptr(1),
getI32Ptr(2),
getI32Ptr(3),
getI32Ptr(4))
// func(command uint16, data THelpEventData, callHelp *bool) bool
case THelpEvent:
v.(THelpEvent)(
uint16(getVal(0)),
THelpEventData(getVal(1)),
getBoolPtr(2),
getBoolPtr(3))
// func(msg *TWMKey, handled *bool)
case TShortCutEvent:
v.(TShortCutEvent)(
(*TWMKey)(getPtr(0)),
getBoolPtr(1))
// func(sender IObject, mousePos TPoint, handled *bool)
case TContextPopupEvent:
v.(TContextPopupEvent)(
AsObject(getVal(0)),
*getPointPtr(1),
getBoolPtr(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)),
getBoolPtr(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:
// obj := AsDragObject(getVal(1))
// v.(TStartDragEvent)(
// AsObject(getVal(0)),
// obj)
// if obj != nil {
// *(*uintptr)(unsafe.Pointer(getVal(1))) = obj.instance
// }
//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)),
getBoolPtr(5))
//func(sender IObject, client *TControl, newTarget *TControl, allow *bool)
case TUnDockEvent:
v.(TUnDockEvent)(
AsObject(getVal(0)),
AsControl(getVal(1)),
AsControl(getVal(2)),
getBoolPtr(3))
//func(sender IObject, dragObject **TDragDockObject)
case TStartDockEvent:
obj := AsDragDockObject(getPtrVal(1))
v.(TStartDockEvent)(
AsObject(getVal(0)),
&obj)
if obj != nil {
setPtrVal(1, obj._instance())
}
//func(sender IObject, dockClient *TControl, influenceRect *TRect, mousePos TPoint, canDock *bool)
case TGetSiteInfoEvent:
v.(TGetSiteInfoEvent)(
AsObject(getVal(0)),
AsControl(getVal(1)),
getRectPtr(2),
*getPointPtr(3),
getBoolPtr(4))
//func(sender IObject, shift TShiftState, mousePos TPoint, handled *bool)
case TMouseWheelUpDownEvent:
v.(TMouseWheelUpDownEvent)(
AsObject(getVal(0)),
TShiftState(getVal(1)),
*getPointPtr(2),
getBoolPtr(3))
// func(sender IObject, isColumn bool, sIndex, tIndex int32)
case TGridOperationEvent:
v.(TGridOperationEvent)(
AsObject(getVal(0)),
GoBool(getVal(1)),
int32(getVal(2)),
int32(getVal(3)))
// func(sender IObject, aCol, aRow int32, aRect TRect, state TGridDrawState)
case TDrawCellEvent:
v.(TDrawCellEvent)(
AsObject(getVal(0)),
int32(getVal(1)),
int32(getVal(2)),
*getRectPtr(3),
TGridDrawState(getVal(4)))
// func(sender IObject, aCol, aRow int32)
case TFixedCellClickEvent:
v.(TFixedCellClickEvent)(
AsObject(getVal(0)),
int32(getVal(1)),
int32(getVal(2)))
// func(sender IObject, aCol, aRow int32, value *string)
case TGetEditEvent:
str := GoStr(getPtrVal(3))
v.(TGetEditEvent)(
AsObject(getVal(0)),
int32(getVal(1)),
int32(getVal(2)),
&str)
setPtrVal(3, PascalStr(str))
// func(sender IObject, aCol, aRow int32, canSelect *bool)
case TSelectCellEvent:
v.(TSelectCellEvent)(
AsObject(getVal(0)),
int32(getVal(1)),
int32(getVal(2)),
getBoolPtr(3))
// func(sender IObject, aCol, aRow int32, value string)
case TSetEditEvent:
v.(TSetEditEvent)(
AsObject(getVal(0)),
int32(getVal(1)),
int32(getVal(2)),
GoStr(getVal(3)))
// func(headerControl *THeaderControl, section *THeaderSection, aRect TRect, pressed bool)
case TDrawSectionEvent:
v.(TDrawSectionEvent)(
AsHeaderControl(getVal(0)),
AsHeaderSection(getVal(1)),
*getRectPtr(2),
getVal(3) != 0)
// func(headerControl *THeaderControl, section *THeaderSection)
case TSectionNotifyEvent:
v.(TSectionNotifyEvent)(
AsHeaderControl(getVal(0)),
AsHeaderSection(getVal(1)))
// 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)))
// func(sender IObject, fromSection, toSection *THeaderSection, allowDrag *bool)
case TSectionDragEvent:
v.(TSectionDragEvent)(
AsObject(getVal(0)),
AsHeaderSection(getVal(1)),
AsHeaderSection(getVal(2)),
getBoolPtr(3))
// func(headerControl *THeaderControl, section *THeaderSection)
case TCustomSectionNotifyEvent:
v.(TCustomSectionNotifyEvent)(
AsHeaderControl(getVal(0)),
AsHeaderSection(getVal(1)))
// 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)(getPtr(6)))
// func(control *TWinControl, index int32, data *string)
case TLBGetDataEvent:
str := GoStr(getPtrVal(2))
v.(TLBGetDataEvent)(
AsWinControl(getVal(0)),
int32(getVal(1)),
&str)
setPtrVal(2, PascalStr(str))
// func(control *TWinControl, index int32, dataObject IObject)
case TLBGetDataObjectEvent:
v.(TLBGetDataObjectEvent)(
AsWinControl(getVal(0)),
int32(getVal(1)),
AsObject(getVal(2))) // 这个参数要改,先这样
// func(control *TWinControl, findString string) int32
case TLBFindDataEvent:
result := v.(TLBFindDataEvent)(
AsWinControl(getVal(0)),
GoStr(getVal(1)))
*getI32Ptr(2) = result
// func(control *TWinControl, index int32, height *int32)
case TMeasureItemEvent:
v.(TMeasureItemEvent)(
AsWinControl(getVal(0)),
int32(getVal(1)),
getI32Ptr(2))
// func(sender IObject, item *TListItem, change TItemChange, allowChange *bool)
case TLVChangingEvent:
v.(TLVChangingEvent)(
AsObject(getVal(0)),
AsListItem(getVal(1)),
TItemChange(getVal(2)),
getBoolPtr(3))
// func(sender IObject, item *TListItem)
case TLVDataEvent:
v.(TLVDataEvent)(
AsObject(getVal(0)),
AsListItem(getVal(1)))
// func(sender IObject, find TItemFind, findString string, findPosition TPoint, findData TCustomData, startIndex int32,
// direction TSearchDirection, warp bool, index *int32)
case TLVDataFindEvent:
v.(TLVDataFindEvent)(
AsObject(getVal(0)),
TItemFind(getVal(1)),
GoStr(getVal(2)),
*getPointPtr(3),
TCustomData(getVal(4)),
int32(getVal(5)),
TSearchDirection(getVal(6)),
GoBool(getVal(7)),
getI32Ptr(8))
// func(sender IObject, item *TListItem)
case TLVDeletedEvent:
v.(TLVDeletedEvent)(
AsObject(getVal(0)),
AsListItem(getVal(1)))
// func(sender IObject, item *TListItem, allowEdit *bool)
case TLVEditingEvent:
v.(TLVEditingEvent)(
AsObject(getVal(0)),
AsListItem(getVal(1)),
getBoolPtr(2))
// func(sender IObject, item *TListItem, s *string)
case TLVEditedEvent:
str := GoStr(getPtrVal(2))
v.(TLVEditedEvent)(
AsObject(getVal(0)),
AsListItem(getVal(1)),
&str)
setPtrVal(2, PascalStr(str))
// func(sender IObject, aCanvas *TCanvas, width, height *int32)
case TMenuMeasureItemEvent:
v.(TMenuMeasureItemEvent)(
AsObject(getVal(0)),
AsCanvas(getVal(1)),
getI32Ptr(2),
getI32Ptr(3))
//type func(sender IObject, allowChange *bool)
case TTabChangingEvent:
v.(TTabChangingEvent)(
AsObject(getVal(0)),
getBoolPtr(1))
// func(sender IObject, node *TTreeNode, allowChange *bool)
case TTVChangingEvent:
v.(TTVChangingEvent)(
AsObject(getVal(0)),
AsTreeNode(getVal(1)),
getBoolPtr(2))
// func(sender IObject, node *TTreeNode, allowCollapse *bool)
case TTVCollapsingEvent:
v.(TTVCollapsingEvent)(
AsObject(getVal(0)),
AsTreeNode(getVal(1)),
getBoolPtr(2))
// func(sender IObject, node *TTreeNode, s *string)
case TTVEditedEvent:
str := GoStr(getPtrVal(2))
v.(TTVEditedEvent)(
AsObject(getVal(0)),
AsTreeNode(getVal(1)),
&str)
setPtrVal(2, PascalStr(str))
// func(sender IObject, node *TTreeNode, allowEdit *bool)
case TTVEditingEvent:
v.(TTVEditingEvent)(
AsObject(getVal(0)),
AsTreeNode(getVal(1)),
getBoolPtr(2))
// func(sender IObject, node *TTreeNode, allowExpansion *bool)
case TTVExpandingEvent:
v.(TTVExpandingEvent)(
AsObject(getVal(0)),
AsTreeNode(getVal(1)),
getBoolPtr(2))
// func(sender IObject, node *TTreeNode, hint *string)
case TTVHintEvent:
str := GoStr(getPtrVal(2))
v.(TTVHintEvent)(
AsObject(getVal(0)),
AsTreeNode(getVal(1)),
&str)
setPtrVal(2, PascalStr(str))
// func(sender IObject, allowChange *bool)
case TUDChangingEvent:
v.(TUDChangingEvent)(
AsObject(getVal(0)),
getBoolPtr(1))
// func(sender IObject, winErrorCode uint32, errorDescription string, handled *bool)
case TCreatingListErrorEvent:
v.(TCreatingListErrorEvent)(
AsObject(getVal(0)),
uint32(getVal(1)),
GoStr(getVal(2)),
getBoolPtr(3))
// func(sender *TListView, aRect TRect, defaultDraw *bool)
case TLVCustomDrawEvent:
v.(TLVCustomDrawEvent)(
AsListView(getVal(0)),
*getRectPtr(1),
getBoolPtr(2))
// func(sender *TListView, item *TListItem, state TCustomDrawStage, defaultDraw *bool)
case TLVCustomDrawItemEvent:
v.(TLVCustomDrawItemEvent)(
AsListView(getVal(0)),
AsListItem(getVal(1)),
TCustomDrawState(getVal(2)),
getBoolPtr(3))
// func(sender *TListView, item *TListItem, subItem int32, state TCustomDrawStage, defaultDraw *bool)
case TLVCustomDrawSubItemEvent:
v.(TLVCustomDrawSubItemEvent)(
AsListView(getVal(0)),
AsListItem(getVal(1)),
int32(getVal(2)),
TCustomDrawState(getVal(3)),
getBoolPtr(4))
// func(sender *TListView, item *TListItem, rect TRect, state TOwnerDrawState)
case TLVDrawItemEvent:
v.(TLVDrawItemEvent)(
AsListView(getVal(0)),
AsListItem(getVal(1)),
*getRectPtr(2),
TOwnerDrawState(getVal(3)))
// func(sender IObject, startIndex, endIndex int32)
case TLVDataHintEvent:
v.(TLVDataHintEvent)(
AsObject(getVal(0)),
int32(getVal(1)),
int32(getVal(2)))
// func(sender *TTreeView, aRect TRect, defaultDraw *bool)
case TTVCustomDrawEvent:
v.(TTVCustomDrawEvent)(
AsTreeView(getVal(0)),
*getRectPtr(1),
getBoolPtr(2))
// func(sender *TTreeView, node *TTreeNode, state TCustomDrawStage, defaultDraw *bool)
case TTVCustomDrawItemEvent:
v.(TTVCustomDrawItemEvent)(
AsTreeView(getVal(0)),
AsTreeNode(getVal(1)),
TCustomDrawState(getVal(2)),
getBoolPtr(3))
// func(sender IObject, text string)
case TWebTitleChangeEvent:
v.(TWebTitleChangeEvent)(
AsObject(getVal(0)),
GoStr(getVal(1)))
// func(sender IObject, funcName, args string, retVal *string)
case TWebJSExternalEvent:
str := GoStr(getPtrVal(3))
v.(TWebJSExternalEvent)(
AsObject(getVal(0)),
GoStr(getVal(1)),
GoStr(getVal(2)),
&str)
setPtrVal(3, PascalStr(str))
// func(sender IObject, modalResult TModalResult, canClose *bool)
case TTaskDlgClickEvent:
v.(TTaskDlgClickEvent)(
AsObject(getVal(0)),
TModalResult(getVal(1)),
getBoolPtr(2))
// func(sender IObject, tickCount uint32, reset *bool)
case TTaskDlgTimerEvent:
v.(TTaskDlgTimerEvent)(
AsObject(getVal(0)),
uint32(getVal(1)),
getBoolPtr(2))
// func(sender *TWinControl, control *TControl, newLeft, newTop, newWidth, newHeight *int32, alignRect *TRect, alignInfo TAlignInfo)
case TAlignPositionEvent:
v.(TAlignPositionEvent)(
AsWinControl(getVal(0)),
AsControl(getVal(1)),
getI32Ptr(2),
getI32Ptr(3),
getI32Ptr(4),
getI32Ptr(5),
getRectPtr(6),
*(*TAlignInfo)(getPtr(7)))
// func(sender IObject, index int32)
case TCheckGroupClicked:
v.(TCheckGroupClicked)(
AsObject(getVal(0)),
int32(getVal(1)))
// func(sender IObject, aCol, aRow int32)
case TOnSelectEvent:
v.(TOnSelectEvent)(
AsObject(getVal(0)),
int32(getVal(1)),
int32(getVal(2)))
// func(sender IObject, aCol, aRow int32, aState TCheckBoxState)
case TToggledCheckboxEvent:
v.(TToggledCheckboxEvent)(
AsObject(getVal(0)),
int32(getVal(1)),
int32(getVal(2)),
TCheckBoxState(getVal(3)))
// func(sender IObject, ACol, ARow, BCol, BRow int32, result *int32)
case TOnCompareCells:
v.(TOnCompareCells)(
AsObject(getVal(0)),
int32(getVal(1)),
int32(getVal(2)),
int32(getVal(3)),
int32(getVal(4)),
getI32Ptr(5))
// func(sender IObject, ACol, ARow int32, hintText *string)
case TGetCellHintEvent:
str := GoStr(getPtrVal(3))
v.(TGetCellHintEvent)(
AsObject(getVal(0)),
int32(getVal(1)),
int32(getVal(2)),
&str)
setPtrVal(3, PascalStr(str))
// func(sender IObject, ACol, ARow int32, value *TCheckBoxState)
case TGetCheckboxStateEvent:
v.(TGetCheckboxStateEvent)(
AsObject(getVal(0)),
int32(getVal(1)),
int32(getVal(2)),
(*TCheckBoxState)(getPtr(3)))
// func(sender IObject, ACol, ARow int32, Value TCheckBoxState)
case TSetCheckboxStateEvent:
v.(TSetCheckboxStateEvent)(
AsObject(getVal(0)),
int32(getVal(1)),
int32(getVal(2)),
TCheckBoxState(getVal(3)))
// func(sender IObject, isColumn bool, index int32)
case THdrEvent:
v.(THdrEvent)(
AsObject(getVal(0)),
GoBool(getVal(1)),
int32(getVal(2)))
// func(sender IObject, isColumn bool, aIndex, aSize int32)
case THeaderSizingEvent:
v.(THeaderSizingEvent)(
AsObject(getVal(0)),
GoBool(getVal(1)),
int32(getVal(2)),
int32(getVal(3)))
// func(sender IObject, aCol, aRow int32, editor **TWinControl)
case TSelectEditorEvent:
obj := AsWinControl(getPtrVal(3))
v.(TSelectEditorEvent)(
AsObject(getVal(0)),
int32(getVal(1)),
int32(getVal(2)),
&obj)
if obj != nil {
setPtrVal(3, obj._instance())
}
// func(sender IObject, aCol, aRow int32, CheckedState TCheckBoxState, aBitmap **TBitmap)
case TUserCheckBoxBitmapEvent:
obj := AsBitmap(getPtrVal(4))
v.(TUserCheckBoxBitmapEvent)(
AsObject(getVal(0)),
int32(getVal(1)),
int32(getVal(2)),
TCheckBoxState(getVal(1)),
&obj)
if obj != nil {
setPtrVal(4, obj._instance())
}
// func(sender IObject, aCol, aRow int32, oldValue string, newValue *string)
case TValidateEntryEvent:
str := GoStr(getPtrVal(4))
v.(TValidateEntryEvent)(
AsObject(getVal(0)),
int32(getVal(1)),
int32(getVal(2)),
GoStr(getVal(3)),
&str)
setPtrVal(4, PascalStr(str))
// func(sender IObject, aCol, aRow int32, aState TGridDrawState)
case TOnPrepareCanvasEvent:
v.(TOnPrepareCanvasEvent)(
AsObject(getVal(0)),
int32(getVal(1)),
int32(getVal(2)),
TGridDrawState(getVal(3)))
// func(sender IObject, value *string)
case TAcceptFileNameEvent:
str := GoStr(getPtrVal(1))
v.(TAcceptFileNameEvent)(
AsObject(getVal(0)), &str)
setPtrVal(1, PascalStr(str))
// func(sender IObject, index int32)
case TCheckItemChange:
v.(TCheckItemChange)(
AsObject(getVal(0)),
int32(getVal(1)))
// func(sender IObject, utf8key *TUTF8Char)
case TUTF8KeyPressEvent:
v.(TUTF8KeyPressEvent)(
AsObject(getVal(0)),
(*TUTF8Char)(getPtr(1)))
// type func(sender IObject, aCanvas *TCanvas, aRect TRect)
case TImagePaintBackgroundEvent:
v.(TImagePaintBackgroundEvent)(
AsObject(getVal(0)),
AsCanvas(getVal(1)),
*getRectPtr(2))
default:
}
}
return 0
}