View Single Post
07/24/14, 06:18 PM   #22
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
I think you misunderstood me Keep your XML exactly as you had it on the previous page. Only change the parent in Lua code from EventExplorerWindowScroll to EventExplorerWindowScrollContents.

Originally Posted by zgrssd View Post
Currently my XML looks like this:
xml Code:
  1. <TopLevelControl name="EventExplorerWindow" mouseEnabled="true" movable="true" clampedToScreen="true" hidden="true" >
  2.             <Dimensions x="760" y="650" />
  3.             <Anchor point="CENTER" />
  4.             <Controls>
  5.                 <Backdrop name="$(parent)BG" inherits="ZO_DefaultBackdrop" />
  6. <!-- *** -->        <Control name="$(parent)Scroll" inherits="ZO_ScrollList">
  7.                     <Anchor point="TOPLEFT" offsetY="30" />
  8.                     <Anchor point="BOTTOMRIGHT" />
  9.                 </Control>
  10.             </Controls>
  11.         </TopLevelControl>
  12. ...
The line marked with *** creates the scroll container you need, it inherits from ZO_ScrollList which contains all the components. And since it's so stupid to write about code we all have installed, here's how it's defined:
xml Code:
  1. <!--Scroll List-->
  2.         <Control name="ZO_ScrollList" inherits="ZO_ScrollAreaBarBehavior" virtual="true">
  3.             <OnInitialized>
  4.                 ZO_ScrollList_Initialize(self)
  5.             </OnInitialized>
  6.  
  7.             <Controls>
  8.                 <Scroll name="$(parent)Contents" mouseEnabled="true">
  9.                     <Anchor point="TOPLEFT" />
  10.                     <Anchor point="BOTTOMRIGHT" offsetX="-16" />
  11.                     <OnMouseWheel>
  12.                         ZO_ScrollList_ScrollRelative(self:GetParent(), -delta * 40)
  13.                     </OnMouseWheel>
  14.                 </Scroll>
  15.                 <Slider name="$(parent)ScrollBar" mouseEnabled="true" inherits="ZO_VerticalScrollbarBase">
  16.                     <Anchor point="TOPLEFT" relativeTo="$(parent)Contents" relativePoint="TOPRIGHT" offsetY="16" />
  17.                     <Anchor point="BOTTOMLEFT" relativeTo="$(parent)Contents" relativePoint="BOTTOMRIGHT" offsetY="-16" />
  18.                     <OnMouseWheel>
  19.                         ZO_ScrollList_ScrollRelative(self:GetParent(), -delta * 40)
  20.                     </OnMouseWheel>
  21.  
  22.                     <OnValueChanged>
  23.                         ZO_ScrollList_MoveWindow(self:GetParent(), value)
  24.                     </OnValueChanged>
  25.                 </Slider>
  26.             </Controls>
  27.         </Control>

You see? By inheriting from ZO_ScrollList, you get a control which has a child named "Contents" where you put all the controls you want in the scrollable window. It's parent is your EventExplorerWindow->Scroll, thus the full name is EventExplorerWindowScrollContents.
  Reply With Quote