cwBasicForm panelclient
Panel defined in core/derma/cl_basicform.lua
Defines cwBasicForm, a DPanelList-based form with helpers for adding labelled controls bound to console
variables.
Offers the same helpers as DForm (TextEntry, ComboBox, NumberWang, NumSlider, CheckBox, Help,
ControlHelp, Button, PanelSelect, ListBox) plus SetText for the header.
Summary
Methods
Methods
Adds a row to the form made of a label and a control.
When right is valid, both panels are placed side by side in a new row, with right offset 110 pixels
from the left. Otherwise left is added on its own; nothing is added when neither is valid.
Parameters
- left Panel Panel shown on the left, usually a label
- right Panel optional, defaults to
nilPanel shown on the right
PANEL:Button(strName, strConCommand, ...)
client gamemodes/catwork/gamemode/core/derma/cl_basicform.lua:261Adds a button, optionally running a console command when clicked.
Parameters
- strName String Button text
- strConCommand String optional, defaults to
nilConsole command to run on click - ... Any Arguments passed to the console command
Returns
- Panel The
DButton
PANEL:CheckBox(strLabel, strConVar)
client gamemodes/catwork/gamemode/core/derma/cl_basicform.lua:196Adds a labelled check box bound to a console variable.
Parameters
- strLabel String Label text
- strConVar String Console variable the check box reads and writes
Returns
- Panel The
DCheckBoxLabel
PANEL:ComboBox(strLabel, strConVar)
client gamemodes/catwork/gamemode/core/derma/cl_basicform.lua:117Adds a labelled combo box that sets a console variable when an option is picked.
The console variable is set to the option's data, or its text when it has no data.
Parameters
- strLabel String Label text
- strConVar String Console variable to set
Returns
- Panel The
DComboBox - Panel The label
Adds a centred, wrapped help label for the control above it.
Parameters
- strHelp String Help text
Returns
- Panel The label
Adds a wrapped help text label to the form.
Parameters
- strHelp String Help text
Returns
- Panel The label
Adds a list box, preceded by a label when one is given.
Parameters
- strLabel String optional, defaults to
nilLabel text shown above the list box
Returns
- Panel The
DListBox - Panel The label, or
nilwhen no label text was given
PANEL:NumberWang(strLabel, strConVar, numMin, numMax, numDecimals)
client gamemodes/catwork/gamemode/core/derma/cl_basicform.lua:145Adds a labelled number wang bound to a console variable.
Parameters
- strLabel String Label text
- strConVar String Console variable the wang reads and writes
- numMin Number Smallest allowed value
- numMax Number Largest allowed value
- numDecimals Number optional, defaults to
nilNumber of decimal places to show
Returns
- Panel The
DNumberWang - Panel The label
PANEL:NumSlider(strLabel, strConVar, numMin, numMax, numDecimals)
client gamemodes/catwork/gamemode/core/derma/cl_basicform.lua:173Adds a number slider bound to a console variable.
Parameters
- strLabel String Label text
- strConVar String Console variable the slider reads and writes
- numMin Number Smallest allowed value
- numMax Number Largest allowed value
- numDecimals Number optional, defaults to
nilNumber of decimal places to show
Returns
- Panel The
DNumSlider
Adds an empty panel select to the form.
Returns
- Panel The
DPanelSelect
PANEL:SetText(text, fontName, color, size)
client gamemodes/catwork/gamemode/core/derma/cl_basicform.lua:19Sets the form's header text, creating the header label on first use.
The label is drawn over a highlighted box and stretched to the form's width.
Parameters
- text String Text of the header
- fontName String optional, defaults to
nilFont to use; defaults to themenu_text_tinytheme font - color Color optional, defaults to
nilText color, or the name of a theme color; defaults tobasic_form_color - size Number optional, defaults to
nilFont size; defaults to 16 when no font is given, otherwise keeps the font's size
PANEL:TextEntry(strLabel, strConVar)
client gamemodes/catwork/gamemode/core/derma/cl_basicform.lua:95Adds a labelled text entry bound to a console variable.
Parameters
- strLabel String Label text
- strConVar String Console variable the entry reads and writes
Returns
- Panel The
DTextEntry - Panel The label