TableListBox, custom component and selection


#1

Hi Jules,

I have a TableListBox with a checkbox in some column.
I would like to select the row if I click checkbox as well as the checking the box.

What would be the best way to do this without coding custom component for the rows ?

Like in the Juce demo and the combo box selecting the row when modified.

Thanks,


#2

A TableListBox is also a ListBox, so you can just call ListBox::selectRow() on it… or am I misunderstanding your question?


#3

Well, I was talking more about the simplest mechanism to avoid coding in each component an explicit call to selectRow.
Like some mouse event forwarding or something like that.

Thanks,


#4

What I often do is to call setInterceptsMouseClicks (false, true), so that my child comps get clicked on, but clicks on the background fall through to the listbox.


#5

Yep but changing the combobox in the case of the demo won’t select the row even with this ?


#6

Sorry, yes, I guess that’d only work for listboxes, not for tables. For a table, selecting the row isn’t default behaviour, so you’d need to explicitly select it yourself if you want that to happen.


#7

No problem.

Thanks for your time.