-
Notifications
You must be signed in to change notification settings - Fork 4
/
GoldSrc.VGUI.pas
3217 lines (2547 loc) · 125 KB
/
GoldSrc.VGUI.pas
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
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(*========= (C) Copyright 2019-2020, Alexander B. All rights reserved. =========*)
(* *)
(* Module: *)
(* GoldSrc.VGUI *)
(* *)
(* License: *)
(* You may freely use this code provided you retain this copyright message. *)
(* *)
(* Description: *)
(* Provides partial SDK for Counter-Strike 1.6 VGUI library. Mostly *)
(* binary-correct virtual tables are presented for working with VGUI *)
(* objects. *)
(*==============================================================================*)
{$DEFINE VGUI_USE_PANEL007}
{.$DEFINE VGUI_USE_PANEL009}
unit GoldSrc.VGUI;
interface
uses
System.SysUtils,
GoldSrc.BaseInterface,
GoldSrc.Collections,
GoldSrc.KeyValues,
Xander.ThisWrap;
{.$A+} // were 1
{$Z4}
type
EInterfaceID = (ICLIENTPANEL_STANDARD_INTERFACE = 0);
type
DmxElementUnpackStructure_t = Pointer;
TDmxElementUnpackStructure = DmxElementUnpackStructure_t;
PDmxElementUnpackStructure = ^TDmxElementUnpackStructure;
CDmxElement = Pointer;
PCDmxElement = ^CDmxElement;
VGUIPanel = Pointer; // Prototype since we can't define type named 'Panel' directry
VGUILabel = Pointer;
TextImage = Pointer;
VPANEL = Cardinal;
HCursor = Cardinal;
FocusNavGroup = Pointer;
PanelMap_t = Pointer;
SurfacePlat = Pointer;
PHandle = ^Integer;
HContext = Cardinal;
HScheme = Cardinal;
HTexture = Cardinal;
HPanel = Cardinal;
HFont = Cardinal;
HInputContext = Integer;
type
VGUIMouseCode = (MOUSE_LEFT = 0, MOUSE_RIGHT, MOUSE_MIDDLE, MOUSE_4, MOUSE_5, MOUSE_LAST);
type
ButtonCode_t = (KEYT_NONE = 0, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7,
KEY_8, KEY_9, KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F, KEY_G,
KEY_H, KEY_I, KEY_J, KEY_K, KEY_L, KEY_M, KEY_N, KEY_O, KEY_P,
KEY_Q, KEY_R, KEY_S, KEY_T, KEY_U, KEY_V, KEY_W, KEY_X, KEY_Y,
KEY_Z, KEY_PAD_0, KEY_PAD_1, KEY_PAD_2, KEY_PAD_3, KEY_PAD_4,
KEY_PAD_5, KEY_PAD_6, KEY_PAD_7, KEY_PAD_8, KEY_PAD_9, KEY_PAD_DIVIDE,
KEY_PAD_MULTIPLY, KEY_PAD_MINUS, KEY_PAD_PLUS, KEY_PAD_ENTER,
KEY_PAD_DECIMAL, KEY_LBRACKET, KEY_RBRACKET, KEY_SEMICOLON, KEY_APOSTROPHE,
KEY_BACKQUOTE, KEY_COMMA, KEY_PERIOD, KEY_SLASH, KEY_BACKSLASH, KEY_MINUS,
KEY_EQUAL, KEY_ENTER, KEY_SPACE, KEY_BACKSPACE, KEY_TAB, KEY_CAPSLOCK,
KEY_NUMLOCK, KEY_ESCAPE, KEY_SCROLLLOCK, KEY_INSERT, KEY_DELETE, KEY_HOME,
KEY_END, KEY_PAGEUP, KEY_PAGEDOWN, KEY_BREAK, KEY_LSHIFT, KEY_RSHIFT,
KEY_LALT, KEY_RALT, KEY_LCONTROL, KEY_RCONTROL, KEY_LWIN, KEY_RWIN, KEY_APP,
KEY_UP, KEY_LEFT, KEY_DOWN, KEY_RIGHT, KEY_F1, KEY_F2, KEY_F3, KEY_F4,
KEY_F5, KEY_F6, KEY_F7, KEY_F8, KEY_F9, KEY_F10, KEY_F11, KEY_F12, KEY_LAST);
KeyCode = ButtonCode_t;
MouseCode = ButtonCode_t;
type
SDK_Color = record
R, G, B, A: Byte;
class function Create(R, G, B, A: Byte): SDK_Color; static;
end;
type
Dar<T> = record
Count: Integer;
Capacity: Integer;
Data: ^T;
end;
const
INVALID_PANEL = HPANEL(-1);
INVALID_FONT = HFont(0);
type
// BuildGroup.h
DBuildGroup = record
_enabled: Boolean;
_snapX, _snapY: Integer;
_cursor_sizenwse: HCursor;
_cursor_sizenesw: HCursor;
_cursor_sizewe: HCursor;
_cursor_sizens: HCursor;
_cursor_sizeall: HCursor;
_dragging: Boolean;
_dragMouseCode: VGUIMouseCode;
_dragStartPanelPos: array[0..1] of Integer;
_dragStartCursorPos: array[0..1] of Integer;
_currentPanel: Pointer;
_panelDar: CUtlVector<PHandle, Integer>;
m_pResourceName: PAnsiChar;
m_pResourcePathID: PAnsiChar;
m_hBuildDialog: PHandle;
m_pBuildContext: Pointer;
m_pParentPanel: Pointer;
_controlGroup: CUtlVector<PHandle, Integer>;
_groupDeltaX: CUtlVector<Integer, Integer>;
_groupDeltaY: CUtlVector<Integer, Integer>;
_rulerNumber: array[0..3] of VGUILabel;
_showRulers: Boolean;
m_RegisteredControlSettingsFiles: CUtlVector<CUtlSymbol, Integer>;
end;
PVBuildGroup = ^VBuildGroup;
VBuildGroup = record
// Toggle build mode on/off
SetEnabled: procedure(State: Boolean); stdcall;
// Check if buildgroup is enabled
IsEnabled: function: Boolean; stdcall;
// Return the currently selected panel
GetCurrentPanel: function: VGUIPanel; stdcall;
// Load the control settings from file
LoadControlSettings: procedure(ControlResourceName: PAnsiChar; PathID: PAnsiChar = nil); stdcall;
// Save control settings from file, using the same resource
// name as what LoadControlSettings() was called with
SaveControlSettings: function: Boolean; stdcall;
// Serialize settings from a resource data container
ApplySettings: procedure(ResourceData: PKeyValues); stdcall;
// Serialize settings to a resource data container
GetSettings: procedure(ResourceData: PKeyValues); stdcall;
// Remove all objects in the current control group
RemoveSettings: procedure; stdcall;
// Set the panel from which the build group gets all it's object creation information
SetContextPanel: procedure(ÑontextPanel: VGUIPanel); stdcall;
//Get the panel that build group is pointed at.
GetContextPanel: function: VGUIPanel; stdcall;
// Get the resource file name used
GetResourceName: function: PAnsiChar; stdcall;
PanelAdded: procedure(Panel: VGUIPanel); stdcall;
MousePressed: function(Code: VGUIMouseCode; Panel: VGUIPanel): Boolean; stdcall;
MouseReleased: function(Code: VGUIMouseCode; Panel: VGUIPanel): Boolean; stdcall;
// Get the list of panels that are currently selected
GetControlGroup: function: Pointer; (*^CUtlVector<PHandle, Integer>;*) stdcall;
// Toggle ruler display on/off
ToggleRulerDisplay: procedure; stdcall;
// Toggle visibility of ruler number labels
SetRulerLabelsVisible: procedure(State: Boolean); stdcall;
// Check if ruler display is activated
HasRulersOn: function: Boolean; stdcall;
// Draw Rulers on screen
DrawRulers: function: Boolean; stdcall;
CursorMoved: procedure(X, Y: Integer; Panel: VGUIPanel); stdcall;
MouseDoublePressed: procedure(Code: VGUIMouseCode; Panel: VGUIPanel); stdcall;
KeyCodeTyped: function(Code: VGUIMouseCode; Panel: VGUIMouseCode): Boolean; stdcall;
ApplySchemeSettings: procedure(Scheme: Pointer); stdcall;
GetCursor: function(Panel: VGUIPanel): HCursor; stdcall;
end;
PBuildGroup = ^BuildGroup;
BuildGroup = record
VTable: ^VBuildGroup;
Data: DBuildGroup;
end;
// MessageMap.h
//-----------------------------------------------------------------------------
// Purpose: parameter data type enumeration
// used internal but the shortcut macros require this to be exposed
//-----------------------------------------------------------------------------
type
DataType_t = (DATATYPE_VOID, DATATYPE_CONSTCHARPTR, DATATYPE_INT, DATATYPE_FLOAT,
DATATYPE_PTR, DATATYPE_BOOL, DATATYPE_KEYVALUES, DATATYPE_CONSTWCHARPTR,
DATATYPE_UINT64);
type
MessageFunc_t = procedure; stdcall;
MessageMapItem_t = record
Name: PAnsiChar;
{$ALIGN 16}
Func: Pointer;
{$ALIGN 1}
NumParams: Integer;
FirstParamType: DataType_t;
FirstParamName: PAnsiChar;
SecondParamType: DataType_t;
SecondParamName: PAnsiChar;
NameSymbol: Integer;
FirstParamSymbol: Integer;
SecondParamSymbol: Integer;
end;
TMessageMapItem = MessageMapItem_t;
PPanelMessageMap = ^PanelMessageMap;
PanelMessageMap = record
Entries: CUtlMemory<MessageMapItem_t, Integer>;
Processed: Boolean;
BaseMap: PPanelMessageMap;
ClassName: function: PAnsiChar; cdecl;
end;
type
{$REGION 'SchemeManager'}
PVScheme = ^VScheme;
VScheme = record
Destroy: procedure(Free: Boolean); stdcall;
GetResourceString: function(StringName: PAnsiChar): PChar; stdcall;
GetBorder: function(BorderName: PAnsiChar): Pointer; stdcall; // TODO: IBorder
GetFont: function(FontName: PAnsiChar; Proportional: Boolean = False): HFont; stdcall;
GetColor: function(ColorName: PAnsiChar; DefaultColor: Pointer): Pointer; stdcall; // TODO: Color
end;
PIScheme = ^IScheme;
IScheme = ^PVScheme;
PVSchemeManager = ^VSchemeManager;
VSchemeManager = record
Create: procedure(Dispose: Boolean); stdcall;
// loads a scheme from a file
// first scheme loaded becomes the default scheme, and all subsequent loaded scheme are derivitives of that
LoadSchemeFromFile: function(FileName, Tag: PAnsiChar): HScheme; stdcall;
// reloads the scheme from the file - should only be used during development
ReloadSchemes: procedure; stdcall;
// returns a handle to the default (first loaded) scheme
GetDefaultScheme: function: HScheme; stdcall;
// returns a handle to the scheme identified by "tag"
GetScheme: function: HScheme; stdcall;
GetImage: function(ImageName: PAnsiChar; HardwareFiltered: Boolean): Pointer; stdcall;
GetImageID: function(ImageName: PAnsiChar; HardwareFiltered: Boolean): HTexture; stdcall;
// This can only be called at certain times, like during paint()
// It will assert-fail if you call it at the wrong time...
// FIXME: This interface should go away!!! It's an icky back-door
// If you're using this interface, try instead to cache off the information
// in ApplySchemeSettings
GetIScheme: function(Scheme: HScheme): PIScheme; stdcall;
// unload all schemes
Shutdown: procedure(Full: Boolean = True); stdcall;
// gets the proportional coordinates for doing screen-size independant panel layouts
// use these for font, image and panel size scaling (they all use the pixel height of the display for scaling)
GetProportionalScaledValue: function(NormalizedValue: Integer): Integer; stdcall;
GetProportionalNormalizedValue: function(ScaledValue: Integer): Integer; stdcall;
end;
ISchemeManager = ^PVSchemeManager;
const
VGUI_SCHEME_INTERFACE_VERSION = 'VGUI_Scheme009';
{$ENDREGION}
{$REGION 'Border'}
type
PVTableBorder = ^VTableBorder;
VTableBorder = record
public type
sides_e =
(
SIDE_LEFT = 0,
SIDE_TOP = 1,
SIDE_RIGHT = 2,
SIDE_BOTTOM = 3
);
public
Paint: procedure(Panel: VPANEL); stdcall;
Paint2: procedure(X0, Y0, X1, Y1: Integer); stdcall;
Paint3: procedure(X0, Y0, X1, Y1: Integer; BreakSide, BreakStart, BreakStop: Integer); stdcall;
SetInset: procedure(Left, Top, Right, Bottom: Integer); stdcall;
GetInset: procedure(out Left, Top, Right, Bottom: Integer); stdcall;
ApplySchemeSettings: procedure(Scheme: IScheme; InResourceData: KeyValues); stdcall;
GetName: function: PAnsiChar; stdcall;
SetName: procedure(Name: PAnsiChar); stdcall;
end;
//-----------------------------------------------------------------------------
// Purpose: Interface to panel borders
// Borders have a close relationship with panels
// They are the edges of the panel.
//-----------------------------------------------------------------------------
IBorder = ^PVTableBorder;
{$ENDREGION}
{$REGION 'IImage'}
//-----------------------------------------------------------------------------
// Purpose: Interface to drawing an image
//-----------------------------------------------------------------------------
PVTableIImage = ^VTableIImage;
VTableIImage = object
public
// Call to Paint the image
// Image will draw within the current panel context at the specified position
Paint: procedure; stdcall;
// Set the position of the image
SetPos: procedure(X, Y: Integer); stdcall;
// Gets the size of the content
GetContentSize: procedure(out Wide, Tall: Integer); stdcall;
// Get the size the image will actually draw in (usually defaults to the content size)
GetSize: procedure(out Wide, Tall: Integer); stdcall;
// Sets the size of the image
SetSize: procedure(Wide, Tall: Integer); stdcall;
// Set the draw color
SetColor: procedure(Col: SDK_Color); stdcall;
// virtual destructor
Destroy: procedure(Free: Boolean); stdcall;
end;
IImage = ^PVTableIImage;
{$ENDREGION}
{$REGION 'Image'}
PVTableImage = ^VTableImage;
VTableImage = object(VTableIImage)
public
// Get the position of the image
GetPos: procedure(out x, y: Integer); stdcall;
// set the background color
SetBkColor: procedure(Color: SDK_Color); stdcall;
// Get the draw color
GetColor: function: SDK_Color; stdcall;
{$IFDEF MSWINDOWS}
DrawSetColor2: procedure(r, g, b, a: Integer); stdcall;
DrawSetColor: procedure(color: SDK_Color); stdcall;
{$ELSE}
DrawSetColor: procedure(color: SDK_Color); stdcall;
DrawSetColor2: procedure(r, g, b, a: Integer); stdcall;
{$ENDIF}
DrawFilledRect: procedure(x0, y0, x1, y1: Integer); stdcall;
DrawOutlinedRect: procedure(x0, y0, x1, y1: Integer); stdcall;
DrawLine: procedure(x0, y0, x1, y1: Integer); stdcall;
DrawPolyLine: procedure(px, py: PInteger; numPoints: Integer); stdcall;
DrawSetTextFont: procedure(font: HFont); stdcall;
{$IFDEF MSWINDOWS}
DrawSetTextColor2: procedure(r, g, b, a: Integer); stdcall;
DrawSetTextColor: procedure(color: SDK_Color); stdcall;
{$ELSE}
DrawSetTextColor: procedure(color: SDK_Color); stdcall;
DrawSetTextColor2: procedure(r, g, b, a: Integer); stdcall;
{$ENDIF}
DrawSetTextPos: procedure(x, y: Integer); stdcall;
{$IFDEF MSWINDOWS}
DrawPrintText2: procedure(x, y: Integer; str: PWideChar; strlen: Integer); stdcall;
DrawPrintText: procedure(str: PWideChar; strlen: Integer); stdcall;
{$ELSE}
DrawPrintText: procedure(str: PWideChar; strlen: Integer); stdcall;
DrawPrintText2: procedure(x, y: Integer; str: PWideChar; strlen: Integer); stdcall;
{$ENDIF}
{$IFDEF MSWINDOWS}
DrawPrintChar2: procedure(x, y: Integer; ch: WideChar); stdcall;
DrawPrintChar: procedure(ch: WideChar); stdcall;
{$ELSE}
DrawPrintChar2: procedure(x, y: Integer; ch: WideChar); stdcall;
DrawPrintChar: procedure(ch: WideChar); stdcall;
{$ENDIF}
DrawSetTexture: procedure(id: Integer); stdcall;
DrawTexturedRect: procedure(x0, y0, x1, y1: Integer); stdcall;
end;
Image = ^PVTableImage;
{$ENDREGION}
{$REGION 'IInput'}
PVTableInput = ^VTableInput;
VTableInput = object(VIBaseInterface)
public
SetMouseFocus: procedure(newMouseFocus: VPANEL); stdcall;
SetMouseCapture: procedure(panel: VPANEL); stdcall;
// returns the string name of a scan code
GetKeyCodeText: procedure(code: KeyCode; buf: PAnsiChar; buflen: Integer); stdcall;
// focus
GetFocus: function: VPANEL; stdcall;
GetMouseOver: function: VPANEL; stdcall; // returns the panel the mouse is currently over, ignoring mouse capture
// mouse state
SetCursorPos: procedure(x, y: Integer); stdcall;
GetCursorPos: procedure(out x, y: Integer); stdcall;
WasMousePressed: function(code: MouseCode): Boolean; stdcall;
WasMouseDoublePressed: function(code: MouseCode): Boolean; stdcall;
IsMouseDown: function(code: MouseCode): Boolean; stdcall;
// cursor override
SetCursorOveride: procedure(cursor: HCursor); stdcall;
GetCursorOveride: function: HCursor; stdcall;
// key state
WasMouseReleased: function(code: MouseCode): Integer; stdcall;
WasKeyPressed: function(code: MouseCode): Integer; stdcall;
IsKeyDown: function(code: MouseCode): Integer; stdcall;
WasKeyTyped: function(code: MouseCode): Integer; stdcall;
WasKeyReleased: function(code: MouseCode): Integer; stdcall;
GetAppModalSurface: function: VPANEL; stdcall;
// set the modal dialog panel.
// all events will go only to this panel and its children.
SetAppModalSurface: procedure(panel: VPANEL); stdcall;
// release the modal dialog panel
// do this when your modal dialog finishes.
ReleaseAppModalSurface: procedure; stdcall;
GetCursorPosition: procedure(out x, y: Integer); stdcall;
RunFrame: procedure; stdcall;
PanelDeleted: procedure(panel: VPANEL); stdcall;
UpdateMouseFocus: procedure(x, y: Integer); stdcall;
InternalCursorMoved: function(x, y: Integer): Boolean; stdcall; //expects input in surface space
InternalMousePressed: function(code: MouseCode): Boolean; stdcall;
InternalMouseDoublePressed: function(code: MouseCode): Boolean; stdcall;
InternalMouseReleased: function(code: MouseCode): Boolean; stdcall;
InternalMouseWheeled: function(delta: Integer): Boolean; stdcall;
InternalKeyCodePressed: function(code: KeyCode): Boolean; stdcall;
InternalKeyCodeTyped: procedure(code: KeyCode); stdcall;
InternalKeyTyped: procedure(unichar: WideChar); stdcall;
// Creates/ destroys "input" contexts, which contains information
// about which controls have mouse + key focus, for example.
CreateInputContext: function: HInputContext; stdcall;
DestroyInputContext: procedure(context: HInputContext); stdcall;
// Associates a particular panel with an input context
// Associating NULL is valid; it disconnects the panel from the context
AssociatePanelWithInputContext: procedure(context: HInputContext; pRoot: VPANEL); stdcall;
// Activates a particular input context, use DEFAULT_INPUT_CONTEXT
// to get the one normally used by VGUI
ActivateInputContext: procedure(context: HInputContext); stdcall;
// returns true if the specified panel is a child of the current modal panel
// if no modal panel is set, then this always returns TRUE
IsChildOfModalPanel: function(panel: VPANEL; checkModalSubTree: Boolean = True): Boolean; stdcall;
ResetInputContext: procedure(context: HInputContext); stdcall;
end;
IInput = ^PVTableInput;
{$ENDREGION}
{$REGION 'PanelWrapper'}
//-----------------------------------------------------------------------------
// Purpose: interface from Client panels -> vgui panels
//-----------------------------------------------------------------------------
PVIPanel009 = ^VIPanel009;
VIPanel009 = object(VIBaseInterface)
public
Init: procedure(vguiPanel: VPANEL; Panel: Pointer (*IClientPanel*)); stdcall;
// methods
SetPos: procedure(vguiPanel: VPANEL; X, Y: Integer); stdcall;
GetPos: procedure(vguiPanel: VPANEL; out X, Y: Integer); stdcall; // TODO: crashes app, find the reason
SetSize: procedure(vguiPanel: VPANEL; Wide, Tall: Integer); stdcall;
GetSize: procedure(vguiPanel: VPANEL; out Wide, Tall: Integer); stdcall;
SetMinimumSize: procedure(vguiPanel: VPANEL; Wide, Tall: Integer); stdcall;
GetMinimumSize: procedure(vguiPanel: VPANEL; out Wide, Tall: Integer); stdcall;
SetZPos: procedure(vguiPanel: VPANEL; Z: Integer); stdcall;
GetZPos: function(vguiPanel: VPANEL): Integer; stdcall;
GetAbsPos: procedure(vguiPanel: VPANEL; X, Y: Integer); stdcall;
GetClipRect: procedure(vguiPanel: VPANEL; out X0, Y0, X1, Y1: Integer); stdcall;
SetInset: procedure(vguiPanel: VPANEL; Left, Top, Right, Bottom: Integer); stdcall;
GetInset: procedure(vguiPanel: VPANEL; out Left, Top, Right, Bottom: Integer); stdcall;
SetVisible: procedure(vguiPanel: VPANEL; State: Boolean); stdcall;
IsVisible: function(vguiPanel: VPANEL): Boolean; stdcall;
SetParent: procedure(vguiPanel, newParent: VPANEL); stdcall;
GetChildCount: function(vguiPanel: VPANEL): Integer; stdcall;
GetChild: function(vguiPanel: VPANEL; Index: Integer): VPANEL; stdcall;
GetChildren: function(vguiPanel: VPANEL): CUtlVector<VPANEL, Integer>; stdcall;
GetParent: function(vguiPanel: VPANEL): VPANEL; stdcall;
MoveToFront: procedure(vguiPanel: VPANEL); stdcall;
MoveToBack: procedure(vguiPanel: VPANEL); stdcall;
HasParent: function(vguiPanel, PotentialParent: VPANEL): Boolean; stdcall;
IsPopup: function(vguiPanel: VPANEL): Boolean; stdcall;
SetPopup: procedure(vguiPanel: VPANEL; State: Boolean); stdcall;
IsFullyVisible: function(vguiPanel: VPANEL): Boolean; stdcall;
// gets the scheme this panel uses
GetScheme: function(vguiPanel: VPANEL): HScheme; stdcall;
// gets whether or not this panel should scale with screen resolution
IsProportional: function(vguiPanel: VPANEL): Boolean; stdcall;
// returns true if auto-deletion flag is set
IsAutoDeleteSet: function(vguiPanel: VPANEL): Boolean; stdcall;
// deletes the Panel * associated with the vpanel
DeletePanel: procedure(vguiPanel: VPANEL); stdcall;
// input interest
SetKeyBoardInputEnabled: procedure(vguiPanel: VPANEL; State: Boolean); stdcall;
SetMouseInputEnabled: procedure(vguiPanel: VPANEL; State: Boolean); stdcall;
IsKeyBoardInputEnabled: function(vguiPanel: VPANEL): Boolean; stdcall;
IsMouseInputEnabled: function(vguiPanel: VPANEL): Boolean; stdcall;
// calculates the panels current position within the hierarchy
Solve: procedure(vguiPanel: VPANEL); stdcall;
// gets names of the object (for debugging purposes)
GetName: function(vguiPanel: VPANEL): PAnsiChar; stdcall;
GetClassName: function(vguiPanel: VPANEL): PAnsiChar; stdcall;
// delivers a message to the panel
SendMessage: procedure(vguiPanel: VPANEL; Params: PKeyValues; FromPanel: VPANEL); stdcall;
// these pass through to the IClientPanel
Think: procedure(vguiPanel: VPANEL); stdcall;
PerformApplySchemeSettings: procedure(vguiPanel: VPANEL); stdcall;
PaintTraverse: procedure(vguiPanel: VPANEL; ForceRepaint: Boolean; AllowForce: Boolean = True); stdcall;
Repaint: procedure(vguiPanel: VPANEL); stdcall;
IsWithinTraverse: function(vguiPanel: VPANEL; X, Y: Integer; TraversePopups: Boolean): VPANEL; stdcall;
OnChildAdded: procedure(vguiPanel, Child: VPANEL); stdcall;
OnSizeChanged: procedure(vguiPanel: VPANEL; NewWide, NewTall: Integer); stdcall;
InternalFocusChanged: procedure(vguiPanel: VPANEL; Lost: Boolean); stdcall;
RequestInfo: function(vguiPanel: VPANEL; OutputData: PKeyValues): Boolean; stdcall;
RequestFocus: procedure(vguiPanel: VPANEL; Direction: Integer = 0); stdcall;
RequestFocusPrev: function(vguiPanel, ExistingPanel: VPANEL): Boolean; stdcall;
RequestFocusNext: function(vguiPanel, ExistingPanel: VPANEL): Boolean; stdcall;
GetCurrentKeyFocus: function(vguiPanel: VPANEL): VPANEL; stdcall;
GetTabPosition: function(vguiPanel: VPANEL): Integer; stdcall;
// used by ISurface to store platform-specific data
Plat: function(vguiPanel: VPANEL): SurfacePlat; stdcall;
SetPlat: procedure(vguiPanel: VPANEL; Plat: SurfacePlat); stdcall;
// returns a pointer to the vgui controls baseclass Panel *
// destinationModule needs to be passed in to verify that the returned Panel * is from the same module
// it must be from the same module since Panel * vtbl may be different in each module
GetPanel: function(vguiPanel: VPANEL; ParentName: PAnsiChar): VGUIPanel; stdcall;
IsEnabled: function(vguiPanel: VPANEL): Boolean; stdcall;
SetEnabled: procedure(vguiPanel: VPANEL; State: Boolean); stdcall;
// Used by the drag/drop manager to always draw on top
IsTopmostPopup: function(vguiPanel: VPANEL): Boolean; stdcall;
SetTopmostPopup: procedure(vguiPanel: VPANEL; State: Boolean); stdcall;
SetMessageContextId: procedure(vguiPanel: VPANEL;nContextId: Integer); stdcall;
GetMessageContextId: function(vguiPanel: VPANEL): Integer; stdcall;
GetUnpackStructure: function(vguiPanel: VPANEL): PDmxElementUnpackStructure; stdcall;
OnUnserialized: procedure(vguiPanel: VPANEL; Element: PCDmxElement); stdcall;
// sibling pins
SetSiblingPin: procedure(vguiPanel: VPANEL; newSibling: VPANEL; MyCornerToPin: Byte = 0; SiblingCornerToPinTo: Byte = 0 ); stdcall;
end;
IPanel009 = ^PVIPanel009;
PVIPanel007 = ^VIPanel007;
VIPanel007 = object(VIBaseInterface)
public
Init: procedure(vguiPanel: VPANEL; Panel: Pointer (*IClientPanel*)); stdcall;
// methods
SetPos: procedure(vguiPanel: VPANEL; X, Y: Integer); stdcall;
GetPos: procedure(vguiPanel: VPANEL; out X, Y: Integer); stdcall; // TODO: crashes app, find the reason
SetSize: procedure(vguiPanel: VPANEL; Wide, Tall: Integer); stdcall;
GetSize: procedure(vguiPanel: VPANEL; out Wide, Tall: Integer); stdcall;
SetMinimumSize: procedure(vguiPanel: VPANEL; Wide, Tall: Integer); stdcall;
GetMinimumSize: procedure(vguiPanel: VPANEL; out Wide, Tall: Integer); stdcall;
SetZPos: procedure(vguiPanel: VPANEL; Z: Integer); stdcall;
GetZPos: function(vguiPanel: VPANEL): Integer; stdcall;
GetAbsPos: procedure(vguiPanel: VPANEL; X, Y: Integer); stdcall;
GetClipRect: procedure(vguiPanel: VPANEL; out X0, Y0, X1, Y1: Integer); stdcall;
SetInset: procedure(vguiPanel: VPANEL; Left, Top, Right, Bottom: Integer); stdcall;
GetInset: procedure(vguiPanel: VPANEL; out Left, Top, Right, Bottom: Integer); stdcall;
SetVisible: procedure(vguiPanel: VPANEL; State: Boolean); stdcall;
IsVisible: function(vguiPanel: VPANEL): Boolean; stdcall;
SetParent: procedure(vguiPanel, newParent: VPANEL); stdcall;
GetChildCount: function(vguiPanel: VPANEL): Integer; stdcall;
GetChild: function(vguiPanel: VPANEL; Index: Integer): VPANEL; stdcall;
GetParent: function(vguiPanel: VPANEL): VPANEL; stdcall;
MoveToFront: procedure(vguiPanel: VPANEL); stdcall;
MoveToBack: procedure(vguiPanel: VPANEL); stdcall;
HasParent: function(vguiPanel, PotentialParent: VPANEL): Boolean; stdcall;
IsPopup: function(vguiPanel: VPANEL): Boolean; stdcall;
SetPopup: procedure(vguiPanel: VPANEL; State: Boolean); stdcall;
Render_GetPopupVisible: function(vguiPanel: VPANEL): Boolean; stdcall;
Render_SetPopupVisible: procedure(vguiPanel: VPANEL; State: Boolean); stdcall;
// gets the scheme this panel uses
GetScheme: function(vguiPanel: VPANEL): HScheme; stdcall;
// gets whether or not this panel should scale with screen resolution
IsProportional: function(vguiPanel: VPANEL): Boolean; stdcall;
// returns true if auto-deletion flag is set
IsAutoDeleteSet: function(vguiPanel: VPANEL): Boolean; stdcall;
// deletes the Panel * associated with the vpanel
DeletePanel: procedure(vguiPanel: VPANEL); stdcall;
// input interest
SetKeyBoardInputEnabled: procedure(vguiPanel: VPANEL; State: Boolean); stdcall;
SetMouseInputEnabled: procedure(vguiPanel: VPANEL; State: Boolean); stdcall;
IsKeyBoardInputEnabled: function(vguiPanel: VPANEL): Boolean; stdcall;
IsMouseInputEnabled: function(vguiPanel: VPANEL): Boolean; stdcall;
// calculates the panels current position within the hierarchy
Solve: procedure(vguiPanel: VPANEL); stdcall;
// gets names of the object (for debugging purposes)
GetName: function(vguiPanel: VPANEL): PAnsiChar; stdcall;
GetClassName: function(vguiPanel: VPANEL): PAnsiChar; stdcall;
// delivers a message to the panel
SendMessage: procedure(vguiPanel: VPANEL; Params: PKeyValues; FromPanel: VPANEL); stdcall;
// these pass through to the IClientPanel
Think: procedure(vguiPanel: VPANEL); stdcall;
PerformApplySchemeSettings: procedure(vguiPanel: VPANEL); stdcall;
PaintTraverse: procedure(vguiPanel: VPANEL; ForceRepaint: Boolean; AllowForce: Boolean = True); stdcall;
Repaint: procedure(vguiPanel: VPANEL); stdcall;
IsWithinTraverse: function(vguiPanel: VPANEL; X, Y: Integer; TraversePopups: Boolean): VPANEL; stdcall;
OnChildAdded: procedure(vguiPanel, Child: VPANEL); stdcall;
OnSizeChanged: procedure(vguiPanel: VPANEL; NewWide, NewTall: Integer); stdcall;
InternalFocusChanged: procedure(vguiPanel: VPANEL; Lost: Boolean); stdcall;
RequestInfo: function(vguiPanel: VPANEL; OutputData: PKeyValues): Boolean; stdcall;
RequestFocus: procedure(vguiPanel: VPANEL; Direction: Integer = 0); stdcall;
RequestFocusPrev: function(vguiPanel, ExistingPanel: VPANEL): Boolean; stdcall;
RequestFocusNext: function(vguiPanel, ExistingPanel: VPANEL): Boolean; stdcall;
GetCurrentKeyFocus: function(vguiPanel: VPANEL): VPANEL; stdcall;
GetTabPosition: function(vguiPanel: VPANEL): Integer; stdcall;
// used by ISurface to store platform-specific data
Plat: function(vguiPanel: VPANEL): SurfacePlat; stdcall;
SetPlat: procedure(vguiPanel: VPANEL; Plat: SurfacePlat); stdcall;
// returns a pointer to the vgui controls baseclass Panel *
// destinationModule needs to be passed in to verify that the returned Panel * is from the same module
// it must be from the same module since Panel * vtbl may be different in each module
GetPanel: function(vguiPanel: VPANEL; ParentName: PAnsiChar): VGUIPanel; stdcall;
IsEnabled: function(vguiPanel: VPANEL): Boolean; stdcall;
SetEnabled: procedure(vguiPanel: VPANEL; State: Boolean); stdcall;
Client: function(vguiPanel: VPANEL): Pointer (*IClientPanel*); stdcall;
GetModuleName: function(vguiPanel: VPANEL): PAnsiChar; stdcall;
end;
IPanel007 = ^PVIPanel007;
{$IFDEF VGUI_USE_PANEL007}
type
PVIPanel = PVIPanel007;
VIPanel = VIPanel007;
IPanel = IPanel007;
const
VGUI_PANEL_INTERFACE_LIBRARY = 'vgui2.dll';
VGUI_PANEL_INTERFACE_VERSION = 'VGUI_Panel007';
{$ELSE}
type
PVIPanel = PVIPanel009;
VIPanel = VIPanel009;
IPanel = IPanel009;
const
VGUI_PANEL_INTERFACE_LIBRARY = 'tier3.dll';
VGUI_PANEL_INTERFACE_VERSION = 'VGUI_Panel009';
{$ENDIF}
{$ENDREGION}
{$REGION 'IClientPanel'}
type
PVIClientPanel = ^VIClientPanel;
VIClientPanel = object
public
GetVPanel: function: VPANEL; stdcall;
// straight interface to Panel functions
Think: procedure; stdcall;
PerformApplySchemeSettings: procedure; stdcall;
PaintTraverse: procedure(ForceRepaint: Boolean; AllowForce: Boolean); stdcall;
Repaint: procedure; stdcall;
IsWithinTraverse: function(X, Y: Integer; TraversePopups: Boolean): VPANEL; stdcall;
GetInset: procedure(out Top, Left, Right, Bottom: Integer); stdcall;
GetClipRect: procedure(out X0, Y0, X1, Y1: Integer); stdcall;
OnChildAdded: procedure(Child: VPANEL); stdcall;
OnSizeChanged: procedure(NewWide, NewTall: Integer); stdcall;
InternalFocusChanged: procedure(Lost: Boolean); stdcall;
RequestInfo: function(OutputData: PKeyValues): Boolean; stdcall;
RequestFocus: procedure(Direction: Integer); stdcall;
RequestFocusPrev: function(ExistingPanel: VPANEL): Boolean; stdcall;
RequestFocusNext: function(ExistingPanel: VPANEL): Boolean; stdcall;
OnMessage: procedure(Params: PKeyValues; FromPanel: VPANEL); stdcall;
GetCurrentKeyFocus: function: VPANEL; stdcall;
GetTabPosition: function: Integer; stdcall;
// for debugging purposes
GetName: function: PAnsiChar; stdcall;
GetClassName: function: PAnsiChar; stdcall;
// get scheme handles from panels
GetScheme: function: HScheme; stdcall;
// gets whether or not this panel should scale with screen resolution
IsProportional: function: Boolean; stdcall;
// auto-deletion
IsAutoDeleteSet: function: Boolean; stdcall;
// deletes this
DeletePanel: procedure; stdcall;
// interfaces
QueryInterface: function(ID: EInterfaceID): Pointer; stdcall;
// returns a pointer to the vgui controls baseclass Panel *
GetPanel: function: VGUIPanel; stdcall;
// returns the name of the module this panel is part of
GetModuleName: function: PAnsiChar; stdcall;
end;
IClientPanel = ^PVIClientPanel;
{$ENDREGION}
{$REGION 'Panel'}
// pin positions for auto-layout
PinCorner_e = (PIN_TOPLEFT = 0, PIN_TOPRIGHT, PIN_BOTTOMLEFT, PIN_BOTTOMRIGHT);
// specifies the auto-resize directions for the panel
AutoResize_e = (AUTORESIZE_NO = 0, AUTORESIZE_RIGHT, AUTORESIZE_DOWN, AUTORESIZE_DOWNANDRIGHT);
//-----------------------------------------------------------------------------
// Purpose: Base interface to all vgui windows
// All vgui controls that receive message and/or have a physical presence
// on screen are be derived from Panel.
// This is designed as an easy-access to the vgui-functionality; for more
// low-level access to vgui functions use the IPanel/IClientPanel interfaces directly
//-----------------------------------------------------------------------------
PVTablePanel = ^VTablePanel;
VTablePanel = object(VIClientPanel)
public
GetMessageMap: function: Pointer; stdcall;
Destroy: procedure(Free: Boolean); stdcall;
// panel visibility
// invisible panels and their children do not drawn, updated, or receive input messages
SetVisible: procedure(State: Boolean); stdcall;
IsVisible: function: Boolean; stdcall;
// painting
{$IFDEF MSWINDOWS}
PostMessage: procedure(Target: VGUIPanel; Msg: PKeyValues; DelaySeconds: Single = 0.0); stdcall;
PostMessageToVPanel: procedure(Target: VPANEL; Msg: PKeyValues; DelaySeconds: Single = 0.0); stdcall;
{$ELSE}
PostMessageToVPanel: procedure(Target: VPANEL; Msg: PKeyValues; DelaySeconds: Single = 0.0); stdcall;
{$ENDIF}
OnMove: procedure; stdcall;
// panel hierarchy
GetParent: function: VGUIPanel; stdcall;
GetVParent: function: VPANEL; stdcall;
{$IFDEF MSWINDOWS}
SetParentByVPanel: procedure(NewParent: VPANEL); stdcall;
SetParentByPanel: procedure(NewParent: VGUIPanel); stdcall;
{$ELSE}
SetParentByPanel: procedure(NewParent: VGUIPanel); stdcall;
SetParentByVPanel: procedure(NewParent: VPANEL); stdcall;
{$ENDIF}
HasParent: function(PotentialParent: VPANEL): Boolean; stdcall;
SetAutoDelete: procedure(State: Boolean); stdcall; // if set to true, panel automatically frees itself when parent is deleted
{$IFDEF MSWINDOWS}
AddActionSignalTargetByVPanel: procedure(MessageTarget: VPANEL); stdcall;
AddActionSignalTargetByPanel: procedure(MessageTarget: VGUIPanel); stdcall;
{$ELSE}
AddActionSignalTargetByPanel: procedure(MessageTarget: VGUIPanel); stdcall;
AddActionSignalTargetByVPanel: procedure(MessageTarget: VPANEL); stdcall;
{$ENDIF}
RemoveActionSignalTarget: procedure(OldTarget: VGUIPanel); stdcall;
PostActionSignal: procedure(Msg: PKeyValues); // sends a message to the current actionSignalTarget(s)
RequestInfoFromChild: function(ChildName: PAnsiChar; OutputData: PKeyValues): Boolean; stdcall;
PostMessageToChild: procedure(ChildName: PAnsiChar; Msg: PKeyValues); stdcall;
{$IFNDEF MSWINDOWS}
PostMessage: procedure(Target: VGUIPanel; Msg: PKeyValues; DelaySeconds: Single = 0.0); stdcall;
{$ENDIF}
SetInfo: function(InputData: PKeyValues): Boolean; stdcall; // sets a specified value in the control - inverse of the above
// drawing state
SetEnabled: procedure(State: Boolean); stdcall;
IsEnabled: function: Boolean; stdcall;
IsPopup: function: Boolean; stdcall; // has a parent, but is in it's own space
MoveToFront: procedure; stdcall;
SetBgColor: procedure(Color: SDK_Color); stdcall;
SetFgColor: procedure(Color: SDK_Color); stdcall;
GetBgColor: function: SDK_Color; stdcall;
GetFgColor: function: SDK_Color; stdcall;
SetCursor: procedure(Cursor: HCursor); stdcall;
GetCursor: function: HCursor; stdcall;
HasFocus: function: Boolean; stdcall;
InvalidateLayout: procedure(LayoutNow: Boolean = False; ReloadScheme: Boolean = False); stdcall;
SetTabPosition: procedure(Position: Integer); stdcall;
SetBorder: procedure(Border: IBorder); stdcall;
GetBorder: function: IBorder; stdcall;
SetPaintBorderEnabled: procedure(State: Boolean); stdcall;
SetPaintBackgroundEnabled: procedure(State: Boolean); stdcall;
SetPaintEnabled: procedure(State: Boolean); stdcall;
SetPostChildPaintEnabled: procedure(State: Boolean); stdcall;
GetPaintSize: procedure(out Wide, Tall: Integer); stdcall;
SetBuildGroup: procedure(BuildGroup: BuildGroup); stdcall;
IsBuildGroupEnabled: function: Boolean; stdcall;
IsCursorNone: function: Boolean; stdcall;
IsCursorOver: function: Boolean; stdcall; // returns true if the cursor is currently over the panel
MarkForDeletion: procedure stdcall; // object will free it's memory next tick
IsLayoutInvalid: function: Boolean; stdcall; // does this object require a perform layout?
HasHotkey: function(Key: WideChar): VGUIPanel; stdcall; // returns the panel that has this hotkey
IsOpaque: function: Boolean; stdcall;
SetSchemeByTag: procedure(Tag: PAnsiChar); stdcall;
SetSchemeByHandle: procedure(Scheme: HScheme); stdcall;
GetSchemeColor: function(KeyName: PAnsiChar; PScheme: IScheme): SDK_Color; stdcall;
GetSchemeColor2: function(KeyName: PAnsiChar; DefaultColor: SDK_Color; PScheme: IScheme): SDK_Color; stdcall;
// called when scheme settings need to be applied; called the first time before the panel is painted
ApplySchemeSettings: procedure(PScheme: IScheme); stdcall;
// interface to build settings
// takes a group of settings and applies them to the control
ApplySettings: procedure(InResourceData: PKeyValues); stdcall;
// records the settings into the resource data
GetSettings: procedure(OutResourceData: PKeyValues); stdcall;
// gets a description of the resource for use in the UI
// format: <type><whitespace | punctuation><keyname><whitespace| punctuation><type><whitespace | punctuation><keyname>...
// unknown types as just displayed as strings in the UI (for future UI expansion)
GetDescription: function: PAnsiChar; stdcall;
// user configuration settings
// this is used for any control details the user wants saved between sessions
// eg. dialog positions, last directory opened, list column width
ApplyUserConfigSettings: procedure(UserConfig: PKeyValues); stdcall;
// returns user config settings for this control
GetUserConfigSettings: procedure(UserConfig: PKeyValues); stdcall;
// optimization, return true if this control has any user config settings
HasUserConfigSettings: function: Boolean; stdcall;
OnThink: procedure; stdcall; // called every frame before painting, but only if panel is visible
OnCommand: procedure(Command: PAnsiChar); stdcall; // called when a panel receives a command
OnMouseCaptureLost: procedure; stdcall; // called after the panel loses mouse capture
OnSetFocus: procedure; stdcall; // called after the panel receives the keyboard focus
OnKillFocus: procedure; stdcall; // called after the panel loses the keyboard focus
OnDelete: procedure; stdcall; // called to delete the panel; Panel::OnDelete() does simply { delete this; }
// called every frame if ivgui()->AddTickSignal() is called
OnTick: procedure; stdcall;
// input messages
OnCursorMoved: procedure(X, Y: Integer); stdcall;
OnCursorEntered: procedure; stdcall;
OnCursorExited: procedure; stdcall;
OnMousePressed: procedure(Code: VGUIMouseCode); stdcall;
OnMouseDoublePressed: procedure(Code: VGUIMouseCode); stdcall;
OnMouseReleased: procedure(Code: VGUIMouseCode); stdcall;
OnMouseWheeled: procedure(Delta: Integer); stdcall;
// base implementation forwards Key messages to the Panel's parent
// - override to 'swallow' the input
OnKeyCodePressed: procedure(Code: KeyCode); stdcall;
OnKeyCodeTyped: procedure(Code: KeyCode); stdcall;
OnKeyTyped: procedure(UniChar: WideChar); stdcall;
OnKeyCodeReleased: procedure(Code: KeyCode); stdcall;
OnKeyFocusTicked: procedure; stdcall; // every window gets key ticked events
// forwards mouse messages to the panel's parent
OnMouseFocusTicked: procedure; stdcall;
// message handlers that don't go through the message pump
PaintBackground: procedure; stdcall;
Paint: procedure; stdcall;
PaintBorder: procedure; stdcall;
PaintBuildOverlay: procedure; stdcall; // the extra drawing for when in build mode
PostChildPaint: procedure; stdcall;
PerformLayout: procedure; stdcall;
// this enables message mapping for this class - requires matching IMPLEMENT_PANELDESC() in the .cpp file
GetPanelMap: function: PanelMap_t; stdcall;
// proportional mode settings
SetProportional: procedure(State: Boolean); stdcall;
// input interest
SetMouseInputEnabled: procedure(State: Boolean); stdcall;
SetKeyBoardInputEnabled: procedure(State: Boolean); stdcall;
IsMouseInputEnabled: function: Boolean; stdcall;
IsKeyBoardInputEnabled: function: Boolean; stdcall;
OnRequestFocus: procedure(SubFocus, DefaultPanel: VPANEL); stdcall;
InternalCursorMoved: procedure(XPos, YPos: Integer); stdcall;
InternalCursorEntered: procedure; stdcall;
InternalCursorExited: procedure; stdcall;
InternalMousePressed: procedure(Code: Integer); stdcall;
InternalMouseDoublePressed: procedure(Code: Integer); stdcall;
InternalMouseReleased: procedure(Code: Integer); stdcall;
InternalMouseWheeled: procedure(Delta: Integer); stdcall;
InternalKeyCodePressed: procedure(Code: Integer); stdcall;
InternalKeyCodeTyped: procedure(Code: Integer); stdcall;
InternalKeyTyped: procedure(UniChar: WideChar); stdcall;
InternalKeyCodeReleased: procedure(Code: Integer); stdcall;
InternalKeyFocusTicked: procedure; stdcall;
InternalMouseFocusTicked: procedure; stdcall;
InternalInvalidateLayout: procedure; stdcall;
InternalMove: procedure; stdcall;
end;
PDBasicPanel = ^DBasicPanel;
DBasicPanel = object
public
RegisterClass: Boolean;
RepaintRegister: Boolean;
OnCommandRegister: Boolean;
OnMouseCaptureLostRegister: Boolean;
OnSetFocusRegister: Boolean;
OnKillFocusRegister: Boolean;
OnDeleteRegister: Boolean;
OnTickRegister: Boolean;
OnCursorMovedRegister: Boolean;