Thread: ZO_ScrollList
View Single Post
05/17/14, 12:25 PM   #2
CrazyDutchGuy
 
CrazyDutchGuy's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 89
After some fiddling i start to get something, but i don't see any data in the list

Lua Code:
  1. local scrollList = WINDOW_MANAGER:CreateControlFromVirtual("$(parent)ScrollList", window, "ZO_ScrollList")
  2. scrollList:SetAnchor(TOPLEFT, window, TOPLEFT, 400, 20)    
  3.  
  4. ZO_ScrollList_Initialize(scrollList)
  5.        
  6. local LOCATION_DATA = 1
  7.  
  8. ZO_ScrollList_AddDataType(scrollList, LOCATION_DATA, "SomeLocationRow", 23, nil, nil, nil, nil)
  9. local scrollData = ZO_ScrollList_GetDataList(scrollList)
  10. for i = 1, GetNumMaps() do
  11.         local mapName, mapType, mapContentType = GetMapInfo(i)
  12.         scrollData[#scrollData + 1] = ZO_ScrollList_CreateDataEntry(LOCATION_DATA, { locationName = zo_strformat("<<1>>", mapName), index = i })
  13. end    
  14.  
  15. ZO_ScrollList_Commit(scrollList)

xml part
Lua Code:
  1. <Control name="SomeLocationRow" virtual="true">
  2.             <Dimensions x="200" y="23"/>
  3.             <Controls>
  4.                 <Label name="$(parent)Location" inherits="ZO_SelectableLabel" font="ZoFontHeader">
  5.                     <Anchor point="TOPLEFT"/>
  6.                 </Label>
  7.             </Controls>
  8.         </Control>

which results in this


I don't see any map locations and the slider is way too small. I can manually fiddle with the height, but still it misses the content
  Reply With Quote