DgsEditSetWhiteList

From Multi Theft Auto: Wiki

This function sets the white list of edit text. White List in edit means every character of the text should meet the requirement of the white list, or the characters will be cut.

Syntax

bool dgsEditSetWhiteList( element edit, string whitelist )

Required Arguments

  • edit: the dgs edit you want to set.
  • whitelist: the pattern (refer to lua pattern).

Returns

Returns true if succeeded, false otherwise.

Example

DGS = exports.dgs

local edit = DGS:dgsCreateEdit(0.3,0.3,0.2,0.05,"",true)
DGS:dgsEditSetWhiteList(edit ,"[^a-zA-Z0-9$]") --This regular expression set a restrict that the character of text allowed is from "a" to "z", "A" to "Z" and 0 to 9

See Also

Multi Language Supports

Animation

3D Interface

3D Text

Arrow List

Browser

Button

Check Box

Combo Box

Edit

Ellipse Detect Area

Detect Area

Grid List

Image

Memo

Label

Progress Bar

Radio Button

Scroll Bar

Scroll Pane

Switch Button

Tab Panel

Window

Plugin

Media Browser

Rounded Rectangle

Color Picker

Blur Box

Effect 3D