OnDgsScrollBarScrollPositionChange: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
(add redirect)
Tag: New redirect
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{Client event}}
#REDIRECT [[OnDgsElementScroll]]
__NOTOC__
This event is fired when a DGS scrollbar is scrolled ( including scroll bars of scrollpane, gridlist and combobox ).
 
==Parameters==
<syntaxhighlight lang="lua">
element Scrolled
</syntaxhighlight>
* '''ScrollTo''':  The value of current scroll position
* '''ScrollFrom''':  The value of previous scroll position
 
==Source==
The [[event system#Event source|source]] of this event is the dgs scrollbar element that got scrolled.
 
==Example==
This example outputs a message with the new scroll position and old scroll position when a scrollbar is scrolled.
<syntaxhighlight lang="lua">
DGS = exports.dgs
function OnScroll(new,old)
outputChatBox("The new scroll position is "..new.." ( was:"..old.." )")
end
addEventHandler("onDgsScrollBarScrollPositionChange",getRootElement(),OnScroll)
</syntaxhighlight>
 
==See Also==
===DGS events===
{{DGSEVENTS}}
===Client event functions===
{{Client_event_functions}}

Latest revision as of 10:10, 18 April 2021

Redirect to: