DgsEditSetTextFilter

From Multi Theft Auto: Wiki
(Redirected from DgsEditSetWhiteList)
Jump to navigation Jump to search

This function sets the text filter of edit text. Text Filter in edit means every character of the text should meet the requirement of the filter, or the characters will be cut.

Syntax

bool dgsEditSetTextFilter( element edit, string filter )

Required Arguments

  • edit: the dgs edit you want to set.
  • filter: 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:dgsEditSetTextFilter(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

Custom Cursor Functions

Multi Language Supports

Animation

3D Element

3D Interface

3D Line

3D Image

3D Text

Browser

Button

Check Box

Combo Box

Custom Renderer

Edit

Detect Area

Drag'N Drop

Grid List

Image

Memo

Menu

Label

Layout

Line

Progress Bar

Radio Button

Scale Pane

Scroll Bar

Scroll Pane

Selector

Style

Switch Button

Tab Panel

Window

Basic Shape Plugins

Circle

Quadrilateral

Rounded Rectangle

Other Plugins

Blur Box

Canvas

Chart

Color Picker

Effect 3D

Gradient

Mask

Media Browser

Nine Slice

Object Preview Supports

Paste Handler

QRCode

Remote Image

Screen Source

SVG

Tooltips