Garry's Mod Wiki

ControlPanel

Description

Used by the context menu in sandbox.

View source

Parent

Derives methods, etc not listed on this page from DForm.

Methods

Panel ControlPanel:AddControl( string type, table controlinfo )
We advise against using this. It may be changed or removed in a future update. It is recommended to use DForm's members instead. Adds a control to the control panel.
ControlPanel:AddPanel( Panel panel )
Adds an item by calling DForm:AddItem.
ControlPanel:ClearControls()
We advise against using this. It may be changed or removed in a future update. Alias of Panel:Clear.
Panel ControlPanel:ColorPicker( string label, string convarR, string convarG, string convarB, string convarA )
Creates a CtrlColor (a color picker) panel and adds it as an item.
ControlPanel:ControlValues( table data )
Sets control values of the control panel.
ControlPanel:FillViaFunction( function func )
Calls the given function with this panel as the only argument. Used by the spawnmenu to populate the control panel. We advise against using this. It may be changed or removed in a future update. This is dumb. Just call the builder function directly.
Returns this control panel.
Panel ControlPanel:KeyBinder( string label1, string convar1, string label2 = "nil", string convar2 = "nil" )
Creates a CtrlNumPad (a Sandbox key binder) panel and adds it as an item.
MatSelect ControlPanel:MatSelect( string convar, table options = nil, boolean autostretch = nil, number width = nil, number height = nil )
Creates a MatSelect panel and adds it as an item.
Panel ControlPanel:ToolPresets( string group, table cvarList )
Creates a ControlPresets panel and adds it as an item.