DForm

From GMod Wiki

Jump to: navigation, search
Derma Control: DForm
Parent Class:Panel
Subclasses:ControlPanel
Description:

Examples

DescriptionCreates a form (almost like DPanelList) where you can place some items in an organized form.
Used onNewerClient.png
Code
 
local TestingForm = vgui.Create( "DForm", DermaPanel )
TestingForm:SetPos( 25, 50 )
TestingForm:SetSize( 350, 50 )
TestingForm:SetSpacing( 10 )
TestingForm:SetName( "Testing Form Thing" )
TestingForm.Paint = function()
    surface.SetDrawColor( 255, 51, 15, 255 )
    -- I draw a box here to show where the form is outlined
    surface.DrawOutlinedRect( 0, 0, TestingForm:GetWide(), TestingForm:GetTall() ) 
end
 
    local FormContentOne = vgui.Create( "DCheckBoxLabel" )
    FormContentOne:SetText( "Use Props?" )
    FormContentOne:SetConVar( "some_convar" )
    FormContentOne:SetValue( 1 )
    FormContentOne:SizeToContents()
TestingForm:AddItem( FormContentOne )
 
    local FormContentTwo = vgui.Create( "DNumSlider" )
    FormContentTwo:SetText( "Max Props" )
    FormContentTwo:SetMin( 0 )
    FormContentTwo:SetMax( 256 )
    FormContentTwo:SetDecimals( 0 )
    FormContentTwo:SetConVar( "sbox_maxprops" )
TestingForm:AddItem( FormContentTwo )
 
Outputform01xp0.png


Methods

NewerClient.png DForm.AddItem
NewerClient.png DForm.ApplySchemeSettings
NewerClient.png DForm.Button
NewerClient.png DForm.CheckBox
NewerClient.png DForm.Clear
NewerClient.png DForm.ComboBox
NewerClient.png DForm.GetAutoSize
NewerClient.png DForm.GetDrawBackground
NewerClient.png DForm.GetPadding
NewerClient.png DForm.GetSpacing
NewerClient.png DForm.Help
NewerClient.png DForm.Init
NewerClient.png DForm.MultiChoice
NewerClient.png DForm.NumberWang
NewerClient.png DForm.NumSlider
NewerClient.png DForm.Paint
NewerClient.png DForm.PanelSelect
NewerClient.png DForm.PerformLayout
NewerClient.png DForm.Rebuild
NewerClient.png DForm.SetAutoSize
NewerClient.png DForm.SetDrawBackground
NewerClient.png DForm.SetName
NewerClient.png DForm.SetPadding
NewerClient.png DForm.SetSpacing
NewerClient.png DForm.TextEntry

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox