WoW:UIHANDLER OnCursorChanged: Difference between revisions

m
Move page script moved page UIHANDLER OnCursorChanged to WoW:UIHANDLER OnCursorChanged without leaving a redirect
m (catfix, Replaced: {{widgethandler}} → {{widgethandler}}<br>)
m (Move page script moved page UIHANDLER OnCursorChanged to WoW:UIHANDLER OnCursorChanged without leaving a redirect)
 
(One intermediate revision by one other user not shown)
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();
Anonymous user