mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-11 23:54:18 +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
|
|
@ -305,32 +305,22 @@ ApplicationCommandTarget* ApplicationCommandManager::findDefaultComponentTarget(
|
|||
//==============================================================================
|
||||
void ApplicationCommandManager::addListener (ApplicationCommandManagerListener* const listener) throw()
|
||||
{
|
||||
jassert (listener != 0);
|
||||
if (listener != 0)
|
||||
listeners.add (listener);
|
||||
listeners.add (listener);
|
||||
}
|
||||
|
||||
void ApplicationCommandManager::removeListener (ApplicationCommandManagerListener* const listener) throw()
|
||||
{
|
||||
listeners.removeValue (listener);
|
||||
listeners.remove (listener);
|
||||
}
|
||||
|
||||
void ApplicationCommandManager::sendListenerInvokeCallback (const ApplicationCommandTarget::InvocationInfo& info) const
|
||||
void ApplicationCommandManager::sendListenerInvokeCallback (const ApplicationCommandTarget::InvocationInfo& info)
|
||||
{
|
||||
for (int i = listeners.size(); --i >= 0;)
|
||||
{
|
||||
((ApplicationCommandManagerListener*) listeners.getUnchecked (i))->applicationCommandInvoked (info);
|
||||
i = jmin (i, listeners.size());
|
||||
}
|
||||
listeners.call (&ApplicationCommandManagerListener::applicationCommandInvoked, info);
|
||||
}
|
||||
|
||||
void ApplicationCommandManager::handleAsyncUpdate()
|
||||
{
|
||||
for (int i = listeners.size(); --i >= 0;)
|
||||
{
|
||||
((ApplicationCommandManagerListener*) listeners.getUnchecked (i))->applicationCommandListChanged();
|
||||
i = jmin (i, listeners.size());
|
||||
}
|
||||
listeners.call (&ApplicationCommandManagerListener::applicationCommandListChanged);
|
||||
}
|
||||
|
||||
void ApplicationCommandManager::globalFocusChanged (Component*)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue