diff --git a/extras/Demo/Source/Demos/AudioLatencyDemo.cpp b/extras/Demo/Source/Demos/AudioLatencyDemo.cpp index 1912d833a8..8a26d6f7fd 100644 --- a/extras/Demo/Source/Demos/AudioLatencyDemo.cpp +++ b/extras/Demo/Source/Demos/AudioLatencyDemo.cpp @@ -302,7 +302,7 @@ public: addAndMakeVisible (liveAudioScroller = new LiveScrollingAudioDisplay()); - addAndMakeVisible (&resultsBox); + addAndMakeVisible (resultsBox); resultsBox.setMultiLine (true); resultsBox.setReturnKeyStartsNewLine (true); resultsBox.setReadOnly (true); @@ -318,7 +318,7 @@ public: "back at the audio input. Obviously for this to work you need to have your " "microphone somewhere near your speakers..."); - addAndMakeVisible (&startTestButton); + addAndMakeVisible (startTestButton); startTestButton.addListener (this); startTestButton.setButtonText ("Test Latency"); diff --git a/extras/Demo/Source/Demos/AudioPlaybackDemo.cpp b/extras/Demo/Source/Demos/AudioPlaybackDemo.cpp index a262878ed6..2738d8c496 100644 --- a/extras/Demo/Source/Demos/AudioPlaybackDemo.cpp +++ b/extras/Demo/Source/Demos/AudioPlaybackDemo.cpp @@ -46,13 +46,13 @@ public: { thumbnail.addChangeListener (this); - addAndMakeVisible (&scrollbar); + addAndMakeVisible (scrollbar); scrollbar.setRangeLimits (visibleRange); scrollbar.setAutoHide (false); scrollbar.addListener (this); currentPositionMarker.setFill (Colours::white.withAlpha (0.85f)); - addAndMakeVisible (¤tPositionMarker); + addAndMakeVisible (currentPositionMarker); } ~DemoThumbnailComp() @@ -240,7 +240,7 @@ public: directoryList (nullptr, thread), fileTreeComp (directoryList) { - addAndMakeVisible (&zoomLabel); + addAndMakeVisible (zoomLabel); zoomLabel.setText ("zoom:", dontSendNotification); zoomLabel.setFont (Font (15.00f, Font::plain)); zoomLabel.setJustificationType (Justification::centredRight); @@ -248,11 +248,11 @@ public: zoomLabel.setColour (TextEditor::textColourId, Colours::black); zoomLabel.setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - addAndMakeVisible (&followTransportButton); + addAndMakeVisible (followTransportButton); followTransportButton.setButtonText ("Follow Transport"); followTransportButton.addListener (this); - addAndMakeVisible (&explanation); + addAndMakeVisible (explanation); explanation.setText ("Select an audio file in the treeview above, and this page will display its waveform, and let you play it..", dontSendNotification); explanation.setFont (Font (14.00f, Font::plain)); explanation.setJustificationType (Justification::bottomRight); @@ -260,7 +260,7 @@ public: explanation.setColour (TextEditor::textColourId, Colours::black); explanation.setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - addAndMakeVisible (&zoomSlider); + addAndMakeVisible (zoomSlider); zoomSlider.setRange (0, 1, 0); zoomSlider.setSliderStyle (Slider::LinearHorizontal); zoomSlider.setTextBoxStyle (Slider::NoTextBox, false, 80, 20); @@ -270,12 +270,12 @@ public: addAndMakeVisible (thumbnail = new DemoThumbnailComp (formatManager, transportSource, zoomSlider)); thumbnail->addChangeListener (this); - addAndMakeVisible (&startStopButton); + addAndMakeVisible (startStopButton); startStopButton.setButtonText ("Play/Stop"); startStopButton.addListener (this); startStopButton.setColour (TextButton::buttonColourId, Colour (0xff79ed7f)); - addAndMakeVisible (&fileTreeComp); + addAndMakeVisible (fileTreeComp); // audio setup formatManager.registerBasicFormats(); diff --git a/extras/Demo/Source/Demos/AudioRecordingDemo.cpp b/extras/Demo/Source/Demos/AudioRecordingDemo.cpp index 2255bc91a7..f7c2c3c4fd 100644 --- a/extras/Demo/Source/Demos/AudioRecordingDemo.cpp +++ b/extras/Demo/Source/Demos/AudioRecordingDemo.cpp @@ -218,9 +218,9 @@ public: recorder (recordingThumbnail.getAudioThumbnail()) { setOpaque (true); - addAndMakeVisible (&liveAudioScroller); + addAndMakeVisible (liveAudioScroller); - addAndMakeVisible (&explanationLabel); + addAndMakeVisible (explanationLabel); explanationLabel.setText ("This page demonstrates how to record a wave file from the live audio input..\n\nPressing record will start recording a file in your \"Documents\" folder.", dontSendNotification); explanationLabel.setFont (Font (15.00f, Font::plain)); explanationLabel.setJustificationType (Justification::topLeft); @@ -228,13 +228,13 @@ public: explanationLabel.setColour (TextEditor::textColourId, Colours::black); explanationLabel.setColour (TextEditor::backgroundColourId, Colour (0x00000000)); - addAndMakeVisible (&recordButton); + addAndMakeVisible (recordButton); recordButton.setButtonText ("Record"); recordButton.addListener (this); recordButton.setColour (TextButton::buttonColourId, Colour (0xffff5c5c)); recordButton.setColour (TextButton::textColourOnId, Colours::black); - addAndMakeVisible (&recordingThumbnail); + addAndMakeVisible (recordingThumbnail); deviceManager.addAudioCallback (&liveAudioScroller); deviceManager.addAudioCallback (&recorder); diff --git a/extras/Demo/Source/Demos/AudioSettingsDemo.cpp b/extras/Demo/Source/Demos/AudioSettingsDemo.cpp index b96e5736c5..067f687cd9 100644 --- a/extras/Demo/Source/Demos/AudioSettingsDemo.cpp +++ b/extras/Demo/Source/Demos/AudioSettingsDemo.cpp @@ -38,7 +38,7 @@ public: = new AudioDeviceSelectorComponent (MainAppWindow::getSharedAudioDeviceManager(), 0, 256, 0, 256, true, true, true, false)); - addAndMakeVisible (&diagnosticsBox); + addAndMakeVisible (diagnosticsBox); diagnosticsBox.setMultiLine (true); diagnosticsBox.setReturnKeyStartsNewLine (true); diagnosticsBox.setReadOnly (true); diff --git a/extras/Demo/Source/Demos/AudioSynthesiserDemo.cpp b/extras/Demo/Source/Demos/AudioSynthesiserDemo.cpp index 1ab981363e..d5124519fa 100644 --- a/extras/Demo/Source/Demos/AudioSynthesiserDemo.cpp +++ b/extras/Demo/Source/Demos/AudioSynthesiserDemo.cpp @@ -241,20 +241,20 @@ public: synthAudioSource (keyboardState), keyboardComponent (keyboardState, MidiKeyboardComponent::horizontalKeyboard) { - addAndMakeVisible (&keyboardComponent); + addAndMakeVisible (keyboardComponent); - addAndMakeVisible (&sineButton); + addAndMakeVisible (sineButton); sineButton.setButtonText ("Use sine wave"); sineButton.setRadioGroupId (321); sineButton.addListener (this); sineButton.setToggleState (true, dontSendNotification); - addAndMakeVisible (&sampledButton); + addAndMakeVisible (sampledButton); sampledButton.setButtonText ("Use sampled sound"); sampledButton.setRadioGroupId (321); sampledButton.addListener (this); - addAndMakeVisible (&liveAudioDisplayComp); + addAndMakeVisible (liveAudioDisplayComp); deviceManager.addAudioCallback (&liveAudioDisplayComp); diff --git a/extras/Demo/Source/Demos/Box2DDemo.cpp b/extras/Demo/Source/Demos/Box2DDemo.cpp index f98954f493..2f346f10dd 100644 --- a/extras/Demo/Source/Demos/Box2DDemo.cpp +++ b/extras/Demo/Source/Demos/Box2DDemo.cpp @@ -178,14 +178,14 @@ public: testsListModel.addChangeListener (this); - addAndMakeVisible (&renderComponent); + addAndMakeVisible (renderComponent); - addAndMakeVisible (&testsListBox); + addAndMakeVisible (testsListBox); testsListBox.setModel (&testsListModel); testsListBox.selectRow (dominoes); testsListBox.setColour (ListBox::backgroundColourId, Colours::lightgrey); - addAndMakeVisible (&instructions); + addAndMakeVisible (instructions); instructions.setMultiLine (true); instructions.setReadOnly (true); instructions.setColour (TextEditor::backgroundColourId, Colours::lightgrey); diff --git a/extras/Demo/Source/Demos/CameraDemo.cpp b/extras/Demo/Source/Demos/CameraDemo.cpp index 321059d543..7369460a9d 100644 --- a/extras/Demo/Source/Demos/CameraDemo.cpp +++ b/extras/Demo/Source/Demos/CameraDemo.cpp @@ -43,20 +43,20 @@ public: { setOpaque (true); - addAndMakeVisible (&cameraSelectorComboBox); + addAndMakeVisible (cameraSelectorComboBox); updateCameraList(); cameraSelectorComboBox.setSelectedId (1); cameraSelectorComboBox.addListener (this); - addAndMakeVisible (&snapshotButton); + addAndMakeVisible (snapshotButton); snapshotButton.addListener (this); snapshotButton.setEnabled (false); - addAndMakeVisible (&recordMovieButton); + addAndMakeVisible (recordMovieButton); recordMovieButton.addListener (this); recordMovieButton.setEnabled (false); - addAndMakeVisible (&lastSnapshot); + addAndMakeVisible (lastSnapshot); cameraSelectorComboBox.setSelectedId (2); } diff --git a/extras/Demo/Source/Demos/CodeEditorDemo.cpp b/extras/Demo/Source/Demos/CodeEditorDemo.cpp index 24bbfffec4..54593471af 100644 --- a/extras/Demo/Source/Demos/CodeEditorDemo.cpp +++ b/extras/Demo/Source/Demos/CodeEditorDemo.cpp @@ -51,7 +51,7 @@ public: "\n"); // Create a file chooser control to load files into it.. - addAndMakeVisible (&fileChooser); + addAndMakeVisible (fileChooser); fileChooser.addListener (this); } diff --git a/extras/Demo/Source/Demos/CryptographyDemo.cpp b/extras/Demo/Source/Demos/CryptographyDemo.cpp index a3bc2efbc1..833ca8422f 100644 --- a/extras/Demo/Source/Demos/CryptographyDemo.cpp +++ b/extras/Demo/Source/Demos/CryptographyDemo.cpp @@ -32,7 +32,7 @@ class RSAComponent : public Component, public: RSAComponent() { - addAndMakeVisible (&rsaGroup); + addAndMakeVisible (rsaGroup); rsaGroup.setText ("RSA Encryption"); rsaGroup.setColour (GroupComponent::outlineColourId, Colours::darkgrey); rsaGroup.setColour (GroupComponent::textColourId, Colours::black); @@ -40,14 +40,14 @@ public: bitSizeLabel.setText ("Num Bits to Use:", dontSendNotification); bitSizeLabel.attachToComponent (&bitSize, true); - addAndMakeVisible (&bitSize); + addAndMakeVisible (bitSize); bitSize.setText (String (256)); - addAndMakeVisible (&generateRSAButton); + addAndMakeVisible (generateRSAButton); generateRSAButton.setButtonText ("Generate RSA"); generateRSAButton.addListener (this); - addAndMakeVisible (&rsaResultBox); + addAndMakeVisible (rsaResultBox); rsaResultBox.setColour (TextEditor::backgroundColourId, Colours::white.withAlpha (0.5f)); rsaResultBox.setReadOnly (true); rsaResultBox.setMultiLine (true); @@ -122,12 +122,12 @@ class HashesComponent : public Component, public: HashesComponent() { - addAndMakeVisible (&hashGroup); + addAndMakeVisible (hashGroup); hashGroup.setText ("Hashes"); hashGroup.setColour (GroupComponent::outlineColourId, Colours::darkgrey); hashGroup.setColour (GroupComponent::textColourId, Colours::black); - addAndMakeVisible (&hashEntryBox); + addAndMakeVisible (hashEntryBox); hashEntryBox.setMultiLine (true); hashEntryBox.setColour (TextEditor::backgroundColourId, Colours::white.withAlpha (0.5f)); @@ -143,8 +143,8 @@ public: hashLabel2.attachToComponent (&md5Result, true); hashLabel3.attachToComponent (&shaResult, true); - addAndMakeVisible (&md5Result); - addAndMakeVisible (&shaResult); + addAndMakeVisible (md5Result); + addAndMakeVisible (shaResult); updateHashes(); } @@ -220,8 +220,8 @@ class CryptographyDemo : public Component public: CryptographyDemo() { - addAndMakeVisible (&rsaDemo); - addAndMakeVisible (&hashDemo); + addAndMakeVisible (rsaDemo); + addAndMakeVisible (hashDemo); } void paint (Graphics& g) override diff --git a/extras/Demo/Source/Demos/DialogsDemo.cpp b/extras/Demo/Source/Demos/DialogsDemo.cpp index 525d329d90..e8d6bdb4a1 100644 --- a/extras/Demo/Source/Demos/DialogsDemo.cpp +++ b/extras/Demo/Source/Demos/DialogsDemo.cpp @@ -91,7 +91,7 @@ public: { setOpaque (true); - addAndMakeVisible (&nativeButton); + addAndMakeVisible (nativeButton); nativeButton.setButtonText ("Use Native Windows"); nativeButton.addListener (this); @@ -112,7 +112,7 @@ public: }; // warn in case we add any windows - jassert (numElementsInArray(windowNames) == numDialogs); + jassert (numElementsInArray (windowNames) == numDialogs); for (int i = 0; i < numDialogs; ++i) { diff --git a/extras/Demo/Source/Demos/FontsDemo.cpp b/extras/Demo/Source/Demos/FontsDemo.cpp index 791a880bdb..44909272c5 100644 --- a/extras/Demo/Source/Demos/FontsDemo.cpp +++ b/extras/Demo/Source/Demos/FontsDemo.cpp @@ -44,17 +44,17 @@ public: { setOpaque (true); - addAndMakeVisible (&listBox); - addAndMakeVisible (&demoTextBox); - addAndMakeVisible (&heightSlider); - addAndMakeVisible (&heightLabel); - addAndMakeVisible (&kerningLabel); - addAndMakeVisible (&kerningSlider); - addAndMakeVisible (&scaleLabel); - addAndMakeVisible (&scaleSlider); - addAndMakeVisible (&boldToggle); - addAndMakeVisible (&italicToggle); - addAndMakeVisible (&styleBox); + addAndMakeVisible (listBox); + addAndMakeVisible (demoTextBox); + addAndMakeVisible (heightSlider); + addAndMakeVisible (heightLabel); + addAndMakeVisible (kerningLabel); + addAndMakeVisible (kerningSlider); + addAndMakeVisible (scaleLabel); + addAndMakeVisible (scaleSlider); + addAndMakeVisible (boldToggle); + addAndMakeVisible (italicToggle); + addAndMakeVisible (styleBox); kerningLabel.attachToComponent (&kerningSlider, true); heightLabel.attachToComponent (&heightSlider, true); diff --git a/extras/Demo/Source/Demos/GraphicsDemo.cpp b/extras/Demo/Source/Demos/GraphicsDemo.cpp index 53ff2dd52e..8e20d1f2f5 100644 --- a/extras/Demo/Source/Demos/GraphicsDemo.cpp +++ b/extras/Demo/Source/Demos/GraphicsDemo.cpp @@ -77,7 +77,7 @@ public: void initialiseToggle (ToggleButton& b, const char* name, bool on) { - addAndMakeVisible (&b); + addAndMakeVisible (b); b.setButtonText (name); b.setToggleState (on, dontSendNotification); } @@ -627,7 +627,7 @@ public: demos.add (new SVGDemo (controls)); demos.add (new LinesDemo (controls)); - addAndMakeVisible (&listBox); + addAndMakeVisible (listBox); listBox.setModel (this); listBox.selectRow (0); listBox.setColour (ListBox::backgroundColourId, Colour::greyLevel (0.9f)); @@ -680,10 +680,10 @@ public: { setOpaque (true); - addAndMakeVisible (&demoHolder); - addAndMakeVisible (&controllersComponent); - addAndMakeVisible (&performanceDisplay); - addAndMakeVisible (&testList); + addAndMakeVisible (demoHolder); + addAndMakeVisible (controllersComponent); + addAndMakeVisible (performanceDisplay); + addAndMakeVisible (testList); } void paint (Graphics& g) diff --git a/extras/Demo/Source/Demos/ImagesDemo.cpp b/extras/Demo/Source/Demos/ImagesDemo.cpp index 74b1d93943..d3e8ef7b96 100644 --- a/extras/Demo/Source/Demos/ImagesDemo.cpp +++ b/extras/Demo/Source/Demos/ImagesDemo.cpp @@ -43,11 +43,11 @@ public: fileTree.addListener (this); fileTree.setColour (TreeView::backgroundColourId, Colours::lightgrey.withAlpha (0.6f)); - addAndMakeVisible (&fileTree); + addAndMakeVisible (fileTree); - addAndMakeVisible (&resizerBar); + addAndMakeVisible (resizerBar); - addAndMakeVisible (&imagePreview); + addAndMakeVisible (imagePreview); // we have to set up our StretchableLayoutManager so it know the limits and preferred sizes of it's contents stretchableManager.setItemLayout (0, // for the fileTree diff --git a/extras/Demo/Source/Demos/JavaScript.cpp b/extras/Demo/Source/Demos/JavaScript.cpp index 36d085a5ef..07bcc528ef 100644 --- a/extras/Demo/Source/Demos/JavaScript.cpp +++ b/extras/Demo/Source/Demos/JavaScript.cpp @@ -44,7 +44,7 @@ public: outputDisplay.setReadOnly (true); outputDisplay.setCaretVisible (false); outputDisplay.setFont (Font (Font::getDefaultMonospacedFontName(), 14.0f, Font::plain)); - addAndMakeVisible (&outputDisplay); + addAndMakeVisible (outputDisplay); codeDocument.addListener (this); diff --git a/extras/Demo/Source/Demos/KeyMappingsDemo.cpp b/extras/Demo/Source/Demos/KeyMappingsDemo.cpp index c825438237..b446d1610a 100644 --- a/extras/Demo/Source/Demos/KeyMappingsDemo.cpp +++ b/extras/Demo/Source/Demos/KeyMappingsDemo.cpp @@ -34,7 +34,7 @@ public: : keyMappingEditor (*MainAppWindow::getApplicationCommandManager().getKeyMappings(), true) { setOpaque (true); - addAndMakeVisible (&keyMappingEditor); + addAndMakeVisible (keyMappingEditor); } void paint (Graphics& g) override diff --git a/extras/Demo/Source/Demos/LiveConstantDemo.cpp b/extras/Demo/Source/Demos/LiveConstantDemo.cpp index 93cdab79db..2dd07d7724 100644 --- a/extras/Demo/Source/Demos/LiveConstantDemo.cpp +++ b/extras/Demo/Source/Demos/LiveConstantDemo.cpp @@ -71,9 +71,9 @@ public: "the code that's invoking the demo below...", dontSendNotification); - addAndMakeVisible (&descriptionLabel); - addAndMakeVisible (&startButton); - addChildComponent (&demoComp); + addAndMakeVisible (descriptionLabel); + addAndMakeVisible (startButton); + addChildComponent (demoComp); startButton.addListener (this); } diff --git a/extras/Demo/Source/Demos/MDIDemo.cpp b/extras/Demo/Source/Demos/MDIDemo.cpp index 59c5f1e52e..81208f95cb 100644 --- a/extras/Demo/Source/Demos/MDIDemo.cpp +++ b/extras/Demo/Source/Demos/MDIDemo.cpp @@ -48,7 +48,7 @@ public: editor.setMultiLine (true); editor.setReturnKeyStartsNewLine (true); editor.getTextValue().referTo (textValueObject); - addAndMakeVisible (&editor); + addAndMakeVisible (editor); editor.addListener (this); } @@ -164,13 +164,13 @@ public: showInTabsButton.setButtonText ("Show with tabs"); showInTabsButton.setToggleState (false, dontSendNotification); showInTabsButton.addListener (this); - addAndMakeVisible (&showInTabsButton); + addAndMakeVisible (showInTabsButton); addNoteButton.setButtonText ("Create a new note"); addNoteButton.addListener (this); - addAndMakeVisible (&addNoteButton); + addAndMakeVisible (addNoteButton); - addAndMakeVisible (&multiDocumentPanel); + addAndMakeVisible (multiDocumentPanel); multiDocumentPanel.setBackgroundColour (Colours::transparentBlack); updateLayoutMode(); diff --git a/extras/Demo/Source/Demos/MidiDemo.cpp b/extras/Demo/Source/Demos/MidiDemo.cpp index 3e38145c86..3889dd9893 100644 --- a/extras/Demo/Source/Demos/MidiDemo.cpp +++ b/extras/Demo/Source/Demos/MidiDemo.cpp @@ -106,11 +106,11 @@ public: { setOpaque (true); - addAndMakeVisible (&midiInputListLabel); + addAndMakeVisible (midiInputListLabel); midiInputListLabel.setText ("MIDI Input:", dontSendNotification); midiInputListLabel.attachToComponent (&midiInputList, true); - addAndMakeVisible (&midiInputList); + addAndMakeVisible (midiInputList); midiInputList.setTextWhenNoChoicesAvailable ("No MIDI Inputs Enabled"); const StringArray midiInputs (MidiInput::getDevices()); midiInputList.addItemList (midiInputs, 1); @@ -130,10 +130,10 @@ public: if (midiInputList.getSelectedId() == 0) setMidiInput (0); - addAndMakeVisible (&keyboardComponent); + addAndMakeVisible (keyboardComponent); keyboardState.addListener (this); - addAndMakeVisible (&messageListBox); + addAndMakeVisible (messageListBox); messageListBox.setModel (&midiLogListBoxModel); messageListBox.setColour (ListBox::backgroundColourId, Colour (0x32ffffff)); messageListBox.setColour (ListBox::outlineColourId, Colours::black); diff --git a/extras/Demo/Source/Demos/MultithreadingDemo.cpp b/extras/Demo/Source/Demos/MultithreadingDemo.cpp index 39aa0a820d..b9e28a950f 100644 --- a/extras/Demo/Source/Demos/MultithreadingDemo.cpp +++ b/extras/Demo/Source/Demos/MultithreadingDemo.cpp @@ -214,7 +214,7 @@ public: { setOpaque (true); - addAndMakeVisible (&controlButton); + addAndMakeVisible (controlButton); controlButton.changeWidthToFitText (24); controlButton.setTopLeftPosition (20, 20); controlButton.setTriggeredOnMouseDown (true); diff --git a/extras/Demo/Source/Demos/NetworkingDemo.cpp b/extras/Demo/Source/Demos/NetworkingDemo.cpp index 785b8cdc8f..a3f9d7de5c 100644 --- a/extras/Demo/Source/Demos/NetworkingDemo.cpp +++ b/extras/Demo/Source/Demos/NetworkingDemo.cpp @@ -36,14 +36,14 @@ public: { setOpaque (true); - addAndMakeVisible (&urlBox); + addAndMakeVisible (urlBox); urlBox.setText ("http://www.google.com"); - addAndMakeVisible (&fetchButton); + addAndMakeVisible (fetchButton); fetchButton.setButtonText ("Download URL Contents"); fetchButton.addListener (this); - addAndMakeVisible (&resultsBox); + addAndMakeVisible (resultsBox); } ~NetworkingDemo() diff --git a/extras/Demo/Source/Demos/OpenGLDemo.cpp b/extras/Demo/Source/Demos/OpenGLDemo.cpp index f6b3771f18..541dec9474 100644 --- a/extras/Demo/Source/Demos/OpenGLDemo.cpp +++ b/extras/Demo/Source/Demos/OpenGLDemo.cpp @@ -340,34 +340,34 @@ struct OpenGLDemoClasses tabbedComp (TabbedButtonBar::TabsAtLeft), showBackgroundToggle ("Draw 2D graphics in background") { - addAndMakeVisible (&statusLabel); + addAndMakeVisible (statusLabel); statusLabel.setJustificationType (Justification::topLeft); statusLabel.setColour (Label::textColourId, Colours::black); statusLabel.setFont (Font (14.0f)); - addAndMakeVisible (&sizeSlider); + addAndMakeVisible (sizeSlider); sizeSlider.setRange (0.0, 1.0, 0.001); sizeSlider.addListener (this); - addAndMakeVisible (&zoomLabel); + addAndMakeVisible (zoomLabel); zoomLabel.setText ("Zoom:", dontSendNotification); zoomLabel.attachToComponent (&sizeSlider, true); - addAndMakeVisible (&speedSlider); + addAndMakeVisible (speedSlider); speedSlider.setRange (0.0, 0.5, 0.001); speedSlider.addListener (this); speedSlider.setSkewFactor (0.5f); - addAndMakeVisible (&speedLabel); + addAndMakeVisible (speedLabel); speedLabel.setText ("Speed:", dontSendNotification); speedLabel.attachToComponent (&speedSlider, true); - addAndMakeVisible (&showBackgroundToggle); + addAndMakeVisible (showBackgroundToggle); showBackgroundToggle.addListener (this); Colour editorBackground (Colours::white.withAlpha (0.6f)); - addAndMakeVisible (&tabbedComp); + addAndMakeVisible (tabbedComp); tabbedComp.setTabBarDepth (25); tabbedComp.setColour (TabbedButtonBar::tabTextColourId, Colours::grey); tabbedComp.addTab ("Vertex", editorBackground, &vertexEditorComp, false); @@ -384,11 +384,11 @@ struct OpenGLDemoClasses textures.add (new BuiltInTexture ("JUCE logo", BinaryData::juce_icon_png, BinaryData::juce_icon_pngSize)); textures.add (new DynamicTexture()); - addAndMakeVisible (&textureBox); + addAndMakeVisible (textureBox); textureBox.addListener (this); updateTexturesList(); - addAndMakeVisible (&presetBox); + addAndMakeVisible (presetBox); presetBox.addListener (this); Array presets (getPresets()); @@ -397,11 +397,11 @@ struct OpenGLDemoClasses for (int i = 0; i < presets.size(); ++i) presetBox.addItem (presets[i].name, i + 1); - addAndMakeVisible (&presetLabel); + addAndMakeVisible (presetLabel); presetLabel.setText ("Shader Preset:", dontSendNotification); presetLabel.attachToComponent (&presetBox, true); - addAndMakeVisible (&textureLabel); + addAndMakeVisible (textureLabel); textureLabel.setText ("Texture:", dontSendNotification); textureLabel.attachToComponent (&textureBox, true); } diff --git a/extras/Demo/Source/Demos/PropertiesDemo.cpp b/extras/Demo/Source/Demos/PropertiesDemo.cpp index 590eb947cd..5f4c84fc85 100644 --- a/extras/Demo/Source/Demos/PropertiesDemo.cpp +++ b/extras/Demo/Source/Demos/PropertiesDemo.cpp @@ -149,7 +149,7 @@ public: PropertiesDemo() { setOpaque (true); - addAndMakeVisible (&propertyPanel); + addAndMakeVisible (propertyPanel); propertyPanel.addSection ("Text Editors", createTextEditors()); propertyPanel.addSection ("Sliders", createSliders (3)); @@ -181,7 +181,7 @@ public: ConcertinaDemo() { setOpaque (true); - addAndMakeVisible (&concertinaPanel); + addAndMakeVisible (concertinaPanel); { PropertyPanel* panel = new PropertyPanel ("Text Editors"); diff --git a/extras/Demo/Source/Demos/SystemInfoDemo.cpp b/extras/Demo/Source/Demos/SystemInfoDemo.cpp index 16772a6753..991d39cbb5 100644 --- a/extras/Demo/Source/Demos/SystemInfoDemo.cpp +++ b/extras/Demo/Source/Demos/SystemInfoDemo.cpp @@ -148,7 +148,7 @@ class SystemInfoDemo : public Component public: SystemInfoDemo() { - addAndMakeVisible (&resultsBox); + addAndMakeVisible (resultsBox); resultsBox.setReadOnly (true); resultsBox.setMultiLine (true); resultsBox.setColour (TextEditor::backgroundColourId, Colours::transparentBlack); diff --git a/extras/Demo/Source/Demos/TimersAndEventsDemo.cpp b/extras/Demo/Source/Demos/TimersAndEventsDemo.cpp index 1847c01e70..3441580a7b 100644 --- a/extras/Demo/Source/Demos/TimersAndEventsDemo.cpp +++ b/extras/Demo/Source/Demos/TimersAndEventsDemo.cpp @@ -152,11 +152,11 @@ public: addAndMakeVisible (newFlasher); } - addAndMakeVisible (&stopButton); + addAndMakeVisible (stopButton); stopButton.addListener (this); stopButton.setButtonText ("Stop"); - addAndMakeVisible (&randomColourButton); + addAndMakeVisible (randomColourButton); randomColourButton.addListener (this); randomColourButton.setButtonText ("Set Random Colour"); diff --git a/extras/Demo/Source/Demos/UnitTestsDemo.cpp b/extras/Demo/Source/Demos/UnitTestsDemo.cpp index 841e277b47..fce56fd093 100644 --- a/extras/Demo/Source/Demos/UnitTestsDemo.cpp +++ b/extras/Demo/Source/Demos/UnitTestsDemo.cpp @@ -108,8 +108,8 @@ struct UnitTestClasses { setOpaque (true); - addAndMakeVisible (&startTestButton); - addAndMakeVisible (&testResultsBox); + addAndMakeVisible (startTestButton); + addAndMakeVisible (testResultsBox); testResultsBox.setMultiLine (true); testResultsBox.setFont (Font (Font::getDefaultMonospacedFontName(), 12.0f, Font::plain)); diff --git a/extras/Demo/Source/Demos/ValueTreesDemo.cpp b/extras/Demo/Source/Demos/ValueTreesDemo.cpp index 4a24cbc0ef..503be976f0 100644 --- a/extras/Demo/Source/Demos/ValueTreesDemo.cpp +++ b/extras/Demo/Source/Demos/ValueTreesDemo.cpp @@ -164,15 +164,15 @@ public: : undoButton ("Undo"), redoButton ("Redo") { - addAndMakeVisible (&tree); + addAndMakeVisible (tree); tree.setDefaultOpenness (true); tree.setMultiSelectEnabled (true); tree.setRootItem (rootItem = new ValueTreeItem (createRootValueTree(), undoManager)); tree.setColour (TreeView::backgroundColourId, Colours::white); - addAndMakeVisible (&undoButton); - addAndMakeVisible (&redoButton); + addAndMakeVisible (undoButton); + addAndMakeVisible (redoButton); undoButton.addListener (this); redoButton.addListener (this); diff --git a/extras/Demo/Source/Demos/VideoDemo.cpp b/extras/Demo/Source/Demos/VideoDemo.cpp index 2347edc55e..37981b7091 100644 --- a/extras/Demo/Source/Demos/VideoDemo.cpp +++ b/extras/Demo/Source/Demos/VideoDemo.cpp @@ -39,9 +39,9 @@ public: fileChooser ("movie", File::nonexistent, true, false, false, "*", String::empty, "(choose a video file to play)") { - addAndMakeVisible (&videoComp); + addAndMakeVisible (videoComp); - addAndMakeVisible (&fileChooser); + addAndMakeVisible (fileChooser); fileChooser.addListener (this); fileChooser.setBrowseButtonText ("browse"); } @@ -148,9 +148,9 @@ public: fileTree.addListener (this); fileTree.setColour (TreeView::backgroundColourId, Colours::lightgrey); - addAndMakeVisible (&fileTree); + addAndMakeVisible (fileTree); - addAndMakeVisible (&resizerBar); + addAndMakeVisible (resizerBar); loadLeftButton.setButtonText ("Load Left"); loadRightButton.setButtonText ("Load Right"); @@ -158,11 +158,11 @@ public: loadLeftButton.addListener (this); loadRightButton.addListener (this); - addAndMakeVisible (&loadLeftButton); - addAndMakeVisible (&loadRightButton); + addAndMakeVisible (loadLeftButton); + addAndMakeVisible (loadRightButton); - addAndMakeVisible (&movieCompLeft); - addAndMakeVisible (&movieCompRight); + addAndMakeVisible (movieCompLeft); + addAndMakeVisible (movieCompRight); // we have to set up our StretchableLayoutManager so it know the limits and preferred sizes of it's contents stretchableManager.setItemLayout (0, // for the fileTree diff --git a/extras/Demo/Source/Demos/WebBrowserDemo.cpp b/extras/Demo/Source/Demos/WebBrowserDemo.cpp index fa967d66ea..b0b5ee4ce7 100644 --- a/extras/Demo/Source/Demos/WebBrowserDemo.cpp +++ b/extras/Demo/Source/Demos/WebBrowserDemo.cpp @@ -74,7 +74,7 @@ public: setOpaque (true); // Create an address box.. - addAndMakeVisible (&addressTextBox); + addAndMakeVisible (addressTextBox); addressTextBox.setTextToShowWhenEmpty ("Enter a web address, e.g. http://www.juce.com", Colours::grey); addressTextBox.addListener (this); @@ -82,11 +82,11 @@ public: addAndMakeVisible (webView = new DemoBrowserComponent (addressTextBox)); // add some buttons.. - addAndMakeVisible (&goButton); + addAndMakeVisible (goButton); goButton.addListener (this); - addAndMakeVisible (&backButton); + addAndMakeVisible (backButton); backButton.addListener (this); - addAndMakeVisible (&forwardButton); + addAndMakeVisible (forwardButton); forwardButton.addListener (this); // send the browser to a start page.. diff --git a/extras/Demo/Source/Demos/WidgetsDemo.cpp b/extras/Demo/Source/Demos/WidgetsDemo.cpp index d5933eabfa..57019f933b 100644 --- a/extras/Demo/Source/Demos/WidgetsDemo.cpp +++ b/extras/Demo/Source/Demos/WidgetsDemo.cpp @@ -200,7 +200,7 @@ struct SlidersPage : public Component } hintLabel.setBounds (20, 245, 350, 150); - addAndMakeVisible (&hintLabel); + addAndMakeVisible (hintLabel); } private: @@ -421,15 +421,15 @@ struct MiscPage : public Component : textEditor2 ("Password", (juce_wchar) 0x2022), comboBox ("Combo") { - addAndMakeVisible (&textEditor1); + addAndMakeVisible (textEditor1); textEditor1.setBounds (10, 25, 200, 24); textEditor1.setText ("Single-line text box"); - addAndMakeVisible (&textEditor2); + addAndMakeVisible (textEditor2); textEditor2.setBounds (10, 55, 200, 24); textEditor2.setText ("Password"); - addAndMakeVisible (&comboBox); + addAndMakeVisible (comboBox); comboBox.setBounds (10, 85, 200, 24); comboBox.setEditableText (true); comboBox.setJustificationType (Justification::centred); @@ -460,19 +460,19 @@ public: customiseButton ("Customise...") { // Create and add the toolbar... - addAndMakeVisible (&toolbar); + addAndMakeVisible (toolbar); // And use our item factory to add a set of default icons to it... toolbar.addDefaultItems (factory); // Now we'll just create the other sliders and buttons on the demo page, which adjust // the toolbar's properties... - addAndMakeVisible (&infoLabel); + addAndMakeVisible (infoLabel); infoLabel.setJustificationType (Justification::topLeft); infoLabel.setBounds (80, 80, 450, 100); infoLabel.setInterceptsMouseClicks (false, false); - addAndMakeVisible (&depthSlider); + addAndMakeVisible (depthSlider); depthSlider.setRange (10.0, 200.0, 1.0); depthSlider.setValue (50, dontSendNotification); depthSlider.setSliderStyle (Slider::LinearHorizontal); @@ -481,12 +481,12 @@ public: depthSlider.setBounds (80, 210, 300, 22); depthLabel.attachToComponent (&depthSlider, false); - addAndMakeVisible (&orientationButton); + addAndMakeVisible (orientationButton); orientationButton.addListener (this); orientationButton.changeWidthToFitText (22); orientationButton.setTopLeftPosition (depthSlider.getX(), depthSlider.getBottom() + 20); - addAndMakeVisible (&customiseButton); + addAndMakeVisible (customiseButton); customiseButton.addListener (this); customiseButton.changeWidthToFitText (22); customiseButton.setTopLeftPosition (orientationButton.getRight() + 20, orientationButton.getY()); @@ -651,7 +651,7 @@ private: : ToolbarItemComponent (toolbarItemId, "Custom Toolbar Item", false), comboBox ("demo toolbar combo box") { - addAndMakeVisible (&comboBox); + addAndMakeVisible (comboBox); for (int i = 1; i < 20; ++i) comboBox.addItem ("Toolbar ComboBox item " + String (i), i); @@ -707,7 +707,7 @@ public: loadData(); // Create our table component and add it to this component.. - addAndMakeVisible (&table); + addAndMakeVisible (table); table.setModel (this); // give it a border @@ -872,7 +872,7 @@ private: : owner (owner_) { // just put a combo box inside this component - addAndMakeVisible (&comboBox); + addAndMakeVisible (comboBox); comboBox.addItem ("fab", 1); comboBox.addItem ("groovy", 2); comboBox.addItem ("hep", 3); @@ -979,8 +979,8 @@ public: sourceListBox.setModel (&sourceModel); sourceListBox.setMultipleSelectionEnabled (true); - addAndMakeVisible (&sourceListBox); - addAndMakeVisible (&target); + addAndMakeVisible (sourceListBox); + addAndMakeVisible (target); } void resized() override @@ -1190,7 +1190,7 @@ public: popupButton.setButtonText ("Show Popup Menu"); popupButton.setTriggeredOnMouseDown (true); popupButton.addListener (this); - addAndMakeVisible (&popupButton); + addAndMakeVisible (popupButton); } ~MenusDemo() @@ -1468,7 +1468,7 @@ public: WidgetsDemo() { setOpaque (true); - addAndMakeVisible (&tabs); + addAndMakeVisible (tabs); } void paint (Graphics& g) override diff --git a/extras/Demo/Source/Demos/WindowsDemo.cpp b/extras/Demo/Source/Demos/WindowsDemo.cpp index c36573430b..26327253c8 100644 --- a/extras/Demo/Source/Demos/WindowsDemo.cpp +++ b/extras/Demo/Source/Demos/WindowsDemo.cpp @@ -201,11 +201,11 @@ public: setOpaque (true); showWindowsButton.setButtonText ("Show Windows"); - addAndMakeVisible (&showWindowsButton); + addAndMakeVisible (showWindowsButton); showWindowsButton.addListener (this); closeWindowsButton.setButtonText ("Close Windows"); - addAndMakeVisible (&closeWindowsButton); + addAndMakeVisible (closeWindowsButton); closeWindowsButton.addListener (this); } diff --git a/extras/Demo/Source/Demos/XMLandJSONDemo.cpp b/extras/Demo/Source/Demos/XMLandJSONDemo.cpp index 5acdd922c0..1d061b40cf 100644 --- a/extras/Demo/Source/Demos/XMLandJSONDemo.cpp +++ b/extras/Demo/Source/Demos/XMLandJSONDemo.cpp @@ -223,7 +223,7 @@ public: { setOpaque (true); - addAndMakeVisible (&typeBox); + addAndMakeVisible (typeBox); typeBox.addListener (this); typeBox.addItem ("XML", 1); typeBox.addItem ("JSON", 2); @@ -231,14 +231,14 @@ public: comboBoxLabel.setText ("Database Type:", dontSendNotification); comboBoxLabel.attachToComponent (&typeBox, true); - addAndMakeVisible (&codeDocumentComponent); + addAndMakeVisible (codeDocumentComponent); codeDocument.addListener (this); - addAndMakeVisible (&resultsTree); + addAndMakeVisible (resultsTree); resultsTree.setColour (TreeView::backgroundColourId, Colours::white); resultsTree.setDefaultOpenness (true); - addAndMakeVisible (&errorMessage); + addAndMakeVisible (errorMessage); errorMessage.setReadOnly (true); errorMessage.setMultiLine (true); errorMessage.setCaretVisible (false); diff --git a/extras/Demo/Source/IntroScreen.cpp b/extras/Demo/Source/IntroScreen.cpp index 60ac9ba8c9..df3efdad39 100644 --- a/extras/Demo/Source/IntroScreen.cpp +++ b/extras/Demo/Source/IntroScreen.cpp @@ -37,9 +37,9 @@ public: { setOpaque (true); - addAndMakeVisible (&versionLabel); - addAndMakeVisible (&linkButton); - addAndMakeVisible (&logo); + addAndMakeVisible (versionLabel); + addAndMakeVisible (linkButton); + addAndMakeVisible (logo); versionLabel.setColour (Label::textColourId, Colours::white); versionLabel.setText (String ("{version} built on {date}") diff --git a/extras/Demo/Source/MainWindow.cpp b/extras/Demo/Source/MainWindow.cpp index 90a2e591e1..8c13005e20 100644 --- a/extras/Demo/Source/MainWindow.cpp +++ b/extras/Demo/Source/MainWindow.cpp @@ -110,7 +110,7 @@ public: ContentComponent() { LookAndFeel::setDefaultLookAndFeel (&lookAndFeelV3); - addAndMakeVisible (&demoList); + addAndMakeVisible (demoList); demoList.setModel (this); demoList.setColour (ListBox::backgroundColourId, Colour::greyLevel (0.7f)); diff --git a/extras/Introjucer/Source/Application/jucer_AppearanceSettings.cpp b/extras/Introjucer/Source/Application/jucer_AppearanceSettings.cpp index 5a13a30689..76fca05cd5 100644 --- a/extras/Introjucer/Source/Application/jucer_AppearanceSettings.cpp +++ b/extras/Introjucer/Source/Application/jucer_AppearanceSettings.cpp @@ -354,15 +354,15 @@ struct AppearanceEditor saveButton ("Save Scheme...") { rebuildProperties(); - addAndMakeVisible (&panel); + addAndMakeVisible (panel); loadButton.setColour (TextButton::buttonColourId, Colours::lightgrey.withAlpha (0.5f)); saveButton.setColour (TextButton::buttonColourId, Colours::lightgrey.withAlpha (0.5f)); loadButton.setColour (TextButton::textColourOffId, Colours::white); saveButton.setColour (TextButton::textColourOffId, Colours::white); - addAndMakeVisible (&loadButton); - addAndMakeVisible (&saveButton); + addAndMakeVisible (loadButton); + addAndMakeVisible (saveButton); loadButton.addListener (this); saveButton.addListener (this); diff --git a/extras/Introjucer/Source/Code Editor/jucer_SourceCodeEditor.cpp b/extras/Introjucer/Source/Code Editor/jucer_SourceCodeEditor.cpp index 5eb474a92c..967c5aa040 100644 --- a/extras/Introjucer/Source/Code Editor/jucer_SourceCodeEditor.cpp +++ b/extras/Introjucer/Source/Code Editor/jucer_SourceCodeEditor.cpp @@ -335,20 +335,20 @@ public: { editor.setColour (CaretComponent::caretColourId, Colours::black); - addAndMakeVisible (&editor); + addAndMakeVisible (editor); label.setText ("Find:", dontSendNotification); label.setColour (Label::textColourId, Colours::white); label.attachToComponent (&editor, false); - addAndMakeVisible (&caseButton); + addAndMakeVisible (caseButton); caseButton.setColour (ToggleButton::textColourId, Colours::white); caseButton.setToggleState (isCaseSensitiveSearch(), dontSendNotification); caseButton.addListener (this); findPrev.setConnectedEdges (Button::ConnectedOnRight); findNext.setConnectedEdges (Button::ConnectedOnLeft); - addAndMakeVisible (&findPrev); - addAndMakeVisible (&findNext); + addAndMakeVisible (findPrev); + addAndMakeVisible (findNext); setWantsKeyboardFocus (false); setFocusContainer (true); diff --git a/extras/Introjucer/Source/ComponentEditor/properties/jucer_ColourPropertyComponent.h b/extras/Introjucer/Source/ComponentEditor/properties/jucer_ColourPropertyComponent.h index 213820a007..0ddc19be54 100644 --- a/extras/Introjucer/Source/ComponentEditor/properties/jucer_ColourPropertyComponent.h +++ b/extras/Introjucer/Source/ComponentEditor/properties/jucer_ColourPropertyComponent.h @@ -114,14 +114,14 @@ public: : owner (owner_), defaultButton ("Reset to Default") { - addAndMakeVisible (&selector); + addAndMakeVisible (selector); selector.setName ("Colour"); selector.setCurrentColour (owner->getColour()); selector.addChangeListener (owner); if (canReset) { - addAndMakeVisible (&defaultButton); + addAndMakeVisible (defaultButton); defaultButton.addListener (this); } } diff --git a/extras/Introjucer/Source/ComponentEditor/properties/jucer_FilePropertyComponent.h b/extras/Introjucer/Source/ComponentEditor/properties/jucer_FilePropertyComponent.h index 5e174db44d..d976360706 100644 --- a/extras/Introjucer/Source/ComponentEditor/properties/jucer_FilePropertyComponent.h +++ b/extras/Introjucer/Source/ComponentEditor/properties/jucer_FilePropertyComponent.h @@ -39,7 +39,7 @@ public: isDirectory, false, fileBrowserWildcard, String::empty, String::empty) { - addAndMakeVisible (&filenameComp); + addAndMakeVisible (filenameComp); filenameComp.addListener (this); } diff --git a/extras/Introjucer/Source/ComponentEditor/properties/jucer_PositionPropertyBase.h b/extras/Introjucer/Source/ComponentEditor/properties/jucer_PositionPropertyBase.h index 9a6256d596..0e47d5e6aa 100644 --- a/extras/Introjucer/Source/ComponentEditor/properties/jucer_PositionPropertyBase.h +++ b/extras/Introjucer/Source/ComponentEditor/properties/jucer_PositionPropertyBase.h @@ -59,7 +59,7 @@ public: includeAnchorOptions (includeAnchorOptions_), allowRelativeOptions (allowRelativeOptions_) { - addAndMakeVisible (&button); + addAndMakeVisible (button); button.addListener (this); button.setTriggeredOnMouseDown (true); button.setConnectedEdges (TextButton::ConnectedOnLeft | TextButton::ConnectedOnRight); diff --git a/extras/Introjucer/Source/ComponentEditor/ui/jucer_ComponentLayoutEditor.cpp b/extras/Introjucer/Source/ComponentEditor/ui/jucer_ComponentLayoutEditor.cpp index c692de8ede..2c344f979b 100644 --- a/extras/Introjucer/Source/ComponentEditor/ui/jucer_ComponentLayoutEditor.cpp +++ b/extras/Introjucer/Source/ComponentEditor/ui/jucer_ComponentLayoutEditor.cpp @@ -282,7 +282,7 @@ void ComponentLayoutEditor::mouseDown (const MouseEvent& e) } else { - addChildComponent (&lassoComp); + addChildComponent (lassoComp); lassoComp.beginLasso (e, this); } } diff --git a/extras/Introjucer/Source/ComponentEditor/ui/jucer_ComponentLayoutPanel.h b/extras/Introjucer/Source/ComponentEditor/ui/jucer_ComponentLayoutPanel.h index b666b6ef64..fcdf2fd387 100644 --- a/extras/Introjucer/Source/ComponentEditor/ui/jucer_ComponentLayoutPanel.h +++ b/extras/Introjucer/Source/ComponentEditor/ui/jucer_ComponentLayoutPanel.h @@ -73,8 +73,7 @@ private: : document (doc), layout (l) { layout.getSelectedSet().addChangeListener (this); - - addAndMakeVisible (&propsPanel); + addAndMakeVisible (propsPanel); } ~LayoutPropsPanel() diff --git a/extras/Introjucer/Source/ComponentEditor/ui/jucer_JucerDocumentEditor.cpp b/extras/Introjucer/Source/ComponentEditor/ui/jucer_JucerDocumentEditor.cpp index 330b840f1b..d16eae473b 100644 --- a/extras/Introjucer/Source/ComponentEditor/ui/jucer_JucerDocumentEditor.cpp +++ b/extras/Introjucer/Source/ComponentEditor/ui/jucer_JucerDocumentEditor.cpp @@ -133,8 +133,8 @@ public: ClassPropertiesPanel (JucerDocument& doc) : document (doc) { - addAndMakeVisible (&panel1); - addAndMakeVisible (&panel2); + addAndMakeVisible (panel1); + addAndMakeVisible (panel2); Array props; props.add (new ComponentClassNameProperty (doc)); @@ -318,7 +318,7 @@ JucerDocumentEditor::JucerDocumentEditor (JucerDocument* const doc) setSize (document->getInitialWidth(), document->getInitialHeight()); - addAndMakeVisible (&tabbedComponent); + addAndMakeVisible (tabbedComponent); tabbedComponent.setOutline (0); tabbedComponent.addTab ("Class", tabColour, new ClassPropertiesPanel (*document), true); diff --git a/extras/Introjucer/Source/ComponentEditor/ui/jucer_PaintRoutineEditor.cpp b/extras/Introjucer/Source/ComponentEditor/ui/jucer_PaintRoutineEditor.cpp index 47181f8ad9..f417f4607a 100644 --- a/extras/Introjucer/Source/ComponentEditor/ui/jucer_PaintRoutineEditor.cpp +++ b/extras/Introjucer/Source/ComponentEditor/ui/jucer_PaintRoutineEditor.cpp @@ -216,7 +216,7 @@ void PaintRoutineEditor::mouseDown (const MouseEvent& e) } else { - addChildComponent (&lassoComp); + addChildComponent (lassoComp); lassoComp.beginLasso (e, this); } } diff --git a/extras/Introjucer/Source/ComponentEditor/ui/jucer_ResourceEditorPanel.cpp b/extras/Introjucer/Source/ComponentEditor/ui/jucer_ResourceEditorPanel.cpp index 27ca236004..b9285179e8 100644 --- a/extras/Introjucer/Source/ComponentEditor/ui/jucer_ResourceEditorPanel.cpp +++ b/extras/Introjucer/Source/ComponentEditor/ui/jucer_ResourceEditorPanel.cpp @@ -35,7 +35,7 @@ public: : document (doc), reloadButton ("Reload"), row (0) { setInterceptsMouseClicks (false, true); - addAndMakeVisible (&reloadButton); + addAndMakeVisible (reloadButton); reloadButton.addListener (this); } @@ -74,13 +74,13 @@ ResourceEditorPanel::ResourceEditorPanel (JucerDocument& doc) reloadAllButton ("Reload all resources"), delButton ("Delete selected resources") { - addAndMakeVisible (&addButton); + addAndMakeVisible (addButton); addButton.addListener (this); - addAndMakeVisible (&reloadAllButton); + addAndMakeVisible (reloadAllButton); reloadAllButton.addListener (this); - addAndMakeVisible (&delButton); + addAndMakeVisible (delButton); delButton.addListener (this); delButton.setEnabled (false); diff --git a/extras/Introjucer/Source/Project/jucer_ConfigTree_Base.h b/extras/Introjucer/Source/Project/jucer_ConfigTree_Base.h index 425444f769..2e1f6bd37d 100644 --- a/extras/Introjucer/Source/Project/jucer_ConfigTree_Base.h +++ b/extras/Introjucer/Source/Project/jucer_ConfigTree_Base.h @@ -139,8 +139,8 @@ private: public: PropertyPanelViewport (Component* content) { - addAndMakeVisible (&viewport); - addAndMakeVisible (&rolloverHelp); + addAndMakeVisible (viewport); + addAndMakeVisible (rolloverHelp); viewport.setViewedComponent (content, true); } @@ -251,7 +251,7 @@ private: public: SettingsComp (Project& p) : project (p) { - addAndMakeVisible (&group); + addAndMakeVisible (group); updatePropertyList(); project.addChangeListener (this); diff --git a/extras/Introjucer/Source/Project/jucer_ConfigTree_Exporter.h b/extras/Introjucer/Source/Project/jucer_ConfigTree_Exporter.h index 222c51cb17..e4ba4e1eb5 100644 --- a/extras/Introjucer/Source/Project/jucer_ConfigTree_Exporter.h +++ b/extras/Introjucer/Source/Project/jucer_ConfigTree_Exporter.h @@ -129,7 +129,7 @@ private: public: SettingsComp (ProjectExporter* exp) { - addAndMakeVisible (&group); + addAndMakeVisible (group); PropertyListBuilder props; exp->createPropertyEditors (props); @@ -230,7 +230,7 @@ private: public: SettingsComp (ProjectExporter::BuildConfiguration* conf, const String& expName) { - addAndMakeVisible (&group); + addAndMakeVisible (group); PropertyListBuilder props; conf->createPropertyEditors (props); diff --git a/extras/Introjucer/Source/Project/jucer_ConfigTree_Modules.h b/extras/Introjucer/Source/Project/jucer_ConfigTree_Modules.h index dc633b3060..7c8d9ddef6 100644 --- a/extras/Introjucer/Source/Project/jucer_ConfigTree_Modules.h +++ b/extras/Introjucer/Source/Project/jucer_ConfigTree_Modules.h @@ -71,7 +71,7 @@ private: ModuleSettingsPanel (Project& p, const String& modID) : project (p), moduleID (modID) { - addAndMakeVisible (&group); + addAndMakeVisible (group); group.setName ("Module: " + moduleID); refresh(); } @@ -202,7 +202,7 @@ private: missingDependencies (project.getModules().getExtraDependenciesNeeded (modID)), fixButton ("Add Required Modules") { - addAndMakeVisible (&fixButton); + addAndMakeVisible (fixButton); fixButton.setColour (TextButton::buttonColourId, Colours::red); fixButton.setColour (TextButton::textColourOffId, Colours::white); fixButton.addListener (this); diff --git a/extras/Introjucer/Source/Project/jucer_GroupInformationComponent.h b/extras/Introjucer/Source/Project/jucer_GroupInformationComponent.h index 50083cd897..01b36719d8 100644 --- a/extras/Introjucer/Source/Project/jucer_GroupInformationComponent.h +++ b/extras/Introjucer/Source/Project/jucer_GroupInformationComponent.h @@ -40,7 +40,7 @@ public: { list.setModel (this); list.setColour (ListBox::backgroundColourId, Colours::transparentBlack); - addAndMakeVisible (&list); + addAndMakeVisible (list); list.updateContent(); list.setRowHeight (20); item.state.addListener (this); @@ -121,10 +121,10 @@ private: { if (item.isFile()) { - addAndMakeVisible (&compileButton); + addAndMakeVisible (compileButton); compileButton.getToggleStateValue().referTo (item.getShouldCompileValue()); - addAndMakeVisible (&resourceButton); + addAndMakeVisible (resourceButton); resourceButton.getToggleStateValue().referTo (item.getShouldAddToResourceValue()); } } diff --git a/extras/Introjucer/Source/Project/jucer_ModulesPanel.h b/extras/Introjucer/Source/Project/jucer_ModulesPanel.h index ee938f84f5..a5b8faa90a 100644 --- a/extras/Introjucer/Source/Project/jucer_ModulesPanel.h +++ b/extras/Introjucer/Source/Project/jucer_ModulesPanel.h @@ -45,14 +45,14 @@ public: table.setModel (this); table.setColour (TableListBox::backgroundColourId, Colours::transparentBlack); - addAndMakeVisible (&table); + addAndMakeVisible (table); table.updateContent(); table.setRowHeight (20); - addAndMakeVisible (&addWebModuleButton); - addAndMakeVisible (&updateModuleButton); - addAndMakeVisible (&setCopyModeButton); - addAndMakeVisible (©PathButton); + addAndMakeVisible (addWebModuleButton); + addAndMakeVisible (updateModuleButton); + addAndMakeVisible (setCopyModeButton); + addAndMakeVisible (copyPathButton); addWebModuleButton.addListener (this); updateModuleButton.addListener (this); updateModuleButton.setEnabled (false); diff --git a/extras/Introjucer/Source/Project/jucer_ProjectContentComponent.cpp b/extras/Introjucer/Source/Project/jucer_ProjectContentComponent.cpp index de0bd2e144..bf97ff9352 100644 --- a/extras/Introjucer/Source/Project/jucer_ProjectContentComponent.cpp +++ b/extras/Introjucer/Source/Project/jucer_ProjectContentComponent.cpp @@ -71,12 +71,12 @@ public: #if JUCE_MAC || JUCE_WINDOWS ApplicationCommandManager& commandManager = IntrojucerApp::getCommandManager(); - addAndMakeVisible (&openProjectButton); + addAndMakeVisible (openProjectButton); openProjectButton.setCommandToTrigger (&commandManager, CommandIDs::openInIDE, true); openProjectButton.setButtonText (commandManager.getNameOfCommand (CommandIDs::openInIDE)); openProjectButton.setColour (TextButton::buttonColourId, Colours::white.withAlpha (0.5f)); - addAndMakeVisible (&saveAndOpenButton); + addAndMakeVisible (saveAndOpenButton); saveAndOpenButton.setCommandToTrigger (&commandManager, CommandIDs::saveAndOpenInIDE, true); saveAndOpenButton.setButtonText (commandManager.getNameOfCommand (CommandIDs::saveAndOpenInIDE)); saveAndOpenButton.setColour (TextButton::buttonColourId, Colours::white.withAlpha (0.5f)); @@ -263,7 +263,7 @@ void ProjectContentComponent::rebuildProjectTabs() if (project != nullptr) { - addAndMakeVisible (&treeViewTabs); + addAndMakeVisible (treeViewTabs); createProjectTabs(); @@ -651,7 +651,7 @@ void ProjectContentComponent::updateMainWindowTitle() void ProjectContentComponent::showBubbleMessage (const Rectangle& pos, const String& text) { - addChildComponent (&bubbleMessage); + addChildComponent (bubbleMessage); bubbleMessage.setColour (BubbleComponent::backgroundColourId, Colours::white.withAlpha (0.7f)); bubbleMessage.setColour (BubbleComponent::outlineColourId, Colours::black.withAlpha (0.8f)); bubbleMessage.setAlwaysOnTop (true); diff --git a/extras/Introjucer/Source/Utility/jucer_JucerTreeViewBase.cpp b/extras/Introjucer/Source/Utility/jucer_JucerTreeViewBase.cpp index b7cd64d460..d6e6127869 100644 --- a/extras/Introjucer/Source/Utility/jucer_JucerTreeViewBase.cpp +++ b/extras/Introjucer/Source/Utility/jucer_JucerTreeViewBase.cpp @@ -144,7 +144,7 @@ public: ed.setText (item.getRenamingName()); ed.setBounds (bounds); - parent.addAndMakeVisible (&ed); + parent.addAndMakeVisible (ed); ed.enterModalState (true, this); } diff --git a/extras/Introjucer/Source/Utility/jucer_JucerTreeViewBase.h b/extras/Introjucer/Source/Utility/jucer_JucerTreeViewBase.h index 78268c4ae7..3372895706 100644 --- a/extras/Introjucer/Source/Utility/jucer_JucerTreeViewBase.h +++ b/extras/Introjucer/Source/Utility/jucer_JucerTreeViewBase.h @@ -118,7 +118,7 @@ public: TreePanelBase (const Project* p, const String& treeviewID) : project (p), opennessStateKey (treeviewID) { - addAndMakeVisible (&tree); + addAndMakeVisible (tree); tree.setRootItemVisible (true); tree.setDefaultOpenness (true); tree.setColour (TreeView::backgroundColourId, Colours::transparentBlack); diff --git a/extras/Introjucer/Source/Utility/jucer_MiscUtilities.cpp b/extras/Introjucer/Source/Utility/jucer_MiscUtilities.cpp index 8cc445a55f..95ee5070ca 100644 --- a/extras/Introjucer/Source/Utility/jucer_MiscUtilities.cpp +++ b/extras/Introjucer/Source/Utility/jucer_MiscUtilities.cpp @@ -306,14 +306,14 @@ public: { desc.setJustificationType (Justification::centred); desc.setColour (Label::textColourId, Colours::white); - addAndMakeVisible (&desc); + addAndMakeVisible (desc); const Colour bkgd (Colours::white.withAlpha (0.6f)); userText.setMultiLine (true, true); userText.setReturnKeyStartsNewLine (true); userText.setColour (TextEditor::backgroundColourId, bkgd); - addAndMakeVisible (&userText); + addAndMakeVisible (userText); userText.addListener (this); resultText.setFont (getAppSettings().appearance.getCodeFont().withHeight (13.0f)); @@ -321,7 +321,7 @@ public: resultText.setColour (TextEditor::backgroundColourId, bkgd); resultText.setReadOnly (true); resultText.setSelectAllWhenFocused (true); - addAndMakeVisible (&resultText); + addAndMakeVisible (resultText); userText.setText (getLastText()); } @@ -391,7 +391,7 @@ public: { desc.setJustificationType (Justification::centred); desc.setColour (Label::textColourId, Colours::white); - addAndMakeVisible (&desc); + addAndMakeVisible (desc); const Colour bkgd (Colours::white.withAlpha (0.6f)); @@ -399,7 +399,7 @@ public: userText.setMultiLine (true, true); userText.setReturnKeyStartsNewLine (true); userText.setColour (TextEditor::backgroundColourId, bkgd); - addAndMakeVisible (&userText); + addAndMakeVisible (userText); userText.addListener (this); resultText.setFont (getAppSettings().appearance.getCodeFont().withHeight (13.0f)); @@ -407,7 +407,7 @@ public: resultText.setColour (TextEditor::backgroundColourId, bkgd); resultText.setReadOnly (true); resultText.setSelectAllWhenFocused (true); - addAndMakeVisible (&resultText); + addAndMakeVisible (resultText); userText.setText (getLastText()); } diff --git a/extras/Introjucer/Source/Utility/jucer_MiscUtilities.h b/extras/Introjucer/Source/Utility/jucer_MiscUtilities.h index 482a2c07a2..49554e458b 100644 --- a/extras/Introjucer/Source/Utility/jucer_MiscUtilities.h +++ b/extras/Introjucer/Source/Utility/jucer_MiscUtilities.h @@ -189,14 +189,14 @@ public: colourValue (colour), defaultColour (defaultCol) { - addAndMakeVisible (&selector); + addAndMakeVisible (selector); selector.setName ("Colour"); selector.setCurrentColour (getColour()); selector.addChangeListener (this); if (canResetToDefault) { - addAndMakeVisible (&defaultButton); + addAndMakeVisible (defaultButton); defaultButton.addListener (this); } @@ -364,7 +364,7 @@ public: : PropertyComponent (name), colourEditor (undoManager, colour, defaultColour, canResetToDefault) { - addAndMakeVisible (&colourEditor); + addAndMakeVisible (colourEditor); } void resized() override diff --git a/extras/Introjucer/Source/Utility/jucer_TranslationTool.h b/extras/Introjucer/Source/Utility/jucer_TranslationTool.h index d16a9f4402..60f605bf46 100644 --- a/extras/Introjucer/Source/Utility/jucer_TranslationTool.h +++ b/extras/Introjucer/Source/Utility/jucer_TranslationTool.h @@ -289,28 +289,28 @@ public: "\n\n" "First, choose whether to scan the current project for all TRANS() macros, or " "pick an existing translation file to load:", dontSendNotification); - addAndMakeVisible (&instructionsLabel); + addAndMakeVisible (instructionsLabel); label1.setText ("..then copy-and-paste this annotated text into Google Translate or some other translator:", dontSendNotification); - addAndMakeVisible (&label1); + addAndMakeVisible (label1); label2.setText ("...then, take the translated result and paste it into the box below:", dontSendNotification); - addAndMakeVisible (&label2); + addAndMakeVisible (label2); label3.setText ("Finally, click the 'Generate' button, and a translation file will be created below. " "Remember to update its language code at the top!", dontSendNotification); - addAndMakeVisible (&label3); + addAndMakeVisible (label3); - addAndMakeVisible (&editorPre); - addAndMakeVisible (&editorPost); - addAndMakeVisible (&editorResult); + addAndMakeVisible (editorPre); + addAndMakeVisible (editorPost); + addAndMakeVisible (editorResult); generateButton.setButtonText (TRANS("Generate")); - addAndMakeVisible (&generateButton); + addAndMakeVisible (generateButton); scanButton.setButtonText ("Scan Project for TRANS macros"); - addAndMakeVisible (&scanButton); + addAndMakeVisible (scanButton); loadButton.setButtonText ("Load existing translation File..."); - addAndMakeVisible (&loadButton); + addAndMakeVisible (loadButton); generateButton.addListener (this); scanButton.addListener (this); diff --git a/extras/audio plugin demo/Source/PluginEditor.cpp b/extras/audio plugin demo/Source/PluginEditor.cpp index 0ee9b1908f..b61ae74488 100644 --- a/extras/audio plugin demo/Source/PluginEditor.cpp +++ b/extras/audio plugin demo/Source/PluginEditor.cpp @@ -22,12 +22,12 @@ JuceDemoPluginAudioProcessorEditor::JuceDemoPluginAudioProcessorEditor (JuceDemo delaySlider ("delay") { // add some sliders.. - addAndMakeVisible (&gainSlider); + addAndMakeVisible (gainSlider); gainSlider.setSliderStyle (Slider::Rotary); gainSlider.addListener (this); gainSlider.setRange (0.0, 1.0, 0.01); - addAndMakeVisible (&delaySlider); + addAndMakeVisible (delaySlider); delaySlider.setSliderStyle (Slider::Rotary); delaySlider.addListener (this); delaySlider.setRange (0.0, 1.0, 0.01); @@ -40,10 +40,10 @@ JuceDemoPluginAudioProcessorEditor::JuceDemoPluginAudioProcessorEditor (JuceDemo delayLabel.setFont (Font (11.0f)); // add the midi keyboard component.. - addAndMakeVisible (&midiKeyboard); + addAndMakeVisible (midiKeyboard); // add a label that will display the current timecode and status.. - addAndMakeVisible (&infoLabel); + addAndMakeVisible (infoLabel); infoLabel.setColour (Label::textColourId, Colours::blue); // add the triangular resizer component for the bottom-right of the UI diff --git a/extras/audio plugin host/Source/GraphEditorPanel.cpp b/extras/audio plugin host/Source/GraphEditorPanel.cpp index 79283dbb8e..ad6664ae97 100644 --- a/extras/audio plugin host/Source/GraphEditorPanel.cpp +++ b/extras/audio plugin host/Source/GraphEditorPanel.cpp @@ -109,7 +109,7 @@ public: jassert (p != nullptr); setOpaque (true); - addAndMakeVisible (&panel); + addAndMakeVisible (panel); Array programs; diff --git a/extras/browser plugin demo/src/JuceBrowserPluginDemo.cpp b/extras/browser plugin demo/src/JuceBrowserPluginDemo.cpp index 861cb00b1a..2a6a9fc20f 100644 --- a/extras/browser plugin demo/src/JuceBrowserPluginDemo.cpp +++ b/extras/browser plugin demo/src/JuceBrowserPluginDemo.cpp @@ -37,11 +37,11 @@ public: : textBox (String::empty), button ("Send a message to the webpage") { - addAndMakeVisible (&textBox); + addAndMakeVisible (textBox); textBox.setMultiLine (true); textBox.setBounds (8, 8, 300, 300); - addAndMakeVisible (&button); + addAndMakeVisible (button); button.setBounds (320, 8, 180, 22); button.addListener (this); button.setEnabled (false); diff --git a/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm b/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm index 25b4fc834f..b1d9ec27ea 100644 --- a/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm +++ b/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm @@ -1372,7 +1372,7 @@ private: JUCE_AUTORELEASEPOOL { jassert (ed != nullptr); - addAndMakeVisible (&editor); + addAndMakeVisible (editor); setOpaque (true); setVisible (true); setBroughtToFrontOnMouseClick (true); diff --git a/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h b/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h index d0613cc4a1..6dfcf87cc9 100644 --- a/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h +++ b/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h @@ -54,7 +54,7 @@ public: { setTitleBarButtonsRequired (DocumentWindow::minimiseButton | DocumentWindow::closeButton, false); - Component::addAndMakeVisible (&optionsButton); + Component::addAndMakeVisible (optionsButton); optionsButton.addListener (this); optionsButton.setTriggeredOnMouseDown (true); diff --git a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm index 64beb38ffe..375b2e7957 100644 --- a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm +++ b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm @@ -1303,7 +1303,7 @@ public: : AudioProcessorEditor (&p), plugin (p) { - addAndMakeVisible (&wrapper); + addAndMakeVisible (wrapper); setOpaque (true); setVisible (true); diff --git a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp index 58fb001583..8d02e5ae27 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp @@ -1682,7 +1682,7 @@ private: pluginHandle = (HandleFormat) peer->getNativeHandle(); #elif JUCE_MAC dummyComponent.setBounds (getBounds().withZeroOrigin()); - addAndMakeVisible (&dummyComponent); + addAndMakeVisible (dummyComponent); pluginHandle = [[NSView alloc] init]; dummyComponent.setView (pluginHandle); #endif diff --git a/modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.cpp b/modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.cpp index 1b584e8376..4b9da9b75d 100644 --- a/modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.cpp +++ b/modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.cpp @@ -35,7 +35,7 @@ public: slider (p, index_) { startTimer (100); - addAndMakeVisible (&slider); + addAndMakeVisible (slider); owner.addListener (this); } @@ -123,7 +123,7 @@ GenericAudioProcessorEditor::GenericAudioProcessorEditor (AudioProcessor* const jassert (p != nullptr); setOpaque (true); - addAndMakeVisible (&panel); + addAndMakeVisible (panel); Array params; diff --git a/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp b/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp index 119bfeb621..81122776f3 100644 --- a/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp +++ b/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp @@ -152,9 +152,9 @@ PluginListComponent::PluginListComponent (AudioPluginFormatManager& manager, Kno table.setHeaderHeight (22); table.setRowHeight (20); table.setModel (tableModel); - addAndMakeVisible (&table); + addAndMakeVisible (table); - addAndMakeVisible (&optionsButton); + addAndMakeVisible (optionsButton); optionsButton.addListener (this); optionsButton.setTriggeredOnMouseDown (true); diff --git a/modules/juce_gui_basics/components/juce_Component.cpp b/modules/juce_gui_basics/components/juce_Component.cpp index de4244ef5c..414dc362cb 100644 --- a/modules/juce_gui_basics/components/juce_Component.cpp +++ b/modules/juce_gui_basics/components/juce_Component.cpp @@ -1443,25 +1443,25 @@ Component* Component::getComponentAt (const int x, const int y) } //============================================================================== -void Component::addChildComponent (Component* const child, int zOrder) +void Component::addChildComponent (Component& child, int zOrder) { // if component methods are being called from threads other than the message // thread, you'll need to use a MessageManagerLock object to make sure it's thread-safe. CHECK_MESSAGE_MANAGER_IS_LOCKED_OR_OFFSCREEN - if (child != nullptr && child->parentComponent != this) + if (child.parentComponent != this) { - if (child->parentComponent != nullptr) - child->parentComponent->removeChildComponent (child); + if (child.parentComponent != nullptr) + child.parentComponent->removeChildComponent (&child); else - child->removeFromDesktop(); + child.removeFromDesktop(); - child->parentComponent = this; + child.parentComponent = this; - if (child->isVisible()) - child->repaintParent(); + if (child.isVisible()) + child.repaintParent(); - if (! child->isAlwaysOnTop()) + if (! child.isAlwaysOnTop()) { if (zOrder < 0 || zOrder > childComponentList.size()) zOrder = childComponentList.size(); @@ -1475,20 +1475,29 @@ void Component::addChildComponent (Component* const child, int zOrder) } } - childComponentList.insert (zOrder, child); + childComponentList.insert (zOrder, &child); - child->internalHierarchyChanged(); + child.internalHierarchyChanged(); internalChildrenChanged(); } } +void Component::addAndMakeVisible (Component& child, int zOrder) +{ + child.setVisible (true); + addChildComponent (child, zOrder); +} + +void Component::addChildComponent (Component* const child, int zOrder) +{ + if (child != nullptr) + addChildComponent (*child, zOrder); +} + void Component::addAndMakeVisible (Component* const child, int zOrder) { if (child != nullptr) - { - child->setVisible (true); - addChildComponent (child, zOrder); - } + addAndMakeVisible (*child, zOrder); } void Component::addChildAndSetID (Component* const child, const String& childID) diff --git a/modules/juce_gui_basics/components/juce_Component.h b/modules/juce_gui_basics/components/juce_Component.h index 313216e53d..00ef6ec8b8 100644 --- a/modules/juce_gui_basics/components/juce_Component.h +++ b/modules/juce_gui_basics/components/juce_Component.h @@ -703,13 +703,38 @@ public: */ void addChildComponent (Component* child, int zOrder = -1); - /** Adds a child component to this one, and also makes the child visible if it isn't. + /** Adds a child component to this one. + + Adding a child component does not mean that the component will own or delete the child - it's + your responsibility to delete the component. Note that it's safe to delete a component + without first removing it from its parent - doing so will automatically remove it and + send out the appropriate notifications before the deletion completes. + + If the child is already a child of this component, then no action will be taken, and its + z-order will be left unchanged. + + @param child the new component to add. If the component passed-in is already + the child of another component, it'll first be removed from it current parent. + @param zOrder The index in the child-list at which this component should be inserted. + A value of -1 will insert it in front of the others, 0 is the back. + @see removeChildComponent, addAndMakeVisible, addChildAndSetID, getChild, ComponentListener::componentChildrenChanged + */ + void addChildComponent (Component& child, int zOrder = -1); + + /** Adds a child component to this one, and also makes the child visible if it isn't already. - Quite a useful function, this is just the same as calling setVisible (true) on the child - and then addChildComponent(). See addChildComponent() for more details. + This is the same as calling setVisible (true) on the child and then addChildComponent(). + See addChildComponent() for more details. */ void addAndMakeVisible (Component* child, int zOrder = -1); + /** Adds a child component to this one, and also makes the child visible if it isn't already. + + This is the same as calling setVisible (true) on the child and then addChildComponent(). + See addChildComponent() for more details. + */ + void addAndMakeVisible (Component& child, int zOrder = -1); + /** Adds a child component to this one, makes it visible, and sets its component ID. @see addAndMakeVisible, addChildComponent */ diff --git a/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.cpp b/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.cpp index 33c485d569..4a2f023877 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.cpp +++ b/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.cpp @@ -84,19 +84,19 @@ FileBrowserComponent::FileBrowserComponent (int flags_, fileListComponent->addListener (this); - addAndMakeVisible (¤tPathBox); + addAndMakeVisible (currentPathBox); currentPathBox.setEditableText (true); resetRecentPaths(); currentPathBox.addListener (this); - addAndMakeVisible (&filenameBox); + addAndMakeVisible (filenameBox); filenameBox.setMultiLine (false); filenameBox.setSelectAllWhenFocused (true); filenameBox.setText (filename, false); filenameBox.addListener (this); filenameBox.setReadOnly ((flags & (filenameBoxIsReadOnly | canSelectMultipleItems)) != 0); - addAndMakeVisible (&fileLabel); + addAndMakeVisible (fileLabel); fileLabel.attachToComponent (&filenameBox, true); addAndMakeVisible (goUpButton = getLookAndFeel().createFileBrowserGoUpButton()); diff --git a/modules/juce_gui_basics/filebrowser/juce_FileChooserDialogBox.cpp b/modules/juce_gui_basics/filebrowser/juce_FileChooserDialogBox.cpp index 745f8ee4fd..adf1a74750 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FileChooserDialogBox.cpp +++ b/modules/juce_gui_basics/filebrowser/juce_FileChooserDialogBox.cpp @@ -33,15 +33,15 @@ public: newFolderButton (TRANS ("New Folder")), instructions (desc) { - addAndMakeVisible (&chooserComponent); + addAndMakeVisible (chooserComponent); - addAndMakeVisible (&okButton); + addAndMakeVisible (okButton); okButton.addShortcut (KeyPress (KeyPress::returnKey)); - addAndMakeVisible (&cancelButton); + addAndMakeVisible (cancelButton); cancelButton.addShortcut (KeyPress (KeyPress::escapeKey)); - addChildComponent (&newFolderButton); + addChildComponent (newFolderButton); setInterceptsMouseClicks (false, true); } diff --git a/modules/juce_gui_basics/filebrowser/juce_FileSearchPathListComponent.cpp b/modules/juce_gui_basics/filebrowser/juce_FileSearchPathListComponent.cpp index 2840480dde..a2cad464b9 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FileSearchPathListComponent.cpp +++ b/modules/juce_gui_basics/filebrowser/juce_FileSearchPathListComponent.cpp @@ -30,23 +30,23 @@ FileSearchPathListComponent::FileSearchPathListComponent() downButton (String::empty, DrawableButton::ImageOnButtonBackground) { listBox.setModel (this); - addAndMakeVisible (&listBox); + addAndMakeVisible (listBox); listBox.setColour (ListBox::backgroundColourId, Colours::black.withAlpha (0.02f)); listBox.setColour (ListBox::outlineColourId, Colours::black.withAlpha (0.1f)); listBox.setOutlineThickness (1); - addAndMakeVisible (&addButton); + addAndMakeVisible (addButton); addButton.addListener (this); addButton.setConnectedEdges (Button::ConnectedOnLeft | Button::ConnectedOnRight | Button::ConnectedOnBottom | Button::ConnectedOnTop); - addAndMakeVisible (&removeButton); + addAndMakeVisible (removeButton); removeButton.addListener (this); removeButton.setConnectedEdges (Button::ConnectedOnLeft | Button::ConnectedOnRight | Button::ConnectedOnBottom | Button::ConnectedOnTop); - addAndMakeVisible (&changeButton); + addAndMakeVisible (changeButton); changeButton.addListener (this); - addAndMakeVisible (&upButton); + addAndMakeVisible (upButton); upButton.addListener (this); { @@ -59,7 +59,7 @@ FileSearchPathListComponent::FileSearchPathListComponent() upButton.setImages (&arrowImage); } - addAndMakeVisible (&downButton); + addAndMakeVisible (downButton); downButton.addListener (this); { diff --git a/modules/juce_gui_basics/filebrowser/juce_FilenameComponent.cpp b/modules/juce_gui_basics/filebrowser/juce_FilenameComponent.cpp index 84c5c64374..e4f18bcdff 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FilenameComponent.cpp +++ b/modules/juce_gui_basics/filebrowser/juce_FilenameComponent.cpp @@ -38,7 +38,7 @@ FilenameComponent::FilenameComponent (const String& name, wildcard (fileBrowserWildcard), enforcedSuffix (suffix) { - addAndMakeVisible (&filenameBox); + addAndMakeVisible (filenameBox); filenameBox.setEditableText (canEditFilename); filenameBox.addListener (this); filenameBox.setTextWhenNothingSelected (textWhenNothingSelected); diff --git a/modules/juce_gui_basics/layout/juce_Viewport.cpp b/modules/juce_gui_basics/layout/juce_Viewport.cpp index d026740e38..d4d0e7297c 100644 --- a/modules/juce_gui_basics/layout/juce_Viewport.cpp +++ b/modules/juce_gui_basics/layout/juce_Viewport.cpp @@ -34,11 +34,11 @@ Viewport::Viewport (const String& name) horizontalScrollBar (false) { // content holder is used to clip the contents so they don't overlap the scrollbars - addAndMakeVisible (&contentHolder); + addAndMakeVisible (contentHolder); contentHolder.setInterceptsMouseClicks (false, true); - addChildComponent (&verticalScrollBar); - addChildComponent (&horizontalScrollBar); + addChildComponent (verticalScrollBar); + addChildComponent (horizontalScrollBar); verticalScrollBar.addListener (this); horizontalScrollBar.addListener (this); diff --git a/modules/juce_gui_basics/properties/juce_BooleanPropertyComponent.cpp b/modules/juce_gui_basics/properties/juce_BooleanPropertyComponent.cpp index adf1ecf1be..6f0d458806 100644 --- a/modules/juce_gui_basics/properties/juce_BooleanPropertyComponent.cpp +++ b/modules/juce_gui_basics/properties/juce_BooleanPropertyComponent.cpp @@ -29,7 +29,7 @@ BooleanPropertyComponent::BooleanPropertyComponent (const String& name, onText (buttonTextWhenTrue), offText (buttonTextWhenFalse) { - addAndMakeVisible (&button); + addAndMakeVisible (button); button.setClickingTogglesState (false); button.addListener (this); } @@ -41,7 +41,7 @@ BooleanPropertyComponent::BooleanPropertyComponent (const Value& valueToControl, onText (buttonText), offText (buttonText) { - addAndMakeVisible (&button); + addAndMakeVisible (button); button.setClickingTogglesState (false); button.setButtonText (buttonText); button.getToggleStateValue().referTo (valueToControl); diff --git a/modules/juce_gui_basics/properties/juce_ButtonPropertyComponent.cpp b/modules/juce_gui_basics/properties/juce_ButtonPropertyComponent.cpp index 1459dd3703..cf03191e46 100644 --- a/modules/juce_gui_basics/properties/juce_ButtonPropertyComponent.cpp +++ b/modules/juce_gui_basics/properties/juce_ButtonPropertyComponent.cpp @@ -26,7 +26,7 @@ ButtonPropertyComponent::ButtonPropertyComponent (const String& name, const bool triggerOnMouseDown) : PropertyComponent (name) { - addAndMakeVisible (&button); + addAndMakeVisible (button); button.setTriggeredOnMouseDown (triggerOnMouseDown); button.addListener (this); } diff --git a/modules/juce_gui_basics/properties/juce_ChoicePropertyComponent.cpp b/modules/juce_gui_basics/properties/juce_ChoicePropertyComponent.cpp index 9168e43ee3..66b5481249 100644 --- a/modules/juce_gui_basics/properties/juce_ChoicePropertyComponent.cpp +++ b/modules/juce_gui_basics/properties/juce_ChoicePropertyComponent.cpp @@ -96,7 +96,7 @@ ChoicePropertyComponent::~ChoicePropertyComponent() //============================================================================== void ChoicePropertyComponent::createComboBox() { - addAndMakeVisible (&comboBox); + addAndMakeVisible (comboBox); for (int i = 0; i < choices.size(); ++i) { diff --git a/modules/juce_gui_basics/properties/juce_PropertyPanel.cpp b/modules/juce_gui_basics/properties/juce_PropertyPanel.cpp index fd1c21d3ec..dc93d7cf6a 100644 --- a/modules/juce_gui_basics/properties/juce_PropertyPanel.cpp +++ b/modules/juce_gui_basics/properties/juce_PropertyPanel.cpp @@ -193,7 +193,7 @@ void PropertyPanel::init() { messageWhenEmpty = TRANS("(nothing selected)"); - addAndMakeVisible (&viewport); + addAndMakeVisible (viewport); viewport.setViewedComponent (propertyHolderComponent = new PropertyHolderComponent()); viewport.setFocusContainer (true); } diff --git a/modules/juce_gui_basics/properties/juce_SliderPropertyComponent.cpp b/modules/juce_gui_basics/properties/juce_SliderPropertyComponent.cpp index def6b12fd1..d1190ae3e5 100644 --- a/modules/juce_gui_basics/properties/juce_SliderPropertyComponent.cpp +++ b/modules/juce_gui_basics/properties/juce_SliderPropertyComponent.cpp @@ -29,7 +29,7 @@ SliderPropertyComponent::SliderPropertyComponent (const String& name, const double skewFactor) : PropertyComponent (name) { - addAndMakeVisible (&slider); + addAndMakeVisible (slider); slider.setRange (rangeMin, rangeMax, interval); slider.setSkewFactor (skewFactor); @@ -46,7 +46,7 @@ SliderPropertyComponent::SliderPropertyComponent (const Value& valueToControl, const double skewFactor) : PropertyComponent (name) { - addAndMakeVisible (&slider); + addAndMakeVisible (slider); slider.setRange (rangeMin, rangeMax, interval); slider.setSkewFactor (skewFactor); diff --git a/modules/juce_gui_basics/widgets/juce_Toolbar.cpp b/modules/juce_gui_basics/widgets/juce_Toolbar.cpp index 2987e8598c..fc7b4a29f6 100644 --- a/modules/juce_gui_basics/widgets/juce_Toolbar.cpp +++ b/modules/juce_gui_basics/widgets/juce_Toolbar.cpp @@ -713,13 +713,13 @@ private: + TRANS ("Items on the toolbar can also be dragged around to change their order, or dragged off the edge to delete them.")), defaultButton (TRANS ("Restore to default set of items")) { - addAndMakeVisible (&palette); + addAndMakeVisible (palette); if ((optionFlags & (Toolbar::allowIconsOnlyChoice | Toolbar::allowIconsWithTextChoice | Toolbar::allowTextOnlyChoice)) != 0) { - addAndMakeVisible (&styleBox); + addAndMakeVisible (styleBox); styleBox.setEditableText (false); if ((optionFlags & Toolbar::allowIconsOnlyChoice) != 0) styleBox.addItem (TRANS("Show icons only"), 1); @@ -741,11 +741,11 @@ private: if ((optionFlags & Toolbar::showResetToDefaultsButton) != 0) { - addAndMakeVisible (&defaultButton); + addAndMakeVisible (defaultButton); defaultButton.addListener (this); } - addAndMakeVisible (&instructions); + addAndMakeVisible (instructions); instructions.setFont (Font (13.0f)); setSize (500, 300); diff --git a/modules/juce_gui_basics/widgets/juce_ToolbarItemPalette.cpp b/modules/juce_gui_basics/widgets/juce_ToolbarItemPalette.cpp index 8f3bb5db4c..a4b6d52114 100644 --- a/modules/juce_gui_basics/widgets/juce_ToolbarItemPalette.cpp +++ b/modules/juce_gui_basics/widgets/juce_ToolbarItemPalette.cpp @@ -28,13 +28,13 @@ ToolbarItemPalette::ToolbarItemPalette (ToolbarItemFactory& tbf, Toolbar& bar) Component* const itemHolder = new Component(); viewport.setViewedComponent (itemHolder); - Array allIds; + Array allIds; factory.getAllToolbarItemIds (allIds); for (int i = 0; i < allIds.size(); ++i) addComponent (allIds.getUnchecked (i), -1); - addAndMakeVisible (&viewport); + addAndMakeVisible (viewport); } ToolbarItemPalette::~ToolbarItemPalette() diff --git a/modules/juce_gui_basics/windows/juce_CallOutBox.cpp b/modules/juce_gui_basics/windows/juce_CallOutBox.cpp index 742bda9c62..1276f43e2c 100644 --- a/modules/juce_gui_basics/windows/juce_CallOutBox.cpp +++ b/modules/juce_gui_basics/windows/juce_CallOutBox.cpp @@ -25,7 +25,7 @@ CallOutBox::CallOutBox (Component& c, const Rectangle& area, Component* const parent) : borderSpace (20), arrowSize (16.0f), content (c) { - addAndMakeVisible (&content); + addAndMakeVisible (content); if (parent != nullptr) { diff --git a/modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.cpp b/modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.cpp index a67c42d64b..cd10127abd 100644 --- a/modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.cpp +++ b/modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.cpp @@ -365,10 +365,10 @@ CodeEditorComponent::CodeEditorComponent (CodeDocument& doc, CodeTokeniser* cons addAndMakeVisible (caret = getLookAndFeel().createCaretComponent (this)); - addAndMakeVisible (&verticalScrollBar); + addAndMakeVisible (verticalScrollBar); verticalScrollBar.setSingleStepSize (1.0); - addAndMakeVisible (&horizontalScrollBar); + addAndMakeVisible (horizontalScrollBar); horizontalScrollBar.setSingleStepSize (1.0); Font f (12.0f); diff --git a/modules/juce_gui_extra/misc/juce_ColourSelector.cpp b/modules/juce_gui_extra/misc/juce_ColourSelector.cpp index 1343b215b8..b41379d138 100644 --- a/modules/juce_gui_extra/misc/juce_ColourSelector.cpp +++ b/modules/juce_gui_extra/misc/juce_ColourSelector.cpp @@ -73,7 +73,7 @@ public: ColourSpaceView (ColourSelector& cs, float& hue, float& sat, float& val, const int edgeSize) : owner (cs), h (hue), s (sat), v (val), lastHue (0.0f), edge (edgeSize) { - addAndMakeVisible (&marker); + addAndMakeVisible (marker); setMouseCursor (MouseCursor::CrosshairCursor); } @@ -199,7 +199,7 @@ public: HueSelectorComp (ColourSelector& cs, float& hue, const int edgeSize) : owner (cs), h (hue), edge (edgeSize) { - addAndMakeVisible (&marker); + addAndMakeVisible (marker); } void paint (Graphics& g) override diff --git a/modules/juce_gui_extra/misc/juce_KeyMappingEditorComponent.cpp b/modules/juce_gui_extra/misc/juce_KeyMappingEditorComponent.cpp index 6299abf692..bfded7a68c 100644 --- a/modules/juce_gui_extra/misc/juce_KeyMappingEditorComponent.cpp +++ b/modules/juce_gui_extra/misc/juce_KeyMappingEditorComponent.cpp @@ -403,11 +403,11 @@ KeyMappingEditorComponent::KeyMappingEditorComponent (KeyPressMappingSet& mappin if (showResetToDefaultButton) { - addAndMakeVisible (&resetButton); + addAndMakeVisible (resetButton); resetButton.addListener (treeItem); } - addAndMakeVisible (&tree); + addAndMakeVisible (tree); tree.setColour (TreeView::backgroundColourId, findColour (backgroundColourId)); tree.setRootItemVisible (false); tree.setDefaultOpenness (true); diff --git a/modules/juce_gui_extra/misc/juce_LiveConstantEditor.cpp b/modules/juce_gui_extra/misc/juce_LiveConstantEditor.cpp index 8a80785993..38c9ab9c92 100644 --- a/modules/juce_gui_extra/misc/juce_LiveConstantEditor.cpp +++ b/modules/juce_gui_extra/misc/juce_LiveConstantEditor.cpp @@ -107,10 +107,10 @@ LivePropertyEditorBase::LivePropertyEditorBase (LiveValueBase& v, CodeDocument& { setSize (600, 100); - addAndMakeVisible (&name); - addAndMakeVisible (&resetButton); - addAndMakeVisible (&valueEditor); - addAndMakeVisible (&sourceEditor); + addAndMakeVisible (name); + addAndMakeVisible (resetButton); + addAndMakeVisible (valueEditor); + addAndMakeVisible (sourceEditor); findOriginalValueInCode(); selectOriginalValue(); @@ -420,7 +420,7 @@ public: : editor (e), isFloat (useFloat) { slider.setTextBoxStyle (Slider::NoTextBox, true, 0, 0); - addAndMakeVisible (&slider); + addAndMakeVisible (slider); updateRange(); slider.addListener (this); }