GridView


#1

Being back to juce after more than two years. Several thing improved and may let us use it in the future👍 One first question, is there a possibility for a GridView Component? Furthermore, may I use touch-drag gestures to scroll though this component?

Thank you in advance


#2

This would be a great thing :wink:


#3

You mean like the TableListBox?


#4

My grid needs were like a view of album covers, where there’s a dynamic number of columns containing identical auto-wrapping items. I could probably put a wrapper around TableListBox to make it work…


How to get FlexBox's needed height to show all items?
#5

You might be better off just using some ordinary components with a FlexBox layout - that kind of flow/wrapping stuff is what it’s great at.


#6

that means, I will have to implement the gridview on my own. Speaking in iOS I have to implement the gestures, the rubber band effect and the tiling on my own. That means the time we save on the audio part with juce will be lost in the UI part :confused: Hhm, tough decision.


#7

You can use the viewport component for the scrolling and a flexbox inside it for the layout.


#8

That’s probably true no matter what library you’re using… In my experience, it’s very unlikely that the exact grid behaviour you need would be what any kind of ready-made library “gridview” component does. You’re almost certainly going to need to customise and tweak it. A Viewport that contains some components with a FlexBox layout does exactly the same thing and IMHO is better in terms of flexibility and probably code size as well.


#9

If you mean the multi-selection stuff by rubber band there are some handy helper classes…


#10

How would you resize the container for all the components managed by the FlexBox? For example you load 3 items and they take a single row. How do you get the height you need to set to the container for that row? Than you load 20 more items and they should go beyond the viewport edge into scroll. Same question, here.