OnDgsSelectorSelect

From Multi Theft Auto: Wiki
Revision as of 13:49, 13 February 2021 by Thisdp (talk | contribs) (Created page with "{{Client event}} __NOTOC__ This event is fired when the selected item of a DGS selector is changed. ==Parameters== <syntaxhighlight lang="lua"> integer current, integer pre...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This event is fired when the selected item of a DGS selector is changed.

Parameters

integer current, integer previous
  • current: The item id that got selected.
  • previous: The item id that last selected.

Source

The source of this event is the dgs selector element that got its selected item changed.

Example

This example outputs a message with the selected item when an item is selected.

DGS = exports.dgs
selector = DGS:dgsCreateSelector(400,500,100,20,false)
for i=1,5000 do
	DGS:dgsSelectorAddItem(selector,i)
end
function onSelected(current,previous)
	outputChatBox("Last Selection:"..(previous or "None")..";Current Selection:"..(current or "None"))
end
addEventHandler("onDgsSelectorSelect",getRootElement(),onSelected)

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