OnDgsCheckBoxChange: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "{{Client event}} __NOTOC__ This event is triggered each time the dgs check box state has changed. ==Parameters== <syntaxhighlight lang="lua"> bool state </syntaxhighlight>...")
 
 
Line 15: Line 15:
DGS = exports.dgs
DGS = exports.dgs


local cb1 = dgsCreateCheckBox(300,300,200,30,"CheckBox Test 1",false)
local cb1 = DGS:dgsCreateCheckBox(300,300,200,30, "CheckBox Test 1", false)
local cb2 = dgsCreateCheckBox(300,320,200,30,"CheckBox Test 2",false)
local cb2 = DGS:dgsCreateCheckBox(300,320,200,30, "CheckBox Test 2", false)


function onStateChanged(state)
function onStateChanged(state)

Latest revision as of 22:21, 2 June 2018

This event is triggered each time the dgs check box state has changed.

Parameters

bool state

Source

The source of this event is the dgs check box.

Example

DGS = exports.dgs

local cb1 = DGS:dgsCreateCheckBox(300,300,200,30, "CheckBox Test 1", false)
local cb2 = DGS:dgsCreateCheckBox(300,320,200,30, "CheckBox Test 2", false)

function onStateChanged(state)
	if source == cb1 and state == true then
		outputChatBox("Selected CheckBox 1")
	end
end
addEventHandler("onDgsCheckBoxChange", root, onStateChanged)

See Also

DGS events

General

Check Box

Combo Box

Drag'N Drop

Edit

Grid List

Menu

Selector

Mouse

Radio Button

Switch Button

Tab

Animation

Plugin

Media

Color Picker

QRCode

Remote Image

Client event functions