Category:DTextEntry

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
m (Bug)
 
Line 19: Line 19:
 
chat.AddText( self:GetValue() ) -- print the form's text as server text
 
chat.AddText( self:GetValue() ) -- print the form's text as server text
 
end
 
end
|Output=<br/>
+
|Output=
 
[[Image:DTextEntryExample.png|center]]
 
[[Image:DTextEntryExample.png|center]]
 
}}
 
}}
 
= Methods =
 
= Methods =
 
* {{VGUIElementMethodInternal|AddHistory}}
 
* {{VGUIElementMethodInternal|AddHistory}}
* {{VGUIElementMethodInternal|GetAutoComplete}}
 
 
* {{VGUIElementMethodInternal|GetDisabled}}
 
* {{VGUIElementMethodInternal|GetDisabled}}
 
* {{VGUIElementMethodInternal|GetDrawBackground}}
 
* {{VGUIElementMethodInternal|GetDrawBackground}}
 
* {{VGUIElementMethodInternal|GetDrawBorder}}
 
* {{VGUIElementMethodInternal|GetDrawBorder}}
* {{VGUIElementMethodInternal|GetEnterAllowed}}
 
* {{VGUIElementMethodInternal|GetFloat}}
 
 
* {{VGUIElementMethodInternal|GetFont}}
 
* {{VGUIElementMethodInternal|GetFont}}
 
* {{VGUIElementMethodInternal|GetHighlightColor}}
 
* {{VGUIElementMethodInternal|GetHighlightColor}}
 
* {{VGUIElementMethodInternal|GetHistoryEnabled}}
 
* {{VGUIElementMethodInternal|GetHistoryEnabled}}
* {{VGUIElementMethodInternal|GetInt}}
 
 
* {{VGUIElementMethodInternal|GetTabbingDisabled}}
 
* {{VGUIElementMethodInternal|GetTabbingDisabled}}
* {{VGUIElementMethodInternal|GetUpdateOnType}}
 
* {{VGUIElementMethodInternal|IsEditing}}
 
* {{VGUIElementMethodInternal|OnGetFocus}}
 
 
* {{VGUIElementMethodInternal|OnKeyCode}}
 
* {{VGUIElementMethodInternal|OnKeyCode}}
 
* {{VGUIElementMethodInternal|OnLoseFocus}}
 
* {{VGUIElementMethodInternal|OnLoseFocus}}
* {{VGUIElementMethodInternal|OpenAutoComplete}}
 
* {{VGUIElementMethodInternal|SetCursorColor}}
 
* {{VGUIElementMethodInternal|SetDisabled}}
 
 
* {{VGUIElementMethodInternal|SetDrawBackground}}
 
* {{VGUIElementMethodInternal|SetDrawBackground}}
 
* {{VGUIElementMethodInternal|SetDrawBorder}}
 
* {{VGUIElementMethodInternal|SetDrawBorder}}
* {{VGUIElementMethodInternal|SetEditable}}
 
* {{VGUIElementMethodInternal|SetEnterAllowed}}
 
* {{VGUIElementMethodInternal|SetFont}}
 
 
* {{VGUIElementMethodInternal|SetHighlightColor}}
 
* {{VGUIElementMethodInternal|SetHighlightColor}}
 
* {{VGUIElementMethodInternal|SetHistoryEnabled}}
 
* {{VGUIElementMethodInternal|SetHistoryEnabled}}
 
* {{VGUIElementMethodInternal|SetTabbingDisabled}}
 
* {{VGUIElementMethodInternal|SetTabbingDisabled}}
* {{VGUIElementMethodInternal|SetTextColor}}
 
* {{VGUIElementMethodInternal|SetUpdateOnType}}
 
* {{VGUIElementMethodInternal|SetPlaceholderText}}
 
* {{VGUIElementMethodInternal|SetValue}}
 
 
* {{VGUIElementMethodInternal|UpdateConvarValue}}
 
* {{VGUIElementMethodInternal|UpdateConvarValue}}
 
* {{VGUIElementMethodInternal|UpdateFromHistory}}
 
* {{VGUIElementMethodInternal|UpdateFromHistory}}
 
* {{VGUIElementMethodInternal|UpdateFromMenu}}
 
* {{VGUIElementMethodInternal|UpdateFromMenu}}

Latest revision as of 18:03, 3 January 2020

Contents

DescriptionPanelPage

A form which may be used to display text the player is meant to select and copy or alternately allow them to enter some text of their own . Do note that at least one of your DTextEntry's parents must either be an EditablePanel or derived from it (like a DFrame, for example), else it won't be able to focus and thus be unselectable. You must also call Panel:MakePopup on said panel or the DTextEntry will not work.

BUG

This does not clear out previously-pasted text properly.

Issue Tracker: #1588

Inherited Functions

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


Examples

Example

Creates a text entry form that allows you to print messages into the local player's chat window.

local frame = vgui.Create( "DFrame" )
frame:SetSize( 400, 200 )
frame:Center()
frame:MakePopup()

local TextEntry = vgui.Create( "DTextEntry", frame ) -- create the form as a child of frame
TextEntry:SetPos( 25, 50 )
TextEntry:SetSize( 75, 85 )
TextEntry:SetText( "Placeholder Text" )
TextEntry.OnEnter = function( self )
	chat.AddText( self:GetValue() )	-- print the form's text as server text
end

Output:

DTextEntryExample.png

Methods

Personal tools
Navigation