DgsCheckBoxSetSelected: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
(No difference)

Latest revision as of 11:10, 20 January 2018

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 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