mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-03 03:30:06 +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
|
|
@ -239,24 +239,18 @@ void FilenameComponent::addRecentlyUsedFile (const File& file)
|
|||
//==============================================================================
|
||||
void FilenameComponent::addListener (FilenameComponentListener* const listener) throw()
|
||||
{
|
||||
jassert (listener != 0);
|
||||
|
||||
if (listener != 0)
|
||||
listeners.add (listener);
|
||||
listeners.add (listener);
|
||||
}
|
||||
|
||||
void FilenameComponent::removeListener (FilenameComponentListener* const listener) throw()
|
||||
{
|
||||
listeners.removeValue (listener);
|
||||
listeners.remove (listener);
|
||||
}
|
||||
|
||||
void FilenameComponent::handleAsyncUpdate()
|
||||
{
|
||||
for (int i = listeners.size(); --i >= 0;)
|
||||
{
|
||||
((FilenameComponentListener*) listeners.getUnchecked (i))->filenameComponentChanged (this);
|
||||
i = jmin (i, listeners.size());
|
||||
}
|
||||
Component::BailOutChecker checker (this);
|
||||
listeners.callChecked (checker, &FilenameComponentListener::filenameComponentChanged, this);
|
||||
}
|
||||
|
||||
END_JUCE_NAMESPACE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue