DTextEntry

From GMod Wiki

Jump to: navigation, search
Derma Control: DTextEntry
Parent Class:TextEntry
Subclasses:
Description:
A control that allows the user to enter text.

Examples

DescriptionCreates a text entry with the text "Initial Value". When new text is entered and the user presses the enter key, the text is printed to the console.
Used onNewerClient.png
Code
// myParent = a panel
local myText = vgui.Create("DTextEntry", myParent)
myText:SetText("Initial Value")
myText.OnEnter = function(self) Msg("Text Entered: " .. self:GetValue() .. "\n") end
OutputN/A
DescriptionCreates a blank multiline text entry, which prints its contents to console every 8 seconds
Used onNewerClient.png
Code
local mom = vgui.Create( "DFrame" )
mom:SetSize(100,200) mom:Center()
mom:MakePopup() -- Makes it visible and grabs the mouse
local textbox = vgui.Create("TextEntry", mom)
textbox:SetMultiline(true)
textbox:SetSize(90,168) 
textbox:SetPos(5,27)
 
timer.Create("printtext", 8, 3, function() print(textbox:GetValue()) end)
timer.Create("removemom", 30, 1, function() mom:Close() end) -- Clean your screen of this example
OutputDTextEntry MultiLineExample.jpg


Additional Notes


You can view the source code for this VGUI element here.

Methods

NewerClient.png DTextEntry.AllowInput
NewerClient.png DTextEntry.ApplySchemeSettings
NewerClient.png DTextEntry.CheckNumeric
NewerClient.png DTextEntry.ConVarChanged
NewerClient.png DTextEntry.ConVarNumberThink
NewerClient.png DTextEntry.ConVarStringThink
NewerClient.png DTextEntry.CreateUnEditableLabel
NewerClient.png DTextEntry.DrawTextEntryText
NewerClient.png DTextEntry.GenerateExample
NewerClient.png DTextEntry.GetCaretPos
NewerClient.png DTextEntry.GetCursorColor
NewerClient.png DTextEntry.GetDrawBackground
NewerClient.png DTextEntry.GetDrawBorder
NewerClient.png DTextEntry.GetEnterAllowed
NewerClient.png DTextEntry.GetHighlightColor
NewerClient.png DTextEntry.GetNumeric
NewerClient.png DTextEntry.GetTextColor
NewerClient.png DTextEntry.GetUpdateOnType
NewerClient.png DTextEntry.GetValue
NewerClient.png DTextEntry.Init
NewerClient.png DTextEntry.OnEnter
NewerClient.png DTextEntry.OnGetFocus
NewerClient.png DTextEntry.OnKeyCodeTyped
NewerClient.png DTextEntry.OnLoseFocus
NewerClient.png DTextEntry.OnMousePressed
NewerClient.png DTextEntry.OnTextChanged
NewerClient.png DTextEntry.OnValueChange
NewerClient.png DTextEntry.Paint
NewerClient.png DTextEntry.PerformLayout
NewerClient.png DTextEntry.RequestFocus
NewerClient.png DTextEntry.SelectAll
NewerClient.png DTextEntry.SelectAllOnFocus
NewerClient.png DTextEntry.SetAllowNonAsciiCharacters
NewerClient.png DTextEntry.SetCaretPos
NewerClient.png DTextEntry.SetConVar
NewerClient.png DTextEntry.SetCursorColor
NewerClient.png DTextEntry.SetDrawBackground
NewerClient.png DTextEntry.SetDrawBorder
NewerClient.png DTextEntry.SetEditable
NewerClient.png DTextEntry.SetEnterAllowed
NewerClient.png DTextEntry.SetHighlightColor
NewerClient.png DTextEntry.SetMultiline
NewerClient.png DTextEntry.SetNumeric
NewerClient.png DTextEntry.SetTall
NewerClient.png DTextEntry.SetTextColor
NewerClient.png DTextEntry.SetUpdateOnType
NewerClient.png DTextEntry.SetValue
NewerClient.png DTextEntry.SetWide
NewerClient.png DTextEntry.Think
NewerClient.png DTextEntry.UpdateConvarValue

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox