Category:DCheckBox

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(Removed method list; all doc'd.)
(better example)
Line 1: Line 1:
 
{{Panel
 
{{Panel
|Name=DCheckBox
 
 
|Parent=DButton
 
|Parent=DButton
 
|Description=The DCheckBox is a checkbox. It allows you to get a boolean value from the user (true/false - yes/no)
 
|Description=The DCheckBox is a checkbox. It allows you to get a boolean value from the user (true/false - yes/no)
 +
|Hooks=
 
}}
 
}}
 
{{Example
 
{{Example
 
|Description=Creates a DCheckBox and sets its initial value.
 
|Description=Creates a DCheckBox and sets its initial value.
|Code=
+
|Code=local window = vgui.Create( "DFrame" )
local DermaCheckbox = vgui.Create("DCheckBox")// Create the checkbox
+
window:SetSize( 300, 200 )
DermaCheckbox:SetPos(25, 50)// Set the position
+
window:Center()
DermaCheckbox:SetValue(0)// Initial value (will determine whether the box is ticked too)
+
window:MakePopup()
 +
 
 +
local checkbox = window:Add( "DCheckBox" ) -- Create the checkbox
 +
checkbox:SetPos( 25, 50 ) -- Set the position
 +
checkbox:SetValue( true ) -- Initial "ticked" value
 
}}
 
}}

Revision as of 18:53, 26 November 2019

Contents

DescriptionPanelPage

The DCheckBox is a checkbox. It allows you to get a boolean value from the user (true/false - yes/no)

Inherited Functions

Inherits the following functions from DButton and its parents up to 3 levels deep:


Examples

Example

Creates a DCheckBox and sets its initial value.

local window = vgui.Create( "DFrame" )
window:SetSize( 300, 200 )
window:Center()
window:MakePopup()

local checkbox = window:Add( "DCheckBox" ) -- Create the checkbox
checkbox:SetPos( 25, 50 ) -- Set the position
checkbox:SetValue( true ) -- Initial "ticked" value


Pages in category "DCheckBox"

The following 6 pages are in this category, out of 6 total.

Personal tools
Navigation