OnDgsSelectorSelect

From Multi Theft Auto: Wiki
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

Selector

Mouse

Radio Button

Switch Button

Tab

Animation

Plugin

Media

Color Picker

QRCode

Remote Image

Client event functions