OnDgsComboBoxSelect: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{Client event}} __NOTOC__ This event is fired when the item of a DGS combo box is selected. ==Parameters== <syntaxhighlight lang="lua"> integer previous, integer current <...") |
m (Thisdp moved page OnClientDgsDxComboBoxSelect to OnDgsComboBoxSelect) |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 5: | Line 5: | ||
==Parameters== | ==Parameters== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
integer | integer current, integer previous | ||
</syntaxhighlight> | </syntaxhighlight> | ||
* '''current''': The item id that got selected. | |||
* '''previous''': The item id that last selected. | * '''previous''': The item id that last selected. | ||
==Source== | ==Source== | ||
Line 16: | Line 16: | ||
This example outputs a message with the selected item when an item is selected. | This example outputs a message with the selected item when an item is selected. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function onSelected(previous | DGS = exports.dgs | ||
outputChatBox("Last Selection:"..(previous or "None").." ; | |||
comboBox = DGS:dgsCreateComboBox(500,400,200,30,false) | |||
for i=1,20 do | |||
DGS:dgsComboBoxAddItem(comboBox ,i) | |||
end | |||
function onSelected(current,previous) | |||
outputChatBox("Last Selection:"..(previous or "None")..";Current Selection:"..(current or "None")) | |||
end | end | ||
addEventHandler(" | addEventHandler("onDgsComboBoxSelect",getRootElement(),onSelected) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
=== | ===DGS events=== | ||
{{ | {{DGSEVENTS}} | ||
===Client event functions=== | ===Client event functions=== | ||
{{Client_event_functions}} | {{Client_event_functions}} |
Latest revision as of 13:39, 20 January 2018
This event is fired when the item of a DGS combo box is selected.
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 combo box element that got its item selected.
Example
This example outputs a message with the selected item when an item is selected.
DGS = exports.dgs comboBox = DGS:dgsCreateComboBox(500,400,200,30,false) for i=1,20 do DGS:dgsComboBoxAddItem(comboBox ,i) end function onSelected(current,previous) outputChatBox("Last Selection:"..(previous or "None")..";Current Selection:"..(current or "None")) end addEventHandler("onDgsComboBoxSelect",getRootElement(),onSelected)
See Also
DGS events
General
- onDgsBlur
- onDgsCreate
- onDgsCursorTypeChange
- onDgsCursorStateChange
- onDgsDestroy
- onDgsElementRender
- onDgsElementMove
- onDgsElementSize
- onDgsElementEnter
- onDgsElementLeave
- onDgsFocus
- onDgsKey
- onDgsPositionChange
- onDgsPreRender
- onDgsRender
- onDgsElementScroll
- onDgsSizeChange
- onDgsTextChange
- onDgsWindowClose
- onDgsPropertyChange
Check Box
Combo Box
Drag'N Drop
Edit
Grid List
Menu
Selector
Mouse
- onDgsMousePreClick
- onDgsMouseClick
- onDgsMouseClickDown
- onDgsMouseClickUp
- onDgsMouseDrag
- onDgsMouseDoubleClick
- onDgsMouseDoubleClickDown
- onDgsMouseDoubleClickUp
- onDgsMouseDown
- onDgsMouseHover
- onDgsMouseEnter
- onDgsMouseLeave
- onDgsMouseMultiClick
- onDgsMouseMove
- onDgsMouseStay
- onDgsMouseUp
- onDgsMouseWheel
Radio Button
Switch Button
Tab
Animation
Plugin
Media
- onDgsMediaPlay
- onDgsMediaPause
- onDgsMediaStop
- onDgsMediaLoaded
- onDgsMediaTimeUpdate
- onDgsMediaBrowserReturn
Color Picker
QRCode
Remote Image
Client event functions
- triggerLatentServerEvent
- triggerServerEvent
- Shared
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled