Garry's Mod Wiki

DProperty_Generic

Description

This is used internally - although you're able to use it you probably shouldn't.

A base for other controls for DProperties. Acts as a generic text input on its own.

Parent

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

Methods

Panel DProperty_Generic:GetRow()
Returns the internal row panel of a DProperties that this panel belongs to.
DProperty_Generic:SetRow( Panel row )
This is used internally - although you're able to use it you probably shouldn't. Called internally by DProperties.
DProperty_Generic:Setup( table data )
Sets up a generic control for use by DProperties.
DProperty_Generic:ValueChanged( any newVal, boolean force )
Called by this control, or a derived control, to alert the row of the change.

Example

Example usage of this control

local Panel = vgui.Create( "DFrame" ) Panel:SetSize( 500, 500 ) Panel:MakePopup() local props = vgui.Create( "DProperties", Panel ) props:Dock( FILL ) local textRow = props:CreateRow( "MyCategory", "GenericTextArea" ) textRow:Setup( "Generic" ) textRow:SetValue( "test" ) textRow.DataChanged = function( self, data ) MsgN( "Text changed: ", data ) end