Widget handlers < OnCursorChanged

Description Edit

Called whenever the cursor in an edit box was moved. Note that the cursor is also moved when typing.

Arguments Edit

the new horizontal (x) position of the cursor in the edit box (the first column being 0, increasing to the right)
the new vertical (y) position of the cursor in the edit box (the first line being 0, DEcreasing downwards)
the height of one line

Example Edit

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.)

	local vs = this:GetParent():GetVerticalScroll();
	local h  = this:GetParent():GetHeight();

	if vs+arg2 > 0 or 0 > vs+arg2-arg4+h then

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.