Panel/SetAllowNonAsciiCharacters

From Garry's Mod
Jump to: navigation, search
 Panel:SetAllowNonAsciiCharacters( )

Contents

Description

Configures a text input to allow user to type characters that are not included in the US-ASCII (7-bit ASCII) character set.

Characters not included in US-ASCII are multi-byte characters in UTF-8. They can be accented characters, non-Latin characters and special characters.

Arguments

boolean allowed

Set to true in order not to restrict input characters.

Examples

Example

Replaces the default vgui.Create() function to always allow non US-ASCII characters for text inputs.

if vgui.CreateStdRestrict == nil then
	vgui.CreateStdRestrict = vgui.Create
end
function vgui.Create( classname, parent, name )
	local vgui_elt = vgui.CreateStdRestrict(classname, parent, name)
	if classname == "DTextEntry" or classname == "RichText" or classname == "TextEntry" then
		vgui_elt:SetAllowNonAsciiCharacters(true)
	end
	return vgui_elt
end


Personal tools
Navigation