ListBox & mouse events


#1

Hi,

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


#2

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?


#3

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


#4

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


#5

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.


#6

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


#7

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


#8

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


#9

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

Commit:032aae78ea4ac83f9840ab4dd9599e561158e531
Date: 15/07/2011 15:14:25