View Single Post
06/28/18, 09:58 PM   #7
Phuein
 
Phuein's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 132
Done those suggestions. The MOTD example is very unfriendly, when translating to a somewhat different situation.

I've come up with my own solution which is working fine, although should have been handled on the dev' side of things. If it helps anyone in the future:

Code:
ScrollContainer = WINDOW_MANAGER:CreateControlFromVirtual("ScrollContainer", MainWindow, "ZO_ScrollContainer")
ScrollContainer.scrollChild = ScrollContainer:GetNamedChild("ScrollChild")
ScrollContainer:ClearAnchors()
ScrollContainer:SetAnchor(TOPLEFT, Backdrop, TOPLEFT, 0, 0)
ScrollContainer:SetAnchor(BOTTOMRIGHT, Backdrop, BOTTOMRIGHT, 0, -30) -- Extra space on bottom of page.

...

ContentsLabel = WINDOW_MANAGER:CreateControl("ContentsLabel", ScrollContainer.scrollChild, CT_LABEL)	
ContentsLabel:SetAnchor(TOPLEFT, ScrollContainer.scrollChild, TOPLEFT, 6, 5) -- Matches Editbox.
ContentsLabel:SetWidth(ScrollContainer:GetWidth()-20)
The Editbox that goes along with it uses this:

Code:
Contents = WINDOW_MANAGER:CreateControlFromVirtual("Contents", ScrollContainer, "ZO_DefaultEditMultiLineForBackdrop")
Contents:ClearAnchors()
Contents:SetAnchor(TOPLEFT, ScrollContainer, TOPLEFT, 6, 5)
Contents:SetHeight(ScrollContainer:GetHeight())
Contents:SetWidth(ScrollContainer:GetWidth()-20)
  Reply With Quote