Garry's Mod Wiki

Revision Difference

DTextEntry#517118

<panel> <parent>TextEntry</parent> <description> 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 <page>EditablePanel</page> or derived from it (like a <page>DFrame</page>, for example), else it won't be able to focus and thus be unselectable. You must also call <page>Panel:MakePopup</page> on said panel or the DTextEntry will not work. <bug issue="1588">This does not clear out previously-pasted text properly.</bug> </description> </panel> <example> <description>Creates a text entry form that allows you to print messages into the local player's chat window.</description> <code> 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 </code> <output></output> </example> # Methods * {{VGUIElementMethodInternal|AddHistory}}⤶ * {{VGUIElementMethodInternal|GetDisabled}}⤶ * {{VGUIElementMethodInternal|GetDrawBackground}}⤶ * {{VGUIElementMethodInternal|GetDrawBorder}}⤶ * {{VGUIElementMethodInternal|GetFont}}⤶ * {{VGUIElementMethodInternal|GetHighlightColor}}⤶ * {{VGUIElementMethodInternal|GetHistoryEnabled}}⤶ * {{VGUIElementMethodInternal|GetTabbingDisabled}}⤶ * {{VGUIElementMethodInternal|OnKeyCode}}⤶ * {{VGUIElementMethodInternal|OnLoseFocus}}⤶ * {{VGUIElementMethodInternal|SetDrawBackground}}⤶ * {{VGUIElementMethodInternal|SetDrawBorder}}⤶ * {{VGUIElementMethodInternal|SetHighlightColor}}⤶ * {{VGUIElementMethodInternal|SetHistoryEnabled}}⤶ * {{VGUIElementMethodInternal|SetTabbingDisabled}}⤶ * {{VGUIElementMethodInternal|UpdateConvarValue}}⤶ * {{VGUIElementMethodInternal|UpdateFromHistory}}⤶ * {{VGUIElementMethodInternal|UpdateFromMenu}}* <page>AddHistory</page>⤶ * <page>GetDisabled</page>⤶ * <page>GetDrawBackground</page>⤶ * <page>GetDrawBorder</page>⤶ * <page>GetFont</page>⤶ * <page>GetHighlightColor</page>⤶ * <page>GetHistoryEnabled</page>⤶ * <page>GetTabbingDisabled</page>⤶ * <page>OnKeyCode</page>⤶ * <page>OnLoseFocus</page>⤶ * <page>SetDrawBackground</page>⤶ * <page>SetDrawBorder</page>⤶ * <page>SetHighlightColor</page>⤶ * <page>SetHistoryEnabled</page>⤶ * <page>SetTabbingDisabled</page>⤶ * <page>UpdateConvarValue</page>⤶ * <page>UpdateFromHistory</page>⤶ * <page>UpdateFromMenu</page>