View Single Post
07/25/14, 05:40 AM   #23
zgrssd
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 280
Originally Posted by merlight View Post
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.
That is exactly the information I was missing. Before I understan code I cannot use it, as I could not debug it.
After some tests to get the name right I got it added to the proper container. But there are still two issues:
The ScrollBar starts out hidden (I forced it visible by calling SetHidden via Zgoo wich hands in nil).
And (propably releated) it is not not as scrolly as I picutred it to be:


As can be expected it cannot be dragged and does not react to mousewheel.
My guess is that the Scroll element caleld "Contents" is not properly aware of the size of it's contents. So it confines itself to Anchor size.
Attached Thumbnails
Click image for larger version

Name:	post.PNG
Views:	1421
Size:	358.8 KB
ID:	361  
  Reply With Quote