What is the recommended way of dealing with custom components for custom ListBoxes now? In particular, i mean handling mouse clicks to select them.
The components are created in the refreshComponentForRow, that happens fine. I presume it needs to register mouse events or something… but who with? My guess is that i update the component to know what row it is, and give it a pointer to the ListBox (assuming that the ListBoxModel class i’m making is also inheriting ListBox), and get it to call selectRow(row) on a mouseDown.
If this is indeed what is required each time, i think it would be very handy to have included with juce a base ListBoxItem component, which has bool selected and int currentRow members and functions, with a default mouseDown implementation to select the row (also taking a pointer to the ListBox in the constructor). Not that it’s that much hassle to make one myself of course. Just thinking out loud!