View Single Post
07/24/14, 01:39 PM   #19
zgrssd
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 280
Currently my XML looks like this:
xml Code:
  1. <GuiXml>
  2.     <Controls>
  3.         <TopLevelControl name="EventExplorerWindow" mouseEnabled="true" movable="true" clampedToScreen="true" hidden="true" >
  4.             <Dimensions x="760" y="650" />
  5.             <Anchor point="CENTER" />
  6.             <Controls>
  7.                 <Backdrop name="$(parent)BG" inherits="ZO_DefaultBackdrop" />
  8.                 <Control name="$(parent)Scroll" inherits="ZO_ScrollList">
  9.                     <Anchor point="TOPLEFT" offsetY="30" />
  10.                     <Anchor point="BOTTOMRIGHT" />
  11.                 </Control>
  12.             </Controls>
  13.         </TopLevelControl>
  14.        
  15.         <Control name="EventExplorerRow" virtual="true">
  16.             <Dimensions y="25"/>
  17.             <Controls>
  18.                 <Label name="$(parent)Id" font="ZoFontGame" horizontalAlignment="RIGHT" >
  19.                     <Dimensions x="60"/>
  20.                     <Anchor point="LEFT" />
  21.                 </Label>
  22.                 <Label name="$(parent)Name" font="ZoFontGame" >
  23.                     <Anchor point="LEFT" relativeTo="$(parent)Id" relativePoint="RIGHT" offsetX="20"/>
  24.                 </Label>
  25.             </Controls>
  26.         </Control>
  27.     </Controls>
  28. </GuiXml>

with fill Window looking like:
Lua Code:
  1. local function fillWindow()
  2.     for key, value in ipairs(Events) do
  3.         local row = CreateControlFromVirtual("$(parent)Row", EventExplorerWindowScroll, "EventExplorerRow", key)
  4.         if key == 1 then
  5.             row:SetAnchor(TOPLEFT, EventExplorerWindowScroll, TOPLEFT, 0, 0)
  6.         else
  7.             row:SetAnchor(TOP, lastRow, BOTTOM, 0, 0)
  8.         end
  9.         row:GetNamedChild("Id"):SetText(tostring(value.value))        
  10.         row:GetNamedChild("Name"):SetText(value.key)
  11.         lastRow = row  
  12.     end
  13. end

Still not getting quite the results I expected, but at least I am hitting the right container element:


I would guess the Scroll Window is not properly aware that it's own Dimensions should bve confined to the Windows Dimensions. So it will automatically stretch to it's contents size instead of doing scroll panel stuff.
Attached Thumbnails
Click image for larger version

Name:	post.PNG
Views:	1672
Size:	659.4 KB
ID:	360  
  Reply With Quote