I have a simple ListBox with custom components inside. Drag and drop is working fine, but I’d like to do “custom” stuff when the drag operation is starting.
I tried to overload the mouseDown and mouseDrag methods of juce::Component, both inside my custom component and in the listBox itself…but the methods never get called
I guess that’s pretty normal because otherwise, the ListBox default behaviour wouldn’t work …but I’m also sure there is a way to do this.
I tried to mess around with setInterceptMouseClicks but no luck so far.
If you have a custom comp, then the mouseDown and up methods will certainly be called for it. If it’s not working then you must have just done something wrong somewhere.
Hey friend,
I have one doubt to ask you, where i have custom component in ListBox,
And I want my custom component to call listBoxItemClicked and other methods of ListBox,
do u have any idea to do so? or just have to have forward events to do so ?
[quote=“acn”]Hey friend,
I have one doubt to ask you, where i have custom component in ListBox,
And I want my custom component to call listBoxItemClicked and other methods of ListBox,
do u have any idea to do so? or just have to have forward events to do so ?[/quote]
Sorry but I’m not sure I understand what you mean ?!
If you have a class derived from ListBoxModel, you just have to override “listBoxItemClicked (int row, const MouseEvent &e)” and it’s gonna work. Or did you mean something else ?
Well ListBox has custom component inside, and You are right It just need listBoxItemClicked(row, e) and other need to be implemented, These all were working fine till ListBox had no custom component inside, when ListBoxItem is represented by that custom component It has to forward that events and selection and other things like it should… That is what custom component was missing, But i finally figured it out that how it all work,
ListBox->SelectItemBasedOnModifierKey(row, e.mods) need to be called with proper Boolean tests. Thanks for your reply.
Also I mentioned Complete problem here . . .http://www.rawmaterialsoftware.com/viewtopic.php?f=2&t=8129 . . . and solution too which worked for me.
Also According to selected components in ListBox DragImage is built and implemented startDragAndDrop Method to customize DragDrop also. It all work fine now.
I would like to see ListBox and TableListBox combined into a single abstract class, where ListBox is just a special case of TableListBox with one column (and the header optionally hidden).
Furthermore, there should be a stock Juce TableListBox, but also a native listbox. Specifically, it would be nice to see a TableListBox for iOS that uses UITableListView (or whatever it is called). This would grant all of the correct behaviors for devices. I imagine something similar could be done for android.
I would like to see ListBox and TableListBox combined into a single abstract class, where ListBox is just a special case of TableListBox with one column (and the header optionally hidden).
Furthermore, there should be a stock Juce TableListBox, but also a native listbox. Specifically, it would be nice to see a TableListBox for iOS that uses UITableListView (or whatever it is called). This would grant all of the correct behaviors for devices. I imagine something similar could be done for android.[/quote]
We talked about this in the #Juce IRC channel…it should be easy enough to just make a new set of classes, keep the old one for compatibility, and try to keep the TableListBoxModel the same so switching is as painless as possible.