|
11/08/15, 06:48 AM | #1 |
|
Need some help with understanding <Scroll> control
I have a plain <Scroll> control (XML source). No inherits="ZO_Scroll", since it only supports vertical scrolling and I want horizontal. No scrollbar.
Here's a picture of two Torchbug windows inspecting tbugTabWindow1Tabs: tbugTabWindow1Tabs is the scroll control in the yellow box. It has 14 children: ActiveBg provides the dark background for the active tab "6", and children 2..14 are tab labels that were added dynamically -- intentionally too many to fit, you can see "_mouseSomething" is clipped on the right. What I don't understand is that both extents.horizontal and extents.vertical are 0 (these are values returned by GetScrollExtents). And when I do /script tbugTabWindow1Tabs:SetHorizontalScroll(10), nothing happens. Offsets remain at 0. I tried playing with SetScrollBounding, and when I set it to SCROLL_BOUNDING_UNBOUND and then SetHorizontalScroll(10), what happens is this: ActiveBg (the first child) is reanchored to the parent with offsetX=-10 and offsetY=-0 (not kidding, negative zero). All other children stay where they are. Looking at how ZO_ScrollContainer is implemented, I'm beginning to think that the scroll control determines its inner extents solely from its first child, and that scrolling is actually implemented by shifting that child's anchor in the opposite direction. Also does anyone know what different ScrollBounding values do? So far I've figured that UNBOUND allows you to SetVertical/HorizontalScroll beyond what GetScrollExtents returns. All other values (BOUND, CONTAINED, DEFAULT) seem to prevent that. |
11/08/15, 11:33 AM | #2 | |
Wandamey
Guest
Posts: n/a
|
not sure if I understand one word of what you said, but i couldn't find this in your post / file :
ZO_HorizontalScrollList thats what is used at the crafting station. could be helpful. |
|
Wandamey |
11/08/15, 03:25 PM | #3 | |
|
This probably isn't to helpful, I've never used this, but heres what I noticed using SetHorizontalScroll with: SCROLL_BOUNDING_CONTAINED -- seems to change the extents & offset SCROLL_BOUNDING_UNBOUND -- changes the offset only SCROLL_BOUNDING_BOUND -- changes neither SCROLL_BOUNDING_DEFAULT -- changes offset only Changing the bounding allows changing the extent & offsets, but even then nothing happens. You said your 1st control reanchored & moved when you called SetHorizontalScroll() after changing the bounds? It didn't for me. Since I see no code for SetHorizontalScroll, I'm assuming it just sets a value but doesn't actually do anything else and I see no handlers to do anything even if those values change. As Wandamey said, I would look at zo_horizontalscrolllist.lua & the clothier crafting station code: smithingcreation_shared.xml & smithing_common.xml. |
|
11/08/15, 03:55 PM | #4 | |
|
SetScrollBounding is still a mystery to me, but luckily scrolling works without touching that ZO_HorizontalScrollList is of no use here. It's written for a fixed number of items of equal width. |
|
11/08/15, 04:01 PM | #5 | ||
Wandamey
Guest
Posts: n/a
|
Edit : actually that's what the smithing station does already, the table of listed items changes at each station/filter change for the corresponding table. for the size of the elements idk though. I can't deny that they were all square. I remember having emptied my crafting lists by accident while I was testing the smithing stations... shouldn't be too hard to reinit. Last edited by Wandamey : 11/08/15 at 04:08 PM. |
||
Wandamey |
11/08/15, 08:05 PM | #6 | |
|
XML:
Warning: Spoiler
xml Code:
LUA:
Warning: Spoiler
Lua Code:
I didn't do this in the screenshots, didn't think of it until afterwords, but if you wanted (you probably would) you can change the DefaultEntryAnchor so that the "selected" control gets aligned left instead of center. Lua Code:
Last edited by circonian : 11/09/15 at 05:30 PM. |
|
11/10/15, 06:08 AM | #7 |
|
Interesting, I didn't know ZO_HorizontalScrollList can handle variable width items. And I didn't even think about item-wise scrolling (select next/previous). I only did area scrolling and you have to click to select another item. But I'm starting to like the idea of scrolling selection.
|
11/10/15, 02:17 PM | #8 | |
|
xml Code:
You can also scroll with the mouse wheel or click/drag the bar to scroll through it, its all handled for you. If you wanted you could even hide the big Left/Right buttons. |
|
ESOUI » Developer Discussions » Lua/XML Help » Need some help with understanding <Scroll> control |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Switch to Linear Mode |
Hybrid Mode |
Switch to Threaded Mode |
|
|