mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-21 01:24:21 +00:00
Added ListenerList class and changed some components to use it for their listener dispatching. Sorted out bug in popup menus and win32 mouse wheel.
This commit is contained in:
parent
b974203d0f
commit
2676bb02f2
42 changed files with 1815 additions and 1867 deletions
|
|
@ -605,23 +605,18 @@ void ComboBox::mouseUp (const MouseEvent& e2)
|
|||
//==============================================================================
|
||||
void ComboBox::addListener (ComboBoxListener* const listener) throw()
|
||||
{
|
||||
jassert (listener != 0);
|
||||
if (listener != 0)
|
||||
listeners.add (listener);
|
||||
listeners.add (listener);
|
||||
}
|
||||
|
||||
void ComboBox::removeListener (ComboBoxListener* const listener) throw()
|
||||
{
|
||||
listeners.removeValue (listener);
|
||||
listeners.remove (listener);
|
||||
}
|
||||
|
||||
void ComboBox::handleAsyncUpdate()
|
||||
{
|
||||
for (int i = listeners.size(); --i >= 0;)
|
||||
{
|
||||
((ComboBoxListener*) listeners.getUnchecked (i))->comboBoxChanged (this);
|
||||
i = jmin (i, listeners.size());
|
||||
}
|
||||
Component::BailOutChecker checker (this);
|
||||
listeners.callChecked (checker, &ComboBoxListener::comboBoxChanged, this);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue