ListBox & mouse events


I think there is a problem with management of mouse events in ListBox.
Indeed, they are not taking in account the enabled state and if they are blocked by another modal component.
When I double clicked on a disabled ListBox, backgroundClicked() action is done, and if there is a modal window (DialogWindow) opened, action is also called.
Is this comportment is normal ?

Best regards

It won’t take into account the enabled state - that’s just a flag that you can use in your own component to decide whether to respond. But it should certainly not respond when there’s a modal component - are you sure the window is actually in a modal state?

Absolutely, window is opened using DialogWindow::showModalDialog()
And so, when ListBox is set as disabled, it calls ::mouseUp() on mouse click is OK ? weird…

Odd… Can you give me some code to reproduce it?

Sorry but I cannot currently give you some code.
In place, I can give you global architecture of how to reproduce it :

  • Create a DocumentWindow with a ListBox component, set it as disabled
  • Click in background of ListBox (odd point, weird comportment IMO) to popup up a DialogWindow set as modal (use of showModalDialog())
  • Click in background of ListBox whereas current modal window is at top of all -> another DialogWindow appears.

Is this sufficient to be understood ?
Sorry about not giving you some source code, I am in hurry and cannot give you my current code.

Are you starting your modal component during a mouseDown() callback? If so, it’ll deliver the corresponding mouseUp before blocking further events.

No, modal dialogs are opened in listBoxItemDoubleClicked() and backgroundClicked() functions

ok, and are you using the very latest version? I fixed something that might affect this only last week…

Hi, sorry for the late…
Yes, I am up to date, using Juce from GIT repository.

Date: 15/07/2011 15:14:25