@tlua/gmod 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -0
- package/__metadata.json +4 -0
- package/_globals.d.tlua +178 -0
- package/_gmod-std.d.tlua +35 -0
- package/achievementicon.d.tlua +12 -0
- package/achievements.d.tlua +162 -0
- package/ai.d.tlua +65 -0
- package/ai_schedule.d.tlua +17 -0
- package/ai_task.d.tlua +17 -0
- package/angle.d.tlua +197 -0
- package/avatarimage.d.tlua +10 -0
- package/awesomium.d.tlua +14 -0
- package/baseclass.d.tlua +42 -0
- package/bf_read.d.tlua +110 -0
- package/bit.d.tlua +121 -0
- package/button.d.tlua +13 -0
- package/cam.d.tlua +220 -0
- package/ceffectdata.d.tlua +337 -0
- package/chat.d.tlua +62 -0
- package/checkbutton.d.tlua +14 -0
- package/cleanup.d.tlua +88 -0
- package/cluaemitter.d.tlua +119 -0
- package/clualocomotion.d.tlua +383 -0
- package/cluaparticle.d.tlua +426 -0
- package/cmovedata.d.tlua +476 -0
- package/cnavarea.d.tlua +845 -0
- package/cnavladder.d.tlua +209 -0
- package/cnewparticleeffect.d.tlua +259 -0
- package/color.d.tlua +339 -0
- package/concommand.d.tlua +69 -0
- package/constraint.d.tlua +311 -0
- package/construct.d.tlua +26 -0
- package/contentheader.d.tlua +32 -0
- package/contenticon.d.tlua +86 -0
- package/contentsidebar.d.tlua +45 -0
- package/contentsidebartoolbox.d.tlua +13 -0
- package/contextbase.d.tlua +37 -0
- package/controlpanel.d.tlua +140 -0
- package/controlpresets.d.tlua +118 -0
- package/convar.d.tlua +162 -0
- package/cookie.d.tlua +60 -0
- package/coroutine.d.tlua +90 -0
- package/crecipientfilter.d.tlua +152 -0
- package/csent.d.tlua +10 -0
- package/csoundpatch.d.tlua +150 -0
- package/ctakedamageinfo.d.tlua +366 -0
- package/ctrllistbox.d.tlua +12 -0
- package/ctrlnumpad.d.tlua +73 -0
- package/cusercmd.d.tlua +320 -0
- package/custom_classes.d.tlua +65 -0
- package/custom_entity_fields.d.tlua +96 -0
- package/cvars.d.tlua +80 -0
- package/dadjustablemodelpanel.d.tlua +81 -0
- package/dalphabar.d.tlua +27 -0
- package/dbinder.d.tlua +37 -0
- package/dbubblecontainer.d.tlua +18 -0
- package/dbutton.d.tlua +88 -0
- package/dcategoryheader.d.tlua +13 -0
- package/dcategorylist.d.tlua +11 -0
- package/dcheckbox.d.tlua +46 -0
- package/dcheckboxlabel.d.tlua +90 -0
- package/dcollapsiblecategory.d.tlua +240 -0
- package/dcolorbutton.d.tlua +73 -0
- package/dcolorcombo.d.tlua +54 -0
- package/dcolorcube.d.tlua +137 -0
- package/dcolormixer.d.tlua +303 -0
- package/dcolorpalette.d.tlua +294 -0
- package/dcolumnsheet.d.tlua +49 -0
- package/dcombobox.d.tlua +161 -0
- package/ddragbase.d.tlua +151 -0
- package/ddrawer.d.tlua +72 -0
- package/debug.d.tlua +236 -0
- package/debugoverlay.d.tlua +193 -0
- package/dentityproperties.d.tlua +63 -0
- package/derma.d.tlua +119 -0
- package/dexpandbutton.d.tlua +30 -0
- package/dfilebrowser.d.tlua +228 -0
- package/dform.d.tlua +176 -0
- package/dframe.d.tlua +261 -0
- package/dgrid.d.tlua +113 -0
- package/dhorizontaldivider.d.tlua +196 -0
- package/dhorizontalscroller.d.tlua +104 -0
- package/dhscrollbar.d.tlua +109 -0
- package/dhtml.d.tlua +91 -0
- package/dhtmlcontrols.d.tlua +62 -0
- package/diconbrowser.d.tlua +113 -0
- package/diconlayout.d.tlua +190 -0
- package/dimage.d.tlua +221 -0
- package/dimagebutton.d.tlua +103 -0
- package/dkillicon.d.tlua +9 -0
- package/dlabel.d.tlua +385 -0
- package/dlabeleditable.d.tlua +51 -0
- package/dlabelurl.d.tlua +100 -0
- package/dlistbox.d.tlua +82 -0
- package/dlistboxitem.d.tlua +42 -0
- package/dlistlayout.d.tlua +14 -0
- package/dlistview.d.tlua +360 -0
- package/dlistview_column.d.tlua +135 -0
- package/dlistview_columnplain.d.tlua +11 -0
- package/dlistview_draggerbar.d.tlua +11 -0
- package/dlistview_line.d.tlua +140 -0
- package/dlistviewheaderlabel.d.tlua +11 -0
- package/dlistviewlabel.d.tlua +11 -0
- package/dlistviewline.d.tlua +11 -0
- package/dmenu.d.tlua +266 -0
- package/dmenubar.d.tlua +42 -0
- package/dmenuoption.d.tlua +135 -0
- package/dmenuoptioncvar.d.tlua +64 -0
- package/dmodelpanel.d.tlua +207 -0
- package/dmodelselect.d.tlua +20 -0
- package/dmodelselectmulti.d.tlua +19 -0
- package/dnotify.d.tlua +93 -0
- package/dnumberscratch.d.tlua +284 -0
- package/dnumberwang.d.tlua +147 -0
- package/dnumpad.d.tlua +11 -0
- package/dnumslider.d.tlua +182 -0
- package/dpanel.d.tlua +152 -0
- package/dpanellist.d.tlua +109 -0
- package/dpaneloverlay.d.tlua +65 -0
- package/dpanelselect.d.tlua +13 -0
- package/dpanpanel.d.tlua +64 -0
- package/dprogress.d.tlua +27 -0
- package/dproperties.d.tlua +52 -0
- package/dproperty_boolean.d.tlua +12 -0
- package/dproperty_combo.d.tlua +31 -0
- package/dproperty_entity.d.tlua +12 -0
- package/dproperty_float.d.tlua +12 -0
- package/dproperty_generic.d.tlua +50 -0
- package/dproperty_int.d.tlua +12 -0
- package/dproperty_vectorcolor.d.tlua +14 -0
- package/dpropertysheet.d.tlua +167 -0
- package/dragndrop.d.tlua +123 -0
- package/draw.d.tlua +162 -0
- package/drgbpicker.d.tlua +49 -0
- package/drive.d.tlua +159 -0
- package/dscrollbargrip.d.tlua +13 -0
- package/dscrollpanel.d.tlua +110 -0
- package/dshape.d.tlua +72 -0
- package/dsizetocontents.d.tlua +46 -0
- package/dslider.d.tlua +302 -0
- package/dsprite.d.tlua +84 -0
- package/dtab.d.tlua +81 -0
- package/dtextentry.d.tlua +442 -0
- package/dtilelayout.d.tlua +218 -0
- package/dtooltip.d.tlua +76 -0
- package/dtree.d.tlua +185 -0
- package/dtree_node.d.tlua +793 -0
- package/dtree_node_button.d.tlua +13 -0
- package/duplicator.d.tlua +338 -0
- package/dverticaldivider.d.tlua +223 -0
- package/dvscrollbar.d.tlua +109 -0
- package/editablepanel.d.tlua +10 -0
- package/effect.d.tlua +121 -0
- package/effects.d.tlua +77 -0
- package/engine.d.tlua +248 -0
- package/entity.d.tlua +8295 -0
- package/ents.d.tlua +267 -0
- package/enums.d.tlua +7082 -0
- package/file.d.tlua +419 -0
- package/file_class.d.tlua +7 -0
- package/fingerposer.d.tlua +12 -0
- package/fingervar.d.tlua +13 -0
- package/frame.d.tlua +11 -0
- package/frame_blend.d.tlua +105 -0
- package/game.d.tlua +482 -0
- package/gameevent.d.tlua +968 -0
- package/gamemode.d.tlua +48 -0
- package/global.d.tlua +3156 -0
- package/gm.d.tlua +3218 -0
- package/gmod.d.tlua +20 -0
- package/gmsave.d.tlua +53 -0
- package/gui.d.tlua +232 -0
- package/gwen.d.tlua +55 -0
- package/halo.d.tlua +42 -0
- package/hammer.d.tlua +17 -0
- package/hook.d.tlua +64 -0
- package/html.d.tlua +22 -0
- package/http.d.tlua +72 -0
- package/iconeditor.d.tlua +130 -0
- package/igmodaudiochannel.d.tlua +419 -0
- package/imagecheckbox.d.tlua +48 -0
- package/imaterial.d.tlua +288 -0
- package/imesh.d.tlua +70 -0
- package/index.d.tlua +277 -0
- package/input.d.tlua +252 -0
- package/invalidateinternalentitycache.d.tlua +13 -0
- package/irestore.d.tlua +94 -0
- package/isave.d.tlua +94 -0
- package/itexture.d.tlua +108 -0
- package/ivideowriter.d.tlua +53 -0
- package/jit.d.tlua +243 -0
- package/killicon.d.tlua +84 -0
- package/label.d.tlua +20 -0
- package/language.d.tlua +26 -0
- package/list.d.tlua +112 -0
- package/makeballoon.d.tlua +15 -0
- package/markup.d.tlua +38 -0
- package/markupobject.d.tlua +53 -0
- package/material.d.tlua +9 -0
- package/math.d.tlua +899 -0
- package/matproxy.d.tlua +60 -0
- package/matselect.d.tlua +106 -0
- package/menu.d.tlua +20 -0
- package/menubar.d.tlua +39 -0
- package/mesh.d.tlua +183 -0
- package/modelimage.d.tlua +12 -0
- package/motionsensor.d.tlua +115 -0
- package/navmesh.d.tlua +274 -0
- package/net.d.tlua +639 -0
- package/nextbot.d.tlua +380 -0
- package/notification.d.tlua +35 -0
- package/npc.d.tlua +1787 -0
- package/numpad.d.tlua +89 -0
- package/os.d.tlua +56 -0
- package/package.d.tlua +15 -0
- package/package.json +18 -0
- package/panel.d.tlua +3650 -0
- package/panellist.d.tlua +13 -0
- package/pathfollower.d.tlua +301 -0
- package/permissions.d.tlua +77 -0
- package/physcollide.d.tlua +40 -0
- package/physenv.d.tlua +136 -0
- package/physobj.d.tlua +799 -0
- package/pixelvis_handle_t.d.tlua +9 -0
- package/player.d.tlua +3320 -0
- package/player_manager.d.tlua +147 -0
- package/preseteditor.d.tlua +13 -0
- package/presets.d.tlua +79 -0
- package/projectedtexture.d.tlua +553 -0
- package/properties.d.tlua +65 -0
- package/propselect.d.tlua +50 -0
- package/radiobutton.d.tlua +13 -0
- package/render.d.tlua +1700 -0
- package/resource.d.tlua +73 -0
- package/richtext.d.tlua +17 -0
- package/sandbox.d.tlua +576 -0
- package/saverestore.d.tlua +148 -0
- package/schedule.d.tlua +69 -0
- package/scripted_ents.d.tlua +124 -0
- package/search.d.tlua +26 -0
- package/serverlist.d.tlua +85 -0
- package/slidebar.d.tlua +12 -0
- package/slider.d.tlua +11 -0
- package/sound.d.tlua +140 -0
- package/spawnicon.d.tlua +95 -0
- package/spawnmenu.d.tlua +286 -0
- package/spawnmenucontentpanel.d.tlua +52 -0
- package/sql.d.tlua +154 -0
- package/stack.d.tlua +57 -0
- package/steamworks.d.tlua +208 -0
- package/string.d.tlua +535 -0
- package/structures.d.tlua +4442 -0
- package/surface.d.tlua +463 -0
- package/surfaceinfo.d.tlua +70 -0
- package/system.d.tlua +134 -0
- package/table.d.tlua +533 -0
- package/task.d.tlua +92 -0
- package/team.d.tlua +195 -0
- package/textentry.d.tlua +12 -0
- package/tgaimage.d.tlua +11 -0
- package/timer.d.tlua +198 -0
- package/tool.d.tlua +466 -0
- package/ugcpublishwindow.d.tlua +83 -0
- package/umsg.d.tlua +147 -0
- package/undo.d.tlua +122 -0
- package/urllabel.d.tlua +13 -0
- package/usermessage.d.tlua +48 -0
- package/utf8.d.tlua +89 -0
- package/util.d.tlua +1087 -0
- package/vector.d.tlua +413 -0
- package/vehicle.d.tlua +472 -0
- package/vgui.d.tlua +201 -0
- package/video.d.tlua +17 -0
- package/vmatrix.d.tlua +392 -0
- package/weapon.d.tlua +913 -0
- package/weapons.d.tlua +90 -0
- package/widgets.d.tlua +29 -0
- package/workshopfilebase.d.tlua +68 -0
package/panel.d.tlua
ADDED
|
@@ -0,0 +1,3650 @@
|
|
|
1
|
+
// AUTO-GENERATED tlua declarations. Do not edit by hand.
|
|
2
|
+
|
|
3
|
+
interface Panel {
|
|
4
|
+
/** The x position of the panel relative to its parent. */
|
|
5
|
+
x: number;
|
|
6
|
+
/** The y position of the panel relative to its parent. */
|
|
7
|
+
y: number;
|
|
8
|
+
/** The base class table of this panel, used for inheritance in vgui.Register panels. */
|
|
9
|
+
BaseClass?: Panel;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Sets the value of this panel. This is a virtual method overridden by
|
|
13
|
+
* individual panel types (DNumSlider, DCheckBox, DTextEntry) to update the
|
|
14
|
+
* panel's displayed value. Called automatically by Panel:SetConVar when the
|
|
15
|
+
* convar changes.
|
|
16
|
+
* @realm client
|
|
17
|
+
* @realm menu
|
|
18
|
+
*/
|
|
19
|
+
SetValue(self: Panel, value: any): void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// The PANEL hook table is a Panel.
|
|
23
|
+
interface PANEL extends Panel {}
|
|
24
|
+
|
|
25
|
+
interface Panel {
|
|
26
|
+
/**
|
|
27
|
+
* Called every frame unless the panel is not visible ([Panel:IsVisible](https://wiki.facepunch.com/gmod/Panel:IsVisible)). Similar to [PANEL:Think](https://wiki.facepunch.com/gmod/PANEL:Think), but can be disabled by [Panel:SetAnimationEnabled](https://wiki.facepunch.com/gmod/Panel:SetAnimationEnabled) as explained below.
|
|
28
|
+
*
|
|
29
|
+
* If you are overriding this, you must call [Panel:AnimationThinkInternal](https://wiki.facepunch.com/gmod/Panel:AnimationThinkInternal) every frame, else animations will cease to work.
|
|
30
|
+
*
|
|
31
|
+
* If you want to "disable" this hook with [Panel:SetAnimationEnabled](https://wiki.facepunch.com/gmod/Panel:SetAnimationEnabled), you must call it after defining this hook. Once disabled, a custom hook **will not** be re-enabled by [Panel:SetAnimationEnabled](https://wiki.facepunch.com/gmod/Panel:SetAnimationEnabled) again - the hook will have to be re-defined.
|
|
32
|
+
*
|
|
33
|
+
* @realm client
|
|
34
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:AnimationThink
|
|
35
|
+
*/
|
|
36
|
+
AnimationThink(self: Panel): void;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
interface Panel {
|
|
40
|
+
/**
|
|
41
|
+
* Called whenever the panel should apply its scheme (colors, fonts, style).
|
|
42
|
+
*
|
|
43
|
+
* It is called a few frames after panel's creation once.
|
|
44
|
+
*
|
|
45
|
+
* The engine will overwrite [Panel:SetFGColor](https://wiki.facepunch.com/gmod/Panel:SetFGColor) and [Panel:SetBGColor](https://wiki.facepunch.com/gmod/Panel:SetBGColor) (from the engine panel theme/scheme) for most panels just before this hook is called in Lua.
|
|
46
|
+
*
|
|
47
|
+
* @realm client
|
|
48
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:ApplySchemeSettings
|
|
49
|
+
*/
|
|
50
|
+
ApplySchemeSettings(self: Panel): void;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
interface Panel {
|
|
54
|
+
/**
|
|
55
|
+
* Called when an object is dragged and hovered over this panel for 0.1 seconds.
|
|
56
|
+
*
|
|
57
|
+
* This is used by [DPropertySheet](https://wiki.facepunch.com/gmod/DPropertySheet) and [DTree](https://wiki.facepunch.com/gmod/DTree), for example to open a tab or expand a node when an object is hovered over it.
|
|
58
|
+
*
|
|
59
|
+
* @realm client
|
|
60
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:DragHoverClick
|
|
61
|
+
*/
|
|
62
|
+
DragHoverClick(self: Panel, hoverTime: number): void;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
interface Panel {
|
|
66
|
+
/**
|
|
67
|
+
* Called when this panel is dropped onto another panel.
|
|
68
|
+
*
|
|
69
|
+
* Only works for panels derived from [DDragBase](https://wiki.facepunch.com/gmod/DDragBase).
|
|
70
|
+
*
|
|
71
|
+
* @realm client
|
|
72
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:DroppedOn
|
|
73
|
+
*/
|
|
74
|
+
DroppedOn(self: Panel, pnl: Panel): void;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
interface Panel {
|
|
78
|
+
/**
|
|
79
|
+
* Called when the panel should generate example use case / example code to use for this panel. Used in the panel opened by **derma_controls** console command.
|
|
80
|
+
* @realm client
|
|
81
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:GenerateExample
|
|
82
|
+
*/
|
|
83
|
+
GenerateExample(self: Panel, _class: string, dpropertysheet: Panel, width: number, height: number): void;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
interface Panel {
|
|
87
|
+
/**
|
|
88
|
+
* Called when the panel is created. This is called for each base type that the panel has.
|
|
89
|
+
* @realm client
|
|
90
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:Init
|
|
91
|
+
*/
|
|
92
|
+
Init(self: Panel): void;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
interface Panel {
|
|
96
|
+
/**
|
|
97
|
+
* Called after [Panel:SetCookieName](https://wiki.facepunch.com/gmod/Panel:SetCookieName) is called on this panel to apply the just loaded cookie values for this panel.
|
|
98
|
+
* @realm client
|
|
99
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:LoadCookies
|
|
100
|
+
*/
|
|
101
|
+
LoadCookies(self: Panel): void;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
interface Panel {
|
|
105
|
+
/**
|
|
106
|
+
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
107
|
+
* Called when we are activated during level load. Used by the loading screen panel.
|
|
108
|
+
* @realm client and menu
|
|
109
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:OnActivate
|
|
110
|
+
*/
|
|
111
|
+
OnActivate(self: Panel): void;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
interface Panel {
|
|
115
|
+
/**
|
|
116
|
+
* Called whenever a child was parented to the panel.
|
|
117
|
+
*
|
|
118
|
+
* This is called before the panel's metatable is set.
|
|
119
|
+
*
|
|
120
|
+
* @realm client
|
|
121
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:OnChildAdded
|
|
122
|
+
*/
|
|
123
|
+
OnChildAdded(self: Panel, child: Panel): void;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
interface Panel {
|
|
127
|
+
/**
|
|
128
|
+
* Called whenever a child of the panel is about to removed.
|
|
129
|
+
* @realm client
|
|
130
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:OnChildRemoved
|
|
131
|
+
*/
|
|
132
|
+
OnChildRemoved(self: Panel, child: Panel): void;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
interface Panel {
|
|
136
|
+
/**
|
|
137
|
+
* Called whenever the cursor entered the panels bounds.
|
|
138
|
+
* @realm client
|
|
139
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:OnCursorEntered
|
|
140
|
+
*/
|
|
141
|
+
OnCursorEntered(self: Panel): void;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
interface Panel {
|
|
145
|
+
/**
|
|
146
|
+
* Called whenever the cursor left the panels bounds.
|
|
147
|
+
* @realm client
|
|
148
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:OnCursorExited
|
|
149
|
+
*/
|
|
150
|
+
OnCursorExited(self: Panel): void;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
interface Panel {
|
|
154
|
+
/**
|
|
155
|
+
* Called whenever the cursor was moved with the panels bounds.
|
|
156
|
+
* @realm client
|
|
157
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:OnCursorMoved
|
|
158
|
+
*/
|
|
159
|
+
OnCursorMoved(self: Panel, cursorX: number, cursorY: number): boolean;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
interface Panel {
|
|
163
|
+
/**
|
|
164
|
+
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
165
|
+
* Called when we are deactivated during level load. Used by the loading screen panel.
|
|
166
|
+
* @realm client and menu
|
|
167
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:OnDeactivate
|
|
168
|
+
*/
|
|
169
|
+
OnDeactivate(self: Panel): void;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
interface Panel {
|
|
173
|
+
/**
|
|
174
|
+
* We're being dropped on something
|
|
175
|
+
* We can create a new panel here and return it, so that instead of dropping us - it drops the new panel instead! We remain where we are!
|
|
176
|
+
*
|
|
177
|
+
* Only works for panels derived from [DDragBase](https://wiki.facepunch.com/gmod/DDragBase).
|
|
178
|
+
*
|
|
179
|
+
* @realm client
|
|
180
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:OnDrop
|
|
181
|
+
*/
|
|
182
|
+
OnDrop(self: Panel): Panel;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
interface Panel {
|
|
186
|
+
/**
|
|
187
|
+
* Called whenever the panel gained or lost focus.
|
|
188
|
+
*
|
|
189
|
+
* **NOTE**: [Panel:HasFocus](https://wiki.facepunch.com/gmod/Panel:HasFocus) will only be updated on the next frame and will return the "old" value at the time this hook is run. Same goes for [vgui.GetKeyboardFocus](https://wiki.facepunch.com/gmod/vgui.GetKeyboardFocus).
|
|
190
|
+
*
|
|
191
|
+
*
|
|
192
|
+
* @realm client
|
|
193
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:OnFocusChanged
|
|
194
|
+
*/
|
|
195
|
+
OnFocusChanged(self: Panel, gained: boolean): void;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
interface Panel {
|
|
199
|
+
/**
|
|
200
|
+
* Called when the panel a child [DHScrollBar](https://wiki.facepunch.com/gmod/DHScrollBar) is scrolled.
|
|
201
|
+
* @realm client
|
|
202
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:OnHScroll
|
|
203
|
+
*/
|
|
204
|
+
OnHScroll(self: Panel, offset: number): void;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
interface Panel {
|
|
208
|
+
/**
|
|
209
|
+
* Called whenever a keyboard key was pressed while the panel is focused.
|
|
210
|
+
*
|
|
211
|
+
* This is not run for ESC/"cancelselect" binding.
|
|
212
|
+
*
|
|
213
|
+
* @realm client
|
|
214
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:OnKeyCodePressed
|
|
215
|
+
*/
|
|
216
|
+
OnKeyCodePressed(self: Panel, keyCode: number): boolean;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
interface Panel {
|
|
220
|
+
/**
|
|
221
|
+
* Called whenever a keyboard key was released while the panel is focused.
|
|
222
|
+
*
|
|
223
|
+
* This is not run for TILDE/"toggleconsole" binding.
|
|
224
|
+
*
|
|
225
|
+
* @realm client
|
|
226
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:OnKeyCodeReleased
|
|
227
|
+
*/
|
|
228
|
+
OnKeyCodeReleased(self: Panel, keyCode: number): boolean;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
interface Panel {
|
|
232
|
+
/**
|
|
233
|
+
* Called whenever a mouse key was pressed while the panel is focused.
|
|
234
|
+
* @realm client
|
|
235
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:OnMousePressed
|
|
236
|
+
*/
|
|
237
|
+
OnMousePressed(self: Panel, keyCode: number): boolean;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
interface Panel {
|
|
241
|
+
/**
|
|
242
|
+
* Called whenever a mouse key was released while the panel is focused.
|
|
243
|
+
* @realm client
|
|
244
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:OnMouseReleased
|
|
245
|
+
*/
|
|
246
|
+
OnMouseReleased(self: Panel, keyCode: number): boolean;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
interface Panel {
|
|
250
|
+
/**
|
|
251
|
+
* Called whenever the mouse wheel was used.
|
|
252
|
+
* @realm client
|
|
253
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:OnMouseWheeled
|
|
254
|
+
*/
|
|
255
|
+
OnMouseWheeled(self: Panel, scrollDelta: number): boolean;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
interface Panel {
|
|
259
|
+
/**
|
|
260
|
+
* Called when the panel is about to be removed.
|
|
261
|
+
* @realm client
|
|
262
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:OnRemove
|
|
263
|
+
*/
|
|
264
|
+
OnRemove(self: Panel): void;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
interface Panel {
|
|
268
|
+
/**
|
|
269
|
+
* Called when the player's screen resolution of the game changes.
|
|
270
|
+
*
|
|
271
|
+
* [Global.ScrW](https://wiki.facepunch.com/gmod/Global.ScrW) and [Global.ScrH](https://wiki.facepunch.com/gmod/Global.ScrH) will return the new values when this hook is called.
|
|
272
|
+
*
|
|
273
|
+
* @realm client and menu
|
|
274
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:OnScreenSizeChanged
|
|
275
|
+
*/
|
|
276
|
+
OnScreenSizeChanged(self: Panel, oldWidth: number, oldHeight: number, newWidth: number, newHeight: number): void;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
interface Panel {
|
|
280
|
+
/**
|
|
281
|
+
* Called when the panel a child [DVScrollBar](https://wiki.facepunch.com/gmod/DVScrollBar) or [DHScrollBar](https://wiki.facepunch.com/gmod/DHScrollBar) becomes visible.
|
|
282
|
+
* @realm client
|
|
283
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:OnScrollbarAppear
|
|
284
|
+
*/
|
|
285
|
+
OnScrollbarAppear(self: Panel): void;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
interface Panel {
|
|
289
|
+
/**
|
|
290
|
+
* Called just after the panel size changes.
|
|
291
|
+
*
|
|
292
|
+
* All size functions will return the new values when this hook is called.
|
|
293
|
+
*
|
|
294
|
+
* **WARNING**: Changing the panel size in this hook will cause an infinite loop!
|
|
295
|
+
*
|
|
296
|
+
*
|
|
297
|
+
* @realm client
|
|
298
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:OnSizeChanged
|
|
299
|
+
*/
|
|
300
|
+
OnSizeChanged(self: Panel, newWidth: number, newHeight: number): void;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
interface Panel {
|
|
304
|
+
/**
|
|
305
|
+
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
306
|
+
* Called by [dragndrop.StartDragging](https://wiki.facepunch.com/gmod/dragndrop.StartDragging) when the panel starts being dragged.
|
|
307
|
+
* @realm client
|
|
308
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:OnStartDragging
|
|
309
|
+
*/
|
|
310
|
+
OnStartDragging(self: Panel): void;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
interface Panel {
|
|
314
|
+
/**
|
|
315
|
+
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
316
|
+
* Called by [Panel:DragMouseRelease](https://wiki.facepunch.com/gmod/Panel:DragMouseRelease) when the panel object is released after being dragged.
|
|
317
|
+
* @realm client
|
|
318
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:OnStopDragging
|
|
319
|
+
*/
|
|
320
|
+
OnStopDragging(self: Panel): void;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
interface Panel {
|
|
324
|
+
/**
|
|
325
|
+
* Called whenever clickable text is clicked within a [RichText](https://wiki.facepunch.com/gmod/RichText).
|
|
326
|
+
* @realm client
|
|
327
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:OnTextClicked
|
|
328
|
+
*/
|
|
329
|
+
OnTextClicked(self: Panel, id: string): void;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
interface Panel {
|
|
333
|
+
/**
|
|
334
|
+
* Called when the panel a child [DVScrollBar](https://wiki.facepunch.com/gmod/DVScrollBar) is scrolled.
|
|
335
|
+
* @realm client
|
|
336
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:OnVScroll
|
|
337
|
+
*/
|
|
338
|
+
OnVScroll(self: Panel, offset: number): void;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
interface Panel {
|
|
342
|
+
/**
|
|
343
|
+
* Called whenever the panel should be drawn.
|
|
344
|
+
*
|
|
345
|
+
* This hook will not run if the panel is completely off the screen, and will still run if any parts of the panel are still on screen.
|
|
346
|
+
*
|
|
347
|
+
* You can create panels with a customized appearance by overriding their `Paint()` function, which will prevent the default appearance from being drawn.
|
|
348
|
+
*
|
|
349
|
+
* See also [PANEL:PaintOver](https://wiki.facepunch.com/gmod/PANEL:PaintOver).
|
|
350
|
+
*
|
|
351
|
+
* **NOTE**: Render operations from the [surface](https://wiki.facepunch.com/gmod/surface) library (and consequentially the [draw](https://wiki.facepunch.com/gmod/draw) library) are always offset by the global position of this panel, as seen in the example below
|
|
352
|
+
*
|
|
353
|
+
*
|
|
354
|
+
*
|
|
355
|
+
* @realm client and menu
|
|
356
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:Paint
|
|
357
|
+
*/
|
|
358
|
+
Paint(self: Panel, width: number, height: number): boolean;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
interface Panel {
|
|
362
|
+
/**
|
|
363
|
+
* Called whenever the panel and all its children were drawn, return true to override the default drawing.
|
|
364
|
+
*
|
|
365
|
+
* This is useful to draw content over the panel without having to overwrite it's [PANEL:Paint](https://wiki.facepunch.com/gmod/PANEL:Paint) hook, for example as an indicator that a panel is selected in [PropSelect](https://wiki.facepunch.com/gmod/PropSelect)
|
|
366
|
+
*
|
|
367
|
+
* @realm client and menu
|
|
368
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:PaintOver
|
|
369
|
+
*/
|
|
370
|
+
PaintOver(self: Panel, width: number, height: number): boolean;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
interface Panel {
|
|
374
|
+
/**
|
|
375
|
+
* Called whenever the panels' layout needs to be performed again. This means all child panels must be re-positioned to fit the possibly new size of this panel.
|
|
376
|
+
*
|
|
377
|
+
* This can be triggered in numerous ways:
|
|
378
|
+
* * [Panel:InvalidateLayout](https://wiki.facepunch.com/gmod/Panel:InvalidateLayout) was called this or previous frame (depending on the argument)
|
|
379
|
+
* * [Panel:SetPos](https://wiki.facepunch.com/gmod/Panel:SetPos) called more than once on the same panel ([Issue](https://github.com/Facepunch/garrysmod-issues/issues/5519))
|
|
380
|
+
* * A child element was added to this panel (TODO: Verify me)
|
|
381
|
+
* * The size of this panel has changed
|
|
382
|
+
*
|
|
383
|
+
* You should not call this function directly. Use [Panel:InvalidateLayout](https://wiki.facepunch.com/gmod/Panel:InvalidateLayout) instead.
|
|
384
|
+
*
|
|
385
|
+
* You should also be careful to not cause layout loops. You can use `vgui_visualizelayout 1` to visualize panel layouts as they happen for debugging purposes. Panels should not be doing this every frame for performance reasons.
|
|
386
|
+
*
|
|
387
|
+
*
|
|
388
|
+
* @realm client
|
|
389
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:PerformLayout
|
|
390
|
+
*/
|
|
391
|
+
PerformLayout(self: Panel, width: number, height: number): void;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
interface Panel {
|
|
395
|
+
/**
|
|
396
|
+
* Only works on elements defined with [derma.DefineControl](https://wiki.facepunch.com/gmod/derma.DefineControl) and only if the panel has **AllowAutoRefresh** set to true.
|
|
397
|
+
*
|
|
398
|
+
* Called after [derma.DefineControl](https://wiki.facepunch.com/gmod/derma.DefineControl) is called with panel's class name.
|
|
399
|
+
*
|
|
400
|
+
* See also [PANEL:PreAutoRefresh](https://wiki.facepunch.com/gmod/PANEL:PreAutoRefresh)
|
|
401
|
+
*
|
|
402
|
+
* @realm client
|
|
403
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:PostAutoRefresh
|
|
404
|
+
*/
|
|
405
|
+
PostAutoRefresh(self: Panel): void;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
interface Panel {
|
|
409
|
+
/**
|
|
410
|
+
* Only works on elements defined with [derma.DefineControl](https://wiki.facepunch.com/gmod/derma.DefineControl) and only if the panel has **AllowAutoRefresh** set to true.
|
|
411
|
+
*
|
|
412
|
+
* Called when [derma.DefineControl](https://wiki.facepunch.com/gmod/derma.DefineControl) is called with this panel's class name before applying changes to this panel.
|
|
413
|
+
*
|
|
414
|
+
* See also [PANEL:PostAutoRefresh](https://wiki.facepunch.com/gmod/PANEL:PostAutoRefresh)
|
|
415
|
+
*
|
|
416
|
+
* @realm client
|
|
417
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:PreAutoRefresh
|
|
418
|
+
*/
|
|
419
|
+
PreAutoRefresh(self: Panel): void;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
interface Panel {
|
|
423
|
+
/**
|
|
424
|
+
* Called to test if the panel is being `hovered` by the mouse. This will only be called if the panel's parent is being hovered.
|
|
425
|
+
* @realm client
|
|
426
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:TestHover
|
|
427
|
+
*/
|
|
428
|
+
TestHover(self: Panel, x: number, y: number): boolean;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
interface Panel {
|
|
432
|
+
/**
|
|
433
|
+
* Called every frame while [Panel:IsVisible](https://wiki.facepunch.com/gmod/Panel:IsVisible) is true.
|
|
434
|
+
* @realm client and menu
|
|
435
|
+
* @source https://wiki.facepunch.com/gmod/PANEL:Think
|
|
436
|
+
*/
|
|
437
|
+
Think(self: Panel): void;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
interface Panel {
|
|
441
|
+
/**
|
|
442
|
+
* Adds the specified object to the panel.
|
|
443
|
+
*
|
|
444
|
+
* NOTE: the wiki maps a panel class-string to a concrete Panel subtype via a
|
|
445
|
+
* class-string generic; tlua cannot map a string literal to a nominal type,
|
|
446
|
+
* so the string form is typed as `string` and returns the generic `T`.
|
|
447
|
+
* @realm client
|
|
448
|
+
* @realm menu
|
|
449
|
+
* @source https://wiki.facepunch.com/gmod/Panel:Add
|
|
450
|
+
*/
|
|
451
|
+
Add<T extends Panel>(self: Panel, object: string | T): T;
|
|
452
|
+
/** Creates a panel from a PANEL table and parents it to this panel. */
|
|
453
|
+
Add(self: Panel, panelTable: table): Panel;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
interface Panel {
|
|
458
|
+
/**
|
|
459
|
+
* This function does nothing.
|
|
460
|
+
*
|
|
461
|
+
* @realm client and menu
|
|
462
|
+
* @source https://wiki.facepunch.com/gmod/Panel:AddText
|
|
463
|
+
* @deprecated Does nothing
|
|
464
|
+
*/
|
|
465
|
+
AddText(self: Panel): void;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
interface Panel {
|
|
469
|
+
/**
|
|
470
|
+
* Aligns the panel on the bottom of its parent with the specified offset.
|
|
471
|
+
* @realm client and menu
|
|
472
|
+
* @source https://wiki.facepunch.com/gmod/Panel:AlignBottom
|
|
473
|
+
*/
|
|
474
|
+
AlignBottom(self: Panel, offset?: number): void;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
interface Panel {
|
|
478
|
+
/**
|
|
479
|
+
* Aligns the panel on the left of its parent with the specified offset.
|
|
480
|
+
* @realm client and menu
|
|
481
|
+
* @source https://wiki.facepunch.com/gmod/Panel:AlignLeft
|
|
482
|
+
*/
|
|
483
|
+
AlignLeft(self: Panel, offset?: number): void;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
interface Panel {
|
|
487
|
+
/**
|
|
488
|
+
* Aligns the panel on the right of its parent with the specified offset.
|
|
489
|
+
* @realm client and menu
|
|
490
|
+
* @source https://wiki.facepunch.com/gmod/Panel:AlignRight
|
|
491
|
+
*/
|
|
492
|
+
AlignRight(self: Panel, offset?: number): void;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
interface Panel {
|
|
496
|
+
/**
|
|
497
|
+
* Aligns the panel on the top of its parent with the specified offset.
|
|
498
|
+
* @realm client and menu
|
|
499
|
+
* @source https://wiki.facepunch.com/gmod/Panel:AlignTop
|
|
500
|
+
*/
|
|
501
|
+
AlignTop(self: Panel, offset?: number): void;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
interface Panel {
|
|
505
|
+
/**
|
|
506
|
+
* Uses animation to transition the current alpha value of a panel to a new alpha, over a set period of time and after a specified delay.
|
|
507
|
+
* @realm client and menu
|
|
508
|
+
* @source https://wiki.facepunch.com/gmod/Panel:AlphaTo
|
|
509
|
+
*/
|
|
510
|
+
AlphaTo(self: Panel, alpha: number, duration: number, delay?: number, callback?: (animData: table, targetPanel: Panel) => void): void;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
interface Panel {
|
|
514
|
+
/**
|
|
515
|
+
* Returns the [Global.SysTime](https://wiki.facepunch.com/gmod/Global.SysTime) value when all animations for this panel object will end.
|
|
516
|
+
* @realm client and menu
|
|
517
|
+
* @source https://wiki.facepunch.com/gmod/Panel:AnimTail
|
|
518
|
+
*/
|
|
519
|
+
AnimTail(self: Panel): number;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
interface Panel {
|
|
523
|
+
/**
|
|
524
|
+
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
525
|
+
* Performs the per-frame operations required for panel animations.
|
|
526
|
+
*
|
|
527
|
+
* This is called every frame by [PANEL:AnimationThink](https://wiki.facepunch.com/gmod/PANEL:AnimationThink).
|
|
528
|
+
*
|
|
529
|
+
* @realm client and menu
|
|
530
|
+
* @source https://wiki.facepunch.com/gmod/Panel:AnimationThinkInternal
|
|
531
|
+
*/
|
|
532
|
+
AnimationThinkInternal(self: Panel): void;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
interface Panel {
|
|
536
|
+
/**
|
|
537
|
+
* Appends text to a [RichText](https://wiki.facepunch.com/gmod/RichText) element. This does not automatically add a new line.
|
|
538
|
+
* @realm client and menu
|
|
539
|
+
* @source https://wiki.facepunch.com/gmod/Panel:AppendText
|
|
540
|
+
*/
|
|
541
|
+
AppendText(self: Panel, txt: string): void;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
interface Panel {
|
|
545
|
+
/**
|
|
546
|
+
* Appends text to a [RichText](https://wiki.facepunch.com/gmod/RichText) element (exactly like [Panel:AppendText](https://wiki.facepunch.com/gmod/Panel:AppendText)), while also parsing and adding valid URLs ([Panel:InsertClickableTextStart](https://wiki.facepunch.com/gmod/Panel:InsertClickableTextStart)). This does not automatically add a new line.
|
|
547
|
+
* @realm client and menu
|
|
548
|
+
* @source https://wiki.facepunch.com/gmod/Panel:AppendTextWithURLs
|
|
549
|
+
*/
|
|
550
|
+
AppendTextWithURLs(self: Panel, txt: string): void;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
interface Panel {
|
|
554
|
+
/**
|
|
555
|
+
* Used by [Panel:LoadGWENFile](https://wiki.facepunch.com/gmod/Panel:LoadGWENFile) and [Panel:LoadGWENString](https://wiki.facepunch.com/gmod/Panel:LoadGWENString) to apply a GWEN controls table to a panel object.
|
|
556
|
+
*
|
|
557
|
+
* You can do this manually using [file.Read](https://wiki.facepunch.com/gmod/file.Read) and [util.JSONToTable](https://wiki.facepunch.com/gmod/util.JSONToTable) to import and create a GWEN table structure from a `.gwen` file. This method can then be called, passing the GWEN table's `Controls` member.
|
|
558
|
+
*
|
|
559
|
+
* @realm client and menu
|
|
560
|
+
* @source https://wiki.facepunch.com/gmod/Panel:ApplyGWEN
|
|
561
|
+
*/
|
|
562
|
+
ApplyGWEN(self: Panel, GWENTable: table): void;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
interface Panel {
|
|
566
|
+
/**
|
|
567
|
+
* Centers the panel on its parent.
|
|
568
|
+
*
|
|
569
|
+
* See [Panel:CenterHorizontal](https://wiki.facepunch.com/gmod/Panel:CenterHorizontal) and [Panel:CenterVertical](https://wiki.facepunch.com/gmod/Panel:CenterVertical) for more specialized functions.
|
|
570
|
+
*
|
|
571
|
+
*
|
|
572
|
+
* **NOTE**: This will center the panel using the current size of the panel, so it should be called **AFTER** setting or adjusting the size of the panel.
|
|
573
|
+
*
|
|
574
|
+
* Take special care when using [Panel:Dock](https://wiki.facepunch.com/gmod/Panel:Dock) as it will not update the size immediately.
|
|
575
|
+
*
|
|
576
|
+
* You may want to use [Panel:PerformLayout](https://wiki.facepunch.com/gmod/Panel:PerformLayout) to set positions of child panels.
|
|
577
|
+
*
|
|
578
|
+
*
|
|
579
|
+
* @realm client and menu
|
|
580
|
+
* @source https://wiki.facepunch.com/gmod/Panel:Center
|
|
581
|
+
*/
|
|
582
|
+
Center(self: Panel): void;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
interface Panel {
|
|
586
|
+
/**
|
|
587
|
+
* Centers the panel horizontally with specified fraction.
|
|
588
|
+
*
|
|
589
|
+
* See [Panel:CenterVertical](https://wiki.facepunch.com/gmod/Panel:CenterVertical) for vertical only centering, and [Panel:Center](https://wiki.facepunch.com/gmod/Panel:Center) for a function that does both axes.
|
|
590
|
+
* @realm client and menu
|
|
591
|
+
* @source https://wiki.facepunch.com/gmod/Panel:CenterHorizontal
|
|
592
|
+
*/
|
|
593
|
+
CenterHorizontal(self: Panel, fraction?: number): void;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
interface Panel {
|
|
597
|
+
/**
|
|
598
|
+
* Centers the panel vertically with specified fraction.
|
|
599
|
+
*
|
|
600
|
+
* See [Panel:CenterHorizontal](https://wiki.facepunch.com/gmod/Panel:CenterHorizontal) for horizontal only centering, and [Panel:Center](https://wiki.facepunch.com/gmod/Panel:Center) for a function that does both axes.
|
|
601
|
+
* @realm client and menu
|
|
602
|
+
* @source https://wiki.facepunch.com/gmod/Panel:CenterVertical
|
|
603
|
+
*/
|
|
604
|
+
CenterVertical(self: Panel, fraction?: number): void;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
interface Panel {
|
|
608
|
+
/**
|
|
609
|
+
* Returns the amount of children of the of panel.
|
|
610
|
+
* @realm client and menu
|
|
611
|
+
* @source https://wiki.facepunch.com/gmod/Panel:ChildCount
|
|
612
|
+
*/
|
|
613
|
+
ChildCount(self: Panel): number;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
interface Panel {
|
|
617
|
+
/**
|
|
618
|
+
* Returns the width and height of the space between the position of the panel (upper-left corner) and the max bound of the children panels (farthest reaching lower-right corner).
|
|
619
|
+
* @realm client and menu
|
|
620
|
+
* @source https://wiki.facepunch.com/gmod/Panel:ChildrenSize
|
|
621
|
+
*/
|
|
622
|
+
ChildrenSize(self: Panel): (number, number);
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
interface Panel {
|
|
626
|
+
/**
|
|
627
|
+
* Removes all of the panel's children. Many panels also override this method to gracefully clear their contents without breaking themselves.
|
|
628
|
+
* @realm client and menu
|
|
629
|
+
* @source https://wiki.facepunch.com/gmod/Panel:Clear
|
|
630
|
+
*/
|
|
631
|
+
Clear(self: Panel): void;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
interface Panel {
|
|
635
|
+
/**
|
|
636
|
+
* Fades panels color to specified one.
|
|
637
|
+
* **NOTE**: The panel must have `GetColor` and `SetColor` functions for `ColorTo` to work.
|
|
638
|
+
*
|
|
639
|
+
*
|
|
640
|
+
* @realm client and menu
|
|
641
|
+
* @source https://wiki.facepunch.com/gmod/Panel:ColorTo
|
|
642
|
+
*/
|
|
643
|
+
ColorTo(self: Panel, color: Color, length: number, delay?: number, callback?: (animData: AnimationData, targetPanel: Panel) => void): void;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
interface Panel {
|
|
647
|
+
/**
|
|
648
|
+
* Updates a panel object's associated console variable. This must first be set up with [Global.Derma_Install_Convar_Functions](https://wiki.facepunch.com/gmod/Global.Derma_Install_Convar_Functions), and have a ConVar set using [Panel:SetConVar](https://wiki.facepunch.com/gmod/Panel:SetConVar).
|
|
649
|
+
* @realm client and menu
|
|
650
|
+
* @source https://wiki.facepunch.com/gmod/Panel:ConVarChanged
|
|
651
|
+
*/
|
|
652
|
+
ConVarChanged(self: Panel, newValue: string): void;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
interface Panel {
|
|
656
|
+
/**
|
|
657
|
+
* A think hook for [Panel](https://wiki.facepunch.com/gmod/Panel)s using ConVars as a value. Call it in the Think hook. Sets the panel's value should the convar change.
|
|
658
|
+
*
|
|
659
|
+
* This function is best for: checkboxes, sliders, number wangs
|
|
660
|
+
*
|
|
661
|
+
* For a string alternative, see [Panel:ConVarStringThink](https://wiki.facepunch.com/gmod/Panel:ConVarStringThink).
|
|
662
|
+
*
|
|
663
|
+
* **NOTE**: Make sure your Panel has a SetValue function, else you may get errors.
|
|
664
|
+
*
|
|
665
|
+
*
|
|
666
|
+
*
|
|
667
|
+
* @realm client and menu
|
|
668
|
+
* @source https://wiki.facepunch.com/gmod/Panel:ConVarNumberThink
|
|
669
|
+
*/
|
|
670
|
+
ConVarNumberThink(self: Panel): void;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
interface Panel {
|
|
674
|
+
/**
|
|
675
|
+
* A think hook for [panels](https://wiki.facepunch.com/gmod/Panel) using ConVars as a value. Call it in the Think hook. Sets the panel's value should the convar change.
|
|
676
|
+
*
|
|
677
|
+
* This function is best for: text inputs, read-only inputs, dropdown selects
|
|
678
|
+
*
|
|
679
|
+
* For a number alternative, see [Panel:ConVarNumberThink](https://wiki.facepunch.com/gmod/Panel:ConVarNumberThink).
|
|
680
|
+
*
|
|
681
|
+
* **NOTE**: Make sure your Panel has a SetValue function, else you may get errors.
|
|
682
|
+
*
|
|
683
|
+
*
|
|
684
|
+
* @realm client and menu
|
|
685
|
+
* @source https://wiki.facepunch.com/gmod/Panel:ConVarStringThink
|
|
686
|
+
*/
|
|
687
|
+
ConVarStringThink(self: Panel): void;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
interface Panel {
|
|
691
|
+
/**
|
|
692
|
+
* Gets the size, position and dock state of the passed panel object, and applies it to this one.
|
|
693
|
+
* @realm client and menu
|
|
694
|
+
* @source https://wiki.facepunch.com/gmod/Panel:CopyBase
|
|
695
|
+
*/
|
|
696
|
+
CopyBase(self: Panel, srcPanel: Panel): void;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
interface Panel {
|
|
700
|
+
/**
|
|
701
|
+
* Copies position and size of the panel.
|
|
702
|
+
* @realm client and menu
|
|
703
|
+
* @source https://wiki.facepunch.com/gmod/Panel:CopyBounds
|
|
704
|
+
*/
|
|
705
|
+
CopyBounds(self: Panel, base: Panel): void;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
interface Panel {
|
|
709
|
+
/**
|
|
710
|
+
* Copies the height of the panel.
|
|
711
|
+
* @realm client and menu
|
|
712
|
+
* @source https://wiki.facepunch.com/gmod/Panel:CopyHeight
|
|
713
|
+
*/
|
|
714
|
+
CopyHeight(self: Panel, base: Panel): void;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
interface Panel {
|
|
718
|
+
/**
|
|
719
|
+
* Copies the position of the panel.
|
|
720
|
+
* @realm client and menu
|
|
721
|
+
* @source https://wiki.facepunch.com/gmod/Panel:CopyPos
|
|
722
|
+
*/
|
|
723
|
+
CopyPos(self: Panel, base: Panel): void;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
interface Panel {
|
|
727
|
+
/**
|
|
728
|
+
* Performs the CONTROL + C key combination effect ( Copy selection to clipboard ) on selected text in a [TextEntry](https://wiki.facepunch.com/gmod/TextEntry) or [RichText](https://wiki.facepunch.com/gmod/RichText) based element.
|
|
729
|
+
* @realm client and menu
|
|
730
|
+
* @source https://wiki.facepunch.com/gmod/Panel:CopySelected
|
|
731
|
+
*/
|
|
732
|
+
CopySelected(self: Panel): void;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
interface Panel {
|
|
736
|
+
/**
|
|
737
|
+
* Copies the width of the panel.
|
|
738
|
+
* @realm client and menu
|
|
739
|
+
* @source https://wiki.facepunch.com/gmod/Panel:CopyWidth
|
|
740
|
+
*/
|
|
741
|
+
CopyWidth(self: Panel, base: Panel): void;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
interface Panel {
|
|
745
|
+
/**
|
|
746
|
+
* Returns the cursor position relative to the top left of the panel.
|
|
747
|
+
*
|
|
748
|
+
* This is equivalent to calling [gui.MousePos](https://wiki.facepunch.com/gmod/gui.MousePos) and then [Panel:ScreenToLocal](https://wiki.facepunch.com/gmod/Panel:ScreenToLocal).
|
|
749
|
+
*
|
|
750
|
+
* **WARNING**: This function uses a cached value for the screen position of the panel, computed at the end of the last VGUI Think/Layout pass.
|
|
751
|
+
*
|
|
752
|
+
* ie. inaccurate results may be returned if the panel or any of its ancestors have been repositioned outside of [PANEL:Think](https://wiki.facepunch.com/gmod/PANEL:Think) or [PANEL:PerformLayout](https://wiki.facepunch.com/gmod/PANEL:PerformLayout) within the last frame.
|
|
753
|
+
*
|
|
754
|
+
*
|
|
755
|
+
* @realm client and menu
|
|
756
|
+
* @source https://wiki.facepunch.com/gmod/Panel:CursorPos
|
|
757
|
+
*/
|
|
758
|
+
CursorPos(self: Panel): (number, number);
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
interface Panel {
|
|
762
|
+
/**
|
|
763
|
+
* Performs the CONTROL + X (delete text and copy it to clipboard buffer) action on selected text in a [TextEntry](https://wiki.facepunch.com/gmod/TextEntry) or [RichText](https://wiki.facepunch.com/gmod/RichText) based element.
|
|
764
|
+
* @realm client and menu
|
|
765
|
+
* @source https://wiki.facepunch.com/gmod/Panel:CutSelected
|
|
766
|
+
*/
|
|
767
|
+
CutSelected(self: Panel): void;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
interface Panel {
|
|
771
|
+
/**
|
|
772
|
+
* Deletes a cookie value using the panel's cookie name ( [Panel:GetCookieName](https://wiki.facepunch.com/gmod/Panel:GetCookieName) ) and the passed extension.
|
|
773
|
+
* @realm client and menu
|
|
774
|
+
* @source https://wiki.facepunch.com/gmod/Panel:DeleteCookie
|
|
775
|
+
*/
|
|
776
|
+
DeleteCookie(self: Panel, cookieName: string): void;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
interface Panel {
|
|
780
|
+
/**
|
|
781
|
+
* Resets the panel object's [Panel:SetPos](https://wiki.facepunch.com/gmod/Panel:SetPos) method and removes its animation table (`Panel.LerpAnim`). This effectively undoes the changes made by [Panel:LerpPositions](https://wiki.facepunch.com/gmod/Panel:LerpPositions).
|
|
782
|
+
*
|
|
783
|
+
* In order to use Lerp animation again, you must call [Panel:Stop](https://wiki.facepunch.com/gmod/Panel:Stop) before setting its `SetPosReal` property to `nil`. See the example below.
|
|
784
|
+
*
|
|
785
|
+
* @realm client and menu
|
|
786
|
+
* @source https://wiki.facepunch.com/gmod/Panel:DisableLerp
|
|
787
|
+
*/
|
|
788
|
+
DisableLerp(self: Panel): void;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
interface Panel {
|
|
792
|
+
/**
|
|
793
|
+
* Returns the linear distance from the center of this panel object and another. **Both panels must have the same parent for this function to work properly.**
|
|
794
|
+
* @realm client and menu
|
|
795
|
+
* @source https://wiki.facepunch.com/gmod/Panel:Distance
|
|
796
|
+
*/
|
|
797
|
+
Distance(self: Panel, tgtPanel: Panel): number;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
interface Panel {
|
|
801
|
+
/**
|
|
802
|
+
* Returns the distance between the center of this panel object and a specified point **local to the parent panel**.
|
|
803
|
+
* @realm client and menu
|
|
804
|
+
* @source https://wiki.facepunch.com/gmod/Panel:DistanceFrom
|
|
805
|
+
*/
|
|
806
|
+
DistanceFrom(self: Panel, posX: number, posY: number): number;
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
interface Panel {
|
|
810
|
+
/**
|
|
811
|
+
* Makes the panel "lock" the screen until it is removed. All input will be directed to the given panel.
|
|
812
|
+
*
|
|
813
|
+
* It will silently fail if used while cursor is not visible.
|
|
814
|
+
* Call [Panel:MakePopup](https://wiki.facepunch.com/gmod/Panel:MakePopup) before calling this function.
|
|
815
|
+
* This must be called on a panel derived from [EditablePanel](https://wiki.facepunch.com/gmod/EditablePanel).
|
|
816
|
+
*
|
|
817
|
+
* @realm client and menu
|
|
818
|
+
* @source https://wiki.facepunch.com/gmod/Panel:DoModal
|
|
819
|
+
*/
|
|
820
|
+
DoModal(self: Panel): void;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
interface Panel {
|
|
824
|
+
/**
|
|
825
|
+
* Sets the dock type for the panel, making the panel "dock" in a certain direction, modifying it's position and size.
|
|
826
|
+
*
|
|
827
|
+
* You can set the inner spacing of a panel's docking using [Panel:DockPadding](https://wiki.facepunch.com/gmod/Panel:DockPadding), which will affect docked child panels, and you can set the outer spacing of a panel's docking using [Panel:DockMargin](https://wiki.facepunch.com/gmod/Panel:DockMargin), which affects how docked siblings are positioned/sized.
|
|
828
|
+
*
|
|
829
|
+
* You may need to use [Panel:SetZPos](https://wiki.facepunch.com/gmod/Panel:SetZPos) to ensure child panels ([DTextEntry](https://wiki.facepunch.com/gmod/DTextEntry)) stay in a specific order.
|
|
830
|
+
*
|
|
831
|
+
* **NOTE**: After using this function, if you want to get the correct panel's bounds (position, size), use [Panel:InvalidateParent](https://wiki.facepunch.com/gmod/Panel:InvalidateParent) (use `true` as argument if you need to update immediately)
|
|
832
|
+
*
|
|
833
|
+
*
|
|
834
|
+
* @realm client and menu
|
|
835
|
+
* @source https://wiki.facepunch.com/gmod/Panel:Dock
|
|
836
|
+
*/
|
|
837
|
+
Dock(self: Panel, dockType: DOCK): void;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
interface Panel {
|
|
841
|
+
/**
|
|
842
|
+
* Sets the dock margin of the panel.
|
|
843
|
+
*
|
|
844
|
+
* The dock margin is the extra space that will be left around the edge when this element is docked inside its parent element.
|
|
845
|
+
*
|
|
846
|
+
* @realm client and menu
|
|
847
|
+
* @source https://wiki.facepunch.com/gmod/Panel:DockMargin
|
|
848
|
+
*/
|
|
849
|
+
DockMargin(self: Panel, marginLeft: number, marginTop: number, marginRight: number, marginBottom: number): void;
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
interface Panel {
|
|
853
|
+
/**
|
|
854
|
+
* Sets the dock padding of the panel.
|
|
855
|
+
*
|
|
856
|
+
* The dock padding is the extra space that will be left around the edge when child elements are docked inside this element.
|
|
857
|
+
*
|
|
858
|
+
* @realm client and menu
|
|
859
|
+
* @source https://wiki.facepunch.com/gmod/Panel:DockPadding
|
|
860
|
+
*/
|
|
861
|
+
DockPadding(self: Panel, paddingLeft: number, paddingTop: number, paddingRight: number, paddingBottom: number): void;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
interface Panel {
|
|
865
|
+
/**
|
|
866
|
+
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
867
|
+
* Called by [Panel:DragMouseRelease](https://wiki.facepunch.com/gmod/Panel:DragMouseRelease) when a user clicks one mouse button whilst dragging with another.
|
|
868
|
+
* @realm client and menu
|
|
869
|
+
* @source https://wiki.facepunch.com/gmod/Panel:DragClick
|
|
870
|
+
*/
|
|
871
|
+
DragClick(self: Panel): boolean;
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
interface Panel {
|
|
875
|
+
/**
|
|
876
|
+
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
877
|
+
* Called by [dragndrop.HoverThink](https://wiki.facepunch.com/gmod/dragndrop.HoverThink) to perform actions on an object that is dragged and hovered over another.
|
|
878
|
+
* @realm client and menu
|
|
879
|
+
* @source https://wiki.facepunch.com/gmod/Panel:DragHover
|
|
880
|
+
*/
|
|
881
|
+
DragHover(self: Panel, HoverTime: number): void;
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
interface Panel {
|
|
885
|
+
/**
|
|
886
|
+
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
887
|
+
* Called to end a drag and hover action. This resets the panel's [PANEL:PaintOver](https://wiki.facepunch.com/gmod/PANEL:PaintOver) method, and is primarily used by [dragndrop.StopDragging](https://wiki.facepunch.com/gmod/dragndrop.StopDragging).
|
|
888
|
+
* @realm client and menu
|
|
889
|
+
* @source https://wiki.facepunch.com/gmod/Panel:DragHoverEnd
|
|
890
|
+
*/
|
|
891
|
+
DragHoverEnd(self: Panel): void;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
interface Panel {
|
|
895
|
+
/**
|
|
896
|
+
* Called to inform the [dragndrop](https://wiki.facepunch.com/gmod/dragndrop) that a mouse button is being held down on a panel object.
|
|
897
|
+
* @realm client and menu
|
|
898
|
+
* @source https://wiki.facepunch.com/gmod/Panel:DragMousePress
|
|
899
|
+
*/
|
|
900
|
+
DragMousePress(self: Panel, mouseCode: number): void;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
interface Panel {
|
|
904
|
+
/**
|
|
905
|
+
* Called to inform the [dragndrop](https://wiki.facepunch.com/gmod/dragndrop) that a mouse button has been depressed on a panel object.
|
|
906
|
+
* @realm client and menu
|
|
907
|
+
* @source https://wiki.facepunch.com/gmod/Panel:DragMouseRelease
|
|
908
|
+
*/
|
|
909
|
+
DragMouseRelease(self: Panel, mouseCode: number): boolean;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
interface Panel {
|
|
913
|
+
/**
|
|
914
|
+
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
915
|
+
* Called to draw the drop target when an object is being dragged across another. See [Panel:SetDropTarget](https://wiki.facepunch.com/gmod/Panel:SetDropTarget).
|
|
916
|
+
* @realm client and menu
|
|
917
|
+
* @source https://wiki.facepunch.com/gmod/Panel:DrawDragHover
|
|
918
|
+
*/
|
|
919
|
+
DrawDragHover(self: Panel, x: number, y: number, width: number, height: number): void;
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
interface Panel {
|
|
923
|
+
/**
|
|
924
|
+
* Draws a coloured rectangle to fill the panel object this method is called on. The colour is set using [surface.SetDrawColor](https://wiki.facepunch.com/gmod/surface.SetDrawColor). This should only be called within the object's [PANEL:Paint](https://wiki.facepunch.com/gmod/PANEL:Paint) or [PANEL:PaintOver](https://wiki.facepunch.com/gmod/PANEL:PaintOver) hooks, as a shortcut for [surface.DrawRect](https://wiki.facepunch.com/gmod/surface.DrawRect).
|
|
925
|
+
*
|
|
926
|
+
*
|
|
927
|
+
*
|
|
928
|
+
*
|
|
929
|
+
* @realm client and menu
|
|
930
|
+
* @source https://wiki.facepunch.com/gmod/Panel:DrawFilledRect
|
|
931
|
+
*/
|
|
932
|
+
DrawFilledRect(self: Panel): void;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
interface Panel {
|
|
936
|
+
/**
|
|
937
|
+
* Draws a hollow rectangle the size of the panel object this method is called on, with a border width of 1 px. The border colour is set using [surface.SetDrawColor](https://wiki.facepunch.com/gmod/surface.SetDrawColor). This should only be called within the object's [PANEL:Paint](https://wiki.facepunch.com/gmod/PANEL:Paint) or [PANEL:PaintOver](https://wiki.facepunch.com/gmod/PANEL:PaintOver) hooks, as a shortcut for [surface.DrawOutlinedRect](https://wiki.facepunch.com/gmod/surface.DrawOutlinedRect).
|
|
938
|
+
*
|
|
939
|
+
*
|
|
940
|
+
*
|
|
941
|
+
*
|
|
942
|
+
* @realm client and menu
|
|
943
|
+
* @source https://wiki.facepunch.com/gmod/Panel:DrawOutlinedRect
|
|
944
|
+
*/
|
|
945
|
+
DrawOutlinedRect(self: Panel): void;
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
interface Panel {
|
|
949
|
+
/**
|
|
950
|
+
* Used to draw the magenta highlight colour of a panel object when it is selected. This should be called in the object's [PANEL:PaintOver](https://wiki.facepunch.com/gmod/PANEL:PaintOver) hook. Once this is implemented, the highlight colour will be displayed only when the object is selectable and selected. This is achieved using [Panel:SetSelectable](https://wiki.facepunch.com/gmod/Panel:SetSelectable) and [Panel:SetSelected](https://wiki.facepunch.com/gmod/Panel:SetSelected) respectively.
|
|
951
|
+
* @realm client and menu
|
|
952
|
+
* @source https://wiki.facepunch.com/gmod/Panel:DrawSelections
|
|
953
|
+
*/
|
|
954
|
+
DrawSelections(self: Panel): void;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
interface Panel {
|
|
958
|
+
/**
|
|
959
|
+
* Used to draw the text in a [DTextEntry](https://wiki.facepunch.com/gmod/DTextEntry) within a derma skin. This is usually called within the [SKIN:PaintTextEntry](https://wiki.facepunch.com/gmod/SKIN:PaintTextEntry) skin hook.
|
|
960
|
+
* **NOTE**: Will silently fail if any of arguments are not given.
|
|
961
|
+
*
|
|
962
|
+
*
|
|
963
|
+
*
|
|
964
|
+
*
|
|
965
|
+
* @realm client and menu
|
|
966
|
+
* @source https://wiki.facepunch.com/gmod/Panel:DrawTextEntryText
|
|
967
|
+
*/
|
|
968
|
+
DrawTextEntryText(self: Panel, textCol: table, highlightCol: table, cursorCol: table): void;
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
interface Panel {
|
|
972
|
+
/**
|
|
973
|
+
* Draws a textured rectangle to fill the panel object this method is called on. The texture is set using [surface.SetTexture](https://wiki.facepunch.com/gmod/surface.SetTexture) or [surface.SetMaterial](https://wiki.facepunch.com/gmod/surface.SetMaterial). This should only be called within the object's [PANEL:Paint](https://wiki.facepunch.com/gmod/PANEL:Paint) or [PANEL:PaintOver](https://wiki.facepunch.com/gmod/PANEL:PaintOver) hooks, as a shortcut for [surface.DrawTexturedRect](https://wiki.facepunch.com/gmod/surface.DrawTexturedRect).
|
|
974
|
+
*
|
|
975
|
+
*
|
|
976
|
+
*
|
|
977
|
+
*
|
|
978
|
+
* @realm client and menu
|
|
979
|
+
* @source https://wiki.facepunch.com/gmod/Panel:DrawTexturedRect
|
|
980
|
+
*/
|
|
981
|
+
DrawTexturedRect(self: Panel): void;
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
interface Panel {
|
|
985
|
+
/**
|
|
986
|
+
* Makes this panel droppable. This is used with [Panel:Receiver](https://wiki.facepunch.com/gmod/Panel:Receiver) to create drag and drop events.
|
|
987
|
+
*
|
|
988
|
+
* Can be called multiple times with different names allowing to be dropped onto different receivers.
|
|
989
|
+
*
|
|
990
|
+
* @realm client and menu
|
|
991
|
+
* @source https://wiki.facepunch.com/gmod/Panel:Droppable
|
|
992
|
+
*/
|
|
993
|
+
Droppable(self: Panel, name: string): table;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
interface Panel {
|
|
997
|
+
/**
|
|
998
|
+
* Completes a box selection. If the end point of the selection box is within the selection canvas, mouse capture is disabled for the panel object, and the selected state of each child object within the selection box is toggled.
|
|
999
|
+
* @realm client and menu
|
|
1000
|
+
* @source https://wiki.facepunch.com/gmod/Panel:EndBoxSelection
|
|
1001
|
+
*/
|
|
1002
|
+
EndBoxSelection(self: Panel): boolean;
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
interface Panel {
|
|
1006
|
+
/**
|
|
1007
|
+
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
1008
|
+
* Used to run commands within a [DHTML](https://wiki.facepunch.com/gmod/DHTML) window.
|
|
1009
|
+
* @realm client and menu
|
|
1010
|
+
* @source https://wiki.facepunch.com/gmod/Panel:Exec
|
|
1011
|
+
*/
|
|
1012
|
+
Exec(self: Panel, cmd: string): void;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
interface Panel {
|
|
1016
|
+
/**
|
|
1017
|
+
* Finds a panel in its children(and sub children) with the given name.
|
|
1018
|
+
* @realm client and menu
|
|
1019
|
+
* @source https://wiki.facepunch.com/gmod/Panel:Find
|
|
1020
|
+
*/
|
|
1021
|
+
Find(self: Panel, panelName: string): Panel;
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
interface Panel {
|
|
1025
|
+
/**
|
|
1026
|
+
* Focuses the next panel in the focus queue.
|
|
1027
|
+
* @realm client and menu
|
|
1028
|
+
* @source https://wiki.facepunch.com/gmod/Panel:FocusNext
|
|
1029
|
+
*/
|
|
1030
|
+
FocusNext(self: Panel): void;
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
interface Panel {
|
|
1034
|
+
/**
|
|
1035
|
+
* Focuses the previous panel in the focus queue.
|
|
1036
|
+
* @realm client and menu
|
|
1037
|
+
* @source https://wiki.facepunch.com/gmod/Panel:FocusPrevious
|
|
1038
|
+
*/
|
|
1039
|
+
FocusPrevious(self: Panel): void;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
interface Panel {
|
|
1043
|
+
/**
|
|
1044
|
+
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
1045
|
+
* Used by [Panel:ApplyGWEN](https://wiki.facepunch.com/gmod/Panel:ApplyGWEN) to apply the `CheckboxText` property to a [DCheckBoxLabel](https://wiki.facepunch.com/gmod/DCheckBoxLabel). This does exactly the same as [Panel:GWEN_SetText](https://wiki.facepunch.com/gmod/Panel:GWEN_SetText), but exists to cater for the seperate GWEN properties.
|
|
1046
|
+
* @realm client and menu
|
|
1047
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GWEN_SetCheckboxText
|
|
1048
|
+
*/
|
|
1049
|
+
GWEN_SetCheckboxText(self: Panel, txt: string): void;
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
interface Panel {
|
|
1053
|
+
/**
|
|
1054
|
+
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
1055
|
+
* Used by [Panel:ApplyGWEN](https://wiki.facepunch.com/gmod/Panel:ApplyGWEN) to apply the `ControlName` property to a panel. This calls [Panel:SetName](https://wiki.facepunch.com/gmod/Panel:SetName).
|
|
1056
|
+
* @realm client and menu
|
|
1057
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GWEN_SetControlName
|
|
1058
|
+
*/
|
|
1059
|
+
GWEN_SetControlName(self: Panel, name: string): void;
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
interface Panel {
|
|
1063
|
+
/**
|
|
1064
|
+
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
1065
|
+
* Used by [Panel:ApplyGWEN](https://wiki.facepunch.com/gmod/Panel:ApplyGWEN) to apply the `Dock` property to a panel object. This calls [Panel:Dock](https://wiki.facepunch.com/gmod/Panel:Dock).
|
|
1066
|
+
* @realm client and menu
|
|
1067
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GWEN_SetDock
|
|
1068
|
+
*/
|
|
1069
|
+
GWEN_SetDock(self: Panel, dockState: string): void;
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
interface Panel {
|
|
1073
|
+
/**
|
|
1074
|
+
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
1075
|
+
* Used by [Panel:ApplyGWEN](https://wiki.facepunch.com/gmod/Panel:ApplyGWEN) to apply the `HorizontalAlign` property to a panel object. This calls [Panel:SetContentAlignment](https://wiki.facepunch.com/gmod/Panel:SetContentAlignment).
|
|
1076
|
+
* @realm client and menu
|
|
1077
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GWEN_SetHorizontalAlign
|
|
1078
|
+
*/
|
|
1079
|
+
GWEN_SetHorizontalAlign(self: Panel, hAlign: string): void;
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
interface Panel {
|
|
1083
|
+
/**
|
|
1084
|
+
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
1085
|
+
* Used by [Panel:ApplyGWEN](https://wiki.facepunch.com/gmod/Panel:ApplyGWEN) to apply the `Margin` property to a panel object. This calls [Panel:DockMargin](https://wiki.facepunch.com/gmod/Panel:DockMargin).
|
|
1086
|
+
* @realm client and menu
|
|
1087
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GWEN_SetMargin
|
|
1088
|
+
*/
|
|
1089
|
+
GWEN_SetMargin(self: Panel, margins: table): void;
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
interface Panel {
|
|
1093
|
+
/**
|
|
1094
|
+
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
1095
|
+
* Used by [Panel:ApplyGWEN](https://wiki.facepunch.com/gmod/Panel:ApplyGWEN) to apply the `Max` property to a [DNumberWang](https://wiki.facepunch.com/gmod/DNumberWang), [Slider](https://wiki.facepunch.com/gmod/Slider), [DNumSlider](https://wiki.facepunch.com/gmod/DNumSlider) or [DNumberScratch](https://wiki.facepunch.com/gmod/DNumberScratch). This calls `SetMax` on one of the previously listed methods.
|
|
1096
|
+
* @realm client and menu
|
|
1097
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GWEN_SetMax
|
|
1098
|
+
*/
|
|
1099
|
+
GWEN_SetMax(self: Panel, maxValue: number): void;
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
interface Panel {
|
|
1103
|
+
/**
|
|
1104
|
+
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
1105
|
+
* Used by [Panel:ApplyGWEN](https://wiki.facepunch.com/gmod/Panel:ApplyGWEN) to apply the `Min` property to a [DNumberWang](https://wiki.facepunch.com/gmod/DNumberWang), [Slider](https://wiki.facepunch.com/gmod/Slider), [DNumSlider](https://wiki.facepunch.com/gmod/DNumSlider) or [DNumberScratch](https://wiki.facepunch.com/gmod/DNumberScratch). This calls `SetMin` on one of the previously listed methods.
|
|
1106
|
+
* @realm client and menu
|
|
1107
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GWEN_SetMin
|
|
1108
|
+
*/
|
|
1109
|
+
GWEN_SetMin(self: Panel, minValue: number): void;
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
interface Panel {
|
|
1113
|
+
/**
|
|
1114
|
+
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
1115
|
+
* Used by [Panel:ApplyGWEN](https://wiki.facepunch.com/gmod/Panel:ApplyGWEN) to apply the `Position` property to a panel object. This calls [Panel:SetPos](https://wiki.facepunch.com/gmod/Panel:SetPos).
|
|
1116
|
+
* @realm client and menu
|
|
1117
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GWEN_SetPosition
|
|
1118
|
+
*/
|
|
1119
|
+
GWEN_SetPosition(self: Panel, pos: table): void;
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
interface Panel {
|
|
1123
|
+
/**
|
|
1124
|
+
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
1125
|
+
* Used by [Panel:ApplyGWEN](https://wiki.facepunch.com/gmod/Panel:ApplyGWEN) to apply the `Size` property to a panel object. This calls [Panel:SetSize](https://wiki.facepunch.com/gmod/Panel:SetSize).
|
|
1126
|
+
* @realm client and menu
|
|
1127
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GWEN_SetSize
|
|
1128
|
+
*/
|
|
1129
|
+
GWEN_SetSize(self: Panel, size: table): void;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
interface Panel {
|
|
1133
|
+
/**
|
|
1134
|
+
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
1135
|
+
* Used by [Panel:ApplyGWEN](https://wiki.facepunch.com/gmod/Panel:ApplyGWEN) to apply the `Text` property to a panel.
|
|
1136
|
+
* @realm client and menu
|
|
1137
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GWEN_SetText
|
|
1138
|
+
*/
|
|
1139
|
+
GWEN_SetText(self: Panel, txt: string): void;
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
interface Panel {
|
|
1143
|
+
/**
|
|
1144
|
+
* Returns the alpha multiplier for this panel.
|
|
1145
|
+
* @realm client and menu
|
|
1146
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetAlpha
|
|
1147
|
+
*/
|
|
1148
|
+
GetAlpha(self: Panel): number;
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
interface Panel {
|
|
1152
|
+
/**
|
|
1153
|
+
* Returns the background color of a panel such as a [RichText](https://wiki.facepunch.com/gmod/RichText), [Label](https://wiki.facepunch.com/gmod/Label) or [DColorCube](https://wiki.facepunch.com/gmod/DColorCube).
|
|
1154
|
+
*
|
|
1155
|
+
* **NOTE**: This doesn't apply to all VGUI elements and its function varies between them
|
|
1156
|
+
*
|
|
1157
|
+
*
|
|
1158
|
+
* @realm client and menu
|
|
1159
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetBGColor
|
|
1160
|
+
*/
|
|
1161
|
+
GetBGColor(self: Panel): Color;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
interface Panel {
|
|
1165
|
+
/**
|
|
1166
|
+
* Returns the position and size of the panel.
|
|
1167
|
+
*
|
|
1168
|
+
* This is equivalent to calling [Panel:GetPos](https://wiki.facepunch.com/gmod/Panel:GetPos) and [Panel:GetSize](https://wiki.facepunch.com/gmod/Panel:GetSize) together.
|
|
1169
|
+
*
|
|
1170
|
+
* @realm client and menu
|
|
1171
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetBounds
|
|
1172
|
+
*/
|
|
1173
|
+
GetBounds(self: Panel): (number, number, number, number);
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
interface Panel {
|
|
1177
|
+
/**
|
|
1178
|
+
* Returns the position/offset of the caret (or text cursor) in a text-based panel object.
|
|
1179
|
+
* @realm client and menu
|
|
1180
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetCaretPos
|
|
1181
|
+
*/
|
|
1182
|
+
GetCaretPos(self: Panel): number;
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
interface Panel {
|
|
1186
|
+
/**
|
|
1187
|
+
* Gets a child by its index. For use with [Panel:ChildCount](https://wiki.facepunch.com/gmod/Panel:ChildCount).
|
|
1188
|
+
* @realm client and menu
|
|
1189
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetChild
|
|
1190
|
+
*/
|
|
1191
|
+
GetChild(self: Panel, childIndex: number): void;
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
interface Panel {
|
|
1195
|
+
/**
|
|
1196
|
+
* Gets a child object's position relative to this panel object. The number of levels is not relevant; the child may have many parents between itself and the object on which the method is called.
|
|
1197
|
+
* @realm client and menu
|
|
1198
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetChildPosition
|
|
1199
|
+
*/
|
|
1200
|
+
GetChildPosition(self: Panel, pnl: Panel): (number, number);
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
interface Panel {
|
|
1204
|
+
/**
|
|
1205
|
+
* Returns a table with all the child panels of the panel.
|
|
1206
|
+
* @realm client and menu
|
|
1207
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetChildren
|
|
1208
|
+
*/
|
|
1209
|
+
GetChildren(self: Panel): table;
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
interface Panel {
|
|
1213
|
+
/**
|
|
1214
|
+
* Returns a table of all visible, selectable children of the panel object that lie at least partially within the specified rectangle.
|
|
1215
|
+
* @realm client and menu
|
|
1216
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetChildrenInRect
|
|
1217
|
+
*/
|
|
1218
|
+
GetChildrenInRect(self: Panel, x: number, y: number, w: number, h: number): table;
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
interface Panel {
|
|
1222
|
+
/**
|
|
1223
|
+
* Returns the class name of the panel. This would be the class name of the base engine-level panel, not Lua classname. The latter is stored usually in [Panel:GetName](https://wiki.facepunch.com/gmod/Panel:GetName).
|
|
1224
|
+
* @realm client and menu
|
|
1225
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetClassName
|
|
1226
|
+
*/
|
|
1227
|
+
GetClassName(self: Panel): string;
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
interface Panel {
|
|
1231
|
+
/**
|
|
1232
|
+
* Returns the child of this panel object that is closest to the specified point. The point is relative to the object on which the method is called. The distance the child is from this point is also returned.
|
|
1233
|
+
* @realm client and menu
|
|
1234
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetClosestChild
|
|
1235
|
+
*/
|
|
1236
|
+
GetClosestChild(self: Panel, x: number, y: number): (Panel, number);
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
interface Panel {
|
|
1240
|
+
/**
|
|
1241
|
+
* Returns the alignment of the text of a [Label](https://wiki.facepunch.com/gmod/Label).
|
|
1242
|
+
*
|
|
1243
|
+
* **NOTE**: This function only works on [Label](https://wiki.facepunch.com/gmod/Label) panels and its derivatives.
|
|
1244
|
+
*
|
|
1245
|
+
*
|
|
1246
|
+
* @realm client and menu
|
|
1247
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetContentAlignment
|
|
1248
|
+
*/
|
|
1249
|
+
GetContentAlignment(self: Panel): number;
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
interface Panel {
|
|
1253
|
+
/**
|
|
1254
|
+
* Gets the size of the content/children within a panel object.
|
|
1255
|
+
*
|
|
1256
|
+
* Only works with [Label](https://wiki.facepunch.com/gmod/Label) derived panels by default such as [DLabel](https://wiki.facepunch.com/gmod/DLabel).
|
|
1257
|
+
*
|
|
1258
|
+
*
|
|
1259
|
+
* Will also work on any panel that manually implements this method.
|
|
1260
|
+
*
|
|
1261
|
+
* @realm client and menu
|
|
1262
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetContentSize
|
|
1263
|
+
*/
|
|
1264
|
+
GetContentSize(self: Panel): (number, number);
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
interface Panel {
|
|
1268
|
+
/**
|
|
1269
|
+
* Gets the value of a cookie stored by the panel object. This can also be done with [cookie.GetString](https://wiki.facepunch.com/gmod/cookie.GetString), using the panel's cookie name, a fullstop, and then the actual name of the cookie.
|
|
1270
|
+
*
|
|
1271
|
+
* Make sure the panel's cookie name has not changed since writing, or the cookie will not be accessible. This can be done with [Panel:GetCookieName](https://wiki.facepunch.com/gmod/Panel:GetCookieName) and [Panel:SetCookieName](https://wiki.facepunch.com/gmod/Panel:SetCookieName).
|
|
1272
|
+
*
|
|
1273
|
+
* @realm client and menu
|
|
1274
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetCookie
|
|
1275
|
+
*/
|
|
1276
|
+
GetCookie(self: Panel, cookieName: string, _default: string): string;
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
interface Panel {
|
|
1280
|
+
/**
|
|
1281
|
+
* Gets the name the panel uses to store cookies. This is set with [Panel:SetCookieName](https://wiki.facepunch.com/gmod/Panel:SetCookieName).
|
|
1282
|
+
* @realm client and menu
|
|
1283
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetCookieName
|
|
1284
|
+
*/
|
|
1285
|
+
GetCookieName(self: Panel): string;
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
interface Panel {
|
|
1289
|
+
/**
|
|
1290
|
+
* Gets the value of a cookie stored by the panel object, as a number. This can also be done with [cookie.GetNumber](https://wiki.facepunch.com/gmod/cookie.GetNumber), using the panel's cookie name, a fullstop, and then the actual name of the cookie.
|
|
1291
|
+
*
|
|
1292
|
+
* Make sure the panel's cookie name has not changed since writing, or the cookie will not be accessible. This can be done with [Panel:GetCookieName](https://wiki.facepunch.com/gmod/Panel:GetCookieName) and [Panel:SetCookieName](https://wiki.facepunch.com/gmod/Panel:SetCookieName).
|
|
1293
|
+
*
|
|
1294
|
+
* @realm client and menu
|
|
1295
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetCookieNumber
|
|
1296
|
+
*/
|
|
1297
|
+
GetCookieNumber(self: Panel, cookieName: string, _default: number): number;
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
interface Panel {
|
|
1301
|
+
/**
|
|
1302
|
+
* Returns a dock enum for the panel's current docking type.
|
|
1303
|
+
* @realm client and menu
|
|
1304
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetDock
|
|
1305
|
+
*/
|
|
1306
|
+
GetDock(self: Panel): number;
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
interface Panel {
|
|
1310
|
+
/**
|
|
1311
|
+
* Returns the docked margins of the panel. (set by [Panel:DockMargin](https://wiki.facepunch.com/gmod/Panel:DockMargin))
|
|
1312
|
+
* @realm client and menu
|
|
1313
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetDockMargin
|
|
1314
|
+
*/
|
|
1315
|
+
GetDockMargin(self: Panel): (number, number, number, number);
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
interface Panel {
|
|
1319
|
+
/**
|
|
1320
|
+
* Returns the docked padding of the panel. (set by [Panel:DockPadding](https://wiki.facepunch.com/gmod/Panel:DockPadding))
|
|
1321
|
+
* @realm client and menu
|
|
1322
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetDockPadding
|
|
1323
|
+
*/
|
|
1324
|
+
GetDockPadding(self: Panel): (number, number, number, number);
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
interface Panel {
|
|
1328
|
+
/**
|
|
1329
|
+
* Returns the foreground color of the panel.
|
|
1330
|
+
*
|
|
1331
|
+
* For a [Label](https://wiki.facepunch.com/gmod/Label) or [RichText](https://wiki.facepunch.com/gmod/RichText), this is the color of its text.
|
|
1332
|
+
*
|
|
1333
|
+
* **NOTE**: This doesn't apply to all VGUI elements (such as [DLabel](https://wiki.facepunch.com/gmod/DLabel)) and its function varies between them
|
|
1334
|
+
*
|
|
1335
|
+
*
|
|
1336
|
+
* @realm client and menu
|
|
1337
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetFGColor
|
|
1338
|
+
*/
|
|
1339
|
+
GetFGColor(self: Panel): Color;
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
interface Panel {
|
|
1343
|
+
/**
|
|
1344
|
+
* Returns the name of the font that the panel renders its text with.
|
|
1345
|
+
*
|
|
1346
|
+
* This is the same font name set with [Panel:SetFontInternal](https://wiki.facepunch.com/gmod/Panel:SetFontInternal).
|
|
1347
|
+
*
|
|
1348
|
+
* **NOTE**: Only works on [Label](https://wiki.facepunch.com/gmod/Label) and [TextEntry](https://wiki.facepunch.com/gmod/TextEntry) and their derived panels by default (such as [DLabel](https://wiki.facepunch.com/gmod/DLabel) and [DTextEntry](https://wiki.facepunch.com/gmod/DTextEntry)), and on any panel that manually implemented the [Panel:GetFont](https://wiki.facepunch.com/gmod/Panel:GetFont) method.
|
|
1349
|
+
*
|
|
1350
|
+
*
|
|
1351
|
+
* @realm client and menu
|
|
1352
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetFont
|
|
1353
|
+
*/
|
|
1354
|
+
GetFont(self: Panel): string;
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
interface Panel {
|
|
1358
|
+
/**
|
|
1359
|
+
* Returns the panel's HTML material. Only works with [Awesomium](https://wiki.facepunch.com/gmod/Awesomium), [HTML](https://wiki.facepunch.com/gmod/HTML) and [DHTML](https://wiki.facepunch.com/gmod/DHTML) panels that have been fully loaded.
|
|
1360
|
+
* @realm client
|
|
1361
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetHTMLMaterial
|
|
1362
|
+
*/
|
|
1363
|
+
GetHTMLMaterial(self: Panel): IMaterial;
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
interface Panel {
|
|
1367
|
+
/**
|
|
1368
|
+
* Returns the height of a single line of a [RichText](https://wiki.facepunch.com/gmod/RichText) panel.
|
|
1369
|
+
*
|
|
1370
|
+
* @realm client and menu
|
|
1371
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetLineHeight
|
|
1372
|
+
*/
|
|
1373
|
+
GetLineHeight(self: Panel): number;
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
interface Panel {
|
|
1377
|
+
/**
|
|
1378
|
+
* Returns the current maximum character count.
|
|
1379
|
+
*
|
|
1380
|
+
* This function will only work on [RichText](https://wiki.facepunch.com/gmod/RichText) and [TextEntry](https://wiki.facepunch.com/gmod/TextEntry) panels and their derivatives.
|
|
1381
|
+
*
|
|
1382
|
+
* @realm client and menu
|
|
1383
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetMaximumCharCount
|
|
1384
|
+
*/
|
|
1385
|
+
GetMaximumCharCount(self: Panel): number;
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
interface Panel {
|
|
1389
|
+
/**
|
|
1390
|
+
* Returns the internal name of the panel. Can be set via [Panel:SetName](https://wiki.facepunch.com/gmod/Panel:SetName).
|
|
1391
|
+
* @realm client and menu
|
|
1392
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetName
|
|
1393
|
+
*/
|
|
1394
|
+
GetName(self: Panel): string;
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
interface Panel {
|
|
1398
|
+
/**
|
|
1399
|
+
* Returns the number of lines in a [RichText](https://wiki.facepunch.com/gmod/RichText) or a [TextEntry](https://wiki.facepunch.com/gmod/TextEntry).
|
|
1400
|
+
*
|
|
1401
|
+
* You must wait a couple frames before calling this after using [Panel:AppendText](https://wiki.facepunch.com/gmod/Panel:AppendText) or [Panel:SetText](https://wiki.facepunch.com/gmod/Panel:SetText), otherwise it will return the number of text lines before the text change.
|
|
1402
|
+
*
|
|
1403
|
+
* @realm client and menu
|
|
1404
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetNumLines
|
|
1405
|
+
*/
|
|
1406
|
+
GetNumLines(self: Panel): number;
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
interface Panel {
|
|
1410
|
+
/**
|
|
1411
|
+
* Returns the parent of the panel, returns nil if there is no parent.
|
|
1412
|
+
* @realm client and menu
|
|
1413
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetParent
|
|
1414
|
+
*/
|
|
1415
|
+
GetParent(self: Panel): Panel;
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
interface Panel {
|
|
1419
|
+
/**
|
|
1420
|
+
* Returns the position of the panel relative to its [Panel:GetParent](https://wiki.facepunch.com/gmod/Panel:GetParent).
|
|
1421
|
+
*
|
|
1422
|
+
* If you require the panel's position **and** size, consider using [Panel:GetBounds](https://wiki.facepunch.com/gmod/Panel:GetBounds) instead.
|
|
1423
|
+
*
|
|
1424
|
+
* If you need the position in screen space, see [Panel:LocalToScreen](https://wiki.facepunch.com/gmod/Panel:LocalToScreen).
|
|
1425
|
+
*
|
|
1426
|
+
* See also [Panel:GetX](https://wiki.facepunch.com/gmod/Panel:GetX) and [Panel:GetY](https://wiki.facepunch.com/gmod/Panel:GetY).
|
|
1427
|
+
*
|
|
1428
|
+
* @realm client and menu
|
|
1429
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetPos
|
|
1430
|
+
*/
|
|
1431
|
+
GetPos(self: Panel): (number, number);
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1434
|
+
interface Panel {
|
|
1435
|
+
/**
|
|
1436
|
+
* Returns the vertical and horizontal start indexes of a [TextEntry](https://wiki.facepunch.com/gmod/TextEntry)'s visible text. This is useful when the panel is scrolled.
|
|
1437
|
+
*
|
|
1438
|
+
* @realm client and menu
|
|
1439
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetScrollStartIndexes
|
|
1440
|
+
*/
|
|
1441
|
+
GetScrollStartIndexes(self: Panel): (number, number);
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1444
|
+
interface Panel {
|
|
1445
|
+
/**
|
|
1446
|
+
* Returns a table of all children of the panel object that are selected. This is recursive, and the returned table will include tables for any child objects that also have children. This means that not all first-level members in the returned table will be of type [Panel](https://wiki.facepunch.com/gmod/Panel).
|
|
1447
|
+
* @realm client and menu
|
|
1448
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetSelectedChildren
|
|
1449
|
+
*/
|
|
1450
|
+
GetSelectedChildren(self: Panel): table;
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
interface Panel {
|
|
1454
|
+
/**
|
|
1455
|
+
* Returns the currently selected range of text.
|
|
1456
|
+
*
|
|
1457
|
+
* This function will only work on [RichText](https://wiki.facepunch.com/gmod/RichText) and [TextEntry](https://wiki.facepunch.com/gmod/TextEntry) panels and their derivatives.
|
|
1458
|
+
*
|
|
1459
|
+
* @realm client and menu
|
|
1460
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetSelectedTextRange
|
|
1461
|
+
*/
|
|
1462
|
+
GetSelectedTextRange(self: Panel): (number, number);
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
interface Panel {
|
|
1466
|
+
/**
|
|
1467
|
+
* Returns the selection canvas for this panel. This will be the first parent that has [Panel:SetSelectionCanvas](https://wiki.facepunch.com/gmod/Panel:SetSelectionCanvas) set to true (or `self` if this panel is the selection canvas)
|
|
1468
|
+
*
|
|
1469
|
+
* A selection canvas would be the panel that contains a bunch of selectable panels ([Panel:SetSelectable](https://wiki.facepunch.com/gmod/Panel:SetSelectable)), usually for the drag'n'drop system. Calling this function on any of the selectable items, or any of their children, will return the first parent that can contain selectable panels.
|
|
1470
|
+
* @realm client and menu
|
|
1471
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetSelectionCanvas
|
|
1472
|
+
*/
|
|
1473
|
+
GetSelectionCanvas(self: Panel): Panel;
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
interface Panel {
|
|
1477
|
+
/**
|
|
1478
|
+
* Returns the size of the panel.
|
|
1479
|
+
*
|
|
1480
|
+
* If you require both the panel's position and size, consider using [Panel:GetBounds](https://wiki.facepunch.com/gmod/Panel:GetBounds) instead.
|
|
1481
|
+
*
|
|
1482
|
+
* @realm client and menu
|
|
1483
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetSize
|
|
1484
|
+
*/
|
|
1485
|
+
GetSize(self: Panel): (number, number);
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
interface Panel {
|
|
1489
|
+
/**
|
|
1490
|
+
* Returns the table for the derma skin currently being used by this panel object.
|
|
1491
|
+
* @realm client and menu
|
|
1492
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetSkin
|
|
1493
|
+
*/
|
|
1494
|
+
GetSkin(self: Panel): table;
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
interface Panel {
|
|
1498
|
+
/**
|
|
1499
|
+
* Returns the internal Lua table of the panel.
|
|
1500
|
+
* @realm client and menu
|
|
1501
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetTable
|
|
1502
|
+
*/
|
|
1503
|
+
GetTable(self: Panel): table;
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
interface Panel {
|
|
1507
|
+
/**
|
|
1508
|
+
* Returns the height of the panel.
|
|
1509
|
+
*
|
|
1510
|
+
* See [Panel:GetWide](https://wiki.facepunch.com/gmod/Panel:GetWide) for the width of the panel. See also [Panel:GetSize](https://wiki.facepunch.com/gmod/Panel:GetSize) for a function that returns both.
|
|
1511
|
+
*
|
|
1512
|
+
*
|
|
1513
|
+
* @realm client and menu
|
|
1514
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetTall
|
|
1515
|
+
*/
|
|
1516
|
+
GetTall(self: Panel): number;
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
interface Panel {
|
|
1520
|
+
/**
|
|
1521
|
+
* Returns the panel's text (where applicable).
|
|
1522
|
+
*
|
|
1523
|
+
* This method returns a maximum of 1023 bytes, except for [TextEntry](https://wiki.facepunch.com/gmod/TextEntry).
|
|
1524
|
+
*
|
|
1525
|
+
* @realm client and menu
|
|
1526
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetText
|
|
1527
|
+
*/
|
|
1528
|
+
GetText(self: Panel): string;
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
interface Panel {
|
|
1532
|
+
/**
|
|
1533
|
+
* Gets the left and top text margins of a text-based panel object, such as a [DButton](https://wiki.facepunch.com/gmod/DButton) or [DLabel](https://wiki.facepunch.com/gmod/DLabel). This is set with [Panel:SetTextInset](https://wiki.facepunch.com/gmod/Panel:SetTextInset).
|
|
1534
|
+
* @realm client and menu
|
|
1535
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetTextInset
|
|
1536
|
+
*/
|
|
1537
|
+
GetTextInset(self: Panel): (number, number);
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
interface Panel {
|
|
1541
|
+
/**
|
|
1542
|
+
* Gets the size of the text within a [Label](https://wiki.facepunch.com/gmod/Label) derived panel.
|
|
1543
|
+
* @realm client and menu
|
|
1544
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetTextSize
|
|
1545
|
+
*/
|
|
1546
|
+
GetTextSize(self: Panel): (number, number);
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
interface Panel {
|
|
1550
|
+
/**
|
|
1551
|
+
* Returns the tooltip text that was set with [PANEL:SetTooltip](https://wiki.facepunch.com/gmod/PANEL:SetTooltip).
|
|
1552
|
+
*
|
|
1553
|
+
* @realm client and menu
|
|
1554
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetTooltip
|
|
1555
|
+
*/
|
|
1556
|
+
GetTooltip(self: Panel): string;
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
interface Panel {
|
|
1560
|
+
/**
|
|
1561
|
+
* Returns the tooltip delay (time between hovering over the panel, and the tooltip showing up) that was set with [Panel:SetTooltipDelay](https://wiki.facepunch.com/gmod/Panel:SetTooltipDelay), or nothing if it was not set.
|
|
1562
|
+
*
|
|
1563
|
+
* If the delay is not explicitly set by this function, it will fallback to the value of the `tooltip_delay` [ConVar](https://wiki.facepunch.com/gmod/ConVar), which is `0.5` by default.
|
|
1564
|
+
*
|
|
1565
|
+
* @realm client and menu
|
|
1566
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetTooltipDelay
|
|
1567
|
+
*/
|
|
1568
|
+
GetTooltipDelay(self: Panel): number;
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
interface Panel {
|
|
1572
|
+
/**
|
|
1573
|
+
* Returns the tooltip panel that was set with [PANEL:SetTooltipPanel](https://wiki.facepunch.com/gmod/PANEL:SetTooltipPanel).
|
|
1574
|
+
*
|
|
1575
|
+
* @realm client and menu
|
|
1576
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetTooltipPanel
|
|
1577
|
+
*/
|
|
1578
|
+
GetTooltipPanel(self: Panel): Panel;
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
interface Panel {
|
|
1582
|
+
/**
|
|
1583
|
+
* Gets valid receiver slot of currently dragged panel.
|
|
1584
|
+
* @realm client and menu
|
|
1585
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetValidReceiverSlot
|
|
1586
|
+
*/
|
|
1587
|
+
GetValidReceiverSlot(self: Panel): (Panel, table);
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1590
|
+
interface Panel {
|
|
1591
|
+
/**
|
|
1592
|
+
* Returns the value the panel holds.
|
|
1593
|
+
*
|
|
1594
|
+
* In engine is only implemented for [CheckButton](https://wiki.facepunch.com/gmod/CheckButton), [Label](https://wiki.facepunch.com/gmod/Label) and [TextEntry](https://wiki.facepunch.com/gmod/TextEntry) as a string.
|
|
1595
|
+
*
|
|
1596
|
+
* **NOTE**: This function is limited to 8092 Bytes. If using [DTextEntry](https://wiki.facepunch.com/gmod/DTextEntry), use [Panel:GetText](https://wiki.facepunch.com/gmod/Panel:GetText) for unlimited bytes.
|
|
1597
|
+
*
|
|
1598
|
+
*
|
|
1599
|
+
* @realm client and menu
|
|
1600
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetValue
|
|
1601
|
+
*/
|
|
1602
|
+
GetValue(self: Panel): any;
|
|
1603
|
+
}
|
|
1604
|
+
|
|
1605
|
+
interface Panel {
|
|
1606
|
+
/**
|
|
1607
|
+
* Returns the width of the panel.
|
|
1608
|
+
*
|
|
1609
|
+
* See [Panel:GetTall](https://wiki.facepunch.com/gmod/Panel:GetTall) for the height of the panel. See also [Panel:GetSize](https://wiki.facepunch.com/gmod/Panel:GetSize) for a function that returns both.
|
|
1610
|
+
* @realm client and menu
|
|
1611
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetWide
|
|
1612
|
+
*/
|
|
1613
|
+
GetWide(self: Panel): number;
|
|
1614
|
+
}
|
|
1615
|
+
|
|
1616
|
+
interface Panel {
|
|
1617
|
+
/**
|
|
1618
|
+
* Returns the X position of the panel relative to its [Panel:GetParent](https://wiki.facepunch.com/gmod/Panel:GetParent).
|
|
1619
|
+
*
|
|
1620
|
+
* Uses [Panel:GetPos](https://wiki.facepunch.com/gmod/Panel:GetPos) internally.
|
|
1621
|
+
*
|
|
1622
|
+
* @realm client and menu
|
|
1623
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetX
|
|
1624
|
+
*/
|
|
1625
|
+
GetX(self: Panel): number;
|
|
1626
|
+
}
|
|
1627
|
+
|
|
1628
|
+
interface Panel {
|
|
1629
|
+
/**
|
|
1630
|
+
* Returns the Y position of the panel relative to its [Panel:GetParent](https://wiki.facepunch.com/gmod/Panel:GetParent).
|
|
1631
|
+
*
|
|
1632
|
+
* Uses [Panel:GetPos](https://wiki.facepunch.com/gmod/Panel:GetPos) internally.
|
|
1633
|
+
*
|
|
1634
|
+
* @realm client and menu
|
|
1635
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetY
|
|
1636
|
+
*/
|
|
1637
|
+
GetY(self: Panel): number;
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
interface Panel {
|
|
1641
|
+
/**
|
|
1642
|
+
* Returns the Z position of the panel.
|
|
1643
|
+
* @realm client and menu
|
|
1644
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GetZPos
|
|
1645
|
+
*/
|
|
1646
|
+
GetZPos(self: Panel): number;
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
interface Panel {
|
|
1650
|
+
/**
|
|
1651
|
+
* Goes back one page in the HTML panel's history if available.
|
|
1652
|
+
* @realm client and menu
|
|
1653
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GoBack
|
|
1654
|
+
*/
|
|
1655
|
+
GoBack(self: Panel): void;
|
|
1656
|
+
}
|
|
1657
|
+
|
|
1658
|
+
interface Panel {
|
|
1659
|
+
/**
|
|
1660
|
+
* Goes forward one page in the HTML panel's history if available.
|
|
1661
|
+
* @realm client and menu
|
|
1662
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GoForward
|
|
1663
|
+
*/
|
|
1664
|
+
GoForward(self: Panel): void;
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
interface Panel {
|
|
1668
|
+
/**
|
|
1669
|
+
* Goes to the page in the HTML panel's history at the specified relative offset.
|
|
1670
|
+
* @realm client and menu
|
|
1671
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GoToHistoryOffset
|
|
1672
|
+
*/
|
|
1673
|
+
GoToHistoryOffset(self: Panel, offset: number): void;
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1676
|
+
interface Panel {
|
|
1677
|
+
/**
|
|
1678
|
+
* Causes a [RichText](https://wiki.facepunch.com/gmod/RichText) element to scroll to the bottom of its text.
|
|
1679
|
+
* @realm client and menu
|
|
1680
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GotoTextEnd
|
|
1681
|
+
*/
|
|
1682
|
+
GotoTextEnd(self: Panel): void;
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1685
|
+
interface Panel {
|
|
1686
|
+
/**
|
|
1687
|
+
* Causes a [RichText](https://wiki.facepunch.com/gmod/RichText) element to scroll to the top of its text.
|
|
1688
|
+
*
|
|
1689
|
+
* @realm client and menu
|
|
1690
|
+
* @source https://wiki.facepunch.com/gmod/Panel:GotoTextStart
|
|
1691
|
+
*/
|
|
1692
|
+
GotoTextStart(self: Panel): void;
|
|
1693
|
+
}
|
|
1694
|
+
|
|
1695
|
+
interface Panel {
|
|
1696
|
+
/**
|
|
1697
|
+
* Returns whenever the panel has child panels.
|
|
1698
|
+
* @realm client and menu
|
|
1699
|
+
* @source https://wiki.facepunch.com/gmod/Panel:HasChildren
|
|
1700
|
+
*/
|
|
1701
|
+
HasChildren(self: Panel): boolean;
|
|
1702
|
+
}
|
|
1703
|
+
|
|
1704
|
+
interface Panel {
|
|
1705
|
+
/**
|
|
1706
|
+
* Returns if the panel is focused.
|
|
1707
|
+
* @realm client and menu
|
|
1708
|
+
* @source https://wiki.facepunch.com/gmod/Panel:HasFocus
|
|
1709
|
+
*/
|
|
1710
|
+
HasFocus(self: Panel): boolean;
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
interface Panel {
|
|
1714
|
+
/**
|
|
1715
|
+
* Returns if the panel or any of its children(sub children and so on) has the focus.
|
|
1716
|
+
* @realm client and menu
|
|
1717
|
+
* @source https://wiki.facepunch.com/gmod/Panel:HasHierarchicalFocus
|
|
1718
|
+
*/
|
|
1719
|
+
HasHierarchicalFocus(self: Panel): boolean;
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
interface Panel {
|
|
1723
|
+
/**
|
|
1724
|
+
* Returns whether the panel is a descendent of the given panel.
|
|
1725
|
+
* @realm client and menu
|
|
1726
|
+
* @source https://wiki.facepunch.com/gmod/Panel:HasParent
|
|
1727
|
+
*/
|
|
1728
|
+
HasParent(self: Panel, parentPanel: Panel): boolean;
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1731
|
+
interface Panel {
|
|
1732
|
+
/**
|
|
1733
|
+
* Makes a panel invisible.
|
|
1734
|
+
* @realm client and menu
|
|
1735
|
+
* @source https://wiki.facepunch.com/gmod/Panel:Hide
|
|
1736
|
+
*/
|
|
1737
|
+
Hide(self: Panel): void;
|
|
1738
|
+
}
|
|
1739
|
+
|
|
1740
|
+
interface Panel {
|
|
1741
|
+
/**
|
|
1742
|
+
* Marks the end of a clickable text segment in a [RichText](https://wiki.facepunch.com/gmod/RichText) element, started with [Panel:InsertClickableTextStart](https://wiki.facepunch.com/gmod/Panel:InsertClickableTextStart).
|
|
1743
|
+
* @realm client and menu
|
|
1744
|
+
* @source https://wiki.facepunch.com/gmod/Panel:InsertClickableTextEnd
|
|
1745
|
+
*/
|
|
1746
|
+
InsertClickableTextEnd(self: Panel): void;
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1749
|
+
interface Panel {
|
|
1750
|
+
/**
|
|
1751
|
+
* Starts the insertion of clickable text for a [RichText](https://wiki.facepunch.com/gmod/RichText) element. Any text appended with [Panel:AppendText](https://wiki.facepunch.com/gmod/Panel:AppendText) between this call and [Panel:InsertClickableTextEnd](https://wiki.facepunch.com/gmod/Panel:InsertClickableTextEnd) will become clickable text.
|
|
1752
|
+
*
|
|
1753
|
+
* The hook [PANEL:OnTextClicked](https://wiki.facepunch.com/gmod/PANEL:OnTextClicked) is called when the text is clicked.
|
|
1754
|
+
*
|
|
1755
|
+
* **NOTE**: The clickable text is a separate Derma panel which will not inherit the current font from the `RichText`.
|
|
1756
|
+
*
|
|
1757
|
+
*
|
|
1758
|
+
* @realm client and menu
|
|
1759
|
+
* @source https://wiki.facepunch.com/gmod/Panel:InsertClickableTextStart
|
|
1760
|
+
*/
|
|
1761
|
+
InsertClickableTextStart(self: Panel, signalValue: string): void;
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
interface Panel {
|
|
1765
|
+
/**
|
|
1766
|
+
* Inserts a color change in a [RichText](https://wiki.facepunch.com/gmod/RichText) element, which affects the color of all text added with [Panel:AppendText](https://wiki.facepunch.com/gmod/Panel:AppendText) until another color change is applied.
|
|
1767
|
+
* @realm client and menu
|
|
1768
|
+
* @source https://wiki.facepunch.com/gmod/Panel:InsertColorChange
|
|
1769
|
+
*/
|
|
1770
|
+
InsertColorChange(self: Panel, r: number, g: number, b: number, a: number): void;
|
|
1771
|
+
}
|
|
1772
|
+
|
|
1773
|
+
interface Panel {
|
|
1774
|
+
/**
|
|
1775
|
+
* Begins a text fade for a [RichText](https://wiki.facepunch.com/gmod/RichText) element where the last appended text segment is fully faded out after a specific amount of time, at a specific speed.
|
|
1776
|
+
*
|
|
1777
|
+
* The alpha of the text at any given time is determined by the text's base alpha * ((`sustain` - [Global.CurTime](https://wiki.facepunch.com/gmod/Global.CurTime)) / `length`) where [Global.CurTime](https://wiki.facepunch.com/gmod/Global.CurTime) is added to `sustain` when this method is called.
|
|
1778
|
+
*
|
|
1779
|
+
* @realm client and menu
|
|
1780
|
+
* @source https://wiki.facepunch.com/gmod/Panel:InsertFade
|
|
1781
|
+
*/
|
|
1782
|
+
InsertFade(self: Panel, sustain: number, length: number): void;
|
|
1783
|
+
}
|
|
1784
|
+
|
|
1785
|
+
interface Panel {
|
|
1786
|
+
/**
|
|
1787
|
+
* Invalidates the layout of this panel object and all its children. This will cause these objects to re-layout immediately, calling [PANEL:PerformLayout](https://wiki.facepunch.com/gmod/PANEL:PerformLayout). If you want to perform the layout in the next frame, you will have loop manually through all children, and call [Panel:InvalidateLayout](https://wiki.facepunch.com/gmod/Panel:InvalidateLayout) on each.
|
|
1788
|
+
* @realm client and menu
|
|
1789
|
+
* @source https://wiki.facepunch.com/gmod/Panel:InvalidateChildren
|
|
1790
|
+
*/
|
|
1791
|
+
InvalidateChildren(self: Panel, recursive?: boolean): void;
|
|
1792
|
+
}
|
|
1793
|
+
|
|
1794
|
+
interface Panel {
|
|
1795
|
+
/**
|
|
1796
|
+
* Causes the panel to re-layout in the next frame. During the layout process [PANEL:PerformLayout](https://wiki.facepunch.com/gmod/PANEL:PerformLayout) will be called on the target panel.
|
|
1797
|
+
*
|
|
1798
|
+
* You should avoid calling this function every frame.
|
|
1799
|
+
*
|
|
1800
|
+
* Using this on a panel after clicking on a docked element will cause docked elements to reorient themselves incorrectly. This can be fixed by assigning a unique [Panel:SetZPos](https://wiki.facepunch.com/gmod/Panel:SetZPos) to each docked element.
|
|
1801
|
+
*
|
|
1802
|
+
* @realm client and menu
|
|
1803
|
+
* @source https://wiki.facepunch.com/gmod/Panel:InvalidateLayout
|
|
1804
|
+
*/
|
|
1805
|
+
InvalidateLayout(self: Panel, layoutNow?: boolean): void;
|
|
1806
|
+
}
|
|
1807
|
+
|
|
1808
|
+
interface Panel {
|
|
1809
|
+
/**
|
|
1810
|
+
* Calls [Panel:InvalidateLayout](https://wiki.facepunch.com/gmod/Panel:InvalidateLayout) on the panel's [parent](https://wiki.facepunch.com/gmod/Panel:GetParent). This function will silently fail if the panel has no parent.
|
|
1811
|
+
*
|
|
1812
|
+
* This will cause the parent panel to re-layout, calling [PANEL:PerformLayout](https://wiki.facepunch.com/gmod/PANEL:PerformLayout).
|
|
1813
|
+
*
|
|
1814
|
+
* Internally sets `LayingOutParent` to `true` on this panel, and will silently fail if it is already set.
|
|
1815
|
+
*
|
|
1816
|
+
* @realm client and menu
|
|
1817
|
+
* @source https://wiki.facepunch.com/gmod/Panel:InvalidateParent
|
|
1818
|
+
*/
|
|
1819
|
+
InvalidateParent(self: Panel, layoutNow?: boolean): void;
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1822
|
+
interface Panel {
|
|
1823
|
+
/**
|
|
1824
|
+
* Determines whether the mouse cursor is hovered over one of this panel object's children. This is a reverse process using [vgui.GetHoveredPanel](https://wiki.facepunch.com/gmod/vgui.GetHoveredPanel), and looks upward to find the parent.
|
|
1825
|
+
* @realm client and menu
|
|
1826
|
+
* @source https://wiki.facepunch.com/gmod/Panel:IsChildHovered
|
|
1827
|
+
*/
|
|
1828
|
+
IsChildHovered(self: Panel, immediate?: boolean): boolean;
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1831
|
+
interface Panel {
|
|
1832
|
+
/**
|
|
1833
|
+
* Returns whether this panel is draggable ( if user is able to drag it ) or not.
|
|
1834
|
+
* @realm client and menu
|
|
1835
|
+
* @source https://wiki.facepunch.com/gmod/Panel:IsDraggable
|
|
1836
|
+
*/
|
|
1837
|
+
IsDraggable(self: Panel): boolean;
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
interface Panel {
|
|
1841
|
+
/**
|
|
1842
|
+
* Returns whether this panel is currently being dragged or not.
|
|
1843
|
+
* @realm client and menu
|
|
1844
|
+
* @source https://wiki.facepunch.com/gmod/Panel:IsDragging
|
|
1845
|
+
*/
|
|
1846
|
+
IsDragging(self: Panel): boolean;
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
interface Panel {
|
|
1850
|
+
/**
|
|
1851
|
+
* Returns whether the the panel is enabled or disabled.
|
|
1852
|
+
*
|
|
1853
|
+
* See [Panel:SetEnabled](https://wiki.facepunch.com/gmod/Panel:SetEnabled) for a function that makes the panel enabled or disabled.
|
|
1854
|
+
*
|
|
1855
|
+
* @realm client and menu
|
|
1856
|
+
* @source https://wiki.facepunch.com/gmod/Panel:IsEnabled
|
|
1857
|
+
*/
|
|
1858
|
+
IsEnabled(self: Panel): boolean;
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
interface Panel {
|
|
1862
|
+
/**
|
|
1863
|
+
* Returns whether the mouse cursor is hovering over this panel or not
|
|
1864
|
+
*
|
|
1865
|
+
* Uses [vgui.GetHoveredPanel](https://wiki.facepunch.com/gmod/vgui.GetHoveredPanel) internally.
|
|
1866
|
+
*
|
|
1867
|
+
* Requires [Panel:SetMouseInputEnabled](https://wiki.facepunch.com/gmod/Panel:SetMouseInputEnabled) to be set to true.
|
|
1868
|
+
*
|
|
1869
|
+
* @realm client and menu
|
|
1870
|
+
* @source https://wiki.facepunch.com/gmod/Panel:IsHovered
|
|
1871
|
+
*/
|
|
1872
|
+
IsHovered(self: Panel): boolean;
|
|
1873
|
+
}
|
|
1874
|
+
|
|
1875
|
+
interface Panel {
|
|
1876
|
+
/**
|
|
1877
|
+
* Returns true if the panel can receive keyboard input.
|
|
1878
|
+
* @realm client and menu
|
|
1879
|
+
* @source https://wiki.facepunch.com/gmod/Panel:IsKeyboardInputEnabled
|
|
1880
|
+
*/
|
|
1881
|
+
IsKeyboardInputEnabled(self: Panel): boolean;
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1884
|
+
interface Panel {
|
|
1885
|
+
/**
|
|
1886
|
+
* Determines whether or not a [HTML](https://wiki.facepunch.com/gmod/HTML) or [DHTML](https://wiki.facepunch.com/gmod/DHTML) element is currently loading a page.
|
|
1887
|
+
*
|
|
1888
|
+
* **NOTE**: Before calling [Panel:SetHTML](https://wiki.facepunch.com/gmod/Panel:SetHTML) or [DHTML:OpenURL](https://wiki.facepunch.com/gmod/DHTML:OpenURL), the result seems to be `false` with the Awesomium web renderer and `true` for the Chromium web renderer. This difference can be used to determine the available HTML5 capabilities.
|
|
1889
|
+
*
|
|
1890
|
+
* **NOTE**: On Awesomium, the result remains `true` until the root document is loaded and when in-page content is loading (when adding pictures, frames, etc.). During this state, the HTML texture is not refreshed and the panel is not painted (it becomes invisible).
|
|
1891
|
+
*
|
|
1892
|
+
* On Chromium, the value is only `true` when the root document is not ready. The rendering is not suspended when in-page elements are loading.
|
|
1893
|
+
*
|
|
1894
|
+
*
|
|
1895
|
+
* @realm client and menu
|
|
1896
|
+
* @source https://wiki.facepunch.com/gmod/Panel:IsLoading
|
|
1897
|
+
*/
|
|
1898
|
+
IsLoading(self: Panel): boolean;
|
|
1899
|
+
}
|
|
1900
|
+
|
|
1901
|
+
interface Panel {
|
|
1902
|
+
/**
|
|
1903
|
+
* Returns if the panel is going to be deleted in the next frame.
|
|
1904
|
+
* @realm client and menu
|
|
1905
|
+
* @source https://wiki.facepunch.com/gmod/Panel:IsMarkedForDeletion
|
|
1906
|
+
*/
|
|
1907
|
+
IsMarkedForDeletion(self: Panel): boolean;
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
interface Panel {
|
|
1911
|
+
/**
|
|
1912
|
+
* Returns whether the panel was made modal or not. See [Panel:DoModal](https://wiki.facepunch.com/gmod/Panel:DoModal).
|
|
1913
|
+
* @realm client and menu
|
|
1914
|
+
* @source https://wiki.facepunch.com/gmod/Panel:IsModal
|
|
1915
|
+
*/
|
|
1916
|
+
IsModal(self: Panel): boolean;
|
|
1917
|
+
}
|
|
1918
|
+
|
|
1919
|
+
interface Panel {
|
|
1920
|
+
/**
|
|
1921
|
+
* Returns true if the panel can receive mouse input.
|
|
1922
|
+
* @realm client and menu
|
|
1923
|
+
* @source https://wiki.facepunch.com/gmod/Panel:IsMouseInputEnabled
|
|
1924
|
+
*/
|
|
1925
|
+
IsMouseInputEnabled(self: Panel): boolean;
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1928
|
+
interface Panel {
|
|
1929
|
+
/**
|
|
1930
|
+
* Determines whether or not a [TextEntry](https://wiki.facepunch.com/gmod/TextEntry) panel is in multi-line mode. This is set with [Panel:SetMultiline](https://wiki.facepunch.com/gmod/Panel:SetMultiline).
|
|
1931
|
+
* @realm client and menu
|
|
1932
|
+
* @source https://wiki.facepunch.com/gmod/Panel:IsMultiline
|
|
1933
|
+
*/
|
|
1934
|
+
IsMultiline(self: Panel): boolean;
|
|
1935
|
+
}
|
|
1936
|
+
|
|
1937
|
+
interface Panel {
|
|
1938
|
+
/**
|
|
1939
|
+
* Returns whether the panel contains the given panel, recursively.
|
|
1940
|
+
* @realm client and menu
|
|
1941
|
+
* @source https://wiki.facepunch.com/gmod/Panel:IsOurChild
|
|
1942
|
+
*/
|
|
1943
|
+
IsOurChild(self: Panel, childPanel: Panel): boolean;
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1946
|
+
interface Panel {
|
|
1947
|
+
/**
|
|
1948
|
+
* Returns if the panel was made popup or not. See [Panel:MakePopup](https://wiki.facepunch.com/gmod/Panel:MakePopup)
|
|
1949
|
+
* @realm client and menu
|
|
1950
|
+
* @source https://wiki.facepunch.com/gmod/Panel:IsPopup
|
|
1951
|
+
*/
|
|
1952
|
+
IsPopup(self: Panel): boolean;
|
|
1953
|
+
}
|
|
1954
|
+
|
|
1955
|
+
interface Panel {
|
|
1956
|
+
/**
|
|
1957
|
+
* Determines if the panel object is selectable (like icons in the Spawn Menu, holding Shift). This is set with [Panel:SetSelectable](https://wiki.facepunch.com/gmod/Panel:SetSelectable).
|
|
1958
|
+
* @realm client and menu
|
|
1959
|
+
* @source https://wiki.facepunch.com/gmod/Panel:IsSelectable
|
|
1960
|
+
*/
|
|
1961
|
+
IsSelectable(self: Panel): boolean;
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1964
|
+
interface Panel {
|
|
1965
|
+
/**
|
|
1966
|
+
* Returns if the panel object is selected (like icons in the Spawn Menu, holding Shift). This can be set in Lua using [Panel:SetSelected](https://wiki.facepunch.com/gmod/Panel:SetSelected).
|
|
1967
|
+
* @realm client and menu
|
|
1968
|
+
* @source https://wiki.facepunch.com/gmod/Panel:IsSelected
|
|
1969
|
+
*/
|
|
1970
|
+
IsSelected(self: Panel): boolean;
|
|
1971
|
+
}
|
|
1972
|
+
|
|
1973
|
+
interface Panel {
|
|
1974
|
+
/**
|
|
1975
|
+
* Determines if the panel object is a selection canvas or not. This is set with [Panel:SetSelectionCanvas](https://wiki.facepunch.com/gmod/Panel:SetSelectionCanvas).
|
|
1976
|
+
* @realm client and menu
|
|
1977
|
+
* @source https://wiki.facepunch.com/gmod/Panel:IsSelectionCanvas
|
|
1978
|
+
*/
|
|
1979
|
+
IsSelectionCanvas(self: Panel): any;
|
|
1980
|
+
}
|
|
1981
|
+
|
|
1982
|
+
interface Panel {
|
|
1983
|
+
/**
|
|
1984
|
+
* Returns if the panel is valid and not marked for deletion.
|
|
1985
|
+
* @realm client and menu
|
|
1986
|
+
* @source https://wiki.facepunch.com/gmod/Panel:IsValid
|
|
1987
|
+
*/
|
|
1988
|
+
IsValid(self: Panel): boolean;
|
|
1989
|
+
}
|
|
1990
|
+
|
|
1991
|
+
interface Panel {
|
|
1992
|
+
/**
|
|
1993
|
+
* Returns if the panel is visible. This will **NOT** take into account visibility of the parent.
|
|
1994
|
+
* @realm client and menu
|
|
1995
|
+
* @source https://wiki.facepunch.com/gmod/Panel:IsVisible
|
|
1996
|
+
*/
|
|
1997
|
+
IsVisible(self: Panel): boolean;
|
|
1998
|
+
}
|
|
1999
|
+
|
|
2000
|
+
interface Panel {
|
|
2001
|
+
/**
|
|
2002
|
+
* Returns if a panel allows world clicking set by [Panel:SetWorldClicker](https://wiki.facepunch.com/gmod/Panel:SetWorldClicker).
|
|
2003
|
+
* @realm client and menu
|
|
2004
|
+
* @source https://wiki.facepunch.com/gmod/Panel:IsWorldClicker
|
|
2005
|
+
*/
|
|
2006
|
+
IsWorldClicker(self: Panel): boolean;
|
|
2007
|
+
}
|
|
2008
|
+
|
|
2009
|
+
interface Panel {
|
|
2010
|
+
/**
|
|
2011
|
+
* Remove the focus from the panel.
|
|
2012
|
+
* @realm client and menu
|
|
2013
|
+
* @source https://wiki.facepunch.com/gmod/Panel:KillFocus
|
|
2014
|
+
*/
|
|
2015
|
+
KillFocus(self: Panel): void;
|
|
2016
|
+
}
|
|
2017
|
+
|
|
2018
|
+
interface Panel {
|
|
2019
|
+
/**
|
|
2020
|
+
* Redefines the panel object's [Panel:SetPos](https://wiki.facepunch.com/gmod/Panel:SetPos) method to operate using frame-by-frame linear interpolation ([Global.Lerp](https://wiki.facepunch.com/gmod/Global.Lerp)). When the panel's position is changed, it will move to the target position at the speed defined. You can undo this with [Panel:DisableLerp](https://wiki.facepunch.com/gmod/Panel:DisableLerp).
|
|
2021
|
+
*
|
|
2022
|
+
* Unlike the other panel animation functions, such as [Panel:MoveTo](https://wiki.facepunch.com/gmod/Panel:MoveTo), this animation method will not operate whilst the game is paused. This is because it relies on [Global.FrameTime](https://wiki.facepunch.com/gmod/Global.FrameTime).
|
|
2023
|
+
*
|
|
2024
|
+
* @realm client and menu
|
|
2025
|
+
* @source https://wiki.facepunch.com/gmod/Panel:LerpPositions
|
|
2026
|
+
*/
|
|
2027
|
+
LerpPositions(self: Panel, speed: number, easeOut: boolean): void;
|
|
2028
|
+
}
|
|
2029
|
+
|
|
2030
|
+
interface Panel {
|
|
2031
|
+
/**
|
|
2032
|
+
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
2033
|
+
*
|
|
2034
|
+
* Similar to [Panel:LoadControlsFromString](https://wiki.facepunch.com/gmod/Panel:LoadControlsFromString) but loads controls from a file.
|
|
2035
|
+
*
|
|
2036
|
+
* @realm client and menu
|
|
2037
|
+
* @source https://wiki.facepunch.com/gmod/Panel:LoadControlsFromFile
|
|
2038
|
+
* @deprecated No longer does anything.
|
|
2039
|
+
*/
|
|
2040
|
+
LoadControlsFromFile(self: Panel, path: string): void;
|
|
2041
|
+
}
|
|
2042
|
+
|
|
2043
|
+
interface Panel {
|
|
2044
|
+
/**
|
|
2045
|
+
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
2046
|
+
*
|
|
2047
|
+
* Loads controls(positions, etc) from given data. This is what the default options menu uses.
|
|
2048
|
+
*
|
|
2049
|
+
* @realm client and menu
|
|
2050
|
+
* @source https://wiki.facepunch.com/gmod/Panel:LoadControlsFromString
|
|
2051
|
+
* @deprecated No longer does anything.
|
|
2052
|
+
*/
|
|
2053
|
+
LoadControlsFromString(self: Panel, data: string): void;
|
|
2054
|
+
}
|
|
2055
|
+
|
|
2056
|
+
interface Panel {
|
|
2057
|
+
/**
|
|
2058
|
+
* Loads a .gwen file (created by GWEN Designer) and calls [Panel:LoadGWENString](https://wiki.facepunch.com/gmod/Panel:LoadGWENString) with the contents of the loaded file.
|
|
2059
|
+
*
|
|
2060
|
+
* Used to load panel controls from a file.
|
|
2061
|
+
*
|
|
2062
|
+
* @realm client and menu
|
|
2063
|
+
* @source https://wiki.facepunch.com/gmod/Panel:LoadGWENFile
|
|
2064
|
+
*/
|
|
2065
|
+
LoadGWENFile(self: Panel, filename: string, path?: string): void;
|
|
2066
|
+
}
|
|
2067
|
+
|
|
2068
|
+
interface Panel {
|
|
2069
|
+
/**
|
|
2070
|
+
* Loads controls for the panel from a JSON string.
|
|
2071
|
+
* @realm client and menu
|
|
2072
|
+
* @source https://wiki.facepunch.com/gmod/Panel:LoadGWENString
|
|
2073
|
+
*/
|
|
2074
|
+
LoadGWENString(self: Panel, str: string): void;
|
|
2075
|
+
}
|
|
2076
|
+
|
|
2077
|
+
interface Panel {
|
|
2078
|
+
/**
|
|
2079
|
+
* Sets a new image to be loaded by a [TGAImage](https://wiki.facepunch.com/gmod/TGAImage).
|
|
2080
|
+
* @realm client and menu
|
|
2081
|
+
* @source https://wiki.facepunch.com/gmod/Panel:LoadTGAImage
|
|
2082
|
+
* @deprecated DImage should be used instead (with `.png` or `.jpg` images). `TGAImage` panel has no advantages.
|
|
2083
|
+
*/
|
|
2084
|
+
LoadTGAImage(self: Panel, imageName: string, strPath: string): void;
|
|
2085
|
+
}
|
|
2086
|
+
|
|
2087
|
+
interface Panel {
|
|
2088
|
+
/**
|
|
2089
|
+
* Returns the cursor position local to the position of the panel (usually the upper-left corner).
|
|
2090
|
+
* @realm client and menu
|
|
2091
|
+
* @source https://wiki.facepunch.com/gmod/Panel:LocalCursorPos
|
|
2092
|
+
*/
|
|
2093
|
+
LocalCursorPos(self: Panel): (number, number);
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2096
|
+
interface Panel {
|
|
2097
|
+
/**
|
|
2098
|
+
* Takes X and Y coordinates relative to the panel and returns their corresponding positions relative to the screen.
|
|
2099
|
+
*
|
|
2100
|
+
* See also [Panel:ScreenToLocal](https://wiki.facepunch.com/gmod/Panel:ScreenToLocal).
|
|
2101
|
+
*
|
|
2102
|
+
* **WARNING**: This function uses a cached value for the screen position of the panel, computed at the end of the last VGUI Think/Layout pass, so inaccurate results may be returned if the panel or any of its ancestors have been re-positioned outside of [PANEL:Think](https://wiki.facepunch.com/gmod/PANEL:Think) or [PANEL:PerformLayout](https://wiki.facepunch.com/gmod/PANEL:PerformLayout) within the last frame.
|
|
2103
|
+
*
|
|
2104
|
+
*
|
|
2105
|
+
* **NOTE**: If the panel uses [Panel:Dock](https://wiki.facepunch.com/gmod/Panel:Dock), this function will return 0, 0 when the panel was created. The position will be updated in the next frame.
|
|
2106
|
+
*
|
|
2107
|
+
*
|
|
2108
|
+
*
|
|
2109
|
+
* @realm client and menu
|
|
2110
|
+
* @source https://wiki.facepunch.com/gmod/Panel:LocalToScreen
|
|
2111
|
+
*/
|
|
2112
|
+
LocalToScreen(self: Panel, posX: number, posY: number): (number, number);
|
|
2113
|
+
}
|
|
2114
|
+
|
|
2115
|
+
interface Panel {
|
|
2116
|
+
/**
|
|
2117
|
+
* Focuses the panel and enables it to receive input.
|
|
2118
|
+
*
|
|
2119
|
+
* This automatically calls [Panel:SetMouseInputEnabled](https://wiki.facepunch.com/gmod/Panel:SetMouseInputEnabled) and [Panel:SetKeyboardInputEnabled](https://wiki.facepunch.com/gmod/Panel:SetKeyboardInputEnabled(lowercase)) and sets them to `true`.
|
|
2120
|
+
*
|
|
2121
|
+
* **NOTE**: Panels derived from [Panel](https://wiki.facepunch.com/gmod/Panel) will not work properly with this function. Due to this, any children will not be intractable with keyboard. Derive from [EditablePanel](https://wiki.facepunch.com/gmod/EditablePanel) instead.
|
|
2122
|
+
*
|
|
2123
|
+
* For non gui related mouse focus, you can use [gui.EnableScreenClicker](https://wiki.facepunch.com/gmod/gui.EnableScreenClicker).
|
|
2124
|
+
*
|
|
2125
|
+
*
|
|
2126
|
+
* @realm client and menu
|
|
2127
|
+
* @source https://wiki.facepunch.com/gmod/Panel:MakePopup
|
|
2128
|
+
*/
|
|
2129
|
+
MakePopup(self: Panel): void;
|
|
2130
|
+
}
|
|
2131
|
+
|
|
2132
|
+
interface Panel {
|
|
2133
|
+
/**
|
|
2134
|
+
* Allows the panel to receive mouse input even if the mouse cursor is outside the bounds of the panel.
|
|
2135
|
+
* @realm client and menu
|
|
2136
|
+
* @source https://wiki.facepunch.com/gmod/Panel:MouseCapture
|
|
2137
|
+
*/
|
|
2138
|
+
MouseCapture(self: Panel, doCapture: boolean): void;
|
|
2139
|
+
}
|
|
2140
|
+
|
|
2141
|
+
interface Panel {
|
|
2142
|
+
/**
|
|
2143
|
+
* Places the panel above the passed panel with the specified offset.
|
|
2144
|
+
* @realm client and menu
|
|
2145
|
+
* @source https://wiki.facepunch.com/gmod/Panel:MoveAbove
|
|
2146
|
+
*/
|
|
2147
|
+
MoveAbove(self: Panel, panel: Panel, offset?: number): void;
|
|
2148
|
+
}
|
|
2149
|
+
|
|
2150
|
+
interface Panel {
|
|
2151
|
+
/**
|
|
2152
|
+
* Places the panel below the passed panel with the specified offset.
|
|
2153
|
+
* @realm client and menu
|
|
2154
|
+
* @source https://wiki.facepunch.com/gmod/Panel:MoveBelow
|
|
2155
|
+
*/
|
|
2156
|
+
MoveBelow(self: Panel, panel: Panel, offset?: number): void;
|
|
2157
|
+
}
|
|
2158
|
+
|
|
2159
|
+
interface Panel {
|
|
2160
|
+
/**
|
|
2161
|
+
* Moves the panel by the specified coordinates using animation.
|
|
2162
|
+
* @realm client and menu
|
|
2163
|
+
* @source https://wiki.facepunch.com/gmod/Panel:MoveBy
|
|
2164
|
+
*/
|
|
2165
|
+
MoveBy(self: Panel, moveX: number, moveY: number, time: number, delay?: number, ease?: number, callback?: (animData: table, targetPanel: Panel) => void): void;
|
|
2166
|
+
}
|
|
2167
|
+
|
|
2168
|
+
interface Panel {
|
|
2169
|
+
/**
|
|
2170
|
+
* Places the panel left to the passed panel with the specified offset.
|
|
2171
|
+
* @realm client and menu
|
|
2172
|
+
* @source https://wiki.facepunch.com/gmod/Panel:MoveLeftOf
|
|
2173
|
+
*/
|
|
2174
|
+
MoveLeftOf(self: Panel, panel: Panel, offset?: number): void;
|
|
2175
|
+
}
|
|
2176
|
+
|
|
2177
|
+
interface Panel {
|
|
2178
|
+
/**
|
|
2179
|
+
* Places the panel right to the passed panel with the specified offset.
|
|
2180
|
+
* @realm client and menu
|
|
2181
|
+
* @source https://wiki.facepunch.com/gmod/Panel:MoveRightOf
|
|
2182
|
+
*/
|
|
2183
|
+
MoveRightOf(self: Panel, panel: Panel, offset?: number): void;
|
|
2184
|
+
}
|
|
2185
|
+
|
|
2186
|
+
interface Panel {
|
|
2187
|
+
/**
|
|
2188
|
+
* Moves the panel to the specified position using animation.
|
|
2189
|
+
* **NOTE**: Setting the ease argument to 0 will result in the animation happening instantly, this applies to all MoveTo/SizeTo functions
|
|
2190
|
+
*
|
|
2191
|
+
*
|
|
2192
|
+
* @realm client and menu
|
|
2193
|
+
* @source https://wiki.facepunch.com/gmod/Panel:MoveTo
|
|
2194
|
+
*/
|
|
2195
|
+
MoveTo(self: Panel, posX: number, posY: number, time: number, delay?: number, ease?: number, callback?: (animData: table, targetPanel: Panel) => void): void;
|
|
2196
|
+
}
|
|
2197
|
+
|
|
2198
|
+
interface Panel {
|
|
2199
|
+
/**
|
|
2200
|
+
* Moves this panel object in front of the specified sibling (child of the same parent) in the render order, and shuffles up the Z-positions of siblings now behind.
|
|
2201
|
+
* @realm client and menu
|
|
2202
|
+
* @source https://wiki.facepunch.com/gmod/Panel:MoveToAfter
|
|
2203
|
+
*/
|
|
2204
|
+
MoveToAfter(self: Panel, siblingPanel: Panel): boolean;
|
|
2205
|
+
}
|
|
2206
|
+
|
|
2207
|
+
interface Panel {
|
|
2208
|
+
/**
|
|
2209
|
+
* Moves the panel object behind all other panels on screen. If the panel has been made a pop-up with [Panel:MakePopup](https://wiki.facepunch.com/gmod/Panel:MakePopup), it will still draw in front of any panels that haven't.
|
|
2210
|
+
* @realm client and menu
|
|
2211
|
+
* @source https://wiki.facepunch.com/gmod/Panel:MoveToBack
|
|
2212
|
+
*/
|
|
2213
|
+
MoveToBack(self: Panel): void;
|
|
2214
|
+
}
|
|
2215
|
+
|
|
2216
|
+
interface Panel {
|
|
2217
|
+
/**
|
|
2218
|
+
* Moves this panel object behind the specified sibling (child of the same parent) in the render order, and shuffles up the [Panel:SetZPos](https://wiki.facepunch.com/gmod/Panel:SetZPos) of siblings now in front.
|
|
2219
|
+
* @realm client and menu
|
|
2220
|
+
* @source https://wiki.facepunch.com/gmod/Panel:MoveToBefore
|
|
2221
|
+
*/
|
|
2222
|
+
MoveToBefore(self: Panel, siblingPanel: Panel): boolean;
|
|
2223
|
+
}
|
|
2224
|
+
|
|
2225
|
+
interface Panel {
|
|
2226
|
+
/**
|
|
2227
|
+
* Moves the panel in front of all other panels on screen. Unless the panel has been made a pop-up using [Panel:MakePopup](https://wiki.facepunch.com/gmod/Panel:MakePopup), it will still draw behind any that have.
|
|
2228
|
+
* @realm client and menu
|
|
2229
|
+
* @source https://wiki.facepunch.com/gmod/Panel:MoveToFront
|
|
2230
|
+
*/
|
|
2231
|
+
MoveToFront(self: Panel): void;
|
|
2232
|
+
}
|
|
2233
|
+
|
|
2234
|
+
interface Panel {
|
|
2235
|
+
/**
|
|
2236
|
+
* Creates a new animation for the panel object.
|
|
2237
|
+
*
|
|
2238
|
+
* Methods that use this function:
|
|
2239
|
+
* * [Panel:MoveTo](https://wiki.facepunch.com/gmod/Panel:MoveTo)
|
|
2240
|
+
* * [Panel:SizeTo](https://wiki.facepunch.com/gmod/Panel:SizeTo)
|
|
2241
|
+
* * [Panel:SlideUp](https://wiki.facepunch.com/gmod/Panel:SlideUp)
|
|
2242
|
+
* * [Panel:SlideDown](https://wiki.facepunch.com/gmod/Panel:SlideDown)
|
|
2243
|
+
* * [Panel:ColorTo](https://wiki.facepunch.com/gmod/Panel:ColorTo)
|
|
2244
|
+
* * [Panel:AlphaTo](https://wiki.facepunch.com/gmod/Panel:AlphaTo)
|
|
2245
|
+
* * [Panel:MoveBy](https://wiki.facepunch.com/gmod/Panel:MoveBy)
|
|
2246
|
+
* * [Panel:LerpPositions](https://wiki.facepunch.com/gmod/Panel:LerpPositions)
|
|
2247
|
+
*
|
|
2248
|
+
* @realm client and menu
|
|
2249
|
+
* @source https://wiki.facepunch.com/gmod/Panel:NewAnimation
|
|
2250
|
+
*/
|
|
2251
|
+
NewAnimation(self: Panel, length: number, delay?: number, ease?: number, callback?: (animData: table, targetPanel: Panel) => void): table;
|
|
2252
|
+
}
|
|
2253
|
+
|
|
2254
|
+
interface Panel {
|
|
2255
|
+
/**
|
|
2256
|
+
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
2257
|
+
*
|
|
2258
|
+
* @realm client and menu
|
|
2259
|
+
* @source https://wiki.facepunch.com/gmod/Panel:NewObject
|
|
2260
|
+
*/
|
|
2261
|
+
NewObject(self: Panel, objectName: string): void;
|
|
2262
|
+
}
|
|
2263
|
+
|
|
2264
|
+
interface Panel {
|
|
2265
|
+
/**
|
|
2266
|
+
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
2267
|
+
*
|
|
2268
|
+
* @realm client and menu
|
|
2269
|
+
* @source https://wiki.facepunch.com/gmod/Panel:NewObjectCallback
|
|
2270
|
+
*/
|
|
2271
|
+
NewObjectCallback(self: Panel, objectName: string, callbackName: string): void;
|
|
2272
|
+
}
|
|
2273
|
+
|
|
2274
|
+
interface Panel {
|
|
2275
|
+
/**
|
|
2276
|
+
* Sets whether this panel's drawings should be clipped within the parent panel's bounds.
|
|
2277
|
+
*
|
|
2278
|
+
* See [render.SetScissorRect](https://wiki.facepunch.com/gmod/render.SetScissorRect) if you wish to set the clipping rect instead.
|
|
2279
|
+
*
|
|
2280
|
+
* **NOTE**: This only disabled clipping for the Paint Related functions (as far as i can tell at the current moment, more testing should be done) so things like the text of a [DLabel](https://wiki.facepunch.com/gmod/DLabel) will still be clipped to the parent.
|
|
2281
|
+
*
|
|
2282
|
+
* To fully disable the clipping of any children see [Global.DisableClipping](https://wiki.facepunch.com/gmod/Global.DisableClipping).
|
|
2283
|
+
*
|
|
2284
|
+
*
|
|
2285
|
+
* @realm client and menu
|
|
2286
|
+
* @source https://wiki.facepunch.com/gmod/Panel:NoClipping
|
|
2287
|
+
*/
|
|
2288
|
+
NoClipping(self: Panel, disableClipping: boolean): void;
|
|
2289
|
+
}
|
|
2290
|
+
|
|
2291
|
+
interface Panel {
|
|
2292
|
+
/**
|
|
2293
|
+
* Returns the number of children of the panel object that are selected. This is equivalent to calling [Panel:IsSelected](https://wiki.facepunch.com/gmod/Panel:IsSelected) on all child objects and counting the number of returns that are `true`.
|
|
2294
|
+
* @realm client and menu
|
|
2295
|
+
* @source https://wiki.facepunch.com/gmod/Panel:NumSelectedChildren
|
|
2296
|
+
*/
|
|
2297
|
+
NumSelectedChildren(self: Panel): number;
|
|
2298
|
+
}
|
|
2299
|
+
|
|
2300
|
+
interface Panel {
|
|
2301
|
+
/**
|
|
2302
|
+
* Instructs a HTML control to download and parse a HTML script using the passed URL.
|
|
2303
|
+
*
|
|
2304
|
+
* This function can only be used on [HTML](https://wiki.facepunch.com/gmod/HTML) panel and its derivatives.
|
|
2305
|
+
* @realm client and menu
|
|
2306
|
+
* @source https://wiki.facepunch.com/gmod/Panel:OpenURL
|
|
2307
|
+
*/
|
|
2308
|
+
OpenURL(self: Panel, URL: string): void;
|
|
2309
|
+
}
|
|
2310
|
+
|
|
2311
|
+
interface Panel {
|
|
2312
|
+
/**
|
|
2313
|
+
* Paints a ghost copy of the panel at the given position.
|
|
2314
|
+
* **WARNING**: This function sets Z pos of panel's children ([PANEL:SetZPos](https://wiki.facepunch.com/gmod/PANEL:SetZPos)). It also briefly unparents and reparents the panel.
|
|
2315
|
+
*
|
|
2316
|
+
*
|
|
2317
|
+
* @realm client and menu
|
|
2318
|
+
* @source https://wiki.facepunch.com/gmod/Panel:PaintAt
|
|
2319
|
+
*/
|
|
2320
|
+
PaintAt(self: Panel, posX: number, posY: number): void;
|
|
2321
|
+
}
|
|
2322
|
+
|
|
2323
|
+
interface Panel {
|
|
2324
|
+
/**
|
|
2325
|
+
* Paints the panel at its current position. To use this you must call [Panel:SetPaintedManually](https://wiki.facepunch.com/gmod/Panel:SetPaintedManually)(true).
|
|
2326
|
+
* @realm client and menu
|
|
2327
|
+
* @source https://wiki.facepunch.com/gmod/Panel:PaintManual
|
|
2328
|
+
*/
|
|
2329
|
+
PaintManual(self: Panel, unclamp?: boolean): void;
|
|
2330
|
+
}
|
|
2331
|
+
|
|
2332
|
+
interface Panel {
|
|
2333
|
+
/**
|
|
2334
|
+
* Parents the panel to the HUD.
|
|
2335
|
+
* Makes it invisible on the escape-menu and disables controls.
|
|
2336
|
+
*
|
|
2337
|
+
* @realm client
|
|
2338
|
+
* @source https://wiki.facepunch.com/gmod/Panel:ParentToHUD
|
|
2339
|
+
*/
|
|
2340
|
+
ParentToHUD(self: Panel): void;
|
|
2341
|
+
}
|
|
2342
|
+
|
|
2343
|
+
interface Panel {
|
|
2344
|
+
/**
|
|
2345
|
+
* Only works for TextEntries.
|
|
2346
|
+
*
|
|
2347
|
+
* Pastes the contents of the clipboard into the TextEntry.
|
|
2348
|
+
*
|
|
2349
|
+
* **NOTE**: Tab characters will be dropped from the pasted text
|
|
2350
|
+
*
|
|
2351
|
+
*
|
|
2352
|
+
* @realm client and menu
|
|
2353
|
+
* @source https://wiki.facepunch.com/gmod/Panel:Paste
|
|
2354
|
+
* @deprecated Due to privacy concerns, this function has been disabled
|
|
2355
|
+
*/
|
|
2356
|
+
Paste(self: Panel): void;
|
|
2357
|
+
}
|
|
2358
|
+
|
|
2359
|
+
interface Panel {
|
|
2360
|
+
/**
|
|
2361
|
+
* Sets the width and position of a [DLabel](https://wiki.facepunch.com/gmod/DLabel) and places the passed panel object directly to the right of it. Returns the `y` value of the bottom of the tallest object. The panel on which this method is run is not relevant; only the passed objects are affected.
|
|
2362
|
+
* @realm client and menu
|
|
2363
|
+
* @source https://wiki.facepunch.com/gmod/Panel:PositionLabel
|
|
2364
|
+
*/
|
|
2365
|
+
PositionLabel(self: Panel, lblWidth: number, x: number, y: number, lbl: Panel, panelObj: Panel): number;
|
|
2366
|
+
}
|
|
2367
|
+
|
|
2368
|
+
interface Panel {
|
|
2369
|
+
/**
|
|
2370
|
+
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
2371
|
+
*
|
|
2372
|
+
* Installs Lua defined functions into the panel.
|
|
2373
|
+
*
|
|
2374
|
+
* @realm client and menu
|
|
2375
|
+
* @source https://wiki.facepunch.com/gmod/Panel:Prepare
|
|
2376
|
+
*/
|
|
2377
|
+
Prepare(self: Panel): void;
|
|
2378
|
+
}
|
|
2379
|
+
|
|
2380
|
+
interface Panel {
|
|
2381
|
+
/**
|
|
2382
|
+
* Enables the queue for panel animations. If enabled, the next new animation will begin after all current animations have ended. This must be called before [Panel:NewAnimation](https://wiki.facepunch.com/gmod/Panel:NewAnimation) to work, and only applies to the next new animation. If you want to queue many, you must call this before each.
|
|
2383
|
+
* @realm client and menu
|
|
2384
|
+
* @source https://wiki.facepunch.com/gmod/Panel:Queue
|
|
2385
|
+
*/
|
|
2386
|
+
Queue(self: Panel): void;
|
|
2387
|
+
}
|
|
2388
|
+
|
|
2389
|
+
interface Panel {
|
|
2390
|
+
/**
|
|
2391
|
+
* Causes a [SpawnIcon](https://wiki.facepunch.com/gmod/SpawnIcon) to rebuild its model image.
|
|
2392
|
+
* @realm client
|
|
2393
|
+
* @source https://wiki.facepunch.com/gmod/Panel:RebuildSpawnIcon
|
|
2394
|
+
*/
|
|
2395
|
+
RebuildSpawnIcon(self: Panel): void;
|
|
2396
|
+
}
|
|
2397
|
+
|
|
2398
|
+
interface Panel {
|
|
2399
|
+
/**
|
|
2400
|
+
* Re-renders a spawn icon with customized cam data.
|
|
2401
|
+
*
|
|
2402
|
+
* [Global.PositionSpawnIcon](https://wiki.facepunch.com/gmod/Global.PositionSpawnIcon) can be used to easily calculate the necessary camera parameters.
|
|
2403
|
+
*
|
|
2404
|
+
* **NOTE**: This function does **not** accept the standard [Structures/CamData](https://wiki.facepunch.com/gmod/Structures/CamData).
|
|
2405
|
+
*
|
|
2406
|
+
*
|
|
2407
|
+
* @realm client
|
|
2408
|
+
* @source https://wiki.facepunch.com/gmod/Panel:RebuildSpawnIconEx
|
|
2409
|
+
*/
|
|
2410
|
+
RebuildSpawnIconEx(self: Panel, data: table): void;
|
|
2411
|
+
}
|
|
2412
|
+
|
|
2413
|
+
interface Panel {
|
|
2414
|
+
/**
|
|
2415
|
+
* Allows the panel to receive drag and drop events. Can be called multiple times with different names to receive multiple different draggable panel events.
|
|
2416
|
+
* @realm client and menu
|
|
2417
|
+
* @source https://wiki.facepunch.com/gmod/Panel:Receiver
|
|
2418
|
+
*/
|
|
2419
|
+
Receiver(self: Panel, name: string, func: (pnl: Panel, tbl: table, dropped: boolean, menuIndex: number, x: number, y: number) => void, menu?: table): void;
|
|
2420
|
+
}
|
|
2421
|
+
|
|
2422
|
+
interface Panel {
|
|
2423
|
+
/**
|
|
2424
|
+
* Refreshes the HTML panel's current page.
|
|
2425
|
+
* @realm client and menu
|
|
2426
|
+
* @source https://wiki.facepunch.com/gmod/Panel:Refresh
|
|
2427
|
+
*/
|
|
2428
|
+
Refresh(self: Panel, ignoreCache?: boolean): void;
|
|
2429
|
+
}
|
|
2430
|
+
|
|
2431
|
+
interface Panel {
|
|
2432
|
+
/**
|
|
2433
|
+
* Marks a panel for deletion so it will be deleted on the next frame.
|
|
2434
|
+
*
|
|
2435
|
+
* This will not mark child panels for deletion this frame, but they will be marked and deleted in the next frame.
|
|
2436
|
+
*
|
|
2437
|
+
* See also [Panel:IsMarkedForDeletion](https://wiki.facepunch.com/gmod/Panel:IsMarkedForDeletion)
|
|
2438
|
+
*
|
|
2439
|
+
* Will automatically call [Panel:InvalidateParent](https://wiki.facepunch.com/gmod/Panel:InvalidateParent).
|
|
2440
|
+
*
|
|
2441
|
+
* @realm client and menu
|
|
2442
|
+
* @source https://wiki.facepunch.com/gmod/Panel:Remove
|
|
2443
|
+
*/
|
|
2444
|
+
Remove(self: Panel): void;
|
|
2445
|
+
}
|
|
2446
|
+
|
|
2447
|
+
interface Panel {
|
|
2448
|
+
/**
|
|
2449
|
+
* Attempts to obtain focus for this panel.
|
|
2450
|
+
* @realm client and menu
|
|
2451
|
+
* @source https://wiki.facepunch.com/gmod/Panel:RequestFocus
|
|
2452
|
+
*/
|
|
2453
|
+
RequestFocus(self: Panel): void;
|
|
2454
|
+
}
|
|
2455
|
+
|
|
2456
|
+
interface Panel {
|
|
2457
|
+
/**
|
|
2458
|
+
* Resets all text fades in a [RichText](https://wiki.facepunch.com/gmod/RichText) element made with [Panel:InsertFade](https://wiki.facepunch.com/gmod/Panel:InsertFade).
|
|
2459
|
+
* @realm client and menu
|
|
2460
|
+
* @source https://wiki.facepunch.com/gmod/Panel:ResetAllFades
|
|
2461
|
+
*/
|
|
2462
|
+
ResetAllFades(self: Panel, hold: boolean, expiredOnly: boolean, newSustain: number): void;
|
|
2463
|
+
}
|
|
2464
|
+
|
|
2465
|
+
interface Panel {
|
|
2466
|
+
/**
|
|
2467
|
+
* Executes a string as JavaScript code on a web document panel.
|
|
2468
|
+
*
|
|
2469
|
+
* **NOTE**: This function does **NOT** allow you to pass variables from JavaScript (JS) to Lua context.
|
|
2470
|
+
* If you wish to pass/return values from JS to Lua, you may want to use [DHTML:AddFunction](https://wiki.facepunch.com/gmod/DHTML:AddFunction) function to accomplish that job.
|
|
2471
|
+
*
|
|
2472
|
+
*
|
|
2473
|
+
* **NOTE**: The Awesomium web renderer automatically delays the code execution if the document is not ready, but the Chromium web renderer does not!
|
|
2474
|
+
*
|
|
2475
|
+
* This means that with Chromium, you cannot JavaScript run code immediatly after calling [Panel:SetHTML](https://wiki.facepunch.com/gmod/Panel:SetHTML) or [Panel:OpenURL](https://wiki.facepunch.com/gmod/Panel:OpenURL). You should wait for the events [HTML:OnDocumentReady](https://wiki.facepunch.com/gmod/HTML:OnDocumentReady) or [HTML:OnFinishLoadingDocument](https://wiki.facepunch.com/gmod/HTML:OnFinishLoadingDocument) to be triggered before proceeding, otherwise you may manipulate an empty / incomplete document.
|
|
2476
|
+
*
|
|
2477
|
+
*
|
|
2478
|
+
* @realm client and menu
|
|
2479
|
+
* @source https://wiki.facepunch.com/gmod/Panel:RunJavascript
|
|
2480
|
+
*/
|
|
2481
|
+
RunJavascript(self: Panel, js: string): void;
|
|
2482
|
+
}
|
|
2483
|
+
|
|
2484
|
+
interface Panel {
|
|
2485
|
+
/**
|
|
2486
|
+
* Saves the current state (caret position and the text inside) of a [TextEntry](https://wiki.facepunch.com/gmod/TextEntry) as an undo state.
|
|
2487
|
+
*
|
|
2488
|
+
* See also [Panel:Undo](https://wiki.facepunch.com/gmod/Panel:Undo).
|
|
2489
|
+
*
|
|
2490
|
+
* @realm client and menu
|
|
2491
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SaveUndoState
|
|
2492
|
+
*/
|
|
2493
|
+
SaveUndoState(self: Panel): void;
|
|
2494
|
+
}
|
|
2495
|
+
|
|
2496
|
+
interface Panel {
|
|
2497
|
+
/**
|
|
2498
|
+
* Translates global screen coordinate to coordinates relative to the panel.
|
|
2499
|
+
*
|
|
2500
|
+
* See also [Panel:LocalToScreen](https://wiki.facepunch.com/gmod/Panel:LocalToScreen).
|
|
2501
|
+
*
|
|
2502
|
+
* **WARNING**: This function uses a cached value for the screen position of the panel, computed at the end of the last VGUI Think/Layout pass, so inaccurate results may be returned if the panel or any of its ancestors have been re-positioned outside of [PANEL:Think](https://wiki.facepunch.com/gmod/PANEL:Think) or [PANEL:PerformLayout](https://wiki.facepunch.com/gmod/PANEL:PerformLayout) within the last frame.
|
|
2503
|
+
*
|
|
2504
|
+
*
|
|
2505
|
+
* @realm client and menu
|
|
2506
|
+
* @source https://wiki.facepunch.com/gmod/Panel:ScreenToLocal
|
|
2507
|
+
*/
|
|
2508
|
+
ScreenToLocal(self: Panel, screenX: number, screenY: number): (number, number);
|
|
2509
|
+
}
|
|
2510
|
+
|
|
2511
|
+
interface Panel {
|
|
2512
|
+
/**
|
|
2513
|
+
* Selects all items within a panel or object. For text-based objects, selects all text.
|
|
2514
|
+
*
|
|
2515
|
+
* **NOTE**: Only works on [RichText](https://wiki.facepunch.com/gmod/RichText) and [TextEntry](https://wiki.facepunch.com/gmod/TextEntry) and their derived panels by default (such as [DTextEntry](https://wiki.facepunch.com/gmod/DTextEntry)), and on any panel that manually reimplemented this method.
|
|
2516
|
+
*
|
|
2517
|
+
*
|
|
2518
|
+
* @realm client and menu
|
|
2519
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SelectAll
|
|
2520
|
+
*/
|
|
2521
|
+
SelectAll(self: Panel): void;
|
|
2522
|
+
}
|
|
2523
|
+
|
|
2524
|
+
interface Panel {
|
|
2525
|
+
/**
|
|
2526
|
+
* If called on a [TextEntry](https://wiki.facepunch.com/gmod/TextEntry), clicking the text entry for the first time will automatically select all of the text ready to be copied by the user.
|
|
2527
|
+
* @realm client and menu
|
|
2528
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SelectAllOnFocus
|
|
2529
|
+
*/
|
|
2530
|
+
SelectAllOnFocus(self: Panel): void;
|
|
2531
|
+
}
|
|
2532
|
+
|
|
2533
|
+
interface Panel {
|
|
2534
|
+
/**
|
|
2535
|
+
* Selects all the text in a panel object. Will not select non-text items; for this, use [Panel:SelectAll](https://wiki.facepunch.com/gmod/Panel:SelectAll).
|
|
2536
|
+
* @realm client and menu
|
|
2537
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SelectAllText
|
|
2538
|
+
* @deprecated Duplicate of Panel:SelectAll.
|
|
2539
|
+
*/
|
|
2540
|
+
SelectAllText(self: Panel, resetCursorPos: boolean): void;
|
|
2541
|
+
}
|
|
2542
|
+
|
|
2543
|
+
interface Panel {
|
|
2544
|
+
/**
|
|
2545
|
+
* Deselects all items in a panel object. For text-based objects, this will deselect all text.
|
|
2546
|
+
*
|
|
2547
|
+
* **NOTE**: Only works on [RichText](https://wiki.facepunch.com/gmod/RichText) and [TextEntry](https://wiki.facepunch.com/gmod/TextEntry) and their derived panels by default (such as [DTextEntry](https://wiki.facepunch.com/gmod/DTextEntry)), and on any panel that manually reimplemented this method.
|
|
2548
|
+
*
|
|
2549
|
+
*
|
|
2550
|
+
* @realm client and menu
|
|
2551
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SelectNone
|
|
2552
|
+
*/
|
|
2553
|
+
SelectNone(self: Panel): void;
|
|
2554
|
+
}
|
|
2555
|
+
|
|
2556
|
+
interface Panel {
|
|
2557
|
+
/**
|
|
2558
|
+
* Sets the achievement to be displayed by [AchievementIcon](https://wiki.facepunch.com/gmod/AchievementIcon).
|
|
2559
|
+
* @realm client and menu
|
|
2560
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetAchievement
|
|
2561
|
+
*/
|
|
2562
|
+
SetAchievement(self: Panel, id: number): void;
|
|
2563
|
+
}
|
|
2564
|
+
|
|
2565
|
+
interface Panel {
|
|
2566
|
+
/**
|
|
2567
|
+
* Configures a [TextEntry](https://wiki.facepunch.com/gmod/TextEntry) to allow user to type characters that are not included in the US-ASCII (7-bit ASCII) character set.
|
|
2568
|
+
*
|
|
2569
|
+
* Characters not included in US-ASCII are multi-byte characters in UTF-8. They can be accented characters, non-Latin characters and special characters.
|
|
2570
|
+
*
|
|
2571
|
+
* @realm client and menu
|
|
2572
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetAllowNonAsciiCharacters
|
|
2573
|
+
*/
|
|
2574
|
+
SetAllowNonAsciiCharacters(self: Panel, allowed: boolean): void;
|
|
2575
|
+
}
|
|
2576
|
+
|
|
2577
|
+
interface Panel {
|
|
2578
|
+
/**
|
|
2579
|
+
* Sets the alpha multiplier for the panel
|
|
2580
|
+
* @realm client and menu
|
|
2581
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetAlpha
|
|
2582
|
+
*/
|
|
2583
|
+
SetAlpha(self: Panel, alpha: number): void;
|
|
2584
|
+
}
|
|
2585
|
+
|
|
2586
|
+
interface Panel {
|
|
2587
|
+
/**
|
|
2588
|
+
* Enables or disables animations for the panel object by overriding the [PANEL:AnimationThink](https://wiki.facepunch.com/gmod/PANEL:AnimationThink) hook to nil and back.
|
|
2589
|
+
* @realm client and menu
|
|
2590
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetAnimationEnabled
|
|
2591
|
+
*/
|
|
2592
|
+
SetAnimationEnabled(self: Panel, enable: boolean): void;
|
|
2593
|
+
}
|
|
2594
|
+
|
|
2595
|
+
interface Panel {
|
|
2596
|
+
/**
|
|
2597
|
+
* Sets whenever the panel should be removed if the parent was removed.
|
|
2598
|
+
* @realm client and menu
|
|
2599
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetAutoDelete
|
|
2600
|
+
*/
|
|
2601
|
+
SetAutoDelete(self: Panel, autoDelete: boolean): void;
|
|
2602
|
+
}
|
|
2603
|
+
|
|
2604
|
+
interface Panel {
|
|
2605
|
+
/**
|
|
2606
|
+
* Sets the background color of a panel such as a [RichText](https://wiki.facepunch.com/gmod/RichText), [Label](https://wiki.facepunch.com/gmod/Label), [DColorCube](https://wiki.facepunch.com/gmod/DColorCube) or the base [Panel](https://wiki.facepunch.com/gmod/Panel).
|
|
2607
|
+
*
|
|
2608
|
+
* For many panels, such as [DLabel](https://wiki.facepunch.com/gmod/DLabel) and [Panel](https://wiki.facepunch.com/gmod/Panel), you must use [Panel:SetPaintBackgroundEnabled](https://wiki.facepunch.com/gmod/Panel:SetPaintBackgroundEnabled)( true ) for the background to appear.
|
|
2609
|
+
*
|
|
2610
|
+
* Please note that for most panels the engine will overwrite the foreground and background colors a frame after panel creation via the [PANEL:ApplySchemeSettings](https://wiki.facepunch.com/gmod/PANEL:ApplySchemeSettings) hook, so you may want to set the color in that hook instead.
|
|
2611
|
+
*
|
|
2612
|
+
* See [Panel:SetFGColor](https://wiki.facepunch.com/gmod/Panel:SetFGColor) for the foreground color.
|
|
2613
|
+
*
|
|
2614
|
+
* **NOTE**: This doesn't apply to all VGUI elements and its function varies between them
|
|
2615
|
+
*
|
|
2616
|
+
*
|
|
2617
|
+
* @realm client and menu
|
|
2618
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetBGColor
|
|
2619
|
+
*/
|
|
2620
|
+
SetBGColor(self: Panel, r: number, g: number, b: number, a: number): void;
|
|
2621
|
+
}
|
|
2622
|
+
|
|
2623
|
+
interface Panel {
|
|
2624
|
+
SetBGColor(self: Panel, color: Color): void;
|
|
2625
|
+
}
|
|
2626
|
+
|
|
2627
|
+
interface Panel {
|
|
2628
|
+
/**
|
|
2629
|
+
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
2630
|
+
* Sets the background color of the panel.
|
|
2631
|
+
* @realm client and menu
|
|
2632
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetBGColorEx
|
|
2633
|
+
*/
|
|
2634
|
+
SetBGColorEx(self: Panel, r: number, g: number, b: number, a: number): void;
|
|
2635
|
+
}
|
|
2636
|
+
|
|
2637
|
+
interface Panel {
|
|
2638
|
+
/**
|
|
2639
|
+
* Sets the position of the caret (or text cursor) in a text-based panel object.
|
|
2640
|
+
* @realm client and menu
|
|
2641
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetCaretPos
|
|
2642
|
+
*/
|
|
2643
|
+
SetCaretPos(self: Panel, offset: number): void;
|
|
2644
|
+
}
|
|
2645
|
+
|
|
2646
|
+
interface Panel {
|
|
2647
|
+
/**
|
|
2648
|
+
* **WARNING**: This function does not exist on all panels
|
|
2649
|
+
*
|
|
2650
|
+
* **WARNING**: This function cannot interact with serverside convars unless you are host
|
|
2651
|
+
*
|
|
2652
|
+
* **NOTE**: Blocked convars will not work with this, see [Blocked ConCommands](https://wiki.facepunch.com/gmod/Blocked_ConCommands)
|
|
2653
|
+
*
|
|
2654
|
+
*
|
|
2655
|
+
* Sets this panel's convar. When the convar changes this panel will update automatically.
|
|
2656
|
+
*
|
|
2657
|
+
* For developer implementation, see [Global.Derma_Install_Convar_Functions](https://wiki.facepunch.com/gmod/Global.Derma_Install_Convar_Functions).
|
|
2658
|
+
*
|
|
2659
|
+
* @realm client and menu
|
|
2660
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetConVar
|
|
2661
|
+
*/
|
|
2662
|
+
SetConVar(self: Panel, convar: string): void;
|
|
2663
|
+
}
|
|
2664
|
+
|
|
2665
|
+
interface Panel {
|
|
2666
|
+
/**
|
|
2667
|
+
* Sets the alignment of the contents.
|
|
2668
|
+
*
|
|
2669
|
+
* **NOTE**: This function only works on [Label](https://wiki.facepunch.com/gmod/Label) panels and its derivatives.
|
|
2670
|
+
*
|
|
2671
|
+
* **NOTE**: This function doesnt work, if [Panel:SetWrap](https://wiki.facepunch.com/gmod/Panel:SetWrap) is true.
|
|
2672
|
+
*
|
|
2673
|
+
*
|
|
2674
|
+
* @realm client and menu
|
|
2675
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetContentAlignment
|
|
2676
|
+
*/
|
|
2677
|
+
SetContentAlignment(self: Panel, alignment: number): void;
|
|
2678
|
+
}
|
|
2679
|
+
|
|
2680
|
+
interface Panel {
|
|
2681
|
+
/**
|
|
2682
|
+
* Stores a string in the named cookie using [Panel:GetCookieName](https://wiki.facepunch.com/gmod/Panel:GetCookieName) as prefix.
|
|
2683
|
+
*
|
|
2684
|
+
* You can also retrieve and modify this cookie by using the [cookie](https://wiki.facepunch.com/gmod/cookie). Cookies are stored in this format:
|
|
2685
|
+
*
|
|
2686
|
+
* ```
|
|
2687
|
+
* panelCookieName.cookieName
|
|
2688
|
+
* ```
|
|
2689
|
+
*
|
|
2690
|
+
*
|
|
2691
|
+
* **WARNING**: The panel's cookie name MUST be set for this function to work. See [Panel:SetCookieName](https://wiki.facepunch.com/gmod/Panel:SetCookieName).
|
|
2692
|
+
*
|
|
2693
|
+
*
|
|
2694
|
+
* @realm client and menu
|
|
2695
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetCookie
|
|
2696
|
+
*/
|
|
2697
|
+
SetCookie(self: Panel, cookieName: string, value: string): void;
|
|
2698
|
+
}
|
|
2699
|
+
|
|
2700
|
+
interface Panel {
|
|
2701
|
+
/**
|
|
2702
|
+
* Sets the panel's cookie name. Calls [PANEL:LoadCookies](https://wiki.facepunch.com/gmod/PANEL:LoadCookies) if defined.
|
|
2703
|
+
* @realm client and menu
|
|
2704
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetCookieName
|
|
2705
|
+
*/
|
|
2706
|
+
SetCookieName(self: Panel, name: string): void;
|
|
2707
|
+
}
|
|
2708
|
+
|
|
2709
|
+
interface Panel {
|
|
2710
|
+
/**
|
|
2711
|
+
* Sets the appearance of the cursor. You can find a list of all available cursors with image previews [here](https://wiki.facepunch.com/gmod/Cursors).
|
|
2712
|
+
*
|
|
2713
|
+
* @realm client and menu
|
|
2714
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetCursor
|
|
2715
|
+
*/
|
|
2716
|
+
SetCursor(self: Panel, cursor: string): void;
|
|
2717
|
+
}
|
|
2718
|
+
|
|
2719
|
+
interface Panel {
|
|
2720
|
+
/**
|
|
2721
|
+
* Sets the drag parent.
|
|
2722
|
+
*
|
|
2723
|
+
* Drag parent means that when we start to drag this panel, we'll really start dragging the defined parent.
|
|
2724
|
+
*
|
|
2725
|
+
* @realm client and menu
|
|
2726
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetDragParent
|
|
2727
|
+
*/
|
|
2728
|
+
SetDragParent(self: Panel, parent: Panel): void;
|
|
2729
|
+
}
|
|
2730
|
+
|
|
2731
|
+
interface Panel {
|
|
2732
|
+
/**
|
|
2733
|
+
* Sets the visibility of the language selection box when typing in non-English mode.
|
|
2734
|
+
*
|
|
2735
|
+
* See [Panel:SetDrawLanguageIDAtLeft](https://wiki.facepunch.com/gmod/Panel:SetDrawLanguageIDAtLeft) for a function that changes the position of the language selection box.
|
|
2736
|
+
*
|
|
2737
|
+
* @realm client and menu
|
|
2738
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetDrawLanguageID
|
|
2739
|
+
*/
|
|
2740
|
+
SetDrawLanguageID(self: Panel, visible: boolean): void;
|
|
2741
|
+
}
|
|
2742
|
+
|
|
2743
|
+
interface Panel {
|
|
2744
|
+
/**
|
|
2745
|
+
* Sets where to draw the language selection box.
|
|
2746
|
+
*
|
|
2747
|
+
* See [Panel:SetDrawLanguageID](https://wiki.facepunch.com/gmod/Panel:SetDrawLanguageID) for a function that hides or shows the language selection box.
|
|
2748
|
+
*
|
|
2749
|
+
* @realm client and menu
|
|
2750
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetDrawLanguageIDAtLeft
|
|
2751
|
+
*/
|
|
2752
|
+
SetDrawLanguageIDAtLeft(self: Panel, left: boolean): void;
|
|
2753
|
+
}
|
|
2754
|
+
|
|
2755
|
+
interface Panel {
|
|
2756
|
+
/**
|
|
2757
|
+
* Makes the panel render in front of all others, including the spawn menu and main menu.
|
|
2758
|
+
*
|
|
2759
|
+
* Priority is given based on the last call, so of two panels that call this method, the second will draw in front of the first.
|
|
2760
|
+
*
|
|
2761
|
+
* **NOTE**: This only makes the panel **draw** above other panels. If there's another panel that would have otherwise covered it, users will not be able to interact with it.
|
|
2762
|
+
*
|
|
2763
|
+
* Completely disregards [PANEL:ParentToHUD](https://wiki.facepunch.com/gmod/PANEL:ParentToHUD).
|
|
2764
|
+
*
|
|
2765
|
+
*
|
|
2766
|
+
* **WARNING**: This does not work when using [PANEL:SetPaintedManually](https://wiki.facepunch.com/gmod/PANEL:SetPaintedManually) or [PANEL:PaintAt](https://wiki.facepunch.com/gmod/PANEL:PaintAt).
|
|
2767
|
+
*
|
|
2768
|
+
*
|
|
2769
|
+
* @realm client and menu
|
|
2770
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetDrawOnTop
|
|
2771
|
+
*/
|
|
2772
|
+
SetDrawOnTop(self: Panel, drawOnTop?: boolean): void;
|
|
2773
|
+
}
|
|
2774
|
+
|
|
2775
|
+
interface Panel {
|
|
2776
|
+
/**
|
|
2777
|
+
* Sets the target area for dropping when an object is being dragged around this panel using the [dragndrop](https://wiki.facepunch.com/gmod/dragndrop).
|
|
2778
|
+
*
|
|
2779
|
+
* This draws a target box of the specified size and position, until [Panel:DragHoverEnd](https://wiki.facepunch.com/gmod/Panel:DragHoverEnd) is called. It uses [Panel:DrawDragHover](https://wiki.facepunch.com/gmod/Panel:DrawDragHover) to draw this area.
|
|
2780
|
+
*
|
|
2781
|
+
* @realm client and menu
|
|
2782
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetDropTarget
|
|
2783
|
+
*/
|
|
2784
|
+
SetDropTarget(self: Panel, x: number, y: number, width: number, height: number): void;
|
|
2785
|
+
}
|
|
2786
|
+
|
|
2787
|
+
interface Panel {
|
|
2788
|
+
/**
|
|
2789
|
+
* Sets the enabled state of a panel object that supports being disabled, such as a [DButton](https://wiki.facepunch.com/gmod/DButton) or [DTextEntry](https://wiki.facepunch.com/gmod/DTextEntry).
|
|
2790
|
+
*
|
|
2791
|
+
* Disabled panels cannot be interacted with, and have a different appearance to indicate this.
|
|
2792
|
+
*
|
|
2793
|
+
* See [Panel:IsEnabled](https://wiki.facepunch.com/gmod/Panel:IsEnabled) for a function that retrieves the "enabled" state of a panel.
|
|
2794
|
+
*
|
|
2795
|
+
* @realm client and menu
|
|
2796
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetEnabled
|
|
2797
|
+
*/
|
|
2798
|
+
SetEnabled(self: Panel, enable: boolean): void;
|
|
2799
|
+
}
|
|
2800
|
+
|
|
2801
|
+
interface Panel {
|
|
2802
|
+
/**
|
|
2803
|
+
* Adds a shadow falling to the bottom right corner of the panel's text.
|
|
2804
|
+
*
|
|
2805
|
+
* **NOTE**: This works only on panels that derive from [Label](https://wiki.facepunch.com/gmod/Label).
|
|
2806
|
+
*
|
|
2807
|
+
*
|
|
2808
|
+
* @realm client and menu
|
|
2809
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetExpensiveShadow
|
|
2810
|
+
*/
|
|
2811
|
+
SetExpensiveShadow(self: Panel, distance: number, Color: Color): void;
|
|
2812
|
+
}
|
|
2813
|
+
|
|
2814
|
+
interface Panel {
|
|
2815
|
+
/**
|
|
2816
|
+
* Sets the foreground color of a panel.
|
|
2817
|
+
*
|
|
2818
|
+
* For a [Label](https://wiki.facepunch.com/gmod/Label) or [RichText](https://wiki.facepunch.com/gmod/RichText), this is the color of its text.
|
|
2819
|
+
*
|
|
2820
|
+
* This function calls [Panel:SetFGColorEx](https://wiki.facepunch.com/gmod/Panel:SetFGColorEx) internally.
|
|
2821
|
+
*
|
|
2822
|
+
* Please note that for most panels the engine will overwrite the foreground and background colors a frame after panel creation via the [PANEL:ApplySchemeSettings](https://wiki.facepunch.com/gmod/PANEL:ApplySchemeSettings) hook, so you may want to set the color in that hook instead.
|
|
2823
|
+
*
|
|
2824
|
+
* See [Panel:SetBGColor](https://wiki.facepunch.com/gmod/Panel:SetBGColor) for the background color.
|
|
2825
|
+
*
|
|
2826
|
+
* **NOTE**: This doesn't apply to all VGUI elements (such as [DLabel](https://wiki.facepunch.com/gmod/DLabel)) and its function varies between them
|
|
2827
|
+
*
|
|
2828
|
+
*
|
|
2829
|
+
* @realm client and menu
|
|
2830
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetFGColor
|
|
2831
|
+
*/
|
|
2832
|
+
SetFGColor(self: Panel, r: number, g: number, b: number, a: number): void;
|
|
2833
|
+
}
|
|
2834
|
+
|
|
2835
|
+
interface Panel {
|
|
2836
|
+
SetFGColor(self: Panel, color: Color): void;
|
|
2837
|
+
}
|
|
2838
|
+
|
|
2839
|
+
interface Panel {
|
|
2840
|
+
/**
|
|
2841
|
+
* **INTERNAL**: This is used internally - although you're able to use it you probably shouldn't.
|
|
2842
|
+
* Sets the foreground color of the panel.
|
|
2843
|
+
*
|
|
2844
|
+
* For labels, this is the color of their text.
|
|
2845
|
+
*
|
|
2846
|
+
* @realm client and menu
|
|
2847
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetFGColorEx
|
|
2848
|
+
*/
|
|
2849
|
+
SetFGColorEx(self: Panel, r: number, g: number, b: number, a: number): void;
|
|
2850
|
+
}
|
|
2851
|
+
|
|
2852
|
+
interface Panel {
|
|
2853
|
+
/**
|
|
2854
|
+
* Sets the panel that owns this FocusNavGroup to be the root in the focus traversal hierarchy. This function will only work on EditablePanel class panels and its derivatives.
|
|
2855
|
+
*
|
|
2856
|
+
* **NOTE**: Child panels that should be part of the tab navigation need [Panel:SetTabPosition](https://wiki.facepunch.com/gmod/Panel:SetTabPosition) called on them.
|
|
2857
|
+
*
|
|
2858
|
+
* @realm client and menu
|
|
2859
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetFocusTopLevel
|
|
2860
|
+
*/
|
|
2861
|
+
SetFocusTopLevel(self: Panel, state: boolean): void;
|
|
2862
|
+
}
|
|
2863
|
+
|
|
2864
|
+
interface Panel {
|
|
2865
|
+
/**
|
|
2866
|
+
* Sets the font used to render this panel's text. This works for [Label](https://wiki.facepunch.com/gmod/Label), [TextEntry](https://wiki.facepunch.com/gmod/TextEntry) and [RichText](https://wiki.facepunch.com/gmod/RichText), but it's a better idea to use their local `SetFont` ([DTextEntry:SetFont](https://wiki.facepunch.com/gmod/DTextEntry:SetFont), [DLabel:SetFont](https://wiki.facepunch.com/gmod/DLabel:SetFont)) methods when available.
|
|
2867
|
+
*
|
|
2868
|
+
* To retrieve the font used by a panel, call [Panel:GetFont](https://wiki.facepunch.com/gmod/Panel:GetFont).
|
|
2869
|
+
*
|
|
2870
|
+
* @realm client and menu
|
|
2871
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetFontInternal
|
|
2872
|
+
*/
|
|
2873
|
+
SetFontInternal(self: Panel, fontName: string): void;
|
|
2874
|
+
}
|
|
2875
|
+
|
|
2876
|
+
interface Panel {
|
|
2877
|
+
/**
|
|
2878
|
+
* Allows you to set HTML code within a panel.
|
|
2879
|
+
* @realm client and menu
|
|
2880
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetHTML
|
|
2881
|
+
*/
|
|
2882
|
+
SetHTML(self: Panel, HTML: string): void;
|
|
2883
|
+
}
|
|
2884
|
+
|
|
2885
|
+
interface Panel {
|
|
2886
|
+
/**
|
|
2887
|
+
* Sets the height of the panel.
|
|
2888
|
+
*
|
|
2889
|
+
* Calls [PANEL:OnSizeChanged](https://wiki.facepunch.com/gmod/PANEL:OnSizeChanged) and marks this panel for layout ([Panel:InvalidateLayout](https://wiki.facepunch.com/gmod/Panel:InvalidateLayout)).
|
|
2890
|
+
* Automatically rounds the height down
|
|
2891
|
+
*
|
|
2892
|
+
* See also [Panel:SetSize](https://wiki.facepunch.com/gmod/Panel:SetSize).
|
|
2893
|
+
*
|
|
2894
|
+
* @realm client and menu
|
|
2895
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetHeight
|
|
2896
|
+
*/
|
|
2897
|
+
SetHeight(self: Panel, height: number): void;
|
|
2898
|
+
}
|
|
2899
|
+
|
|
2900
|
+
interface Panel {
|
|
2901
|
+
/**
|
|
2902
|
+
* Enables or disables the keyboard input for the panel.
|
|
2903
|
+
* @realm client and menu
|
|
2904
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetKeyBoardInputEnabled
|
|
2905
|
+
* @deprecated Alias of Panel:SetKeyboardInputEnabled(lowercase)
|
|
2906
|
+
*/
|
|
2907
|
+
SetKeyBoardInputEnabled(self: Panel, keyboardInput: boolean): void;
|
|
2908
|
+
}
|
|
2909
|
+
|
|
2910
|
+
interface Panel {
|
|
2911
|
+
/**
|
|
2912
|
+
* Allows or disallows the panel to receive keyboard focus and input. This is recursively applied to all children.
|
|
2913
|
+
* @realm client
|
|
2914
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetKeyboardInputEnabled(lowercase)
|
|
2915
|
+
*/
|
|
2916
|
+
SetKeyboardInputEnabled(self: Panel, enable: boolean): void;
|
|
2917
|
+
}
|
|
2918
|
+
|
|
2919
|
+
interface Panel {
|
|
2920
|
+
/**
|
|
2921
|
+
* Sets the height of a single line of a [RichText](https://wiki.facepunch.com/gmod/RichText) panel.
|
|
2922
|
+
*
|
|
2923
|
+
* @realm client and menu
|
|
2924
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetLineHeight
|
|
2925
|
+
*/
|
|
2926
|
+
SetLineHeight(self: Panel): number;
|
|
2927
|
+
}
|
|
2928
|
+
|
|
2929
|
+
interface Panel {
|
|
2930
|
+
/**
|
|
2931
|
+
* Sets the maximum character count this panel should have.
|
|
2932
|
+
*
|
|
2933
|
+
* This function will only work on [RichText](https://wiki.facepunch.com/gmod/RichText) and [TextEntry](https://wiki.facepunch.com/gmod/TextEntry) panels and their derivatives.
|
|
2934
|
+
*
|
|
2935
|
+
* @realm client and menu
|
|
2936
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetMaximumCharCount
|
|
2937
|
+
*/
|
|
2938
|
+
SetMaximumCharCount(self: Panel, maxChar: number): void;
|
|
2939
|
+
}
|
|
2940
|
+
|
|
2941
|
+
interface Panel {
|
|
2942
|
+
/**
|
|
2943
|
+
* Sets the minimum dimensions of the panel or object.
|
|
2944
|
+
*
|
|
2945
|
+
* You can restrict either or both values.
|
|
2946
|
+
*
|
|
2947
|
+
* Calling the function without arguments will remove the minimum size.
|
|
2948
|
+
*
|
|
2949
|
+
* @realm client and menu
|
|
2950
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetMinimumSize
|
|
2951
|
+
*/
|
|
2952
|
+
SetMinimumSize(self: Panel, minW?: number, minH?: number): void;
|
|
2953
|
+
}
|
|
2954
|
+
|
|
2955
|
+
interface Panel {
|
|
2956
|
+
/**
|
|
2957
|
+
* Sets the model to be displayed by [SpawnIcon](https://wiki.facepunch.com/gmod/SpawnIcon).
|
|
2958
|
+
*
|
|
2959
|
+
* **NOTE**: This must be called after setting size if you wish to use a different size spawnicon
|
|
2960
|
+
*
|
|
2961
|
+
*
|
|
2962
|
+
* @realm client
|
|
2963
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetModel
|
|
2964
|
+
*/
|
|
2965
|
+
SetModel(self: Panel, ModelPath: string, skin?: number, bodygroups?: string): void;
|
|
2966
|
+
}
|
|
2967
|
+
|
|
2968
|
+
interface Panel {
|
|
2969
|
+
/**
|
|
2970
|
+
* Enables or disables the mouse input for the panel.
|
|
2971
|
+
* **NOTE**: Panels parented to the context menu will not be clickable unless [Panel:SetKeyboardInputEnabled](https://wiki.facepunch.com/gmod/Panel:SetKeyboardInputEnabled(lowercase)) is enabled or [Panel:MakePopup](https://wiki.facepunch.com/gmod/Panel:MakePopup) has been called. If you want the panel to have mouse input but you do not want to prevent players from moving, set [Panel:SetKeyboardInputEnabled](https://wiki.facepunch.com/gmod/Panel:SetKeyboardInputEnabled(lowercase)) to false immediately after calling [Panel:MakePopup](https://wiki.facepunch.com/gmod/Panel:MakePopup).
|
|
2972
|
+
*
|
|
2973
|
+
*
|
|
2974
|
+
* @realm client and menu
|
|
2975
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetMouseInputEnabled
|
|
2976
|
+
*/
|
|
2977
|
+
SetMouseInputEnabled(self: Panel, mouseInput: boolean): void;
|
|
2978
|
+
}
|
|
2979
|
+
|
|
2980
|
+
interface Panel {
|
|
2981
|
+
/**
|
|
2982
|
+
* Enables or disables the multi-line functionality of [TextEntry](https://wiki.facepunch.com/gmod/TextEntry) panel and its derivatives.
|
|
2983
|
+
* @realm client and menu
|
|
2984
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetMultiline
|
|
2985
|
+
*/
|
|
2986
|
+
SetMultiline(self: Panel, multiline: boolean): void;
|
|
2987
|
+
}
|
|
2988
|
+
|
|
2989
|
+
interface Panel {
|
|
2990
|
+
/**
|
|
2991
|
+
* Sets the internal name of the panel. Can be retrieved with [Panel:GetName](https://wiki.facepunch.com/gmod/Panel:GetName).
|
|
2992
|
+
* @realm client and menu
|
|
2993
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetName
|
|
2994
|
+
*/
|
|
2995
|
+
SetName(self: Panel, name: string): void;
|
|
2996
|
+
}
|
|
2997
|
+
|
|
2998
|
+
interface Panel {
|
|
2999
|
+
/**
|
|
3000
|
+
* Set to true to open links in an external browser. This only functions on the `x86-64` beta.
|
|
3001
|
+
* @realm menu
|
|
3002
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetOpenLinksExternally
|
|
3003
|
+
*/
|
|
3004
|
+
SetOpenLinksExternally(self: Panel, openExternally: boolean): void;
|
|
3005
|
+
}
|
|
3006
|
+
|
|
3007
|
+
interface Panel {
|
|
3008
|
+
/**
|
|
3009
|
+
* Sets whether the default background of the panel should be drawn or not. It's color is usually set by [Panel:SetBGColor](https://wiki.facepunch.com/gmod/Panel:SetBGColor).
|
|
3010
|
+
* @realm client and menu
|
|
3011
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetPaintBackgroundEnabled
|
|
3012
|
+
*/
|
|
3013
|
+
SetPaintBackgroundEnabled(self: Panel, paintBackground: boolean): void;
|
|
3014
|
+
}
|
|
3015
|
+
|
|
3016
|
+
interface Panel {
|
|
3017
|
+
/**
|
|
3018
|
+
* Sets whether the default border of the panel should be drawn or not.
|
|
3019
|
+
* @realm client and menu
|
|
3020
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetPaintBorderEnabled
|
|
3021
|
+
*/
|
|
3022
|
+
SetPaintBorderEnabled(self: Panel, paintBorder: boolean): void;
|
|
3023
|
+
}
|
|
3024
|
+
|
|
3025
|
+
interface Panel {
|
|
3026
|
+
/**
|
|
3027
|
+
* Enables or disables painting of the panel manually with [Panel:PaintManual](https://wiki.facepunch.com/gmod/Panel:PaintManual).
|
|
3028
|
+
* @realm client and menu
|
|
3029
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetPaintedManually
|
|
3030
|
+
*/
|
|
3031
|
+
SetPaintedManually(self: Panel, paintedManually: boolean): void;
|
|
3032
|
+
}
|
|
3033
|
+
|
|
3034
|
+
interface Panel {
|
|
3035
|
+
/**
|
|
3036
|
+
* Sets the parent of the panel.
|
|
3037
|
+
* **NOTE**: Panels parented to the context menu will not be clickable unless [Panel:SetMouseInputEnabled](https://wiki.facepunch.com/gmod/Panel:SetMouseInputEnabled) and [Panel:SetKeyboardInputEnabled](https://wiki.facepunch.com/gmod/Panel:SetKeyboardInputEnabled(lowercase)) are both true or [Panel:MakePopup](https://wiki.facepunch.com/gmod/Panel:MakePopup) has been called. If you want the panel to have mouse input but you do not want to prevent players from moving, set [Panel:SetKeyboardInputEnabled](https://wiki.facepunch.com/gmod/Panel:SetKeyboardInputEnabled(lowercase)) to false immediately after calling [Panel:MakePopup](https://wiki.facepunch.com/gmod/Panel:MakePopup).
|
|
3038
|
+
*
|
|
3039
|
+
*
|
|
3040
|
+
* @realm client and menu
|
|
3041
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetParent
|
|
3042
|
+
*/
|
|
3043
|
+
SetParent(self: Panel, parent: Panel): void;
|
|
3044
|
+
}
|
|
3045
|
+
|
|
3046
|
+
interface Panel {
|
|
3047
|
+
/**
|
|
3048
|
+
* Used by [AvatarImage](https://wiki.facepunch.com/gmod/AvatarImage) to load an avatar for given player.
|
|
3049
|
+
* @realm client
|
|
3050
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetPlayer
|
|
3051
|
+
*/
|
|
3052
|
+
SetPlayer(self: Panel, player: Player, size?: number): void;
|
|
3053
|
+
}
|
|
3054
|
+
|
|
3055
|
+
interface Panel {
|
|
3056
|
+
/**
|
|
3057
|
+
* If this panel object has been made a popup with [Panel:MakePopup](https://wiki.facepunch.com/gmod/Panel:MakePopup), this method will prevent it from drawing in front of other panels when it receives input focus.
|
|
3058
|
+
* @realm client and menu
|
|
3059
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetPopupStayAtBack
|
|
3060
|
+
*/
|
|
3061
|
+
SetPopupStayAtBack(self: Panel, stayAtBack: boolean): void;
|
|
3062
|
+
}
|
|
3063
|
+
|
|
3064
|
+
interface Panel {
|
|
3065
|
+
/**
|
|
3066
|
+
* Sets the position of the panel's top left corner.
|
|
3067
|
+
*
|
|
3068
|
+
* This will trigger [PANEL:PerformLayout](https://wiki.facepunch.com/gmod/PANEL:PerformLayout). You should avoid calling this function in [PANEL:PerformLayout](https://wiki.facepunch.com/gmod/PANEL:PerformLayout) to avoid infinite loops.
|
|
3069
|
+
*
|
|
3070
|
+
* See also [Panel:SetX](https://wiki.facepunch.com/gmod/Panel:SetX) and [Panel:SetY](https://wiki.facepunch.com/gmod/Panel:SetY).
|
|
3071
|
+
*
|
|
3072
|
+
* **NOTE**: If you wish to position and re-size panels without much guesswork and have them look good on different screen resolutions, you may find [Panel:Dock](https://wiki.facepunch.com/gmod/Panel:Dock) useful
|
|
3073
|
+
*
|
|
3074
|
+
*
|
|
3075
|
+
* @realm client and menu
|
|
3076
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetPos
|
|
3077
|
+
*/
|
|
3078
|
+
SetPos(self: Panel, posX: number, posY: number): void;
|
|
3079
|
+
}
|
|
3080
|
+
|
|
3081
|
+
interface Panel {
|
|
3082
|
+
/**
|
|
3083
|
+
* Sets whenever the panel should be rendered in a screenshot. (`jpeg` or `screenshot` commands, Camera SWEP)
|
|
3084
|
+
* @realm client and menu
|
|
3085
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetRenderInScreenshots
|
|
3086
|
+
*/
|
|
3087
|
+
SetRenderInScreenshots(self: Panel, renderInScreenshot: boolean): void;
|
|
3088
|
+
}
|
|
3089
|
+
|
|
3090
|
+
interface Panel {
|
|
3091
|
+
/**
|
|
3092
|
+
* Sets whether the panel object can be selected or not (like icons in the Spawn Menu, holding Shift). If enabled, this will affect the function of a [DButton](https://wiki.facepunch.com/gmod/DButton) whilst Shift is pressed. [Panel:SetSelected](https://wiki.facepunch.com/gmod/Panel:SetSelected) can be used to select/deselect the object.
|
|
3093
|
+
* @realm client and menu
|
|
3094
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetSelectable
|
|
3095
|
+
*/
|
|
3096
|
+
SetSelectable(self: Panel, selectable: boolean): void;
|
|
3097
|
+
}
|
|
3098
|
+
|
|
3099
|
+
interface Panel {
|
|
3100
|
+
/**
|
|
3101
|
+
* Sets the selected state of a selectable panel object. This functionality is set with [Panel:SetSelectable](https://wiki.facepunch.com/gmod/Panel:SetSelectable) and checked with [Panel:IsSelectable](https://wiki.facepunch.com/gmod/Panel:IsSelectable).
|
|
3102
|
+
* @realm client and menu
|
|
3103
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetSelected
|
|
3104
|
+
*/
|
|
3105
|
+
SetSelected(self: Panel, selected?: boolean): void;
|
|
3106
|
+
}
|
|
3107
|
+
|
|
3108
|
+
interface Panel {
|
|
3109
|
+
/**
|
|
3110
|
+
* Enables the panel object for selection (much like the spawn menu).
|
|
3111
|
+
* @realm client and menu
|
|
3112
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetSelectionCanvas
|
|
3113
|
+
*/
|
|
3114
|
+
SetSelectionCanvas(self: Panel, set: boolean): void;
|
|
3115
|
+
}
|
|
3116
|
+
|
|
3117
|
+
interface Panel {
|
|
3118
|
+
/**
|
|
3119
|
+
* Sets the size of the panel.
|
|
3120
|
+
*
|
|
3121
|
+
* Calls [PANEL:OnSizeChanged](https://wiki.facepunch.com/gmod/PANEL:OnSizeChanged) and marks this panel for layout ([Panel:InvalidateLayout](https://wiki.facepunch.com/gmod/Panel:InvalidateLayout)).
|
|
3122
|
+
* Automatically rounds the width and height down
|
|
3123
|
+
*
|
|
3124
|
+
*
|
|
3125
|
+
* See also [Panel:SetWidth](https://wiki.facepunch.com/gmod/Panel:SetWidth) and [Panel:SetHeight](https://wiki.facepunch.com/gmod/Panel:SetHeight).
|
|
3126
|
+
*
|
|
3127
|
+
* **NOTE**: If you wish to position and re-size panels without much guesswork and have them look good on different screen resolutions, you may find [Panel:Dock](https://wiki.facepunch.com/gmod/Panel:Dock) useful
|
|
3128
|
+
*
|
|
3129
|
+
*
|
|
3130
|
+
* @realm client and menu
|
|
3131
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetSize
|
|
3132
|
+
*/
|
|
3133
|
+
SetSize(self: Panel, width: number, height: number): void;
|
|
3134
|
+
}
|
|
3135
|
+
|
|
3136
|
+
interface Panel {
|
|
3137
|
+
/**
|
|
3138
|
+
* Sets the derma skin that the panel object will use, and refreshes all panels with [derma.RefreshSkins](https://wiki.facepunch.com/gmod/derma.RefreshSkins).
|
|
3139
|
+
* @realm client and menu
|
|
3140
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetSkin
|
|
3141
|
+
*/
|
|
3142
|
+
SetSkin(self: Panel, skinName: string): void;
|
|
3143
|
+
}
|
|
3144
|
+
|
|
3145
|
+
interface Panel {
|
|
3146
|
+
/**
|
|
3147
|
+
* Sets the `.png` image to be displayed on a [SpawnIcon](https://wiki.facepunch.com/gmod/SpawnIcon) or the panel it is based on - [ModelImage](https://wiki.facepunch.com/gmod/ModelImage).
|
|
3148
|
+
*
|
|
3149
|
+
* Only `.png` images can be used with this function.
|
|
3150
|
+
*
|
|
3151
|
+
* @realm client
|
|
3152
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetSpawnIcon
|
|
3153
|
+
*/
|
|
3154
|
+
SetSpawnIcon(self: Panel, icon: string): void;
|
|
3155
|
+
}
|
|
3156
|
+
|
|
3157
|
+
interface Panel {
|
|
3158
|
+
/**
|
|
3159
|
+
* Used by [AvatarImage](https://wiki.facepunch.com/gmod/AvatarImage) panels to load an avatar by its 64-bit Steam ID (community ID).
|
|
3160
|
+
* @realm client
|
|
3161
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetSteamID
|
|
3162
|
+
*/
|
|
3163
|
+
SetSteamID(self: Panel, steamid: string, size: number): void;
|
|
3164
|
+
}
|
|
3165
|
+
|
|
3166
|
+
interface Panel {
|
|
3167
|
+
/**
|
|
3168
|
+
* When TAB is pressed, the next selectable panel in the number sequence is selected.
|
|
3169
|
+
*
|
|
3170
|
+
* **NOTE**: This function requires [Panel:SetFocusTopLevel](https://wiki.facepunch.com/gmod/Panel:SetFocusTopLevel) to be called on the parent panel for tab navigation to work.
|
|
3171
|
+
*
|
|
3172
|
+
*
|
|
3173
|
+
* @realm client and menu
|
|
3174
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetTabPosition
|
|
3175
|
+
*/
|
|
3176
|
+
SetTabPosition(self: Panel, position: number): void;
|
|
3177
|
+
}
|
|
3178
|
+
|
|
3179
|
+
interface Panel {
|
|
3180
|
+
/**
|
|
3181
|
+
* Sets height of a panel. An alias of [Panel:SetHeight](https://wiki.facepunch.com/gmod/Panel:SetHeight).
|
|
3182
|
+
* @realm client and menu
|
|
3183
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetTall
|
|
3184
|
+
*/
|
|
3185
|
+
SetTall(self: Panel, height: number): void;
|
|
3186
|
+
}
|
|
3187
|
+
|
|
3188
|
+
interface Panel {
|
|
3189
|
+
/**
|
|
3190
|
+
* Removes the panel after given time in seconds.
|
|
3191
|
+
* **NOTE**: This function will not work if [PANEL:AnimationThink](https://wiki.facepunch.com/gmod/PANEL:AnimationThink) is overridden, unless [Panel:AnimationThinkInternal](https://wiki.facepunch.com/gmod/Panel:AnimationThinkInternal) is called every frame.
|
|
3192
|
+
*
|
|
3193
|
+
*
|
|
3194
|
+
* @realm client and menu
|
|
3195
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetTerm
|
|
3196
|
+
*/
|
|
3197
|
+
SetTerm(self: Panel, delay: number): void;
|
|
3198
|
+
}
|
|
3199
|
+
|
|
3200
|
+
interface Panel {
|
|
3201
|
+
/**
|
|
3202
|
+
* Sets the text value of a panel object containing text, such as a [Label](https://wiki.facepunch.com/gmod/Label), [TextEntry](https://wiki.facepunch.com/gmod/TextEntry) or [RichText](https://wiki.facepunch.com/gmod/RichText) and their derivatives, such as [DLabel](https://wiki.facepunch.com/gmod/DLabel), [DTextEntry](https://wiki.facepunch.com/gmod/DTextEntry) or [DButton](https://wiki.facepunch.com/gmod/DButton).
|
|
3203
|
+
*
|
|
3204
|
+
* **WARNING**: When used on a [Label](https://wiki.facepunch.com/gmod/Label) or its derivatives ( [DLabel](https://wiki.facepunch.com/gmod/DLabel) and [DButton](https://wiki.facepunch.com/gmod/DButton) ), it will automatically call [Panel:InvalidateLayout](https://wiki.facepunch.com/gmod/Panel:InvalidateLayout), meaning that you should avoid running this function every frame on these panels to avoid unnecessary performance loss.
|
|
3205
|
+
*
|
|
3206
|
+
*
|
|
3207
|
+
* **WARNING**: [Label](https://wiki.facepunch.com/gmod/Label) & its derivatives has hard length limit, maximum 1023 ascii characters.
|
|
3208
|
+
*
|
|
3209
|
+
*
|
|
3210
|
+
*
|
|
3211
|
+
*
|
|
3212
|
+
* @realm client and menu
|
|
3213
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetText
|
|
3214
|
+
*/
|
|
3215
|
+
SetText(self: Panel, text: string): void;
|
|
3216
|
+
}
|
|
3217
|
+
|
|
3218
|
+
interface Panel {
|
|
3219
|
+
/**
|
|
3220
|
+
* Makes [TextEntry](https://wiki.facepunch.com/gmod/TextEntry)'s text be replaced by `*` characters, just like a password-entry text field would.
|
|
3221
|
+
*
|
|
3222
|
+
* @realm client and menu
|
|
3223
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetTextHidden
|
|
3224
|
+
*/
|
|
3225
|
+
SetTextHidden(self: Panel, arg0: boolean): void;
|
|
3226
|
+
}
|
|
3227
|
+
|
|
3228
|
+
interface Panel {
|
|
3229
|
+
/**
|
|
3230
|
+
* Sets the left and top text margins of a text-based panel object, such as a [DButton](https://wiki.facepunch.com/gmod/DButton) or [DLabel](https://wiki.facepunch.com/gmod/DLabel).
|
|
3231
|
+
* @realm client and menu
|
|
3232
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetTextInset
|
|
3233
|
+
*/
|
|
3234
|
+
SetTextInset(self: Panel, insetX: number, insetY: number): void;
|
|
3235
|
+
}
|
|
3236
|
+
|
|
3237
|
+
interface Panel {
|
|
3238
|
+
/**
|
|
3239
|
+
* Sets text selection colors of a [RichText](https://wiki.facepunch.com/gmod/RichText) element.
|
|
3240
|
+
* @realm client and menu
|
|
3241
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetTextSelectionColors
|
|
3242
|
+
*/
|
|
3243
|
+
SetTextSelectionColors(self: Panel, textColor: Color, backgroundColor: Color): void;
|
|
3244
|
+
}
|
|
3245
|
+
|
|
3246
|
+
interface Panel {
|
|
3247
|
+
/**
|
|
3248
|
+
* Sets the height of a [RichText](https://wiki.facepunch.com/gmod/RichText) element to accommodate the text inside.
|
|
3249
|
+
*
|
|
3250
|
+
* **NOTE**: This function internally relies on [Panel:GetNumLines](https://wiki.facepunch.com/gmod/Panel:GetNumLines), so it should be called at least a couple frames after modifying the text using [Panel:AppendText](https://wiki.facepunch.com/gmod/Panel:AppendText)
|
|
3251
|
+
*
|
|
3252
|
+
*
|
|
3253
|
+
* @realm client and menu
|
|
3254
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetToFullHeight
|
|
3255
|
+
*/
|
|
3256
|
+
SetToFullHeight(self: Panel): void;
|
|
3257
|
+
}
|
|
3258
|
+
|
|
3259
|
+
interface Panel {
|
|
3260
|
+
/**
|
|
3261
|
+
* Sets the tooltip to be displayed when a player hovers over the panel object with their cursor.
|
|
3262
|
+
*
|
|
3263
|
+
* By default, [DTooltip](https://wiki.facepunch.com/gmod/DTooltip) will be used. [Panel:SetTooltipPanelOverride](https://wiki.facepunch.com/gmod/Panel:SetTooltipPanelOverride) can be used to override the tooltip panel.
|
|
3264
|
+
*
|
|
3265
|
+
* @realm client and menu
|
|
3266
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetTooltip
|
|
3267
|
+
*/
|
|
3268
|
+
SetTooltip(self: Panel, str?: string): void;
|
|
3269
|
+
}
|
|
3270
|
+
|
|
3271
|
+
interface Panel {
|
|
3272
|
+
/**
|
|
3273
|
+
* Sets the tooltip delay. (time between hovering over the panel, and the tooltip showing up)
|
|
3274
|
+
*
|
|
3275
|
+
* Can be retrieved with [Panel:GetTooltipDelay](https://wiki.facepunch.com/gmod/Panel:GetTooltipDelay).
|
|
3276
|
+
*
|
|
3277
|
+
* @realm client and menu
|
|
3278
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetTooltipDelay
|
|
3279
|
+
*/
|
|
3280
|
+
SetTooltipDelay(self: Panel, tooltip: number): void;
|
|
3281
|
+
}
|
|
3282
|
+
|
|
3283
|
+
interface Panel {
|
|
3284
|
+
/**
|
|
3285
|
+
* Sets the panel to be displayed as contents of a [DTooltip](https://wiki.facepunch.com/gmod/DTooltip) when a player hovers over the panel object with their cursor. See [Panel:SetTooltipPanelOverride](https://wiki.facepunch.com/gmod/Panel:SetTooltipPanelOverride) if you are looking to override [DTooltip](https://wiki.facepunch.com/gmod/DTooltip) itself.
|
|
3286
|
+
*
|
|
3287
|
+
* **NOTE**: [Panel:SetTooltip](https://wiki.facepunch.com/gmod/Panel:SetTooltip) will override this functionality.
|
|
3288
|
+
*
|
|
3289
|
+
*
|
|
3290
|
+
* **WARNING**: Calling this from [PANEL:OnCursorEntered](https://wiki.facepunch.com/gmod/PANEL:OnCursorEntered) is too late! The tooltip will not be displayed or be updated.
|
|
3291
|
+
*
|
|
3292
|
+
* Given panel or the previously set one will **NOT** be automatically removed.
|
|
3293
|
+
*
|
|
3294
|
+
*
|
|
3295
|
+
* @realm client and menu
|
|
3296
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetTooltipPanel
|
|
3297
|
+
*/
|
|
3298
|
+
SetTooltipPanel(self: Panel, tooltipPanel?: Panel): void;
|
|
3299
|
+
}
|
|
3300
|
+
|
|
3301
|
+
interface Panel {
|
|
3302
|
+
/**
|
|
3303
|
+
* Sets the panel class to be created instead of [DTooltip](https://wiki.facepunch.com/gmod/DTooltip) when the player hovers over this panel and a tooltip needs creating.
|
|
3304
|
+
*
|
|
3305
|
+
* @realm client and menu
|
|
3306
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetTooltipPanelOverride
|
|
3307
|
+
*/
|
|
3308
|
+
SetTooltipPanelOverride(self: Panel, override: string): void;
|
|
3309
|
+
}
|
|
3310
|
+
|
|
3311
|
+
interface Panel {
|
|
3312
|
+
/**
|
|
3313
|
+
* Sets the URL of a link-based panel such as [DLabelURL](https://wiki.facepunch.com/gmod/DLabelURL).
|
|
3314
|
+
* @realm client and menu
|
|
3315
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetURL
|
|
3316
|
+
*/
|
|
3317
|
+
SetURL(self: Panel, url: string): void;
|
|
3318
|
+
}
|
|
3319
|
+
|
|
3320
|
+
interface Panel {
|
|
3321
|
+
/**
|
|
3322
|
+
* Sets the underlined font for use by clickable text in a [RichText](https://wiki.facepunch.com/gmod/RichText). See also [Panel:InsertClickableTextStart](https://wiki.facepunch.com/gmod/Panel:InsertClickableTextStart)
|
|
3323
|
+
*
|
|
3324
|
+
* This function will only work on [RichText](https://wiki.facepunch.com/gmod/RichText) panels.
|
|
3325
|
+
*
|
|
3326
|
+
* @realm client and menu
|
|
3327
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetUnderlineFont
|
|
3328
|
+
*/
|
|
3329
|
+
SetUnderlineFont(self: Panel, fontName: string): void;
|
|
3330
|
+
}
|
|
3331
|
+
|
|
3332
|
+
interface Panel {
|
|
3333
|
+
/**
|
|
3334
|
+
* Sets the visibility of the vertical scrollbar.
|
|
3335
|
+
*
|
|
3336
|
+
* Works for [RichText](https://wiki.facepunch.com/gmod/RichText) and [TextEntry](https://wiki.facepunch.com/gmod/TextEntry).
|
|
3337
|
+
*
|
|
3338
|
+
* @realm client and menu
|
|
3339
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetVerticalScrollbarEnabled
|
|
3340
|
+
*/
|
|
3341
|
+
SetVerticalScrollbarEnabled(self: Panel, display?: boolean): void;
|
|
3342
|
+
}
|
|
3343
|
+
|
|
3344
|
+
interface Panel {
|
|
3345
|
+
/**
|
|
3346
|
+
* Sets the "visibility" of the panel.
|
|
3347
|
+
* @realm client and menu
|
|
3348
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetVisible
|
|
3349
|
+
*/
|
|
3350
|
+
SetVisible(self: Panel, visible: boolean): void;
|
|
3351
|
+
}
|
|
3352
|
+
|
|
3353
|
+
interface Panel {
|
|
3354
|
+
/**
|
|
3355
|
+
* Sets width of a panel. An alias of [Panel:SetWidth](https://wiki.facepunch.com/gmod/Panel:SetWidth).
|
|
3356
|
+
* @realm client and menu
|
|
3357
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetWide
|
|
3358
|
+
*/
|
|
3359
|
+
SetWide(self: Panel, width: number): void;
|
|
3360
|
+
}
|
|
3361
|
+
|
|
3362
|
+
interface Panel {
|
|
3363
|
+
/**
|
|
3364
|
+
* Sets the width of the panel.
|
|
3365
|
+
*
|
|
3366
|
+
* Calls [PANEL:OnSizeChanged](https://wiki.facepunch.com/gmod/PANEL:OnSizeChanged) and marks this panel for layout ([Panel:InvalidateLayout](https://wiki.facepunch.com/gmod/Panel:InvalidateLayout)).
|
|
3367
|
+
* Automatically rounds the width down
|
|
3368
|
+
*
|
|
3369
|
+
* See also [Panel:SetSize](https://wiki.facepunch.com/gmod/Panel:SetSize).
|
|
3370
|
+
*
|
|
3371
|
+
* @realm client and menu
|
|
3372
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetWidth
|
|
3373
|
+
*/
|
|
3374
|
+
SetWidth(self: Panel, width: number): void;
|
|
3375
|
+
}
|
|
3376
|
+
|
|
3377
|
+
interface Panel {
|
|
3378
|
+
/**
|
|
3379
|
+
* This makes it so that when you're hovering over this panel you can "click" on the world. Your weapon aim (and its viewmodel) will follow the cursor. This is primarily used for the Sandbox context menu.
|
|
3380
|
+
*
|
|
3381
|
+
* @realm client and menu
|
|
3382
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetWorldClicker
|
|
3383
|
+
*/
|
|
3384
|
+
SetWorldClicker(self: Panel, enable: boolean): void;
|
|
3385
|
+
}
|
|
3386
|
+
|
|
3387
|
+
interface Panel {
|
|
3388
|
+
/**
|
|
3389
|
+
* Sets whether text wrapping should be enabled or disabled on [Label](https://wiki.facepunch.com/gmod/Label) and [DLabel](https://wiki.facepunch.com/gmod/DLabel) panels.
|
|
3390
|
+
*
|
|
3391
|
+
* Use [DLabel:SetAutoStretchVertical](https://wiki.facepunch.com/gmod/DLabel:SetAutoStretchVertical) to automatically correct vertical size; [Panel:SizeToContents](https://wiki.facepunch.com/gmod/Panel:SizeToContents) will not set the correct height.
|
|
3392
|
+
*
|
|
3393
|
+
* @realm client and menu
|
|
3394
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetWrap
|
|
3395
|
+
*/
|
|
3396
|
+
SetWrap(self: Panel, wrap: boolean): void;
|
|
3397
|
+
}
|
|
3398
|
+
|
|
3399
|
+
interface Panel {
|
|
3400
|
+
/**
|
|
3401
|
+
* Sets the X position of the panel.
|
|
3402
|
+
*
|
|
3403
|
+
* Uses [Panel:SetPos](https://wiki.facepunch.com/gmod/Panel:SetPos) internally.
|
|
3404
|
+
*
|
|
3405
|
+
* @realm client and menu
|
|
3406
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetX
|
|
3407
|
+
*/
|
|
3408
|
+
SetX(self: Panel, x: number): void;
|
|
3409
|
+
}
|
|
3410
|
+
|
|
3411
|
+
interface Panel {
|
|
3412
|
+
/**
|
|
3413
|
+
* Sets the Y position of the panel.
|
|
3414
|
+
*
|
|
3415
|
+
* Uses [Panel:SetPos](https://wiki.facepunch.com/gmod/Panel:SetPos) internally.
|
|
3416
|
+
*
|
|
3417
|
+
* @realm client and menu
|
|
3418
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetY
|
|
3419
|
+
*/
|
|
3420
|
+
SetY(self: Panel, y: number): void;
|
|
3421
|
+
}
|
|
3422
|
+
|
|
3423
|
+
interface Panel {
|
|
3424
|
+
/**
|
|
3425
|
+
* Sets the panels z position which determines the rendering order.
|
|
3426
|
+
*
|
|
3427
|
+
* Panels with lower z positions appear behind panels with higher z positions.
|
|
3428
|
+
*
|
|
3429
|
+
* This also controls in which order panels docked with [Panel:Dock](https://wiki.facepunch.com/gmod/Panel:Dock) appears.
|
|
3430
|
+
*
|
|
3431
|
+
* @realm client and menu
|
|
3432
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SetZPos
|
|
3433
|
+
*/
|
|
3434
|
+
SetZPos(self: Panel, zIndex: number): void;
|
|
3435
|
+
}
|
|
3436
|
+
|
|
3437
|
+
interface Panel {
|
|
3438
|
+
/**
|
|
3439
|
+
* Makes a panel visible.
|
|
3440
|
+
* @realm client and menu
|
|
3441
|
+
* @source https://wiki.facepunch.com/gmod/Panel:Show
|
|
3442
|
+
*/
|
|
3443
|
+
Show(self: Panel): void;
|
|
3444
|
+
}
|
|
3445
|
+
|
|
3446
|
+
interface Panel {
|
|
3447
|
+
/**
|
|
3448
|
+
* Uses animation to resize the panel to the specified size.
|
|
3449
|
+
* @realm client and menu
|
|
3450
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SizeTo
|
|
3451
|
+
*/
|
|
3452
|
+
SizeTo(self: Panel, sizeW?: number, sizeH?: number, time?: number, delay?: number, ease?: number, callback?: (animData: table, targetPanel: Panel) => void): void;
|
|
3453
|
+
}
|
|
3454
|
+
|
|
3455
|
+
interface Panel {
|
|
3456
|
+
/**
|
|
3457
|
+
* Resizes the panel to fit the bounds of its children.
|
|
3458
|
+
*
|
|
3459
|
+
* **NOTE**: Your panel must have its layout updated ([Panel:InvalidateLayout](https://wiki.facepunch.com/gmod/Panel:InvalidateLayout)) for this function to work properly.
|
|
3460
|
+
*
|
|
3461
|
+
* **NOTE**: The sizeW and sizeH parameters are false by default. Therefore, calling this function with no arguments will result in a no-op.
|
|
3462
|
+
*
|
|
3463
|
+
*
|
|
3464
|
+
* @realm client and menu
|
|
3465
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SizeToChildren
|
|
3466
|
+
*/
|
|
3467
|
+
SizeToChildren(self: Panel, sizeW?: boolean, sizeH?: boolean): void;
|
|
3468
|
+
}
|
|
3469
|
+
|
|
3470
|
+
interface Panel {
|
|
3471
|
+
/**
|
|
3472
|
+
* Resizes the panel so that its width and height fit all of the content inside.
|
|
3473
|
+
*
|
|
3474
|
+
* **NOTE**: Only works on [Label](https://wiki.facepunch.com/gmod/Label) derived panels such as [DLabel](https://wiki.facepunch.com/gmod/DLabel) by default, and on any panel that manually implemented the [Panel:SizeToContents](https://wiki.facepunch.com/gmod/Panel:SizeToContents) method, such as [DNumberWang](https://wiki.facepunch.com/gmod/DNumberWang) and [DImage](https://wiki.facepunch.com/gmod/DImage).
|
|
3475
|
+
*
|
|
3476
|
+
*
|
|
3477
|
+
* **WARNING**: You must call this function **AFTER** setting text/font, adjusting child panels or otherwise altering the panel.
|
|
3478
|
+
*
|
|
3479
|
+
*
|
|
3480
|
+
* @realm client and menu
|
|
3481
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SizeToContents
|
|
3482
|
+
*/
|
|
3483
|
+
SizeToContents(self: Panel): void;
|
|
3484
|
+
}
|
|
3485
|
+
|
|
3486
|
+
interface Panel {
|
|
3487
|
+
/**
|
|
3488
|
+
* Resizes the panel object's width to accommodate all child objects/contents.
|
|
3489
|
+
*
|
|
3490
|
+
* Only works on [Label](https://wiki.facepunch.com/gmod/Label) derived panels such as [DLabel](https://wiki.facepunch.com/gmod/DLabel) by default, and on any panel that manually implemented [Panel:GetContentSize](https://wiki.facepunch.com/gmod/Panel:GetContentSize) method.
|
|
3491
|
+
*
|
|
3492
|
+
* **NOTE**: You must call this function **AFTER** setting text/font or adjusting child panels.
|
|
3493
|
+
*
|
|
3494
|
+
*
|
|
3495
|
+
* @realm client and menu
|
|
3496
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SizeToContentsX
|
|
3497
|
+
*/
|
|
3498
|
+
SizeToContentsX(self: Panel, addVal?: number): void;
|
|
3499
|
+
}
|
|
3500
|
+
|
|
3501
|
+
interface Panel {
|
|
3502
|
+
/**
|
|
3503
|
+
* Resizes the panel object's height to accommodate all child objects/contents.
|
|
3504
|
+
*
|
|
3505
|
+
* Only works on [Label](https://wiki.facepunch.com/gmod/Label) derived panels such as [DLabel](https://wiki.facepunch.com/gmod/DLabel) by default, and on any panel that manually implemented [Panel:GetContentSize](https://wiki.facepunch.com/gmod/Panel:GetContentSize) method.
|
|
3506
|
+
*
|
|
3507
|
+
* **NOTE**: You must call this function **AFTER** setting text/font or adjusting child panels.
|
|
3508
|
+
*
|
|
3509
|
+
*
|
|
3510
|
+
* @realm client and menu
|
|
3511
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SizeToContentsY
|
|
3512
|
+
*/
|
|
3513
|
+
SizeToContentsY(self: Panel, addVal?: number): void;
|
|
3514
|
+
}
|
|
3515
|
+
|
|
3516
|
+
interface Panel {
|
|
3517
|
+
/**
|
|
3518
|
+
* Slides the panel in from above.
|
|
3519
|
+
* @realm client and menu
|
|
3520
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SlideDown
|
|
3521
|
+
*/
|
|
3522
|
+
SlideDown(self: Panel, Length: number): void;
|
|
3523
|
+
}
|
|
3524
|
+
|
|
3525
|
+
interface Panel {
|
|
3526
|
+
/**
|
|
3527
|
+
* Slides the panel out to the top.
|
|
3528
|
+
* @realm client and menu
|
|
3529
|
+
* @source https://wiki.facepunch.com/gmod/Panel:SlideUp
|
|
3530
|
+
*/
|
|
3531
|
+
SlideUp(self: Panel, Length: number): void;
|
|
3532
|
+
}
|
|
3533
|
+
|
|
3534
|
+
interface Panel {
|
|
3535
|
+
/**
|
|
3536
|
+
* Begins a box selection, enables mouse capture for the panel object, and sets the start point of the selection box to the mouse cursor's position, relative to this object. For this to work, either the object or its parent must be enabled as a selection canvas. This is set using [Panel:SetSelectionCanvas](https://wiki.facepunch.com/gmod/Panel:SetSelectionCanvas).
|
|
3537
|
+
* @realm client and menu
|
|
3538
|
+
* @source https://wiki.facepunch.com/gmod/Panel:StartBoxSelection
|
|
3539
|
+
*/
|
|
3540
|
+
StartBoxSelection(self: Panel): void;
|
|
3541
|
+
}
|
|
3542
|
+
|
|
3543
|
+
interface Panel {
|
|
3544
|
+
/**
|
|
3545
|
+
* Stops all panel animations by clearing its animation list. This also clears all delayed animations.
|
|
3546
|
+
* @realm client and menu
|
|
3547
|
+
* @source https://wiki.facepunch.com/gmod/Panel:Stop
|
|
3548
|
+
*/
|
|
3549
|
+
Stop(self: Panel): void;
|
|
3550
|
+
}
|
|
3551
|
+
|
|
3552
|
+
interface Panel {
|
|
3553
|
+
/**
|
|
3554
|
+
* Stops the loading of the [HTML](https://wiki.facepunch.com/gmod/HTML) panel's current page.
|
|
3555
|
+
* @realm client and menu
|
|
3556
|
+
* @source https://wiki.facepunch.com/gmod/Panel:StopLoading
|
|
3557
|
+
*/
|
|
3558
|
+
StopLoading(self: Panel): void;
|
|
3559
|
+
}
|
|
3560
|
+
|
|
3561
|
+
interface Panel {
|
|
3562
|
+
/**
|
|
3563
|
+
* Resizes the panel object's height so that its bottom is aligned with the top of the passed panel. An offset greater than zero will reduce the panel's height to leave a gap between it and the passed panel.
|
|
3564
|
+
* @realm client and menu
|
|
3565
|
+
* @source https://wiki.facepunch.com/gmod/Panel:StretchBottomTo
|
|
3566
|
+
*/
|
|
3567
|
+
StretchBottomTo(self: Panel, tgtPanel: Panel, offset?: number): void;
|
|
3568
|
+
}
|
|
3569
|
+
|
|
3570
|
+
interface Panel {
|
|
3571
|
+
/**
|
|
3572
|
+
* Resizes the panel object's width so that its right edge is aligned with the left of the passed panel. An offset greater than zero will reduce the panel's width to leave a gap between it and the passed panel.
|
|
3573
|
+
* @realm client and menu
|
|
3574
|
+
* @source https://wiki.facepunch.com/gmod/Panel:StretchRightTo
|
|
3575
|
+
*/
|
|
3576
|
+
StretchRightTo(self: Panel, tgtPanel: Panel, offset?: number): void;
|
|
3577
|
+
}
|
|
3578
|
+
|
|
3579
|
+
interface Panel {
|
|
3580
|
+
/**
|
|
3581
|
+
* Sets the dimensions of the panel to fill its parent. It will only stretch in directions that aren't nil.
|
|
3582
|
+
* @realm client and menu
|
|
3583
|
+
* @source https://wiki.facepunch.com/gmod/Panel:StretchToParent
|
|
3584
|
+
*/
|
|
3585
|
+
StretchToParent(self: Panel, offsetLeft?: number, offsetTop?: number, offsetRight?: number, offsetBottom?: number): void;
|
|
3586
|
+
}
|
|
3587
|
+
|
|
3588
|
+
interface Panel {
|
|
3589
|
+
/**
|
|
3590
|
+
* Toggles the selected state of a selectable panel object. This functionality is set with [Panel:SetSelectable](https://wiki.facepunch.com/gmod/Panel:SetSelectable) and checked with [Panel:IsSelectable](https://wiki.facepunch.com/gmod/Panel:IsSelectable). To check whether the object is selected or not, [Panel:IsSelected](https://wiki.facepunch.com/gmod/Panel:IsSelected) is used.
|
|
3591
|
+
* @realm client and menu
|
|
3592
|
+
* @source https://wiki.facepunch.com/gmod/Panel:ToggleSelection
|
|
3593
|
+
*/
|
|
3594
|
+
ToggleSelection(self: Panel): void;
|
|
3595
|
+
}
|
|
3596
|
+
|
|
3597
|
+
interface Panel {
|
|
3598
|
+
/**
|
|
3599
|
+
* Toggles the visibility of a panel and all its children.
|
|
3600
|
+
* @realm client and menu
|
|
3601
|
+
* @source https://wiki.facepunch.com/gmod/Panel:ToggleVisible
|
|
3602
|
+
*/
|
|
3603
|
+
ToggleVisible(self: Panel): void;
|
|
3604
|
+
}
|
|
3605
|
+
|
|
3606
|
+
interface Panel {
|
|
3607
|
+
/**
|
|
3608
|
+
* Restores the last saved state (caret position and the text inside) of a [TextEntry](https://wiki.facepunch.com/gmod/TextEntry). Should act identically to pressing CTRL+Z in a [TextEntry](https://wiki.facepunch.com/gmod/TextEntry).
|
|
3609
|
+
*
|
|
3610
|
+
* See also [Panel:SaveUndoState](https://wiki.facepunch.com/gmod/Panel:SaveUndoState).
|
|
3611
|
+
*
|
|
3612
|
+
* @realm client and menu
|
|
3613
|
+
* @source https://wiki.facepunch.com/gmod/Panel:Undo
|
|
3614
|
+
*/
|
|
3615
|
+
Undo(self: Panel): void;
|
|
3616
|
+
}
|
|
3617
|
+
|
|
3618
|
+
interface Panel {
|
|
3619
|
+
/**
|
|
3620
|
+
* Recursively deselects this panel object and all of its children. This will cascade to all child objects at every level below the parent.
|
|
3621
|
+
* @realm client and menu
|
|
3622
|
+
* @source https://wiki.facepunch.com/gmod/Panel:UnselectAll
|
|
3623
|
+
*/
|
|
3624
|
+
UnselectAll(self: Panel): void;
|
|
3625
|
+
}
|
|
3626
|
+
|
|
3627
|
+
interface Panel {
|
|
3628
|
+
/**
|
|
3629
|
+
* Forcibly updates the panels' HTML Material, similar to when Paint is called on it.This is only useful if the panel is not normally visible, i.e the panel exists purely for its HTML Material.
|
|
3630
|
+
* **NOTE**: Only works on with panels that have a HTML Material. See [Panel:GetHTMLMaterial](https://wiki.facepunch.com/gmod/Panel:GetHTMLMaterial) for more details.
|
|
3631
|
+
*
|
|
3632
|
+
* **NOTE**: A good place to call this is in the [GM:PreRender](https://wiki.facepunch.com/gmod/GM:PreRender) hook
|
|
3633
|
+
*
|
|
3634
|
+
*
|
|
3635
|
+
* @realm client and menu
|
|
3636
|
+
* @source https://wiki.facepunch.com/gmod/Panel:UpdateHTMLTexture
|
|
3637
|
+
*/
|
|
3638
|
+
UpdateHTMLTexture(self: Panel): void;
|
|
3639
|
+
}
|
|
3640
|
+
|
|
3641
|
+
interface Panel {
|
|
3642
|
+
/**
|
|
3643
|
+
* Returns if a given panel is valid or not.
|
|
3644
|
+
* @realm client and menu
|
|
3645
|
+
* @source https://wiki.facepunch.com/gmod/Panel:Valid
|
|
3646
|
+
* @deprecated Use Panel:IsValid instead.
|
|
3647
|
+
*/
|
|
3648
|
+
Valid(self: Panel): boolean;
|
|
3649
|
+
}
|
|
3650
|
+
|