DgsCheckBoxSetSelected

From Multi Theft Auto: Wiki
Jump to navigation Jump to search

This function selects (ticks) or unselects a checkbox.

Syntax

bool dgsCheckBoxSetSelected ( 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, false indicates unselected, and nil indicates indeterminate.

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:dgsCreateCheckBox(20,30,150,20,"Checked checkbox",true,false)
uncheckedBox = DGS:dgsCreateCheckBox(20,30,150,20,"UnChecked checkbox",false,false)

if DGS:dgsCheckBoxGetSelected(checkedBox)then
	DGS:dgsCheckBoxSetSelected(uncheckedBox,true)
else
	DGS:dgsCheckBoxSetSelected(checkedBox,true)
end

See Also

Custom Cursor Functions

Multi Language Supports

Animation

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

Label

Line

Progress Bar

Radio Button

Scale Pane

Scroll Bar

Scroll Pane

Selector

Style

Switch Button

Tab Panel

Window

Plugin

Blur Box

Color Picker

Canvas

Circle

Effect 3D

Media Browser

Mask

Nine Slice

Object Preview Supports

Paste Handler

QRCode

Remote Image

Rounded Rectangle