DgsCheckBoxSetSelected

From Multi Theft Auto: Wiki
Revision as of 17:17, 4 October 2017 by Ahmed Ly (talk | contribs) (Created page with "{{Client function}} __NOTOC__ This function selects (ticks) or unselects a checkbox. ==Syntax== <syntaxhighlight lang="lua"> bool DgsDxCheckBoxSetSelected ( element theChec...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function selects (ticks) or unselects a checkbox.

Syntax

bool DgsDxCheckBoxSetSelected ( element theCheckbox, bool state )

Required Arguments

  • theCheckbox: The dgs element in which you wish to change the selection state of
  • state: The state of the checkbox, where true indicates selected, and false indicates unselected.

Returns

Returns true if the checkbox's selection state was successfully set, false otherwise.

Example

This example creates 2 checkboxes and sets one of them selected then checks if the first one is selected and if it is then the second one would be set selected.

DGS = exports.dgs

checkedBox = DGS:DgsDxCreateCheckBox(20,30,150,20,"Checked checkbox",true,false)
uncheckedBox = DGS:DgsDxCreateCheckBox(20,30,150,20,"UnChecked checkbox",false,false)

if(DgsDxCheckBoxGetSelected(checkedBox))then
	DGS:DgsDxCheckBoxSetSelected(uncheckedBox,true)
else
	DGS:DgsDxCheckBoxSetSelected(checkedBox,true)
end

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