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

Browser

Button

Check Box

Combo Box

Custom Renderer

Edit

Ellipse Detect Area [Deprecated]

Detect Area

Grid List

Image

Memo

Label

Progress Bar

Radio Button

Scroll Bar

Scroll Pane

Switch Button

Tab Panel

Window

Plugin

Blur Box

Color Picker

Canvas

Effect 3D

Media Browser

Mask

Nine Slice

Object Preview

QRCode

Rounded Rectangle