Garry's Mod Wiki

DTextEntry:AllowInput

boolean DTextEntry:AllowInput( string char )

Description

Called whenever the value of the panel has been updated (whether by user input or otherwise).

It allows you to determine whether a user can modify the TextEntry's text.

By default, this only checks whether the panel disallows numeric characters, preventing it from being edited if the value contains any.

This is actually an engine hook that only works on TextEntry derived elements.

Arguments

1 string char
The last character entered into the panel.

Returns

1 boolean
Return true to prevent the value from changing, false to allow it.

Example

Prevents the user from editing the text entirely.

local TextEntry = vgui.Create( "DTextEntry" ) TextEntry.AllowInput = function( self, stringValue ) return true end
Output: The panel does not allow any alterations.

Page Links


Special Pages


Wikis

?

Render Time: 49ms

DB GetPage 3
Generate Html 3
SaveChanges (1) 23
Render Body 0
Render Sidebar 17