View Single Post
05/11/16, 07:40 AM   #17
Letho
AddOn Author - Click to view addons
Join Date: Apr 2016
Posts: 238
Ok I finally managed setting up a working scroll container:

lua Code:
  1. <GuiXml>
  2.     <Controls>
  3.  
  4. <!-- This is my parent container containing the scrollable container -->
  5.         <TopLevelControl name="AuraMasteryMenuContainer" clampedToScreen="true" mouseEnabled="true" movable="true" hidden="true">
  6.             <Dimensions x="1280" y="768" />
  7.             <Anchor point="CENTER" relativeTo="GuiRoot" relativePoint="CENTER" />
  8.             <Controls>
  9.                 <Backdrop name="$(parent)_Backdrop" centerColor="CC000000" edgeColor="1F1F1F">
  10.                     <AnchorFill />
  11.                     <Edge edgeSize= "1" />
  12.                 </Backdrop>
  13.  
  14.  
  15. <!-- SCrollable container that will contain all the nice little icons that the user will be able to scroll through -->
  16.         <Control name="$(parent)ScrollExample" inherits="ZO_ScrollContainer">
  17.              <OnInitialized>
  18.                   ZO_Scroll_Initialize(self)
  19.              </OnInitialized>
  20.              <Dimensions x="850" y="630"/>
  21.              <Anchor point="BOTTOMLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="50" offsetY="650" />
  22.         </Control>

And the .lua file for adding one of the above mentioned icons to the scroll container:
lua Code:
  1. local parent = WM:GetControlByName("AuraMasteryMenuContainerScrollExampleScrollChild");
  2.         d(tostring(parent));
  3.         local icon = WM:CreateControl("$(parent)_Texture", parent, CT_TEXTURE);
  4.         icon:SetParent(parent);
  5.         icon:SetAnchor(TOPLEFT, parent, TOPLEFT, 4, 4);
  6.         icon:SetDimensions(iconSize,iconSize);
  7.         icon:SetTexture("esoui/art/icons/ability_1handed_001.dds");


This code results in the icon texture being displayed, but no scroll bar and no background for the scrollcontainer.

In this post (http://www.esoui.com/forums/showpost.php?p=10826) u stated that

Originally Posted by merlight View Post
ZO_ScrollContainer is a control that contains the slider bar, buttons and the scrolled area, which is named "$(parent)ScrollChild".
I inspected the container with the addon "zgoo" and the container does not contain a scrollbar.
Did i do something wrong or did Zenimax change that? How do i set up a scollbar and associate it or it's event handler OnValueChanged to the container?

P.S.: I didn't get that ZO_ScrollContainer and ZO_ScrollList are two different things, that confused me

Last edited by Letho : 05/11/16 at 10:58 AM.
  Reply With Quote