diff --git a/Builds/MacOSX/Juce.xcodeproj/project.pbxproj b/Builds/MacOSX/Juce.xcodeproj/project.pbxproj index a6bea333ea..378ea641d6 100644 --- a/Builds/MacOSX/Juce.xcodeproj/project.pbxproj +++ b/Builds/MacOSX/Juce.xcodeproj/project.pbxproj @@ -607,7 +607,6 @@ 1DB68310EA4D6180FF948AA0 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_ProgressBar.h; path = ../../src/gui/components/controls/juce_ProgressBar.h; sourceTree = SOURCE_ROOT; }; 3CE16163A43A6E67428385EE = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_Slider.cpp; path = ../../src/gui/components/controls/juce_Slider.cpp; sourceTree = SOURCE_ROOT; }; E698677EEC8E88CAFF542764 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_Slider.h; path = ../../src/gui/components/controls/juce_Slider.h; sourceTree = SOURCE_ROOT; }; - BBF1D5E94840603712BDB13D = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_SliderListener.h; path = ../../src/gui/components/controls/juce_SliderListener.h; sourceTree = SOURCE_ROOT; }; 6BB68B37C7B0BB4DA8326647 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_TableHeaderComponent.cpp; path = ../../src/gui/components/controls/juce_TableHeaderComponent.cpp; sourceTree = SOURCE_ROOT; }; 1EA844F7CC5377A14B0FD21C = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_TableHeaderComponent.h; path = ../../src/gui/components/controls/juce_TableHeaderComponent.h; sourceTree = SOURCE_ROOT; }; 76E073B2A3F59A3ACD20CC87 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_TableListBox.cpp; path = ../../src/gui/components/controls/juce_TableListBox.cpp; sourceTree = SOURCE_ROOT; }; @@ -1319,7 +1318,6 @@ 1DB68310EA4D6180FF948AA0, 3CE16163A43A6E67428385EE, E698677EEC8E88CAFF542764, - BBF1D5E94840603712BDB13D, 6BB68B37C7B0BB4DA8326647, 1EA844F7CC5377A14B0FD21C, 76E073B2A3F59A3ACD20CC87, diff --git a/Builds/VisualStudio2005/Juce.vcproj b/Builds/VisualStudio2005/Juce.vcproj index b46de99df4..571493081b 100644 --- a/Builds/VisualStudio2005/Juce.vcproj +++ b/Builds/VisualStudio2005/Juce.vcproj @@ -491,7 +491,6 @@ - diff --git a/Builds/VisualStudio2008/Juce.vcproj b/Builds/VisualStudio2008/Juce.vcproj index ae066b98ad..4018c00755 100644 --- a/Builds/VisualStudio2008/Juce.vcproj +++ b/Builds/VisualStudio2008/Juce.vcproj @@ -491,7 +491,6 @@ - diff --git a/Builds/VisualStudio2008_DLL/Juce.vcproj b/Builds/VisualStudio2008_DLL/Juce.vcproj index ab65a18e8d..dc686365fc 100644 --- a/Builds/VisualStudio2008_DLL/Juce.vcproj +++ b/Builds/VisualStudio2008_DLL/Juce.vcproj @@ -493,7 +493,6 @@ - diff --git a/Builds/VisualStudio2010/Juce.vcxproj b/Builds/VisualStudio2010/Juce.vcxproj index fa11c6305f..8a1f04740d 100644 --- a/Builds/VisualStudio2010/Juce.vcxproj +++ b/Builds/VisualStudio2010/Juce.vcxproj @@ -576,7 +576,6 @@ - diff --git a/Builds/VisualStudio2010/Juce.vcxproj.filters b/Builds/VisualStudio2010/Juce.vcxproj.filters index 4c4d1939b8..add560dc15 100644 --- a/Builds/VisualStudio2010/Juce.vcxproj.filters +++ b/Builds/VisualStudio2010/Juce.vcxproj.filters @@ -1650,9 +1650,6 @@ Juce\Source\gui\components\controls - - Juce\Source\gui\components\controls - Juce\Source\gui\components\controls diff --git a/Builds/iPhone/Juce.xcodeproj/project.pbxproj b/Builds/iPhone/Juce.xcodeproj/project.pbxproj index b8fd890b31..12b01bd2a3 100644 --- a/Builds/iPhone/Juce.xcodeproj/project.pbxproj +++ b/Builds/iPhone/Juce.xcodeproj/project.pbxproj @@ -607,7 +607,6 @@ 1DB68310EA4D6180FF948AA0 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_ProgressBar.h; path = ../../src/gui/components/controls/juce_ProgressBar.h; sourceTree = SOURCE_ROOT; }; 3CE16163A43A6E67428385EE = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_Slider.cpp; path = ../../src/gui/components/controls/juce_Slider.cpp; sourceTree = SOURCE_ROOT; }; E698677EEC8E88CAFF542764 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_Slider.h; path = ../../src/gui/components/controls/juce_Slider.h; sourceTree = SOURCE_ROOT; }; - BBF1D5E94840603712BDB13D = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_SliderListener.h; path = ../../src/gui/components/controls/juce_SliderListener.h; sourceTree = SOURCE_ROOT; }; 6BB68B37C7B0BB4DA8326647 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_TableHeaderComponent.cpp; path = ../../src/gui/components/controls/juce_TableHeaderComponent.cpp; sourceTree = SOURCE_ROOT; }; 1EA844F7CC5377A14B0FD21C = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_TableHeaderComponent.h; path = ../../src/gui/components/controls/juce_TableHeaderComponent.h; sourceTree = SOURCE_ROOT; }; 76E073B2A3F59A3ACD20CC87 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_TableListBox.cpp; path = ../../src/gui/components/controls/juce_TableListBox.cpp; sourceTree = SOURCE_ROOT; }; @@ -1319,7 +1318,6 @@ 1DB68310EA4D6180FF948AA0, 3CE16163A43A6E67428385EE, E698677EEC8E88CAFF542764, - BBF1D5E94840603712BDB13D, 6BB68B37C7B0BB4DA8326647, 1EA844F7CC5377A14B0FD21C, 76E073B2A3F59A3ACD20CC87, diff --git a/Juce.jucer b/Juce.jucer index 38f98e70ba..35b401f7b3 100644 --- a/Juce.jucer +++ b/Juce.jucer @@ -619,8 +619,6 @@ file="src/gui/components/controls/juce_Slider.cpp"/> - setValue (ourProcessor->delay, false); } -// This is our SliderListener callback, when the user drags a slider. +// This is our Slider::Listener callback, when the user drags a slider. void JuceDemoPluginAudioProcessorEditor::sliderValueChanged (Slider* slider) { if (slider == gainSlider) diff --git a/extras/audio plugins/demo/Source/PluginEditor.h b/extras/audio plugins/demo/Source/PluginEditor.h index 3e260c0f98..28a1d5e039 100644 --- a/extras/audio plugins/demo/Source/PluginEditor.h +++ b/extras/audio plugins/demo/Source/PluginEditor.h @@ -20,7 +20,7 @@ /** This is the editor component that our filter will display. */ class JuceDemoPluginAudioProcessorEditor : public AudioProcessorEditor, - public SliderListener, + public Slider::Listener, public Timer { public: diff --git a/extras/audio plugins/wrapper/Standalone/juce_StandaloneFilterWindow.h b/extras/audio plugins/wrapper/Standalone/juce_StandaloneFilterWindow.h index d67e5bfce1..8463681b30 100644 --- a/extras/audio plugins/wrapper/Standalone/juce_StandaloneFilterWindow.h +++ b/extras/audio plugins/wrapper/Standalone/juce_StandaloneFilterWindow.h @@ -38,7 +38,7 @@ that the other plugin wrappers use. */ class StandaloneFilterWindow : public DocumentWindow, - public ButtonListener + public Button::Listener { public: //============================================================================== diff --git a/extras/browser plugins/demo/src/JuceBrowserPluginDemo.cpp b/extras/browser plugins/demo/src/JuceBrowserPluginDemo.cpp index 92f56367d1..09fea03f1b 100644 --- a/extras/browser plugins/demo/src/JuceBrowserPluginDemo.cpp +++ b/extras/browser plugins/demo/src/JuceBrowserPluginDemo.cpp @@ -31,7 +31,7 @@ This is our top-level component for our plugin.. */ class JuceDemoBrowserPlugin : public BrowserPluginComponent, - public ButtonListener + public Button::Listener { public: JuceDemoBrowserPlugin() diff --git a/extras/juce demo/Source/demos/AudioDemoPlaybackPage.h b/extras/juce demo/Source/demos/AudioDemoPlaybackPage.h index f622c88090..75080bebd6 100644 --- a/extras/juce demo/Source/demos/AudioDemoPlaybackPage.h +++ b/extras/juce demo/Source/demos/AudioDemoPlaybackPage.h @@ -39,8 +39,8 @@ class DemoThumbnailComp; */ class AudioDemoPlaybackPage : public Component, public FileBrowserListener, - public ButtonListener, - public SliderListener + public Button::Listener, + public Slider::Listener { public: //============================================================================== diff --git a/extras/juce demo/Source/demos/CameraDemo.cpp b/extras/juce demo/Source/demos/CameraDemo.cpp index 6cf056968a..959082d192 100644 --- a/extras/juce demo/Source/demos/CameraDemo.cpp +++ b/extras/juce demo/Source/demos/CameraDemo.cpp @@ -30,9 +30,9 @@ //============================================================================== class CameraDemo : public Component, - public ComboBoxListener, - public ButtonListener, - public CameraImageListener + public ComboBox::Listener, + public Button::Listener, + public CameraDevice::Listener { public: //============================================================================== diff --git a/extras/juce demo/Source/demos/FontsAndTextDemo.cpp b/extras/juce demo/Source/demos/FontsAndTextDemo.cpp index c46f2ef5e1..6ea4211d07 100644 --- a/extras/juce demo/Source/demos/FontsAndTextDemo.cpp +++ b/extras/juce demo/Source/demos/FontsAndTextDemo.cpp @@ -29,8 +29,8 @@ //============================================================================== class FontsAndTextDemo : public Component, public ListBoxModel, - public ButtonListener, - public SliderListener + public Button::Listener, + public Slider::Listener { Array fonts; ListBox* listBox; diff --git a/extras/juce demo/Source/demos/InterprocessCommsDemo.cpp b/extras/juce demo/Source/demos/InterprocessCommsDemo.cpp index 05021fa39e..e6930b0f98 100644 --- a/extras/juce demo/Source/demos/InterprocessCommsDemo.cpp +++ b/extras/juce demo/Source/demos/InterprocessCommsDemo.cpp @@ -28,8 +28,8 @@ //============================================================================== class InterprocessCommsDemo : public Component, - public ButtonListener, - public ComboBoxListener + public Button::Listener, + public ComboBox::Listener { public: //============================================================================== diff --git a/extras/juce demo/Source/demos/RenderingTestComponent.h b/extras/juce demo/Source/demos/RenderingTestComponent.h index 22904876ce..fdd3e205c8 100644 --- a/extras/juce demo/Source/demos/RenderingTestComponent.h +++ b/extras/juce demo/Source/demos/RenderingTestComponent.h @@ -38,8 +38,8 @@ class RenderingTestCanvas; //[/Comments] */ class RenderingTestComponent : public Component, - public ComboBoxListener, - public SliderListener + public ComboBox::Listener, + public Slider::Listener { public: //============================================================================== diff --git a/extras/juce demo/Source/demos/ThreadingDemo.cpp b/extras/juce demo/Source/demos/ThreadingDemo.cpp index 7f24705101..e81bc42f23 100644 --- a/extras/juce demo/Source/demos/ThreadingDemo.cpp +++ b/extras/juce demo/Source/demos/ThreadingDemo.cpp @@ -211,7 +211,7 @@ public: //============================================================================== class ThreadingDemo : public Component, public Timer, - public ButtonListener + public Button::Listener { bool isUsingPool; ThreadPool pool; diff --git a/extras/juce demo/Source/demos/TreeViewDemo.cpp b/extras/juce demo/Source/demos/TreeViewDemo.cpp index 8c2cbb3ea8..5eb23ee041 100644 --- a/extras/juce demo/Source/demos/TreeViewDemo.cpp +++ b/extras/juce demo/Source/demos/TreeViewDemo.cpp @@ -118,7 +118,7 @@ public: //============================================================================== class TreeViewDemo : public Component, public DragAndDropContainer, - public ButtonListener + public Button::Listener { XmlElement* treeXml; diff --git a/extras/juce demo/Source/demos/WebBrowserDemo.cpp b/extras/juce demo/Source/demos/WebBrowserDemo.cpp index 272a2d385a..0fccc8064d 100644 --- a/extras/juce demo/Source/demos/WebBrowserDemo.cpp +++ b/extras/juce demo/Source/demos/WebBrowserDemo.cpp @@ -65,8 +65,8 @@ private: //============================================================================== class WebBrowserDemo : public Component, - public TextEditorListener, - public ButtonListener + public TextEditor::Listener, + public Button::Listener { public: //============================================================================== diff --git a/extras/juce demo/Source/demos/WidgetsDemo.cpp b/extras/juce demo/Source/demos/WidgetsDemo.cpp index 5e5042abe4..463b78cc32 100644 --- a/extras/juce demo/Source/demos/WidgetsDemo.cpp +++ b/extras/juce demo/Source/demos/WidgetsDemo.cpp @@ -477,7 +477,7 @@ static Component* createRadioButtonPage() //============================================================================== class ButtonsPage : public Component, - public ButtonListener + public Button::Listener { public: ButtonsPage (ButtonListener* buttonListener) @@ -643,8 +643,8 @@ static Component* createMiscPage() //============================================================================== class ToolbarDemoComp : public Component, - public SliderListener, - public ButtonListener + public Slider::Listener, + public Button::Listener { public: ToolbarDemoComp() @@ -917,7 +917,7 @@ private: //============================================================================== class DemoTabbedComponent : public TabbedComponent, - public ButtonListener + public Button::Listener { public: DemoTabbedComponent() @@ -1115,7 +1115,7 @@ public: const int numGroups = 4; class WidgetsDemo : public Component, - public ButtonListener + public Button::Listener { TextButton* menuButton; ToggleButton* enableButton; diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index 3405e8fedf..3414f78192 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -41362,7 +41362,7 @@ void Component::takeKeyboardFocus (const FocusChangeType cause) if (peer->isFocused() && currentlyFocusedComponent != this) { - Component* const componentLosingFocus = currentlyFocusedComponent; + SafePointer componentLosingFocus (currentlyFocusedComponent); currentlyFocusedComponent = this; @@ -41370,7 +41370,7 @@ void Component::takeKeyboardFocus (const FocusChangeType cause) // call this after setting currentlyFocusedComponent so that the one that's // losing it has a chance to see where focus is going - if (componentLosingFocus->isValidComponent()) + if (componentLosingFocus != 0) componentLosingFocus->internalFocusLoss (cause); if (currentlyFocusedComponent == this) @@ -41502,11 +41502,12 @@ Component* JUCE_CALLTYPE Component::getCurrentlyFocusedComponent() throw() void Component::giveAwayFocus() { // use a copy so we can clear the value before the call - Component* const componentLosingFocus = currentlyFocusedComponent; + SafePointer componentLosingFocus (currentlyFocusedComponent); + currentlyFocusedComponent = 0; Desktop::getInstance().triggerFocusCallback(); - if (componentLosingFocus->isValidComponent()) + if (componentLosingFocus != 0) componentLosingFocus->internalFocusLoss (focusChangedDirectly); } @@ -42539,12 +42540,12 @@ void Button::handleCommandMessage (int commandId) } } -void Button::addButtonListener (ButtonListener* const newListener) +void Button::addButtonListener (Listener* const newListener) { buttonListeners.add (newListener); } -void Button::removeButtonListener (ButtonListener* const listener) +void Button::removeButtonListener (Listener* const listener) { buttonListeners.remove (listener); } @@ -42565,7 +42566,7 @@ void Button::sendClickMessage (const ModifierKeys& modifiers) clicked (modifiers); if (! checker.shouldBailOut()) - buttonListeners.callChecked (checker, &ButtonListener::buttonClicked, this); + buttonListeners.callChecked (checker, &Listener::buttonClicked, this); } void Button::sendStateMessage() @@ -42575,7 +42576,7 @@ void Button::sendStateMessage() buttonStateChanged(); if (! checker.shouldBailOut()) - buttonListeners.callChecked (checker, &ButtonListener::buttonStateChanged, this); + buttonListeners.callChecked (checker, &Listener::buttonStateChanged, this); } void Button::paint (Graphics& g) @@ -46956,12 +46957,12 @@ void ComboBox::mouseUp (const MouseEvent& e2) } } -void ComboBox::addListener (ComboBoxListener* const listener) throw() +void ComboBox::addListener (Listener* const listener) throw() { listeners.add (listener); } -void ComboBox::removeListener (ComboBoxListener* const listener) throw() +void ComboBox::removeListener (Listener* const listener) throw() { listeners.remove (listener); } @@ -46969,7 +46970,7 @@ void ComboBox::removeListener (ComboBoxListener* const listener) throw() void ComboBox::handleAsyncUpdate() { Component::BailOutChecker checker (this); - listeners.callChecked (checker, &ComboBoxListener::comboBoxChanged, this); + listeners.callChecked (checker, &Listener::comboBoxChanged, this); } END_JUCE_NAMESPACE @@ -47342,12 +47343,12 @@ KeyboardFocusTraverser* Label::createFocusTraverser() return new LabelKeyboardFocusTraverser(); } -void Label::addListener (LabelListener* const listener) throw() +void Label::addListener (Listener* const listener) throw() { listeners.add (listener); } -void Label::removeListener (LabelListener* const listener) throw() +void Label::removeListener (Listener* const listener) throw() { listeners.remove (listener); } @@ -47355,7 +47356,7 @@ void Label::removeListener (LabelListener* const listener) throw() void Label::callChangeListeners() { Component::BailOutChecker checker (this); - listeners.callChecked (checker, &LabelListener::labelTextChanged, this); + listeners.callChecked (checker, &Listener::labelTextChanged, this); } void Label::textEditorTextChanged (TextEditor& ed) @@ -48580,7 +48581,7 @@ void Slider::handleAsyncUpdate() cancelPendingUpdate(); Component::BailOutChecker checker (this); - listeners.callChecked (checker, &SliderListener::sliderValueChanged, this); + listeners.callChecked (checker, &Listener::sliderValueChanged, this); } void Slider::sendDragStart() @@ -48588,7 +48589,7 @@ void Slider::sendDragStart() startedDragging(); Component::BailOutChecker checker (this); - listeners.callChecked (checker, &SliderListener::sliderDragStarted, this); + listeners.callChecked (checker, &Listener::sliderDragStarted, this); } void Slider::sendDragEnd() @@ -48598,15 +48599,15 @@ void Slider::sendDragEnd() sliderBeingDragged = -1; Component::BailOutChecker checker (this); - listeners.callChecked (checker, &SliderListener::sliderDragEnded, this); + listeners.callChecked (checker, &Listener::sliderDragEnded, this); } -void Slider::addListener (SliderListener* const listener) +void Slider::addListener (Listener* const listener) { listeners.add (listener); } -void Slider::removeListener (SliderListener* const listener) +void Slider::removeListener (Listener* const listener) { listeners.remove (listener); } @@ -49836,11 +49837,11 @@ void Slider::mouseWheelMove (const MouseEvent& e, float wheelIncrementX, float w } } -void SliderListener::sliderDragStarted (Slider*) +void Slider::Listener::sliderDragStarted (Slider*) { } -void SliderListener::sliderDragEnded (Slider*) +void Slider::Listener::sliderDragEnded (Slider*) { } @@ -50299,12 +50300,12 @@ void TableHeaderComponent::restoreFromString (const String& storedVersion) } } -void TableHeaderComponent::addListener (TableHeaderListener* const newListener) +void TableHeaderComponent::addListener (Listener* const newListener) { listeners.addIfNotAlreadyThere (newListener); } -void TableHeaderComponent::removeListener (TableHeaderListener* const listenerToRemove) +void TableHeaderComponent::removeListener (Listener* const listenerToRemove) { listeners.removeValue (listenerToRemove); } @@ -50742,7 +50743,7 @@ void TableHeaderComponent::showColumnChooserMenu (const int columnIdClicked) } } -void TableHeaderListener::tableColumnDraggingChanged (TableHeaderComponent*, int) +void TableHeaderComponent::Listener::tableColumnDraggingChanged (TableHeaderComponent*, int) { } @@ -52504,12 +52505,12 @@ void TextEditor::escapePressed() postCommandMessage (TextEditorDefs::escapeKeyMessageId); } -void TextEditor::addListener (TextEditorListener* const newListener) +void TextEditor::addListener (Listener* const newListener) { listeners.add (newListener); } -void TextEditor::removeListener (TextEditorListener* const listenerToRemove) +void TextEditor::removeListener (Listener* const listenerToRemove) { listeners.remove (listenerToRemove); } @@ -53426,19 +53427,19 @@ void TextEditor::handleCommandMessage (const int commandId) switch (commandId) { case TextEditorDefs::textChangeMessageId: - listeners.callChecked (checker, &TextEditorListener::textEditorTextChanged, (TextEditor&) *this); + listeners.callChecked (checker, &Listener::textEditorTextChanged, (TextEditor&) *this); break; case TextEditorDefs::returnKeyMessageId: - listeners.callChecked (checker, &TextEditorListener::textEditorReturnKeyPressed, (TextEditor&) *this); + listeners.callChecked (checker, &Listener::textEditorReturnKeyPressed, (TextEditor&) *this); break; case TextEditorDefs::escapeKeyMessageId: - listeners.callChecked (checker, &TextEditorListener::textEditorEscapeKeyPressed, (TextEditor&) *this); + listeners.callChecked (checker, &Listener::textEditorEscapeKeyPressed, (TextEditor&) *this); break; case TextEditorDefs::focusLossMessageId: - listeners.callChecked (checker, &TextEditorListener::textEditorFocusLost, (TextEditor&) *this); + listeners.callChecked (checker, &Listener::textEditorFocusLost, (TextEditor&) *this); break; default: @@ -53989,7 +53990,7 @@ private: ToolbarSpacerComp& operator= (const ToolbarSpacerComp&); }; -class MissingItemsComponent : public PopupMenuCustomComponent +class Toolbar::MissingItemsComponent : public PopupMenuCustomComponent { public: MissingItemsComponent (Toolbar& owner_, const int height_) @@ -54590,8 +54591,8 @@ private: Toolbar* const toolbar; class CustomiserPanel : public Component, - private ComboBoxListener, - private ButtonListener + private ComboBox::Listener, + private Button::Listener { public: CustomiserPanel (ToolbarItemFactory& factory_, @@ -61949,12 +61950,12 @@ void ScrollBar::setButtonRepeatSpeed (const int initialDelayInMillisecs_, } } -void ScrollBar::addListener (ScrollBarListener* const listener) +void ScrollBar::addListener (Listener* const listener) { listeners.add (listener); } -void ScrollBar::removeListener (ScrollBarListener* const listener) +void ScrollBar::removeListener (Listener* const listener) { listeners.remove (listener); } @@ -61962,7 +61963,7 @@ void ScrollBar::removeListener (ScrollBarListener* const listener) void ScrollBar::handleAsyncUpdate() { double start = visibleRange.getStart(); // (need to use a temp variable for VC7 compatibility) - listeners.call (&ScrollBarListener::scrollBarMoved, this, start); + listeners.call (&Listener::scrollBarMoved, this, start); } void ScrollBar::updateThumbPosition() @@ -67839,12 +67840,12 @@ void MenuBarModel::setApplicationCommandManagerToWatch (ApplicationCommandManage } } -void MenuBarModel::addListener (MenuBarModelListener* const newListener) throw() +void MenuBarModel::addListener (Listener* const newListener) throw() { listeners.add (newListener); } -void MenuBarModel::removeListener (MenuBarModelListener* const listenerToRemove) throw() +void MenuBarModel::removeListener (Listener* const listenerToRemove) throw() { // Trying to remove a listener that isn't on the list! // If this assertion happens because this object is a dangling pointer, make sure you've not @@ -67856,12 +67857,12 @@ void MenuBarModel::removeListener (MenuBarModelListener* const listenerToRemove) void MenuBarModel::handleAsyncUpdate() { - listeners.call (&MenuBarModelListener::menuBarItemsChanged, this); + listeners.call (&Listener::menuBarItemsChanged, this); } void MenuBarModel::applicationCommandInvoked (const ApplicationCommandTarget::InvocationInfo& info) { - listeners.call (&MenuBarModelListener::menuCommandInvoked, this, info); + listeners.call (&Listener::menuCommandInvoked, this, info); } void MenuBarModel::applicationCommandListChanged() @@ -72019,9 +72020,9 @@ private: }; class AudioDeviceSettingsPanel : public Component, - public ComboBoxListener, public ChangeListener, - public ButtonListener + public ComboBox::Listener, + public Button::Listener { public: AudioDeviceSettingsPanel (AudioIODeviceType* type_, @@ -77221,7 +77222,7 @@ END_JUCE_NAMESPACE /*** Start of inlined file: juce_DocumentWindow.cpp ***/ BEGIN_JUCE_NAMESPACE -class DocumentWindow::ButtonListenerProxy : public ButtonListener +class DocumentWindow::ButtonListenerProxy : public Button::Listener { public: ButtonListenerProxy (DocumentWindow& owner_) @@ -252282,7 +252283,7 @@ public: mediaControl->Run(); } - void addListener (CameraImageListener* listenerToAdd) + void addListener (CameraDevice::Listener* listenerToAdd) { const ScopedLock sl (listenerLock); @@ -252292,7 +252293,7 @@ public: listeners.addIfNotAlreadyThere (listenerToAdd); } - void removeListener (CameraImageListener* listenerToRemove) + void removeListener (CameraDevice::Listener* listenerToRemove) { const ScopedLock sl (listenerLock); listeners.removeValue (listenerToRemove); @@ -252307,7 +252308,7 @@ public: for (int i = listeners.size(); --i >= 0;) { - CameraImageListener* const l = listeners[i]; + CameraDevice::Listener* const l = listeners[i]; if (l != 0) l->imageReceived (image); @@ -252586,7 +252587,7 @@ private: }; ComSmartPtr callback; - Array listeners; + Array listeners; CriticalSection listenerLock; DShowCameraDeviceInteral (const DShowCameraDeviceInteral&); @@ -252642,7 +252643,7 @@ void CameraDevice::stopRecording() } } -void CameraDevice::addListener (CameraImageListener* listenerToAdd) +void CameraDevice::addListener (Listener* listenerToAdd) { DShowCameraDeviceInteral* const d = (DShowCameraDeviceInteral*) internal; @@ -252650,7 +252651,7 @@ void CameraDevice::addListener (CameraImageListener* listenerToAdd) d->addListener (listenerToAdd); } -void CameraDevice::removeListener (CameraImageListener* listenerToRemove) +void CameraDevice::removeListener (Listener* listenerToRemove) { DShowCameraDeviceInteral* const d = (DShowCameraDeviceInteral*) internal; @@ -272769,7 +272770,7 @@ using namespace JUCE_NAMESPACE; @end BEGIN_JUCE_NAMESPACE -class JuceMainMenuHandler : private MenuBarModelListener, +class JuceMainMenuHandler : private MenuBarModel::Listener, private DeletedAtShutdown { public: @@ -277376,7 +277377,7 @@ public: } } - void addListener (CameraImageListener* listenerToAdd) + void addListener (CameraDevice::Listener* listenerToAdd) { const ScopedLock sl (listenerLock); @@ -277386,7 +277387,7 @@ public: listeners.addIfNotAlreadyThere (listenerToAdd); } - void removeListener (CameraImageListener* listenerToRemove) + void removeListener (CameraDevice::Listener* listenerToRemove) { const ScopedLock sl (listenerLock); listeners.removeValue (listenerToRemove); @@ -277408,7 +277409,7 @@ public: for (int i = listeners.size(); --i >= 0;) { - CameraImageListener* const l = listeners[i]; + CameraDevice::Listener* const l = listeners[i]; if (l != 0) l->imageReceived (image); @@ -277425,7 +277426,7 @@ public: QTCaptureCallbackDelegate* callbackDelegate; String openingError; - Array listeners; + Array listeners; CriticalSection listenerLock; }; @@ -277599,13 +277600,13 @@ void CameraDevice::stopRecording() } } -void CameraDevice::addListener (CameraImageListener* listenerToAdd) +void CameraDevice::addListener (Listener* listenerToAdd) { if (listenerToAdd != 0) static_cast (internal)->addListener (listenerToAdd); } -void CameraDevice::removeListener (CameraImageListener* listenerToRemove) +void CameraDevice::removeListener (Listener* listenerToRemove) { if (listenerToRemove != 0) static_cast (internal)->removeListener (listenerToRemove); diff --git a/juce_amalgamated.h b/juce_amalgamated.h index ee3a09110a..1c92e77bd3 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -64,7 +64,7 @@ */ #define JUCE_MAJOR_VERSION 1 #define JUCE_MINOR_VERSION 52 -#define JUCE_BUILDNUMBER 41 +#define JUCE_BUILDNUMBER 42 /** Current Juce version number. @@ -34208,26 +34208,6 @@ private: #endif // __JUCE_TOOLTIPWINDOW_JUCEHEADER__ /*** End of inlined file: juce_TooltipWindow.h ***/ -class Button; - -/** - Used to receive callbacks when a button is clicked. - - @see Button::addButtonListener, Button::removeButtonListener -*/ -class JUCE_API ButtonListener -{ -public: - /** Destructor. */ - virtual ~ButtonListener() {} - - /** Called when the button is clicked. */ - virtual void buttonClicked (Button* button) = 0; - - /** Called when the button's state changes. */ - virtual void buttonStateChanged (Button*) {} -}; - /** A base class for buttons. @@ -34358,19 +34338,37 @@ public: */ int getRadioGroupId() const throw() { return radioGroupId; } + /** + Used to receive callbacks when a button is clicked. + + @see Button::addButtonListener, Button::removeButtonListener + */ + class JUCE_API Listener + { + public: + /** Destructor. */ + virtual ~Listener() {} + + /** Called when the button is clicked. */ + virtual void buttonClicked (Button* button) = 0; + + /** Called when the button's state changes. */ + virtual void buttonStateChanged (Button*) {} + }; + /** Registers a listener to receive events when this button's state changes. If the listener is already registered, this will not register it again. @see removeButtonListener */ - void addButtonListener (ButtonListener* newListener); + void addButtonListener (Listener* newListener); /** Removes a previously-registered button listener @see addButtonListener */ - void removeButtonListener (ButtonListener* listener); + void removeButtonListener (Listener* listener); /** Causes the button to act as if it's been clicked. @@ -34625,7 +34623,7 @@ private: Array shortcuts; Component::SafePointer keySource; String text; - ListenerList buttonListeners; + ListenerList buttonListeners; class RepeatTimer; friend class RepeatTimer; @@ -34661,34 +34659,12 @@ private: Button& operator= (const Button&); }; +/** This typedef is just for compatibility with old code - newer code should use Button::Listener instead. */ +typedef Button::Listener ButtonListener; + #endif // __JUCE_BUTTON_JUCEHEADER__ /*** End of inlined file: juce_Button.h ***/ -class ScrollBar; - -/** - A class for receiving events from a ScrollBar. - - You can register a ScrollBarListener with a ScrollBar using the ScrollBar::addListener() - method, and it will be called when the bar's position changes. - - @see ScrollBar::addListener, ScrollBar::removeListener -*/ -class JUCE_API ScrollBarListener -{ -public: - /** Destructor. */ - virtual ~ScrollBarListener() {} - - /** Called when a ScrollBar is moved. - - @param scrollBarThatHasMoved the bar that has moved - @param newRangeStart the new range start of this bar - */ - virtual void scrollBarMoved (ScrollBar* scrollBarThatHasMoved, - double newRangeStart) = 0; -}; - /** A scrollbar component. @@ -34696,7 +34672,7 @@ public: sets the range of values it can represent. Then you can use setCurrentRange() to change the position and size of the scrollbar's 'thumb'. - Registering a ScrollBarListener with the scrollbar will allow you to find out when + Registering a ScrollBar::Listener with the scrollbar will allow you to find out when the user moves it, and you can use the getCurrentRangeStart() to find out where they moved it to. @@ -34706,7 +34682,7 @@ public: For most purposes, it's probably easier to use a ViewportContainer or ListBox instead of handling a scrollbar directly. - @see ScrollBarListener + @see ScrollBar::Listener */ class JUCE_API ScrollBar : public Component, public AsyncUpdater, @@ -34793,7 +34769,7 @@ public: /** Changes the position of the scrollbar's 'thumb'. If this method call actually changes the scrollbar's position, it will trigger an - asynchronous call to ScrollBarListener::scrollBarMoved() for all the listeners that + asynchronous call to ScrollBar::Listener::scrollBarMoved() for all the listeners that are registered. @see getCurrentRange. setCurrentRangeStart @@ -34806,7 +34782,7 @@ public: changing the size, you can use setCurrentRangeStart(). If this method call actually changes the scrollbar's position, it will trigger an - asynchronous call to ScrollBarListener::scrollBarMoved() for all the listeners that + asynchronous call to ScrollBar::Listener::scrollBarMoved() for all the listeners that are registered. @param newStart the top (or left) of the thumb, in the range @@ -34825,7 +34801,7 @@ public: that the maximum thumb start position is (getMaximumRangeLimit() - getCurrentRangeSize()). If this method call actually changes the scrollbar's position, it will trigger an - asynchronous call to ScrollBarListener::scrollBarMoved() for all the listeners that + asynchronous call to ScrollBar::Listener::scrollBarMoved() for all the listeners that are registered. @see setCurrentRange @@ -34911,11 +34887,34 @@ public: trackColourId = 0x1000401 /**< A base colour to use for the slot area of the bar. The look and feel will probably use variations on this colour. */ }; + /** + A class for receiving events from a ScrollBar. + + You can register a ScrollBar::Listener with a ScrollBar using the ScrollBar::addListener() + method, and it will be called when the bar's position changes. + + @see ScrollBar::addListener, ScrollBar::removeListener + */ + class JUCE_API Listener + { + public: + /** Destructor. */ + virtual ~Listener() {} + + /** Called when a ScrollBar is moved. + + @param scrollBarThatHasMoved the bar that has moved + @param newRangeStart the new range start of this bar + */ + virtual void scrollBarMoved (ScrollBar* scrollBarThatHasMoved, + double newRangeStart) = 0; + }; + /** Registers a listener that will be called when the scrollbar is moved. */ - void addListener (ScrollBarListener* listener); + void addListener (Listener* listener); /** Deregisters a previously-registered listener. */ - void removeListener (ScrollBarListener* listener); + void removeListener (Listener* listener); /** @internal */ bool keyPressed (const KeyPress& key); @@ -34949,7 +34948,7 @@ private: class ScrollbarButton; friend class ScopedPointer; ScopedPointer upButton, downButton; - ListenerList listeners; + ListenerList listeners; void updateThumbPosition(); void timerCallback(); @@ -34958,6 +34957,9 @@ private: ScrollBar& operator= (const ScrollBar&); }; +/** This typedef is just for compatibility with old code - newer code should use the ScrollBar::Listener class directly. */ +typedef ScrollBar::Listener ScrollBarListener; + #endif // __JUCE_SCROLLBAR_JUCEHEADER__ /*** End of inlined file: juce_ScrollBar.h ***/ @@ -34975,7 +34977,7 @@ private: */ class JUCE_API Viewport : public Component, private ComponentListener, - private ScrollBarListener + private ScrollBar::Listener { public: @@ -35623,39 +35625,13 @@ public: #endif // __JUCE_TEXTINPUTTARGET_JUCEHEADER__ /*** End of inlined file: juce_TextInputTarget.h ***/ -class TextEditor; - -/** - Receives callbacks from a TextEditor component when it changes. - - @see TextEditor::addListener -*/ -class JUCE_API TextEditorListener -{ -public: - /** Destructor. */ - virtual ~TextEditorListener() {} - - /** Called when the user changes the text in some way. */ - virtual void textEditorTextChanged (TextEditor& editor) = 0; - - /** Called when the user presses the return key. */ - virtual void textEditorReturnKeyPressed (TextEditor& editor) = 0; - - /** Called when the user presses the escape key. */ - virtual void textEditorEscapeKeyPressed (TextEditor& editor) = 0; - - /** Called when the text editor loses focus. */ - virtual void textEditorFocusLost (TextEditor& editor) = 0; -}; - /** A component containing text that can be edited. A TextEditor can either be in single- or multi-line mode, and supports mixed fonts and colours. - @see TextEditorListener, Label + @see TextEditor::Listener, Label */ class JUCE_API TextEditor : public Component, public TextInputTarget, @@ -35699,7 +35675,7 @@ public: /** Changes the behaviour of the return key. If set to true, the return key will insert a new-line into the text; if false - it will trigger a call to the TextEditorListener::textEditorReturnKeyPressed() + it will trigger a call to the TextEditor::Listener::textEditorReturnKeyPressed() method. By default this is set to false, and when true it will only insert new-lines when in multi-line mode (see setMultiLine()). */ @@ -35899,17 +35875,41 @@ public: */ void setScrollBarButtonVisibility (bool buttonsVisible); + /** + Receives callbacks from a TextEditor component when it changes. + + @see TextEditor::addListener + */ + class JUCE_API Listener + { + public: + /** Destructor. */ + virtual ~Listener() {} + + /** Called when the user changes the text in some way. */ + virtual void textEditorTextChanged (TextEditor& editor) = 0; + + /** Called when the user presses the return key. */ + virtual void textEditorReturnKeyPressed (TextEditor& editor) = 0; + + /** Called when the user presses the escape key. */ + virtual void textEditorEscapeKeyPressed (TextEditor& editor) = 0; + + /** Called when the text editor loses focus. */ + virtual void textEditorFocusLost (TextEditor& editor) = 0; + }; + /** Registers a listener to be told when things happen to the text. @see removeListener */ - void addListener (TextEditorListener* newListener); + void addListener (Listener* newListener); /** Deregisters a listener. @see addListener */ - void removeListener (TextEditorListener* listenerToRemove); + void removeListener (Listener* listenerToRemove); /** Returns the entire contents of the editor. */ const String getText() const; @@ -36227,7 +36227,7 @@ private: } dragType; String allowedCharacters; - ListenerList listeners; + ListenerList listeners; void coalesceSimilarSections(); void splitSection (int sectionIndex, int charToSplitAt); @@ -36257,39 +36257,19 @@ private: TextEditor& operator= (const TextEditor&); }; +/** This typedef is just for compatibility with old code - newer code should use the TextEditor::Listener class directly. */ +typedef TextEditor::Listener TextEditorListener; + #endif // __JUCE_TEXTEDITOR_JUCEHEADER__ /*** End of inlined file: juce_TextEditor.h ***/ -class Label; - -/** - A class for receiving events from a Label. - - You can register a LabelListener with a Label using the Label::addListener() - method, and it will be called when the text of the label changes, either because - of a call to Label::setText() or by the user editing the text (if the label is - editable). - - @see Label::addListener, Label::removeListener -*/ -class JUCE_API LabelListener -{ -public: - /** Destructor. */ - virtual ~LabelListener() {} - - /** Called when a Label's text has changed. - */ - virtual void labelTextChanged (Label* labelThatHasChanged) = 0; -}; - /** A component that displays a text string, and can optionally become a text editor when clicked. */ class JUCE_API Label : public Component, public SettableTooltipClient, - protected TextEditorListener, + protected TextEditor::Listener, private ComponentListener, private Value::Listener { @@ -36309,11 +36289,10 @@ public: /** Changes the label text. If broadcastChangeMessage is true and the new text is different to the current - text, then the class will broadcast a change message to any LabelListeners that - are registered. + text, then the class will broadcast a change message to any Label::Listener objects + that are registered. */ - void setText (const String& newText, - bool broadcastChangeMessage); + void setText (const String& newText, bool broadcastChangeMessage); /** Returns the label's current text. @@ -36419,11 +36398,32 @@ public: float getMinimumHorizontalScale() const throw() { return minimumHorizontalScale; } + /** + A class for receiving events from a Label. + + You can register a Label::Listener with a Label using the Label::addListener() + method, and it will be called when the text of the label changes, either because + of a call to Label::setText() or by the user editing the text (if the label is + editable). + + @see Label::addListener, Label::removeListener + */ + class JUCE_API Listener + { + public: + /** Destructor. */ + virtual ~Listener() {} + + /** Called when a Label's text has changed. + */ + virtual void labelTextChanged (Label* labelThatHasChanged) = 0; + }; + /** Registers a listener that will be called when the label's text changes. */ - void addListener (LabelListener* listener) throw(); + void addListener (Listener* listener) throw(); /** Deregisters a previously-registered listener. */ - void removeListener (LabelListener* listener) throw(); + void removeListener (Listener* listener) throw(); /** Makes the label turn into a TextEditor when clicked. @@ -36484,26 +36484,20 @@ public: protected: /** Creates the TextEditor component that will be used when the user has clicked on the label. - Subclasses can override this if they need to customise this component in some way. */ virtual TextEditor* createEditorComponent(); - /** Called after the user changes the text. - */ + /** Called after the user changes the text. */ virtual void textWasEdited(); - /** Called when the text has been altered. - */ + /** Called when the text has been altered. */ virtual void textWasChanged(); - /** Called when the text editor has just appeared, due to a user click or other - focus change. - */ + /** Called when the text editor has just appeared, due to a user click or other focus change. */ virtual void editorShown (TextEditor* editorComponent); - /** Called when the text editor is going to be deleted, after editing has finished. - */ + /** Called when the text editor is going to be deleted, after editing has finished. */ virtual void editorAboutToBeHidden (TextEditor* editorComponent); /** @internal */ @@ -36547,7 +36541,7 @@ private: Font font; Justification justification; ScopedPointer editor; - ListenerList listeners; + ListenerList listeners; Component::SafePointer ownerComponent; int horizontalBorderSize, verticalBorderSize; float minimumHorizontalScale; @@ -36563,30 +36557,12 @@ private: Label& operator= (const Label&); }; +/** This typedef is just for compatibility with old code - newer code should use the Label::Listener class directly. */ +typedef Label::Listener LabelListener; + #endif // __JUCE_LABEL_JUCEHEADER__ /*** End of inlined file: juce_Label.h ***/ -class ComboBox; - -/** - A class for receiving events from a ComboBox. - - You can register a ComboBoxListener with a ComboBox using the ComboBox::addListener() - method, and it will be called when the selected item in the box changes. - - @see ComboBox::addListener, ComboBox::removeListener -*/ -class JUCE_API ComboBoxListener -{ -public: - /** Destructor. */ - virtual ~ComboBoxListener() {} - - /** Called when a ComboBox has its selected item changed. - */ - virtual void comboBoxChanged (ComboBox* comboBoxThatHasChanged) = 0; -}; - /** A component that lets the user choose from a drop-down list of choices. @@ -36597,14 +36573,14 @@ public: either be read-only text, or editable. To find out when the user selects a different item or edits the text, you - can register a ComboBoxListener to receive callbacks. + can register a ComboBox::Listener to receive callbacks. - @see ComboBoxListener + @see ComboBox::Listener */ class JUCE_API ComboBox : public Component, public SettableTooltipClient, - private LabelListener, private AsyncUpdater, + private Label::Listener, private Value::Listener { public: @@ -36813,11 +36789,29 @@ public: /** Pops up the combo box's list. */ void showPopup(); + /** + A class for receiving events from a ComboBox. + + You can register a ComboBox::Listener with a ComboBox using the ComboBox::addListener() + method, and it will be called when the selected item in the box changes. + + @see ComboBox::addListener, ComboBox::removeListener + */ + class JUCE_API Listener + { + public: + /** Destructor. */ + virtual ~Listener() {} + + /** Called when a ComboBox has its selected item changed. */ + virtual void comboBoxChanged (ComboBox* comboBoxThatHasChanged) = 0; + }; + /** Registers a listener that will be called when the box's content changes. */ - void addListener (ComboBoxListener* listener) throw(); + void addListener (Listener* listener) throw(); /** Deregisters a previously-registered listener. */ - void removeListener (ComboBoxListener* listener) throw(); + void removeListener (Listener* listener) throw(); /** Sets a message to display when there is no item currently selected. @@ -36918,7 +36912,7 @@ private: Value currentId; int lastCurrentId; bool isButtonDown, separatorPending, menuActive, textIsCustom; - ListenerList listeners; + ListenerList listeners; ScopedPointer