View Single Post
02/11/15, 07:15 PM   #6
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by merlight View Post
The layout is all newly created controls, like this:
TopLevelWindow - fixed width, height, no resizeToFit
+ Backgrounds - fixed dimensions, anchored to TLW and excludeFromResizeToFit (just to be sure)
+ Title - fixed height, anchor (TOPLEFT, TLW, TOPLEFT)
+ Divider - fixed height, anchor (TOPLEFT, Title, BOTTOMLEFT)
+ List - anchor (TOPLEFT, Divider, BOTTOMLEFT) anchor (BOTTOMRIGHT, TLW, BOTTOMLEFT, 250, -120)

So the second List anchor determines its width and height. The TLW is anchored by ZO_ReanchorControlForLeftSidePanel.
I still can't see why the List had one height after creation, and another when it was shown. I replaced the second anchor with fixed width and height, and the scrollbar appears correctly.
offsetY = -120
Lua Code:
  1. + List - anchor (TOPLEFT, Divider, BOTTOMLEFT) anchor (BOTTOMRIGHT, TLW, BOTTOMLEFT, 250, -120)
What are those other fixed dimensions? My guess at this point would be that if it had 1 height, that is all of the room there was. Is your TLW height 120+1+titleHeight+dividerHeight (-OffsetY distance + the 1 you said the list had a height of 1 + title height + divider height)?

EDIT:
One other long shot, I'm not sure if this would even happen, but its the only other thing I can think of.
You said your anchoring the TLW by passing it to:
Lua Code:
  1. function ZO_ReanchorControlForLeftSidePanel(control)
Which clears the anchors & sets a new TOPLEFT anchor and registers it for EVENT_SCREEN_RESIZED to reset that anchor on that event.
Any chance some code, yours or the games, could be running while all of the anchors are getting moved which might temporarily mess up the calculations?
Have you tried anchoring the TLW manually to a fixed position (so no anchors move) and see what happens?

I know you said you got it to work a different way, but if you want to post some code I'll look at it, give it a try, & see what happens.

Last edited by circonian : 02/11/15 at 07:44 PM.
  Reply With Quote