m
Move page script moved page UIHANDLER OnCursorChanged to WoW:UIHANDLER OnCursorChanged without leaving a redirect
(new) |
m (Move page script moved page UIHANDLER OnCursorChanged to WoW:UIHANDLER OnCursorChanged without leaving a redirect) |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
{{widgethandler}} | {{widgethandler}}<br> | ||
== Description == | == Description == | ||
| Line 13: | Line 13: | ||
== Example == | == Example == | ||
Say we have a plain textbox inside a scrollframe (inside [[UIPanelScrollFrameTemplate]]; as the only child-element, etc.), the following code will automatically move scrollframe viewport so that the cursor is inside it. | Say we have a plain textbox inside a scrollframe (inside [[UIPanelScrollFrameTemplate]]; as the only child-element, etc.), the following code will automatically move scrollframe viewport so that the cursor is inside it. (The | ||
ScrollingEdit_OnUpdate() function in UIPanelTemplates.lua does something akin to this also.) | |||
<OnCursorChanged> | <OnCursorChanged> | ||
local vs = this:GetParent():GetVerticalScroll(); | local vs = this:GetParent():GetVerticalScroll(); | ||