Browse Source

Finally removed the juce_malloc and juce_free functions! Misc minor tidying-up.

tags/2021-05-28
Julian Storer 14 years ago
parent
commit
f307045b92
100 changed files with 977 additions and 1198 deletions
  1. +5
    -3
      extras/JuceDemo/Source/demos/AudioDemoLatencyPage.cpp
  2. +6
    -4
      extras/JuceDemo/Source/demos/AudioDemoLatencyPage.h
  3. +6
    -4
      extras/JuceDemo/Source/demos/AudioDemoPlaybackPage.cpp
  4. +6
    -4
      extras/JuceDemo/Source/demos/AudioDemoPlaybackPage.h
  5. +6
    -4
      extras/JuceDemo/Source/demos/AudioDemoRecordPage.cpp
  6. +6
    -4
      extras/JuceDemo/Source/demos/AudioDemoRecordPage.h
  7. +3
    -1
      extras/JuceDemo/Source/demos/AudioDemoSetupPage.cpp
  8. +7
    -5
      extras/JuceDemo/Source/demos/AudioDemoSetupPage.h
  9. +6
    -4
      extras/JuceDemo/Source/demos/AudioDemoSynthPage.cpp
  10. +6
    -4
      extras/JuceDemo/Source/demos/AudioDemoSynthPage.h
  11. +8
    -6
      extras/JuceDemo/Source/demos/AudioDemoTabComponent.cpp
  12. +6
    -4
      extras/JuceDemo/Source/demos/AudioDemoTabComponent.h
  13. +68
    -66
      extras/JuceDemo/Source/demos/RenderingTestComponent.cpp
  14. +6
    -4
      extras/JuceDemo/Source/demos/RenderingTestComponent.h
  15. +6
    -4
      extras/example projects/Source/MainComponent.cpp
  16. +8
    -6
      extras/example projects/Source/MainComponent.h
  17. +28
    -31
      extras/the jucer/src/model/components/jucer_ButtonHandler.h
  18. +24
    -27
      extras/the jucer/src/model/components/jucer_ComboBoxHandler.h
  19. +6
    -12
      extras/the jucer/src/model/components/jucer_ComponentNameProperty.h
  20. +27
    -27
      extras/the jucer/src/model/components/jucer_ComponentTypeHandler.cpp
  21. +1
    -4
      extras/the jucer/src/model/components/jucer_ComponentTypeHandler.h
  22. +10
    -16
      extras/the jucer/src/model/components/jucer_GenericComponentHandler.h
  23. +9
    -12
      extras/the jucer/src/model/components/jucer_GroupComponentHandler.h
  24. +5
    -7
      extras/the jucer/src/model/components/jucer_HyperlinkButtonHandler.h
  25. +23
    -28
      extras/the jucer/src/model/components/jucer_ImageButtonHandler.h
  26. +13
    -17
      extras/the jucer/src/model/components/jucer_JucerComponentHandler.h
  27. +45
    -48
      extras/the jucer/src/model/components/jucer_LabelHandler.h
  28. +68
    -70
      extras/the jucer/src/model/components/jucer_SliderHandler.h
  29. +56
    -59
      extras/the jucer/src/model/components/jucer_TabbedComponentHandler.h
  30. +1
    -7
      extras/the jucer/src/model/components/jucer_TextButtonHandler.h
  31. +30
    -33
      extras/the jucer/src/model/components/jucer_TextEditorHandler.h
  32. +5
    -8
      extras/the jucer/src/model/components/jucer_ToggleButtonHandler.h
  33. +12
    -15
      extras/the jucer/src/model/components/jucer_TreeViewHandler.h
  34. +32
    -42
      extras/the jucer/src/model/components/jucer_ViewportHandler.h
  35. +13
    -13
      extras/the jucer/src/model/documents/jucer_ButtonDocument.cpp
  36. +0
    -5
      extras/the jucer/src/model/documents/jucer_ButtonDocument.h
  37. +1
    -1
      extras/the jucer/src/model/documents/jucer_ComponentDocument.cpp
  38. +1
    -5
      extras/the jucer/src/model/documents/jucer_ComponentDocument.h
  39. +5
    -5
      extras/the jucer/src/model/jucer_BinaryResources.cpp
  40. +0
    -2
      extras/the jucer/src/model/jucer_BinaryResources.h
  41. +4
    -4
      extras/the jucer/src/model/jucer_ComponentLayout.cpp
  42. +4
    -4
      extras/the jucer/src/model/jucer_GeneratedCode.cpp
  43. +45
    -45
      extras/the jucer/src/model/jucer_JucerDocument.cpp
  44. +0
    -2
      extras/the jucer/src/model/jucer_JucerDocument.h
  45. +3
    -3
      extras/the jucer/src/model/jucer_ObjectTypes.cpp
  46. +3
    -3
      extras/the jucer/src/model/jucer_PaintRoutine.cpp
  47. +48
    -48
      extras/the jucer/src/model/paintelements/jucer_ColouredElement.cpp
  48. +0
    -3
      extras/the jucer/src/model/paintelements/jucer_ColouredElement.h
  49. +23
    -23
      extras/the jucer/src/model/paintelements/jucer_FillType.cpp
  50. +7
    -7
      extras/the jucer/src/model/paintelements/jucer_ImageResourceProperty.h
  51. +5
    -5
      extras/the jucer/src/model/paintelements/jucer_PaintElement.cpp
  52. +0
    -1
      extras/the jucer/src/model/paintelements/jucer_PaintElement.h
  53. +3
    -6
      extras/the jucer/src/model/paintelements/jucer_PaintElementEllipse.h
  54. +3
    -5
      extras/the jucer/src/model/paintelements/jucer_PaintElementGroup.h
  55. +20
    -23
      extras/the jucer/src/model/paintelements/jucer_PaintElementImage.h
  56. +21
    -21
      extras/the jucer/src/model/paintelements/jucer_PaintElementPath.cpp
  57. +0
    -9
      extras/the jucer/src/model/paintelements/jucer_PaintElementPath.h
  58. +0
    -4
      extras/the jucer/src/model/paintelements/jucer_PaintElementRectangle.h
  59. +7
    -10
      extras/the jucer/src/model/paintelements/jucer_PaintElementRoundedRectangle.h
  60. +2
    -5
      extras/the jucer/src/model/paintelements/jucer_PaintElementText.h
  61. +7
    -7
      extras/the jucer/src/model/paintelements/jucer_StrokeType.cpp
  62. +0
    -3
      extras/the jucer/src/properties/jucer_ColourPropertyComponent.h
  63. +2
    -5
      extras/the jucer/src/properties/jucer_ComponentColourProperty.h
  64. +1
    -4
      extras/the jucer/src/properties/jucer_FilePropertyComponent.h
  65. +11
    -11
      extras/the jucer/src/properties/jucer_FontPropertyComponent.cpp
  66. +0
    -2
      extras/the jucer/src/properties/jucer_FontPropertyComponent.h
  67. +15
    -18
      extras/the jucer/src/properties/jucer_PositionPropertyBase.h
  68. +0
    -3
      extras/the jucer/src/ui/jucer_ComponentLayoutEditor.h
  69. +0
    -3
      extras/the jucer/src/ui/jucer_ComponentLayoutPanel.cpp
  70. +0
    -3
      extras/the jucer/src/ui/jucer_ComponentLayoutPanel.h
  71. +0
    -3
      extras/the jucer/src/ui/jucer_ComponentOverlayComponent.h
  72. +0
    -3
      extras/the jucer/src/ui/jucer_EditingPanelBase.h
  73. +74
    -74
      extras/the jucer/src/ui/jucer_JucerDocumentHolder.cpp
  74. +0
    -3
      extras/the jucer/src/ui/jucer_JucerDocumentHolder.h
  75. +7
    -7
      extras/the jucer/src/ui/jucer_MainWindow.cpp
  76. +0
    -3
      extras/the jucer/src/ui/jucer_MainWindow.h
  77. +0
    -3
      extras/the jucer/src/ui/jucer_PaintRoutineEditor.h
  78. +0
    -3
      extras/the jucer/src/ui/jucer_PaintRoutinePanel.cpp
  79. +0
    -3
      extras/the jucer/src/ui/jucer_PaintRoutinePanel.h
  80. +8
    -8
      extras/the jucer/src/ui/jucer_PrefsPanel.cpp
  81. +4
    -4
      extras/the jucer/src/ui/jucer_ResourceEditorPanel.cpp
  82. +0
    -3
      extras/the jucer/src/ui/jucer_ResourceEditorPanel.h
  83. +0
    -3
      extras/the jucer/src/ui/jucer_SnapGridPainter.h
  84. +3
    -3
      extras/the jucer/src/ui/jucer_TestComponent.cpp
  85. +0
    -3
      extras/the jucer/src/ui/jucer_TestComponent.h
  86. +2
    -4
      extras/the jucer/src/utility/jucer_ColourEditorComponent.h
  87. +10
    -10
      extras/the jucer/src/utility/jucer_StoredSettings.cpp
  88. +0
    -3
      extras/the jucer/src/utility/jucer_StoredSettings.h
  89. +6
    -6
      extras/the jucer/src/utility/jucer_UtilityFunctions.cpp
  90. +1
    -1
      src/audio/processors/juce_AudioProcessorGraph.h
  91. +1
    -1
      src/containers/juce_NamedValueSet.cpp
  92. +1
    -1
      src/containers/juce_NamedValueSet.h
  93. +0
    -14
      src/core/juce_SystemStats.cpp
  94. +8
    -6
      src/gui/components/filebrowser/juce_FileChooserDialogBox.h
  95. +4
    -0
      src/gui/components/filebrowser/juce_WildcardFileFilter.h
  96. +1
    -3
      src/gui/components/windows/juce_ComponentPeer.cpp
  97. +10
    -10
      src/gui/components/windows/juce_ResizableWindow.cpp
  98. +25
    -98
      src/memory/juce_Memory.h
  99. +0
    -4
      src/native/windows/juce_win32_Messaging.cpp
  100. +4
    -0
      src/native/windows/juce_win32_NativeIncludes.h

+ 5
- 3
extras/JuceDemo/Source/demos/AudioDemoLatencyPage.cpp View File

@@ -3,7 +3,7 @@
This is an automatically generated file created by the Jucer!
Creation date: 18 Sep 2009 5:32:11 pm
Creation date: 1 May 2011 1:54:50pm
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
@@ -289,7 +289,7 @@ AudioDemoLatencyPage::AudioDemoLatencyPage (AudioDeviceManager& deviceManager_)
addAndMakeVisible (liveAudioDisplayComp = new LiveAudioInputDisplayComp());
addAndMakeVisible (startTestButton = new TextButton (String::empty));
startTestButton->setButtonText ("Test Latency");
startTestButton->setButtonText (L"Test Latency");
startTestButton->addListener (this);
addAndMakeVisible (testResultsBox = new TextEditor (String::empty));
@@ -302,7 +302,7 @@ AudioDemoLatencyPage::AudioDemoLatencyPage (AudioDeviceManager& deviceManager_)
testResultsBox->setColour (TextEditor::backgroundColourId, Colour (0x32ffffff));
testResultsBox->setColour (TextEditor::outlineColourId, Colour (0x1c000000));
testResultsBox->setColour (TextEditor::shadowColourId, Colour (0x16000000));
testResultsBox->setText ("Running this test measures the round-trip latency between the audio output and input devices you\'ve got selected.\n\nIt\'ll play a sound, then try to measure the time at which the sound arrives back at the audio input. Obviously for this to work you need to have your microphone somewhere near your speakers...");
testResultsBox->setText (L"Running this test measures the round-trip latency between the audio output and input devices you\'ve got selected.\n\nIt\'ll play a sound, then try to measure the time at which the sound arrives back at the audio input. Obviously for this to work you need to have your microphone somewhere near your speakers...");
//[UserPreSize]
@@ -310,6 +310,7 @@ AudioDemoLatencyPage::AudioDemoLatencyPage (AudioDeviceManager& deviceManager_)
setSize (600, 400);
//[Constructor] You can add your own custom stuff here..
deviceManager.addAudioCallback (liveAudioDisplayComp);
@@ -330,6 +331,7 @@ AudioDemoLatencyPage::~AudioDemoLatencyPage()
deleteAndZero (startTestButton);
deleteAndZero (testResultsBox);
//[Destructor]. You can add your own custom destruction code here..
//[/Destructor]
}


+ 6
- 4
extras/JuceDemo/Source/demos/AudioDemoLatencyPage.h View File

@@ -3,7 +3,7 @@
This is an automatically generated file created by the Jucer!
Creation date: 18 Sep 2009 5:32:11 pm
Creation date: 1 May 2011 1:54:50pm
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
@@ -19,8 +19,8 @@
==============================================================================
*/
#ifndef __JUCER_HEADER_AUDIODEMOLATENCYPAGE_AUDIODEMOLATENCYPAGE_BFCD772A__
#define __JUCER_HEADER_AUDIODEMOLATENCYPAGE_AUDIODEMOLATENCYPAGE_BFCD772A__
#ifndef __JUCER_HEADER_AUDIODEMOLATENCYPAGE_AUDIODEMOLATENCYPAGE_7C897E97__
#define __JUCER_HEADER_AUDIODEMOLATENCYPAGE_AUDIODEMOLATENCYPAGE_7C897E97__
//[Headers] -- You can add your own extra header files here --
#include "../jucedemo_headers.h"
@@ -55,6 +55,7 @@ public:
void buttonClicked (Button* buttonThatWasClicked);
//==============================================================================
juce_UseDebuggingNewOperator
@@ -69,6 +70,7 @@ private:
TextButton* startTestButton;
TextEditor* testResultsBox;
//==============================================================================
// (prevent copy constructor and operator= being generated..)
AudioDemoLatencyPage (const AudioDemoLatencyPage&);
@@ -76,4 +78,4 @@ private:
};
#endif // __JUCER_HEADER_AUDIODEMOLATENCYPAGE_AUDIODEMOLATENCYPAGE_BFCD772A__
#endif // __JUCER_HEADER_AUDIODEMOLATENCYPAGE_AUDIODEMOLATENCYPAGE_7C897E97__

+ 6
- 4
extras/JuceDemo/Source/demos/AudioDemoPlaybackPage.cpp View File

@@ -3,7 +3,7 @@
This is an automatically generated file created by the Jucer!
Creation date: 18 Sep 2009 7:17:11 pm
Creation date: 1 May 2011 12:08:14pm
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
@@ -133,7 +133,7 @@ AudioDemoPlaybackPage::AudioDemoPlaybackPage (AudioDeviceManager& deviceManager_
zoomSlider (0)
{
addAndMakeVisible (zoomLabel = new Label (String::empty,
T("zoom:")));
L"zoom:"));
zoomLabel->setFont (Font (15.0000f, Font::plain));
zoomLabel->setJustificationType (Justification::centredRight);
zoomLabel->setEditable (false, false, false);
@@ -143,14 +143,14 @@ AudioDemoPlaybackPage::AudioDemoPlaybackPage (AudioDeviceManager& deviceManager_
addAndMakeVisible (thumbnail = new DemoThumbnailComp());
addAndMakeVisible (startStopButton = new TextButton (String::empty));
startStopButton->setButtonText (T("Play/Stop"));
startStopButton->setButtonText (L"Play/Stop");
startStopButton->addListener (this);
startStopButton->setColour (TextButton::buttonColourId, Colour (0xff79ed7f));
addAndMakeVisible (fileTreeComp = new FileTreeComponent (directoryList));
addAndMakeVisible (explanation = new Label (String::empty,
T("Select an audio file in the treeview above, and this page will display its waveform, and let you play it..")));
L"Select an audio file in the treeview above, and this page will display its waveform, and let you play it.."));
explanation->setFont (Font (14.0000f, Font::plain));
explanation->setJustificationType (Justification::bottomRight);
explanation->setEditable (false, false, false);
@@ -170,6 +170,7 @@ AudioDemoPlaybackPage::AudioDemoPlaybackPage (AudioDeviceManager& deviceManager_
setSize (600, 400);
//[Constructor] You can add your own custom stuff here..
directoryList.setDirectory (File::getSpecialLocation (File::userHomeDirectory), true, true);
thread.startThread (3);
@@ -199,6 +200,7 @@ AudioDemoPlaybackPage::~AudioDemoPlaybackPage()
deleteAndZero (explanation);
deleteAndZero (zoomSlider);
//[Destructor]. You can add your own custom destruction code here..
//[/Destructor]
}


+ 6
- 4
extras/JuceDemo/Source/demos/AudioDemoPlaybackPage.h View File

@@ -3,7 +3,7 @@
This is an automatically generated file created by the Jucer!
Creation date: 18 Sep 2009 7:17:11 pm
Creation date: 1 May 2011 12:08:14pm
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
@@ -19,8 +19,8 @@
==============================================================================
*/
#ifndef __JUCER_HEADER_AUDIODEMOPLAYBACKPAGE_AUDIODEMOPLAYBACKPAGE_8AB55057__
#define __JUCER_HEADER_AUDIODEMOPLAYBACKPAGE_AUDIODEMOPLAYBACKPAGE_8AB55057__
#ifndef __JUCER_HEADER_AUDIODEMOPLAYBACKPAGE_AUDIODEMOPLAYBACKPAGE_81B4F279__
#define __JUCER_HEADER_AUDIODEMOPLAYBACKPAGE_AUDIODEMOPLAYBACKPAGE_81B4F279__
//[Headers] -- You can add your own extra header files here --
#include "../jucedemo_headers.h"
@@ -63,6 +63,7 @@ public:
void sliderValueChanged (Slider* sliderThatWasMoved);
//==============================================================================
juce_UseDebuggingNewOperator
@@ -87,6 +88,7 @@ private:
Label* explanation;
Slider* zoomSlider;
//==============================================================================
// (prevent copy constructor and operator= being generated..)
AudioDemoPlaybackPage (const AudioDemoPlaybackPage&);
@@ -94,4 +96,4 @@ private:
};
#endif // __JUCER_HEADER_AUDIODEMOPLAYBACKPAGE_AUDIODEMOPLAYBACKPAGE_8AB55057__
#endif // __JUCER_HEADER_AUDIODEMOPLAYBACKPAGE_AUDIODEMOPLAYBACKPAGE_81B4F279__

+ 6
- 4
extras/JuceDemo/Source/demos/AudioDemoRecordPage.cpp View File

@@ -3,7 +3,7 @@
This is an automatically generated file created by the Jucer!
Creation date: 13 Nov 2009 3:52:50 pm
Creation date: 1 May 2011 12:08:25pm
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
@@ -146,7 +146,7 @@ AudioDemoRecordPage::AudioDemoRecordPage (AudioDeviceManager& deviceManager_)
addAndMakeVisible (liveAudioDisplayComp = new LiveAudioInputDisplayComp());
addAndMakeVisible (explanationLabel = new Label (String::empty,
T("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.")));
L"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."));
explanationLabel->setFont (Font (15.0000f, Font::plain));
explanationLabel->setJustificationType (Justification::topLeft);
explanationLabel->setEditable (false, false, false);
@@ -154,10 +154,10 @@ AudioDemoRecordPage::AudioDemoRecordPage (AudioDeviceManager& deviceManager_)
explanationLabel->setColour (TextEditor::backgroundColourId, Colour (0x0));
addAndMakeVisible (recordButton = new TextButton (String::empty));
recordButton->setButtonText (T("Record"));
recordButton->setButtonText (L"Record");
recordButton->addListener (this);
recordButton->setColour (TextButton::buttonColourId, Colour (0xffff5c5c));
recordButton->setColour (TextButton::textColourOffId, Colours::black);
recordButton->setColour (TextButton::textColourOnId, Colours::black);
//[UserPreSize]
@@ -165,6 +165,7 @@ AudioDemoRecordPage::AudioDemoRecordPage (AudioDeviceManager& deviceManager_)
setSize (600, 400);
//[Constructor] You can add your own custom stuff here..
recorder = new AudioRecorder();
deviceManager.addAudioCallback (recorder);
@@ -184,6 +185,7 @@ AudioDemoRecordPage::~AudioDemoRecordPage()
deleteAndZero (explanationLabel);
deleteAndZero (recordButton);
//[Destructor]. You can add your own custom destruction code here..
//[/Destructor]
}


+ 6
- 4
extras/JuceDemo/Source/demos/AudioDemoRecordPage.h View File

@@ -3,7 +3,7 @@
This is an automatically generated file created by the Jucer!
Creation date: 13 Nov 2009 3:52:50 pm
Creation date: 1 May 2011 12:08:25pm
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
@@ -19,8 +19,8 @@
==============================================================================
*/
#ifndef __JUCER_HEADER_AUDIODEMORECORDPAGE_AUDIODEMORECORDPAGE_4FF281BF__
#define __JUCER_HEADER_AUDIODEMORECORDPAGE_AUDIODEMORECORDPAGE_4FF281BF__
#ifndef __JUCER_HEADER_AUDIODEMORECORDPAGE_AUDIODEMORECORDPAGE_E12E1947__
#define __JUCER_HEADER_AUDIODEMORECORDPAGE_AUDIODEMORECORDPAGE_E12E1947__
//[Headers] -- You can add your own extra header files here --
#include "../jucedemo_headers.h"
@@ -56,6 +56,7 @@ public:
void visibilityChanged();
//==============================================================================
juce_UseDebuggingNewOperator
@@ -70,6 +71,7 @@ private:
Label* explanationLabel;
TextButton* recordButton;
//==============================================================================
// (prevent copy constructor and operator= being generated..)
AudioDemoRecordPage (const AudioDemoRecordPage&);
@@ -77,4 +79,4 @@ private:
};
#endif // __JUCER_HEADER_AUDIODEMORECORDPAGE_AUDIODEMORECORDPAGE_4FF281BF__
#endif // __JUCER_HEADER_AUDIODEMORECORDPAGE_AUDIODEMORECORDPAGE_E12E1947__

+ 3
- 1
extras/JuceDemo/Source/demos/AudioDemoSetupPage.cpp View File

@@ -3,7 +3,7 @@
This is an automatically generated file created by the Jucer!
Creation date: 18 Sep 2009 11:26:45 am
Creation date: 1 May 2011 1:54:18pm
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
@@ -41,6 +41,7 @@ AudioDemoSetupPage::AudioDemoSetupPage (AudioDeviceManager& deviceManager_)
setSize (600, 400);
//[Constructor] You can add your own custom stuff here..
//[/Constructor]
}
@@ -52,6 +53,7 @@ AudioDemoSetupPage::~AudioDemoSetupPage()
deleteAndZero (deviceSelector);
//[Destructor]. You can add your own custom destruction code here..
//[/Destructor]
}


+ 7
- 5
extras/JuceDemo/Source/demos/AudioDemoSetupPage.h View File

@@ -3,7 +3,7 @@
This is an automatically generated file created by the Jucer!
Creation date: 18 Sep 2009 11:26:45 am
Creation date: 1 May 2011 1:54:18pm
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
@@ -19,8 +19,8 @@
==============================================================================
*/
#ifndef __JUCER_HEADER_AUDIODEMOSETUPPAGE_AUDIODEMOSETUPPAGE_244CE6A7__
#define __JUCER_HEADER_AUDIODEMOSETUPPAGE_AUDIODEMOSETUPPAGE_244CE6A7__
#ifndef __JUCER_HEADER_AUDIODEMOSETUPPAGE_AUDIODEMOSETUPPAGE_A3545895__
#define __JUCER_HEADER_AUDIODEMOSETUPPAGE_AUDIODEMOSETUPPAGE_A3545895__
//[Headers] -- You can add your own extra header files here --
#include "../jucedemo_headers.h"
@@ -51,6 +51,7 @@ public:
void resized();
//==============================================================================
juce_UseDebuggingNewOperator
@@ -62,11 +63,12 @@ private:
//==============================================================================
AudioDeviceSelectorComponent* deviceSelector;
//==============================================================================
// (prevent copy constructor and operator= being generated..)
AudioDemoSetupPage (const AudioDemoSetupPage&);
AudioDemoSetupPage& operator= (const AudioDemoSetupPage&);
const AudioDemoSetupPage& operator= (const AudioDemoSetupPage&);
};
#endif // __JUCER_HEADER_AUDIODEMOSETUPPAGE_AUDIODEMOSETUPPAGE_244CE6A7__
#endif // __JUCER_HEADER_AUDIODEMOSETUPPAGE_AUDIODEMOSETUPPAGE_A3545895__

+ 6
- 4
extras/JuceDemo/Source/demos/AudioDemoSynthPage.cpp View File

@@ -3,7 +3,7 @@
This is an automatically generated file created by the Jucer!
Creation date: 18 Sep 2009 9:46:49 pm
Creation date: 1 May 2011 12:06:00pm
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
@@ -25,7 +25,7 @@
#include "AudioDemoSynthPage.h"
//[MiscUserDefs]
//[MiscUserDefs] You can add your own user definitions and misc code here...
//==============================================================================
/** Our demo synth sound is just a basic sine wave..
@@ -257,13 +257,13 @@ AudioDemoSynthPage::AudioDemoSynthPage (AudioDeviceManager& deviceManager_)
addAndMakeVisible (keyboardComponent = new MidiKeyboardComponent (keyboardState, MidiKeyboardComponent::horizontalKeyboard));
addAndMakeVisible (sineButton = new ToggleButton (String::empty));
sineButton->setButtonText (T("Use sine wave"));
sineButton->setButtonText (L"Use sine wave");
sineButton->setRadioGroupId (321);
sineButton->addListener (this);
sineButton->setToggleState (true, false);
addAndMakeVisible (sampledButton = new ToggleButton (String::empty));
sampledButton->setButtonText (T("Use sampled sound"));
sampledButton->setButtonText (L"Use sampled sound");
sampledButton->setRadioGroupId (321);
sampledButton->addListener (this);
@@ -275,6 +275,7 @@ AudioDemoSynthPage::AudioDemoSynthPage (AudioDeviceManager& deviceManager_)
setSize (600, 400);
//[Constructor] You can add your own custom stuff here..
deviceManager.addAudioCallback (liveAudioDisplayComp);
@@ -300,6 +301,7 @@ AudioDemoSynthPage::~AudioDemoSynthPage()
deleteAndZero (sampledButton);
deleteAndZero (liveAudioDisplayComp);
//[Destructor]. You can add your own custom destruction code here..
//[/Destructor]
}


+ 6
- 4
extras/JuceDemo/Source/demos/AudioDemoSynthPage.h View File

@@ -3,7 +3,7 @@
This is an automatically generated file created by the Jucer!
Creation date: 18 Sep 2009 9:46:49 pm
Creation date: 1 May 2011 12:06:00pm
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
@@ -19,8 +19,8 @@
==============================================================================
*/
#ifndef __JUCER_HEADER_AUDIODEMOSYNTHPAGE_AUDIODEMOSYNTHPAGE_76557DC7__
#define __JUCER_HEADER_AUDIODEMOSYNTHPAGE_AUDIODEMOSYNTHPAGE_76557DC7__
#ifndef __JUCER_HEADER_AUDIODEMOSYNTHPAGE_AUDIODEMOSYNTHPAGE_1E55DCCB__
#define __JUCER_HEADER_AUDIODEMOSYNTHPAGE_AUDIODEMOSYNTHPAGE_1E55DCCB__
//[Headers] -- You can add your own extra header files here --
#include "../jucedemo_headers.h"
@@ -55,6 +55,7 @@ public:
void buttonClicked (Button* buttonThatWasClicked);
//==============================================================================
juce_UseDebuggingNewOperator
@@ -72,6 +73,7 @@ private:
ToggleButton* sampledButton;
LiveAudioInputDisplayComp* liveAudioDisplayComp;
//==============================================================================
// (prevent copy constructor and operator= being generated..)
AudioDemoSynthPage (const AudioDemoSynthPage&);
@@ -79,4 +81,4 @@ private:
};
#endif // __JUCER_HEADER_AUDIODEMOSYNTHPAGE_AUDIODEMOSYNTHPAGE_76557DC7__
#endif // __JUCER_HEADER_AUDIODEMOSYNTHPAGE_AUDIODEMOSYNTHPAGE_1E55DCCB__

+ 8
- 6
extras/JuceDemo/Source/demos/AudioDemoTabComponent.cpp View File

@@ -3,7 +3,7 @@
This is an automatically generated file created by the Jucer!
Creation date: 19 Sep 2009 11:10:57 am
Creation date: 1 May 2011 12:07:35pm
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
@@ -116,11 +116,11 @@ AudioDemoTabComponent::AudioDemoTabComponent ()
{
addAndMakeVisible (tabbedComponent = new TabbedComponent (TabbedButtonBar::TabsAtTop));
tabbedComponent->setTabBarDepth (30);
tabbedComponent->addTab (T("Audio Device Setup"), Colours::lightgrey, new AudioDemoSetupPage (deviceManager), true);
tabbedComponent->addTab (T("File Playback"), Colours::lightgrey, new AudioDemoPlaybackPage (deviceManager), true);
tabbedComponent->addTab (T("Synth Playback"), Colours::lightgrey, new AudioDemoSynthPage (deviceManager), true);
tabbedComponent->addTab (T("Latency Test"), Colours::lightgrey, new AudioDemoLatencyPage (deviceManager), true);
tabbedComponent->addTab (T("Recording"), Colours::lightgrey, new AudioDemoRecordPage (deviceManager), true);
tabbedComponent->addTab (L"Audio Device Setup", Colours::lightgrey, new AudioDemoSetupPage (deviceManager), true);
tabbedComponent->addTab (L"File Playback", Colours::lightgrey, new AudioDemoPlaybackPage (deviceManager), true);
tabbedComponent->addTab (L"Synth Playback", Colours::lightgrey, new AudioDemoSynthPage (deviceManager), true);
tabbedComponent->addTab (L"Latency Test", Colours::lightgrey, new AudioDemoLatencyPage (deviceManager), true);
tabbedComponent->addTab (L"Recording", Colours::lightgrey, new AudioDemoRecordPage (deviceManager), true);
tabbedComponent->setCurrentTabIndex (0);
@@ -130,6 +130,7 @@ AudioDemoTabComponent::AudioDemoTabComponent ()
setSize (600, 400);
//[Constructor] You can add your own custom stuff here..
//[/Constructor]
}
@@ -141,6 +142,7 @@ AudioDemoTabComponent::~AudioDemoTabComponent()
deleteAndZero (tabbedComponent);
//[Destructor]. You can add your own custom destruction code here..
//[/Destructor]
}


+ 6
- 4
extras/JuceDemo/Source/demos/AudioDemoTabComponent.h View File

@@ -3,7 +3,7 @@
This is an automatically generated file created by the Jucer!
Creation date: 19 Sep 2009 11:10:57 am
Creation date: 1 May 2011 12:07:35pm
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
@@ -19,8 +19,8 @@
==============================================================================
*/
#ifndef __JUCER_HEADER_AUDIODEMOTABCOMPONENT_AUDIODEMOTABCOMPONENT_10720733__
#define __JUCER_HEADER_AUDIODEMOTABCOMPONENT_AUDIODEMOTABCOMPONENT_10720733__
#ifndef __JUCER_HEADER_AUDIODEMOTABCOMPONENT_AUDIODEMOTABCOMPONENT_ADE99E0E__
#define __JUCER_HEADER_AUDIODEMOTABCOMPONENT_AUDIODEMOTABCOMPONENT_ADE99E0E__
//[Headers] -- You can add your own extra header files here --
#include "../jucedemo_headers.h"
@@ -81,6 +81,7 @@ public:
void resized();
//==============================================================================
juce_UseDebuggingNewOperator
@@ -92,6 +93,7 @@ private:
//==============================================================================
TabbedComponent* tabbedComponent;
//==============================================================================
// (prevent copy constructor and operator= being generated..)
AudioDemoTabComponent (const AudioDemoTabComponent&);
@@ -99,4 +101,4 @@ private:
};
#endif // __JUCER_HEADER_AUDIODEMOTABCOMPONENT_AUDIODEMOTABCOMPONENT_10720733__
#endif // __JUCER_HEADER_AUDIODEMOTABCOMPONENT_AUDIODEMOTABCOMPONENT_ADE99E0E__

+ 68
- 66
extras/JuceDemo/Source/demos/RenderingTestComponent.cpp View File

@@ -3,7 +3,7 @@
This is an automatically generated file created by the Jucer!
Creation date: 1 Dec 2009 9:04:27 pm
Creation date: 1 May 2011 12:07:57pm
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
@@ -406,22 +406,22 @@ RenderingTestComponent::RenderingTestComponent ()
testTypeComboBox->setEditableText (false);
testTypeComboBox->setJustificationType (Justification::centredLeft);
testTypeComboBox->setTextWhenNothingSelected (String::empty);
testTypeComboBox->setTextWhenNoChoicesAvailable (T("(no choices)"));
testTypeComboBox->addItem (T("Paths - Solid"), 1);
testTypeComboBox->addItem (T("Paths - Linear gradient"), 2);
testTypeComboBox->addItem (T("Paths - Radial gradient"), 3);
testTypeComboBox->addItem (T("Paths - Stroked"), 4);
testTypeComboBox->addItem (T("Images - RGB"), 5);
testTypeComboBox->addItem (T("Images - ARGB"), 6);
testTypeComboBox->addItem (T("Tiled Images - RGB"), 7);
testTypeComboBox->addItem (T("Tiled Images - ARGB"), 8);
testTypeComboBox->addItem (T("Glyphs"), 9);
testTypeComboBox->addItem (T("SVG"), 10);
testTypeComboBox->addItem (T("Lines"), 11);
testTypeComboBox->setTextWhenNoChoicesAvailable (L"(no choices)");
testTypeComboBox->addItem (L"Paths - Solid", 1);
testTypeComboBox->addItem (L"Paths - Linear gradient", 2);
testTypeComboBox->addItem (L"Paths - Radial gradient", 3);
testTypeComboBox->addItem (L"Paths - Stroked", 4);
testTypeComboBox->addItem (L"Images - RGB", 5);
testTypeComboBox->addItem (L"Images - ARGB", 6);
testTypeComboBox->addItem (L"Tiled Images - RGB", 7);
testTypeComboBox->addItem (L"Tiled Images - ARGB", 8);
testTypeComboBox->addItem (L"Glyphs", 9);
testTypeComboBox->addItem (L"SVG", 10);
testTypeComboBox->addItem (L"Lines", 11);
testTypeComboBox->addListener (this);
addAndMakeVisible (testTypeLabel = new Label (String::empty,
T("Test type:")));
L"Test type:"));
testTypeLabel->setFont (Font (15.0000f, Font::plain));
testTypeLabel->setJustificationType (Justification::centredRight);
testTypeLabel->setEditable (false, false, false);
@@ -429,7 +429,7 @@ RenderingTestComponent::RenderingTestComponent ()
testTypeLabel->setColour (TextEditor::backgroundColourId, Colour (0x0));
addAndMakeVisible (speedLabel = new Label (String::empty,
T("speed")));
L"speed"));
speedLabel->setFont (Font (15.0000f, Font::plain));
speedLabel->setJustificationType (Justification::centredLeft);
speedLabel->setEditable (false, false, false);
@@ -445,22 +445,22 @@ RenderingTestComponent::RenderingTestComponent ()
opacitySlider->addListener (this);
addAndMakeVisible (highQualityToggle = new ToggleButton (String::empty));
highQualityToggle->setButtonText (T("Higher quality image interpolation"));
highQualityToggle->setButtonText (L"Higher quality image interpolation");
addAndMakeVisible (animateSizeToggle = new ToggleButton (String::empty));
animateSizeToggle->setButtonText (T("Animate size"));
animateSizeToggle->setButtonText (L"Animate size");
addAndMakeVisible (animateRotationToggle = new ToggleButton (String::empty));
animateRotationToggle->setButtonText (T("Animate rotation"));
animateRotationToggle->setButtonText (L"Animate rotation");
addAndMakeVisible (animatePositionToggle = new ToggleButton (String::empty));
animatePositionToggle->setButtonText (T("Animate position"));
animatePositionToggle->setButtonText (L"Animate position");
addAndMakeVisible (animateFillToggle = new ToggleButton (String::empty));
animateFillToggle->setButtonText (T("Animate gradient"));
animateFillToggle->setButtonText (L"Animate gradient");
addAndMakeVisible (opacityLabel = new Label (String::empty,
T("Opacity:")));
L"Opacity:"));
opacityLabel->setFont (Font (15.0000f, Font::plain));
opacityLabel->setJustificationType (Justification::centredRight);
opacityLabel->setEditable (false, false, false);
@@ -493,7 +493,7 @@ RenderingTestComponent::RenderingTestComponent ()
angleSlider->addListener (this);
addAndMakeVisible (xSliderLabel = new Label (String::empty,
T("X offset:")));
L"X offset:"));
xSliderLabel->setFont (Font (15.0000f, Font::plain));
xSliderLabel->setJustificationType (Justification::centredRight);
xSliderLabel->setEditable (false, false, false);
@@ -501,7 +501,7 @@ RenderingTestComponent::RenderingTestComponent ()
xSliderLabel->setColour (TextEditor::backgroundColourId, Colour (0x0));
addAndMakeVisible (ySliderLabel = new Label (String::empty,
T("Y offset:")));
L"Y offset:"));
ySliderLabel->setFont (Font (15.0000f, Font::plain));
ySliderLabel->setJustificationType (Justification::centredRight);
ySliderLabel->setEditable (false, false, false);
@@ -509,7 +509,7 @@ RenderingTestComponent::RenderingTestComponent ()
ySliderLabel->setColour (TextEditor::backgroundColourId, Colour (0x0));
addAndMakeVisible (sizeSliderLabel = new Label (String::empty,
T("Size:")));
L"Size:"));
sizeSliderLabel->setFont (Font (15.0000f, Font::plain));
sizeSliderLabel->setJustificationType (Justification::centredRight);
sizeSliderLabel->setEditable (false, false, false);
@@ -517,7 +517,7 @@ RenderingTestComponent::RenderingTestComponent ()
sizeSliderLabel->setColour (TextEditor::backgroundColourId, Colour (0x0));
addAndMakeVisible (angleSliderLabel = new Label (String::empty,
T("Angle:")));
L"Angle:"));
angleSliderLabel->setFont (Font (15.0000f, Font::plain));
angleSliderLabel->setJustificationType (Justification::centredRight);
angleSliderLabel->setEditable (false, false, false);
@@ -525,13 +525,13 @@ RenderingTestComponent::RenderingTestComponent ()
angleSliderLabel->setColour (TextEditor::backgroundColourId, Colour (0x0));
addAndMakeVisible (clipToRectangleToggle = new ToggleButton (String::empty));
clipToRectangleToggle->setButtonText (T("Clip to rectangle"));
clipToRectangleToggle->setButtonText (L"Clip to rectangle");
addAndMakeVisible (clipToPathToggle = new ToggleButton (String::empty));
clipToPathToggle->setButtonText (T("Clip to path"));
clipToPathToggle->setButtonText (L"Clip to path");
addAndMakeVisible (clipToImageToggle = new ToggleButton (String::empty));
clipToImageToggle->setButtonText (T("Clip to image"));
clipToImageToggle->setButtonText (L"Clip to image");
//[UserPreSize]
@@ -539,6 +539,7 @@ RenderingTestComponent::RenderingTestComponent ()
setSize (600, 400);
//[Constructor] You can add your own custom stuff here..
testTypeComboBox->setSelectedId (2);
sizeSlider->setValue (1.0, false);
@@ -575,6 +576,7 @@ RenderingTestComponent::~RenderingTestComponent()
deleteAndZero (clipToPathToggle);
deleteAndZero (clipToImageToggle);
//[Destructor]. You can add your own custom destruction code here..
//[/Destructor]
}
@@ -593,25 +595,25 @@ void RenderingTestComponent::paint (Graphics& g)
void RenderingTestComponent::resized()
{
testTypeComboBox->setBounds (proportionOfWidth (0.1652f), 16, proportionOfWidth (0.3425f), 24);
testTypeLabel->setBounds (proportionOfWidth (0.0275f), 16, proportionOfWidth (0.1291f), 24);
speedLabel->setBounds (proportionOfWidth (0.5370f), 16, proportionOfWidth (0.4303f), 24);
testTypeComboBox->setBounds (proportionOfWidth (0.1647f), 16, proportionOfWidth (0.3426f), 24);
testTypeLabel->setBounds (proportionOfWidth (0.0277f), 16, proportionOfWidth (0.1291f), 24);
speedLabel->setBounds (proportionOfWidth (0.5375f), 16, proportionOfWidth (0.4308f), 24);
testCanvas->setBounds (20, 56, getWidth() - 40, getHeight() - 215);
opacitySlider->setBounds (proportionOfWidth (0.5990f), getHeight() - 141, proportionOfWidth (0.3787f), 24);
highQualityToggle->setBounds (proportionOfWidth (0.0224f), getHeight() - 141, proportionOfWidth (0.4458f), 24);
animateSizeToggle->setBounds (proportionOfWidth (0.7573f), getHeight() - 85, proportionOfWidth (0.2237f), 24);
animateRotationToggle->setBounds (proportionOfWidth (0.7573f), getHeight() - 61, proportionOfWidth (0.2237f), 24);
animatePositionToggle->setBounds (proportionOfWidth (0.7573f), getHeight() - 109, proportionOfWidth (0.2237f), 24);
animateFillToggle->setBounds (proportionOfWidth (0.7573f), getHeight() - 37, proportionOfWidth (0.2341f), 24);
opacityLabel->setBounds ((proportionOfWidth (0.5990f)) + -66, getHeight() - 141, 64, 24);
xSlider->setBounds (proportionOfWidth (0.3614f), getHeight() - 109, proportionOfWidth (0.3787f), 24);
ySlider->setBounds (proportionOfWidth (0.3614f), getHeight() - 85, proportionOfWidth (0.3787f), 24);
sizeSlider->setBounds (proportionOfWidth (0.3614f), getHeight() - 61, proportionOfWidth (0.3787f), 24);
angleSlider->setBounds (proportionOfWidth (0.3614f), getHeight() - 37, proportionOfWidth (0.3787f), 24);
xSliderLabel->setBounds (proportionOfWidth (0.2496f), getHeight() - 109, proportionOfWidth (0.1067f), 24);
ySliderLabel->setBounds (proportionOfWidth (0.2496f), getHeight() - 85, proportionOfWidth (0.1067f), 24);
sizeSliderLabel->setBounds (proportionOfWidth (0.2496f), getHeight() - 61, proportionOfWidth (0.1067f), 24);
angleSliderLabel->setBounds (proportionOfWidth (0.2496f), getHeight() - 37, proportionOfWidth (0.1067f), 24);
opacitySlider->setBounds (proportionOfWidth (0.5995f), getHeight() - 141, proportionOfWidth (0.3781f), 24);
highQualityToggle->setBounds (proportionOfWidth (0.0224f), getHeight() - 141, proportionOfWidth (0.4453f), 24);
animateSizeToggle->setBounds (proportionOfWidth (0.7576f), getHeight() - 85, proportionOfWidth (0.2240f), 24);
animateRotationToggle->setBounds (proportionOfWidth (0.7576f), getHeight() - 61, proportionOfWidth (0.2240f), 24);
animatePositionToggle->setBounds (proportionOfWidth (0.7576f), getHeight() - 109, proportionOfWidth (0.2240f), 24);
animateFillToggle->setBounds (proportionOfWidth (0.7576f), getHeight() - 37, proportionOfWidth (0.2345f), 24);
opacityLabel->setBounds ((proportionOfWidth (0.5995f)) + -66, getHeight() - 141, 64, 24);
xSlider->setBounds (proportionOfWidth (0.3610f), getHeight() - 109, proportionOfWidth (0.3781f), 24);
ySlider->setBounds (proportionOfWidth (0.3610f), getHeight() - 85, proportionOfWidth (0.3781f), 24);
sizeSlider->setBounds (proportionOfWidth (0.3610f), getHeight() - 61, proportionOfWidth (0.3781f), 24);
angleSlider->setBounds (proportionOfWidth (0.3610f), getHeight() - 37, proportionOfWidth (0.3781f), 24);
xSliderLabel->setBounds (proportionOfWidth (0.2490f), getHeight() - 109, proportionOfWidth (0.1067f), 24);
ySliderLabel->setBounds (proportionOfWidth (0.2490f), getHeight() - 85, proportionOfWidth (0.1067f), 24);
sizeSliderLabel->setBounds (proportionOfWidth (0.2490f), getHeight() - 61, proportionOfWidth (0.1067f), 24);
angleSliderLabel->setBounds (proportionOfWidth (0.2490f), getHeight() - 37, proportionOfWidth (0.1067f), 24);
clipToRectangleToggle->setBounds (proportionOfWidth (0.0224f), getHeight() - 109, 144, 24);
clipToPathToggle->setBounds (proportionOfWidth (0.0224f), getHeight() - 85, 144, 24);
clipToImageToggle->setBounds (proportionOfWidth (0.0224f), getHeight() - 61, 144, 24);
@@ -689,16 +691,16 @@ BEGIN_JUCER_METADATA
fixedSize="0" initialWidth="600" initialHeight="400">
<BACKGROUND backgroundColour="ffffffff"/>
<COMBOBOX name="" id="216a392b47348589" memberName="testTypeComboBox" virtualName=""
explicitFocusOrder="0" pos="16.469% 16 34.256% 24" editable="0"
explicitFocusOrder="0" pos="16.517% 16 34.291% 24" editable="0"
layout="33" items="Paths - Solid&#10;Paths - Linear gradient&#10;Paths - Radial gradient&#10;Paths - Stroked&#10;Images - RGB&#10;Images - ARGB&#10;Tiled Images - RGB&#10;Tiled Images - ARGB&#10;Glyphs&#10;SVG&#10;Lines"
textWhenNonSelected="" textWhenNoItems="(no choices)"/>
<LABEL name="" id="193cb8e961baa02a" memberName="testTypeLabel" virtualName=""
explicitFocusOrder="0" pos="2.767% 16 12.912% 24" edTextCol="ff000000"
explicitFocusOrder="0" pos="2.693% 16 12.926% 24" edTextCol="ff000000"
edBkgCol="0" labelText="Test type:" editableSingleClick="0" editableDoubleClick="0"
focusDiscardsChanges="0" fontname="Default font" fontsize="15"
bold="0" italic="0" justification="34"/>
<LABEL name="" id="c4977cdfea8776fb" memberName="speedLabel" virtualName=""
explicitFocusOrder="0" pos="53.755% 16 43.083% 24" edTextCol="ff000000"
explicitFocusOrder="0" pos="53.68% 16 43.088% 24" edTextCol="ff000000"
edBkgCol="0" labelText="speed" editableSingleClick="0" editableDoubleClick="0"
focusDiscardsChanges="0" fontname="Default font" fontsize="15"
bold="0" italic="0" justification="33"/>
@@ -706,27 +708,27 @@ BEGIN_JUCER_METADATA
explicitFocusOrder="0" pos="20 56 40M 215M" class="RenderingTestCanvas"
params="*this"/>
<SLIDER name="" id="e970a33ca991909e" memberName="opacitySlider" virtualName=""
explicitFocusOrder="0" pos="59.947% 141R 37.813% 24" min="0"
explicitFocusOrder="0" pos="59.964% 141R 37.882% 24" min="0"
max="1" int="0.001" style="LinearHorizontal" textBoxPos="TextBoxLeft"
textBoxEditable="1" textBoxWidth="70" textBoxHeight="20" skewFactor="1"/>
<TOGGLEBUTTON name="" id="2d368b2ffc99beef" memberName="highQualityToggle"
virtualName="" explicitFocusOrder="0" pos="2.24% 141R 44.532% 24"
virtualName="" explicitFocusOrder="0" pos="2.154% 141R 44.524% 24"
buttonText="Higher quality image interpolation" connectedEdges="0"
needsCallback="0" radioGroupId="0" state="0"/>
<TOGGLEBUTTON name="" id="3b7c06ef24935a72" memberName="animateSizeToggle"
virtualName="" explicitFocusOrder="0" pos="75.758% 85R 22.398% 24"
virtualName="" explicitFocusOrder="0" pos="75.763% 85R 22.442% 24"
buttonText="Animate size" connectedEdges="0" needsCallback="0"
radioGroupId="0" state="0"/>
<TOGGLEBUTTON name="" id="acf40ac0130d68eb" memberName="animateRotationToggle"
virtualName="" explicitFocusOrder="0" pos="75.758% 61R 22.398% 24"
virtualName="" explicitFocusOrder="0" pos="75.763% 61R 22.442% 24"
buttonText="Animate rotation" connectedEdges="0" needsCallback="0"
radioGroupId="0" state="0"/>
<TOGGLEBUTTON name="" id="afe7d31210a544cb" memberName="animatePositionToggle"
virtualName="" explicitFocusOrder="0" pos="75.758% 109R 22.398% 24"
virtualName="" explicitFocusOrder="0" pos="75.763% 109R 22.442% 24"
buttonText="Animate position" connectedEdges="0" needsCallback="0"
radioGroupId="0" state="0"/>
<TOGGLEBUTTON name="" id="20466306ead4c6c2" memberName="animateFillToggle"
virtualName="" explicitFocusOrder="0" pos="75.758% 37R 23.452% 24"
virtualName="" explicitFocusOrder="0" pos="75.763% 37R 23.519% 24"
buttonText="Animate gradient" connectedEdges="0" needsCallback="0"
radioGroupId="0" state="0"/>
<LABEL name="" id="ff3fb4acd2101aa5" memberName="opacityLabel" virtualName=""
@@ -735,50 +737,50 @@ BEGIN_JUCER_METADATA
editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
fontsize="15" bold="0" italic="0" justification="34"/>
<SLIDER name="" id="549cfd1459f09c12" memberName="xSlider" virtualName=""
explicitFocusOrder="0" pos="36.1% 109R 37.813% 24" min="-100"
explicitFocusOrder="0" pos="36.086% 109R 37.882% 24" min="-100"
max="100" int="0.1" style="LinearHorizontal" textBoxPos="TextBoxLeft"
textBoxEditable="1" textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
<SLIDER name="" id="49b53bab0eca9967" memberName="ySlider" virtualName=""
explicitFocusOrder="0" pos="36.1% 85R 37.813% 24" min="-100"
explicitFocusOrder="0" pos="36.086% 85R 37.882% 24" min="-100"
max="100" int="0.1" style="LinearHorizontal" textBoxPos="TextBoxLeft"
textBoxEditable="1" textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
<SLIDER name="" id="d89d3e0269c1aef4" memberName="sizeSlider" virtualName=""
explicitFocusOrder="0" pos="36.1% 61R 37.813% 24" min="0.01"
explicitFocusOrder="0" pos="36.086% 61R 37.882% 24" min="0.01"
max="10" int="0.01" style="LinearHorizontal" textBoxPos="TextBoxLeft"
textBoxEditable="1" textBoxWidth="80" textBoxHeight="20" skewFactor="0.4"/>
<SLIDER name="" id="a68c75ae0f41c437" memberName="angleSlider" virtualName=""
explicitFocusOrder="0" pos="36.1% 37R 37.813% 24" min="-180"
explicitFocusOrder="0" pos="36.086% 37R 37.882% 24" min="-180"
max="180" int="0.1" style="LinearHorizontal" textBoxPos="TextBoxLeft"
textBoxEditable="1" textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
<LABEL name="" id="61972b44db6093d7" memberName="xSliderLabel" virtualName=""
explicitFocusOrder="0" pos="24.901% 109R 10.672% 24" edTextCol="ff000000"
explicitFocusOrder="0" pos="24.955% 109R 10.592% 24" edTextCol="ff000000"
edBkgCol="0" labelText="X offset:" editableSingleClick="0" editableDoubleClick="0"
focusDiscardsChanges="0" fontname="Default font" fontsize="15"
bold="0" italic="0" justification="34"/>
<LABEL name="" id="fd87229f56908c79" memberName="ySliderLabel" virtualName=""
explicitFocusOrder="0" pos="24.901% 85R 10.672% 24" edTextCol="ff000000"
explicitFocusOrder="0" pos="24.955% 85R 10.592% 24" edTextCol="ff000000"
edBkgCol="0" labelText="Y offset:" editableSingleClick="0" editableDoubleClick="0"
focusDiscardsChanges="0" fontname="Default font" fontsize="15"
bold="0" italic="0" justification="34"/>
<LABEL name="" id="889901f3d351ac41" memberName="sizeSliderLabel" virtualName=""
explicitFocusOrder="0" pos="24.901% 61R 10.672% 24" edTextCol="ff000000"
explicitFocusOrder="0" pos="24.955% 61R 10.592% 24" edTextCol="ff000000"
edBkgCol="0" labelText="Size:" editableSingleClick="0" editableDoubleClick="0"
focusDiscardsChanges="0" fontname="Default font" fontsize="15"
bold="0" italic="0" justification="34"/>
<LABEL name="" id="98c096221f161097" memberName="angleSliderLabel" virtualName=""
explicitFocusOrder="0" pos="24.901% 37R 10.672% 24" edTextCol="ff000000"
explicitFocusOrder="0" pos="24.955% 37R 10.592% 24" edTextCol="ff000000"
edBkgCol="0" labelText="Angle:" editableSingleClick="0" editableDoubleClick="0"
focusDiscardsChanges="0" fontname="Default font" fontsize="15"
bold="0" italic="0" justification="34"/>
<TOGGLEBUTTON name="" id="dc21f241b7188003" memberName="clipToRectangleToggle"
virtualName="" explicitFocusOrder="0" pos="2.24% 109R 144 24"
virtualName="" explicitFocusOrder="0" pos="2.154% 109R 144 24"
buttonText="Clip to rectangle" connectedEdges="0" needsCallback="0"
radioGroupId="0" state="0"/>
<TOGGLEBUTTON name="" id="e242a0decedf4fbd" memberName="clipToPathToggle" virtualName=""
explicitFocusOrder="0" pos="2.24% 85R 144 24" buttonText="Clip to path"
explicitFocusOrder="0" pos="2.154% 85R 144 24" buttonText="Clip to path"
connectedEdges="0" needsCallback="0" radioGroupId="0" state="0"/>
<TOGGLEBUTTON name="" id="2c40de62d77841ae" memberName="clipToImageToggle"
virtualName="" explicitFocusOrder="0" pos="2.24% 61R 144 24"
virtualName="" explicitFocusOrder="0" pos="2.154% 61R 144 24"
buttonText="Clip to image" connectedEdges="0" needsCallback="0"
radioGroupId="0" state="0"/>
</JUCER_COMPONENT>


+ 6
- 4
extras/JuceDemo/Source/demos/RenderingTestComponent.h View File

@@ -3,7 +3,7 @@
This is an automatically generated file created by the Jucer!
Creation date: 1 Dec 2009 9:04:27 pm
Creation date: 1 May 2011 12:07:57pm
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
@@ -19,8 +19,8 @@
==============================================================================
*/
#ifndef __JUCER_HEADER_RENDERINGTESTCOMPONENT_RENDERINGTESTCOMPONENT_79B4A77C__
#define __JUCER_HEADER_RENDERINGTESTCOMPONENT_RENDERINGTESTCOMPONENT_79B4A77C__
#ifndef __JUCER_HEADER_RENDERINGTESTCOMPONENT_RENDERINGTESTCOMPONENT_ABDF1DF__
#define __JUCER_HEADER_RENDERINGTESTCOMPONENT_RENDERINGTESTCOMPONENT_ABDF1DF__
//[Headers] -- You can add your own extra header files here --
#include "../jucedemo_headers.h"
@@ -61,6 +61,7 @@ public:
static const char* demoPng_png;
static const int demoPng_pngSize;
//==============================================================================
juce_UseDebuggingNewOperator
@@ -93,6 +94,7 @@ private:
ToggleButton* clipToPathToggle;
ToggleButton* clipToImageToggle;
//==============================================================================
// (prevent copy constructor and operator= being generated..)
RenderingTestComponent (const RenderingTestComponent&);
@@ -100,4 +102,4 @@ private:
};
#endif // __JUCER_HEADER_RENDERINGTESTCOMPONENT_RENDERINGTESTCOMPONENT_79B4A77C__
#endif // __JUCER_HEADER_RENDERINGTESTCOMPONENT_RENDERINGTESTCOMPONENT_ABDF1DF__

+ 6
- 4
extras/example projects/Source/MainComponent.cpp View File

@@ -3,13 +3,13 @@
This is an automatically generated file created by the Jucer!
Creation date: 14 Apr 2008 11:28:13 am
Creation date: 1 May 2011 12:12:59pm
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
and re-saved.
Jucer version: 1.11
Jucer version: 1.12
------------------------------------------------------------------------------
@@ -34,7 +34,7 @@ MainComponent::MainComponent ()
quitButton (0)
{
addAndMakeVisible (helloWorldLabel = new Label (String::empty,
T("Hello World!")));
L"Hello World!"));
helloWorldLabel->setFont (Font (40.0000f, Font::bold));
helloWorldLabel->setJustificationType (Justification::centred);
helloWorldLabel->setEditable (false, false, false);
@@ -43,7 +43,7 @@ MainComponent::MainComponent ()
helloWorldLabel->setColour (TextEditor::backgroundColourId, Colour (0x0));
addAndMakeVisible (quitButton = new TextButton (String::empty));
quitButton->setButtonText (T("Quit"));
quitButton->setButtonText (L"Quit");
quitButton->addListener (this);
@@ -52,6 +52,7 @@ MainComponent::MainComponent ()
setSize (600, 300);
//[Constructor] You can add your own custom stuff here..
//[/Constructor]
}
@@ -64,6 +65,7 @@ MainComponent::~MainComponent()
deleteAndZero (helloWorldLabel);
deleteAndZero (quitButton);
//[Destructor]. You can add your own custom destruction code here..
//[/Destructor]
}


+ 8
- 6
extras/example projects/Source/MainComponent.h View File

@@ -3,13 +3,13 @@
This is an automatically generated file created by the Jucer!
Creation date: 14 Apr 2008 11:28:13 am
Creation date: 1 May 2011 12:12:59pm
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
and re-saved.
Jucer version: 1.11
Jucer version: 1.12
------------------------------------------------------------------------------
@@ -19,8 +19,8 @@
==============================================================================
*/
#ifndef __JUCER_HEADER_MAINCOMPONENT_MAINCOMPONENT_D0F6CD31__
#define __JUCER_HEADER_MAINCOMPONENT_MAINCOMPONENT_D0F6CD31__
#ifndef __JUCER_HEADER_MAINCOMPONENT_MAINCOMPONENT_5ACBBA44__
#define __JUCER_HEADER_MAINCOMPONENT_MAINCOMPONENT_5ACBBA44__
//[Headers] -- You can add your own extra header files here --
#include "../JuceLibraryCode/JuceHeader.h"
@@ -53,6 +53,7 @@ public:
void buttonClicked (Button* buttonThatWasClicked);
//==============================================================================
juce_UseDebuggingNewOperator
@@ -65,11 +66,12 @@ private:
TextButton* quitButton;
Path internalPath1;
//==============================================================================
// (prevent copy constructor and operator= being generated..)
MainComponent (const MainComponent&);
MainComponent& operator= (const MainComponent&);
const MainComponent& operator= (const MainComponent&);
};
#endif // __JUCER_HEADER_MAINCOMPONENT_MAINCOMPONENT_D0F6CD31__
#endif // __JUCER_HEADER_MAINCOMPONENT_MAINCOMPONENT_5ACBBA44__

+ 28
- 31
extras/the jucer/src/model/components/jucer_ButtonHandler.h View File

@@ -61,10 +61,10 @@ public:
properties.add (new ButtonRadioGroupProperty (b, document));
properties.add (new ButtonConnectedEdgeProperty (T("connected left"), Button::ConnectedOnLeft, b, document));
properties.add (new ButtonConnectedEdgeProperty (T("connected right"), Button::ConnectedOnRight, b, document));
properties.add (new ButtonConnectedEdgeProperty (T("connected top"), Button::ConnectedOnTop, b, document));
properties.add (new ButtonConnectedEdgeProperty (T("connected bottom"), Button::ConnectedOnBottom, b, document));
properties.add (new ButtonConnectedEdgeProperty ("connected left", Button::ConnectedOnLeft, b, document));
properties.add (new ButtonConnectedEdgeProperty ("connected right", Button::ConnectedOnRight, b, document));
properties.add (new ButtonConnectedEdgeProperty ("connected top", Button::ConnectedOnTop, b, document));
properties.add (new ButtonConnectedEdgeProperty ("connected bottom", Button::ConnectedOnBottom, b, document));
}
XmlElement* createXmlFor (Component* comp, const ComponentLayout* layout)
@@ -72,10 +72,10 @@ public:
Button* const b = dynamic_cast <Button*> (comp);
XmlElement* e = ComponentTypeHandler::createXmlFor (comp, layout);
e->setAttribute (T("buttonText"), b->getButtonText());
e->setAttribute (T("connectedEdges"), b->getConnectedEdgeFlags());
e->setAttribute (T("needsCallback"), needsButtonListener (b));
e->setAttribute (T("radioGroupId"), b->getRadioGroupId());
e->setAttribute ("buttonText", b->getButtonText());
e->setAttribute ("connectedEdges", b->getConnectedEdgeFlags());
e->setAttribute ("needsCallback", needsButtonListener (b));
e->setAttribute ("radioGroupId", b->getRadioGroupId());
return e;
}
@@ -87,10 +87,10 @@ public:
if (! ComponentTypeHandler::restoreFromXml (xml, comp, layout))
return false;
b->setButtonText (xml.getStringAttribute (T("buttonText"), b->getButtonText()));
b->setConnectedEdges (xml.getIntAttribute (T("connectedEdges"), 0));
setNeedsButtonListener (b, xml.getBoolAttribute (T("needsCallback"), true));
b->setRadioGroupId (xml.getIntAttribute (T("radioGroupId"), 0));
b->setButtonText (xml.getStringAttribute ("buttonText", b->getButtonText()));
b->setConnectedEdges (xml.getIntAttribute ("connectedEdges", 0));
setNeedsButtonListener (b, xml.getBoolAttribute ("needsCallback", true));
b->setRadioGroupId (xml.getIntAttribute ("radioGroupId", 0));
return true;
}
@@ -118,20 +118,20 @@ public:
StringArray flags;
if (b->isConnectedOnLeft())
flags.add (T("Button::ConnectedOnLeft"));
flags.add ("Button::ConnectedOnLeft");
if (b->isConnectedOnRight())
flags.add (T("Button::ConnectedOnRight"));
flags.add ("Button::ConnectedOnRight");
if (b->isConnectedOnTop())
flags.add (T("Button::ConnectedOnTop"));
flags.add ("Button::ConnectedOnTop");
if (b->isConnectedOnBottom())
flags.add (T("Button::ConnectedOnBottom"));
flags.add ("Button::ConnectedOnBottom");
String s;
s << memberVariableName << "->setConnectedEdges ("
<< flags.joinIntoString (T(" | ")) << ");\n";
<< flags.joinIntoString (" | ") << ");\n";
code.constructorCode += s;
}
@@ -150,9 +150,9 @@ public:
if (needsButtonListener (component))
{
String& callback = code.getCallbackCode (T("public ButtonListener"),
T("void"),
T("buttonClicked (Button* buttonThatWasClicked)"),
String& callback = code.getCallbackCode ("public ButtonListener",
"void",
"buttonClicked (Button* buttonThatWasClicked)",
true);
if (callback.isNotEmpty())
@@ -177,23 +177,20 @@ public:
button->getProperties().set ("generateListenerCallback", shouldDoCallback);
}
//==============================================================================
juce_UseDebuggingNewOperator
private:
//==============================================================================
class ButtonTextProperty : public ComponentTextProperty <Button>
{
public:
ButtonTextProperty (Button* button_, JucerDocument& document_)
: ComponentTextProperty <Button> (T("text"), 100, false, button_, document_)
: ComponentTextProperty <Button> ("text", 100, false, button_, document_)
{
}
void setText (const String& newText)
{
document.perform (new ButtonTextChangeAction (component, *document.getComponentLayout(), newText),
T("Change button text"));
"Change button text");
}
const String getText() const
@@ -236,14 +233,14 @@ private:
{
public:
ButtonCallbackProperty (Button* button, JucerDocument& document)
: ComponentBooleanProperty <Button> (T("callback"), T("Generate ButtonListener"), T("Generate ButtonListener"), button, document)
: ComponentBooleanProperty <Button> ("callback", "Generate ButtonListener", "Generate ButtonListener", button, document)
{
}
void setState (bool newState)
{
document.perform (new ButtonCallbackChangeAction (component, *document.getComponentLayout(), newState),
T("Change button callback"));
"Change button callback");
}
bool getState() const { return needsButtonListener (component); }
@@ -283,14 +280,14 @@ private:
{
public:
ButtonRadioGroupProperty (Button* const button_, JucerDocument& document_)
: ComponentTextProperty <Button> (T("radio group"), 10, false, button_, document_)
: ComponentTextProperty <Button> ("radio group", 10, false, button_, document_)
{
}
void setText (const String& newText)
{
document.perform (new ButtonRadioGroupChangeAction (component, *document.getComponentLayout(), newText.getIntValue()),
T("Change radio group ID"));
"Change radio group ID");
}
const String getText() const
@@ -334,7 +331,7 @@ private:
public:
ButtonConnectedEdgeProperty (const String& name, const int flag_,
Button* button, JucerDocument& document)
: ComponentBooleanProperty <Button> (name, T("Connected"), T("Connected"), button, document),
: ComponentBooleanProperty <Button> (name, "Connected", "Connected", button, document),
flag (flag_)
{
}
@@ -342,7 +339,7 @@ private:
void setState (bool newState)
{
document.perform (new ButtonConnectedChangeAction (component, *document.getComponentLayout(), flag, newState),
T("Change button connected edges"));
"Change button connected edges");
}
bool getState() const


+ 24
- 27
extras/the jucer/src/model/components/jucer_ComboBoxHandler.h View File

@@ -41,7 +41,7 @@ public:
//==============================================================================
Component* createNewComponent (JucerDocument*)
{
return new ComboBox (T("new combo box"));
return new ComboBox ("new combo box");
}
XmlElement* createXmlFor (Component* comp, const ComponentLayout* layout)
@@ -51,11 +51,11 @@ public:
XmlElement* e = ComponentTypeHandler::createXmlFor (comp, layout);
e->setAttribute (T("editable"), c->isTextEditable());
e->setAttribute (T("layout"), c->getJustificationType().getFlags());
e->setAttribute (T("items"), c->getProperties() ["items"].toString());
e->setAttribute (T("textWhenNonSelected"), c->getTextWhenNothingSelected());
e->setAttribute (T("textWhenNoItems"), c->getTextWhenNoChoicesAvailable());
e->setAttribute ("editable", c->isTextEditable());
e->setAttribute ("layout", c->getJustificationType().getFlags());
e->setAttribute ("items", c->getProperties() ["items"].toString());
e->setAttribute ("textWhenNonSelected", c->getTextWhenNothingSelected());
e->setAttribute ("textWhenNoItems", c->getTextWhenNoChoicesAvailable());
return e;
}
@@ -70,11 +70,11 @@ public:
ComboBox* const c = dynamic_cast <ComboBox*> (comp);
jassert (c != 0);
c->setEditableText (xml.getBoolAttribute (T("editable"), defaultBox.isTextEditable()));
c->setJustificationType (Justification (xml.getIntAttribute (T("layout"), defaultBox.getJustificationType().getFlags())));
c->getProperties().set ("items", xml.getStringAttribute (T("items"), String::empty));
c->setTextWhenNothingSelected (xml.getStringAttribute (T("textWhenNonSelected"), defaultBox.getTextWhenNothingSelected()));
c->setTextWhenNoChoicesAvailable (xml.getStringAttribute (T("textWhenNoItems"), defaultBox.getTextWhenNoChoicesAvailable()));
c->setEditableText (xml.getBoolAttribute ("editable", defaultBox.isTextEditable()));
c->setJustificationType (Justification (xml.getIntAttribute ("layout", defaultBox.getJustificationType().getFlags())));
c->getProperties().set ("items", xml.getStringAttribute ("items", String::empty));
c->setTextWhenNothingSelected (xml.getStringAttribute ("textWhenNonSelected", defaultBox.getTextWhenNothingSelected()));
c->setTextWhenNoChoicesAvailable (xml.getStringAttribute ("textWhenNoItems", defaultBox.getTextWhenNoChoicesAvailable()));
updateItems (c);
@@ -140,9 +140,9 @@ public:
if (needsCallback (component))
{
String& callback = code.getCallbackCode (T("public ComboBoxListener"),
T("void"),
T("comboBoxChanged (ComboBox* comboBoxThatHasChanged)"),
String& callback = code.getCallbackCode ("public ComboBoxListener",
"void",
"comboBoxChanged (ComboBox* comboBoxThatHasChanged)",
true);
if (callback.trim().isNotEmpty())
@@ -179,16 +179,13 @@ public:
return true; // xxx should be configurable
}
//==============================================================================
juce_UseDebuggingNewOperator
private:
//==============================================================================
class ComboEditableProperty : public ComponentBooleanProperty <ComboBox>
{
public:
ComboEditableProperty (ComboBox* component_, JucerDocument& document_)
: ComponentBooleanProperty <ComboBox> (T("editable"), T("Text is editable"), T("Text is editable"), component_, document_)
: ComponentBooleanProperty <ComboBox> ("editable", "Text is editable", "Text is editable", component_, document_)
{
}
@@ -196,7 +193,7 @@ private:
void setState (bool newState)
{
document.perform (new ComboEditableChangeAction (component, *document.getComponentLayout(), newState),
T("Change combo box editability"));
"Change combo box editability");
}
bool getState() const
@@ -240,7 +237,7 @@ private:
{
public:
ComboJustificationProperty (ComboBox* component_, JucerDocument& document_)
: JustificationProperty (T("text layout"), false),
: JustificationProperty ("text layout", false),
component (component_),
document (document_)
{
@@ -250,7 +247,7 @@ private:
void setJustification (const Justification& newJustification)
{
document.perform (new ComboJustifyChangeAction (component, *document.getComponentLayout(), newJustification),
T("Change combo box justification"));
"Change combo box justification");
}
const Justification getJustification() const { return component->getJustificationType(); }
@@ -294,14 +291,14 @@ private:
{
public:
ComboItemsProperty (ComboBox* component_, JucerDocument& document_)
: ComponentTextProperty <ComboBox> (T("items"), 10000, true, component_, document_)
: ComponentTextProperty <ComboBox> ("items", 10000, true, component_, document_)
{}
//==============================================================================
void setText (const String& newText)
{
document.perform (new ComboItemsChangeAction (component, *document.getComponentLayout(), newText),
T("Change combo box items"));
"Change combo box items");
}
const String getText() const
@@ -347,14 +344,14 @@ private:
{
public:
ComboTextWhenNoneSelectedProperty (ComboBox* component_, JucerDocument& document_)
: ComponentTextProperty <ComboBox> (T("text when none selected"), 200, false, component_, document_)
: ComponentTextProperty <ComboBox> ("text when none selected", 200, false, component_, document_)
{}
//==============================================================================
void setText (const String& newText)
{
document.perform (new ComboNonSelTextChangeAction (component, *document.getComponentLayout(), newText),
T("Change combo box text when nothing selected"));
"Change combo box text when nothing selected");
}
const String getText() const
@@ -398,14 +395,14 @@ private:
{
public:
ComboTextWhenNoItemsProperty (ComboBox* component_, JucerDocument& document_)
: ComponentTextProperty <ComboBox> (T("text when no items"), 200, false, component_, document_)
: ComponentTextProperty <ComboBox> ("text when no items", 200, false, component_, document_)
{}
//==============================================================================
void setText (const String& newText)
{
document.perform (new ComboNoItemTextChangeAction (component, *document.getComponentLayout(), newText),
T("Change combo box 'no items' text"));
"Change combo box 'no items' text");
}
const String getText() const


+ 6
- 12
extras/the jucer/src/model/components/jucer_ComponentNameProperty.h View File

@@ -38,7 +38,7 @@ class ComponentNameProperty : public ComponentTextProperty <Component>
{
public:
ComponentNameProperty (Component* component_, JucerDocument& document_)
: ComponentTextProperty <Component> (T("name"), 40, false, component_, document_)
: ComponentTextProperty <Component> ("name", 40, false, component_, document_)
{
}
@@ -50,7 +50,7 @@ public:
void setText (const String& newText)
{
document.perform (new CompNameChangeAction (component, *document.getComponentLayout(), newText),
T("Change component name"));
"Change component name");
}
const String getText() const
@@ -58,8 +58,6 @@ public:
return component->getName();
}
juce_UseDebuggingNewOperator
private:
class CompNameChangeAction : public ComponentUndoableAction <Component>
{
@@ -100,7 +98,7 @@ class ComponentMemberNameProperty : public ComponentTextProperty <Component>
{
public:
ComponentMemberNameProperty (Component* component_, JucerDocument& document_)
: ComponentTextProperty <Component> (T("member name"), 40, false, component_, document_)
: ComponentTextProperty <Component> ("member name", 40, false, component_, document_)
{
}
@@ -112,7 +110,7 @@ public:
void setText (const String& newText)
{
document.perform (new CompMemberNameChangeAction (component, *document.getComponentLayout(), newText),
T("Change component member name"));
"Change component member name");
}
const String getText() const
@@ -120,8 +118,6 @@ public:
return document.getComponentLayout()->getComponentMemberVariableName (component);
}
juce_UseDebuggingNewOperator
private:
class CompMemberNameChangeAction : public ComponentUndoableAction <Component>
{
@@ -161,7 +157,7 @@ class ComponentVirtualClassProperty : public ComponentTextProperty <Component>
{
public:
ComponentVirtualClassProperty (Component* component_, JucerDocument& document_)
: ComponentTextProperty <Component> (T("virtual class"), 40, false, component_, document_)
: ComponentTextProperty <Component> ("virtual class", 40, false, component_, document_)
{
}
@@ -173,7 +169,7 @@ public:
void setText (const String& newText)
{
document.perform (new CompVirtualClassChangeAction (component, *document.getComponentLayout(), newText),
T("Change component virtual class name"));
"Change component virtual class name");
}
const String getText() const
@@ -181,8 +177,6 @@ public:
return document.getComponentLayout()->getComponentVirtualClassName (component);
}
juce_UseDebuggingNewOperator
private:
class CompVirtualClassChangeAction : public ComponentUndoableAction <Component>
{


+ 27
- 27
extras/the jucer/src/model/components/jucer_ComponentTypeHandler.cpp View File

@@ -144,11 +144,11 @@ XmlElement* ComponentTypeHandler::createXmlFor (Component* comp, const Component
{
XmlElement* e = new XmlElement (getXmlTagName());
e->setAttribute (T("name"), comp->getName());
e->setAttribute (T("id"), String::toHexString (getComponentId (comp)));
e->setAttribute (T("memberName"), comp->getProperties() ["memberName"].toString());
e->setAttribute (T("virtualName"), comp->getProperties() ["virtualName"].toString());
e->setAttribute (T("explicitFocusOrder"), comp->getExplicitFocusOrder());
e->setAttribute ("name", comp->getName());
e->setAttribute ("id", String::toHexString (getComponentId (comp)));
e->setAttribute ("memberName", comp->getProperties() ["memberName"].toString());
e->setAttribute ("virtualName", comp->getProperties() ["virtualName"].toString());
e->setAttribute ("explicitFocusOrder", comp->getExplicitFocusOrder());
RelativePositionedRectangle pos (getComponentPosition (comp));
pos.updateFromComponent (*comp, layout);
@@ -156,7 +156,7 @@ XmlElement* ComponentTypeHandler::createXmlFor (Component* comp, const Component
SettableTooltipClient* const ttc = dynamic_cast <SettableTooltipClient*> (comp);
if (ttc != 0 && ttc->getTooltip().isNotEmpty())
e->setAttribute (T("tooltip"), ttc->getTooltip());
e->setAttribute ("tooltip", ttc->getTooltip());
for (int i = 0; i < colours.size(); ++i)
{
@@ -179,11 +179,11 @@ bool ComponentTypeHandler::restoreFromXml (const XmlElement& xml,
if (! xml.hasTagName (getXmlTagName()))
return false;
comp->setName (xml.getStringAttribute (T("name"), comp->getName()));
setComponentId (comp, xml.getStringAttribute (T("id")).getHexValue64());
comp->getProperties().set ("memberName", xml.getStringAttribute (T("memberName")));
comp->getProperties().set ("virtualName", xml.getStringAttribute (T("virtualName")));
comp->setExplicitFocusOrder (xml.getIntAttribute (T("explicitFocusOrder")));
comp->setName (xml.getStringAttribute ("name", comp->getName()));
setComponentId (comp, xml.getStringAttribute ("id").getHexValue64());
comp->getProperties().set ("memberName", xml.getStringAttribute ("memberName"));
comp->getProperties().set ("virtualName", xml.getStringAttribute ("virtualName"));
comp->setExplicitFocusOrder (xml.getIntAttribute ("explicitFocusOrder"));
RelativePositionedRectangle currentPos (getComponentPosition (comp));
currentPos.updateFromComponent (*comp, layout);
@@ -196,7 +196,7 @@ bool ComponentTypeHandler::restoreFromXml (const XmlElement& xml,
SettableTooltipClient* const ttc = dynamic_cast <SettableTooltipClient*> (comp);
if (ttc != 0)
ttc->setTooltip (xml.getStringAttribute (T("tooltip")));
ttc->setTooltip (xml.getStringAttribute ("tooltip"));
for (int i = 0; i < colours.size(); ++i)
{
@@ -267,7 +267,7 @@ class TooltipProperty : public ComponentTextProperty <Component>
{
public:
TooltipProperty (Component* comp, JucerDocument& document)
: ComponentTextProperty <Component> (T("tooltip"), 1024, false, comp, document)
: ComponentTextProperty <Component> ("tooltip", 1024, false, comp, document)
{
}
@@ -280,7 +280,7 @@ public:
void setText (const String& newText)
{
document.perform (new SetTooltipAction (component, *document.getComponentLayout(), newText),
T("Change tooltip"));
"Change tooltip");
}
private:
@@ -371,7 +371,7 @@ class FocusOrderProperty : public ComponentTextProperty <Component>
{
public:
FocusOrderProperty (Component* comp, JucerDocument& document)
: ComponentTextProperty <Component> (T("focus order"), 8, false, comp, document)
: ComponentTextProperty <Component> ("focus order", 8, false, comp, document)
{
}
@@ -383,7 +383,7 @@ public:
void setText (const String& newText)
{
document.perform (new SetFocusOrderAction (component, *document.getComponentLayout(), jmax (0, newText.getIntValue())),
T("Change focus order"));
"Change focus order");
}
private:
@@ -426,10 +426,10 @@ void ComponentTypeHandler::getEditableProperties (Component* component,
properties.add (new ComponentNameProperty (component, document));
properties.add (new ComponentVirtualClassProperty (component, document));
properties.add (new ComponentPositionProperty (component, document, T("x"), ComponentPositionProperty::componentX));
properties.add (new ComponentPositionProperty (component, document, T("y"), ComponentPositionProperty::componentY));
properties.add (new ComponentPositionProperty (component, document, T("width"), ComponentPositionProperty::componentWidth));
properties.add (new ComponentPositionProperty (component, document, T("height"), ComponentPositionProperty::componentHeight));
properties.add (new ComponentPositionProperty (component, document, "x", ComponentPositionProperty::componentX));
properties.add (new ComponentPositionProperty (component, document, "y", ComponentPositionProperty::componentY));
properties.add (new ComponentPositionProperty (component, document, "width", ComponentPositionProperty::componentWidth));
properties.add (new ComponentPositionProperty (component, document, "height", ComponentPositionProperty::componentHeight));
if (dynamic_cast <SettableTooltipClient*> (component) != 0)
properties.add (new TooltipProperty (component, document));
@@ -483,11 +483,11 @@ const String ComponentTypeHandler::getColourIntialisationCode (Component* compon
{
if (component->isColourSpecified (colours[i]->colourId))
{
s << objectName << T("->setColour (")
s << objectName << "->setColour ("
<< colours[i]->colourIdCode
<< T(", ")
<< ", "
<< colourToCode (component->findColour (colours[i]->colourId))
<< T(");\n");
<< ");\n";
}
}
@@ -521,9 +521,9 @@ void ComponentTypeHandler::fillInMemberVariableDeclarations (GeneratedCode& code
}
code.privateMemberDeclarations
<< T("* ") << memberVariableName << T(";\n");
<< "* " << memberVariableName << ";\n";
code.initialisers.add (memberVariableName + T(" (0)"));
code.initialisers.add (memberVariableName + " (0)");
}
void ComponentTypeHandler::fillInResizeCode (GeneratedCode& code, Component* component, const String& memberVariableName)
@@ -537,9 +537,9 @@ void ComponentTypeHandler::fillInResizeCode (GeneratedCode& code, Component* com
<< x << ", " << y << ", " << w << ", " << h << ");\n";
if (pos.rect.isPositionAbsolute())
code.constructorCode += r + T("\n");
code.constructorCode += r + "\n";
else
code.getCallbackCode (String::empty, T("void"), T("resized()"), false) += r;
code.getCallbackCode (String::empty, "void", "resized()", false) += r;
}
const String ComponentTypeHandler::getCreationParameters (Component* component)


+ 1
- 4
extras/the jucer/src/model/components/jucer_ComponentTypeHandler.h View File

@@ -75,7 +75,7 @@ public:
const String& xmlTagName);
#define registerColour(colourId, colourName, xmlTagName) \
registerEditableColour (colourId, #colourId, T(colourName), T(xmlTagName))
registerEditableColour (colourId, #colourId, colourName, xmlTagName)
void addColourProperties (Component* component,
JucerDocument& document,
@@ -122,9 +122,6 @@ public:
static JucerDocument* findParentDocument (Component* component);
//==============================================================================
juce_UseDebuggingNewOperator
protected:
//==============================================================================
const String typeName, className, virtualClass, componentClassRawName;


+ 10
- 16
extras/the jucer/src/model/components/jucer_GenericComponentHandler.h View File

@@ -34,12 +34,8 @@ class GenericComponent : public Component
{
public:
GenericComponent()
: Component (T("new component")),
actualClassName (T("Component"))
{
}
~GenericComponent()
: Component ("new component"),
actualClassName ("Component")
{
}
@@ -97,8 +93,8 @@ public:
XmlElement* createXmlFor (Component* comp, const ComponentLayout* layout)
{
XmlElement* e = ComponentTypeHandler::createXmlFor (comp, layout);
e->setAttribute (T("class"), ((GenericComponent*) comp)->actualClassName);
e->setAttribute (T("params"), ((GenericComponent*) comp)->constructorParams);
e->setAttribute ("class", ((GenericComponent*) comp)->actualClassName);
e->setAttribute ("params", ((GenericComponent*) comp)->constructorParams);
return e;
}
@@ -108,8 +104,8 @@ public:
if (! ComponentTypeHandler::restoreFromXml (xml, comp, layout))
return false;
((GenericComponent*) comp)->actualClassName = xml.getStringAttribute (T("class"), T("Component"));
((GenericComponent*) comp)->constructorParams = xml.getStringAttribute (T("params"), String::empty);
((GenericComponent*) comp)->actualClassName = xml.getStringAttribute ("class", "Component");
((GenericComponent*) comp)->constructorParams = xml.getStringAttribute ("params", String::empty);
return true;
}
@@ -144,14 +140,12 @@ public:
code.constructorCode << "\n";
}
juce_UseDebuggingNewOperator
private:
class GenericCompClassProperty : public ComponentTextProperty <GenericComponent>
{
public:
GenericCompClassProperty (GenericComponent* comp, JucerDocument& document)
: ComponentTextProperty <GenericComponent> (T("class"), 300, false, comp, document)
: ComponentTextProperty <GenericComponent> ("class", 300, false, comp, document)
{
}
@@ -159,7 +153,7 @@ private:
{
document.perform (new GenericCompClassChangeAction (component, *document.getComponentLayout(),
makeValidCppIdentifier (newText, false, false, true)),
T("Change generic component class"));
"Change generic component class");
}
const String getText() const
@@ -202,14 +196,14 @@ private:
{
public:
GenericCompParamsProperty (GenericComponent* comp, JucerDocument& document)
: ComponentTextProperty <GenericComponent> (T("constructor params"), 1024, true, comp, document)
: ComponentTextProperty <GenericComponent> ("constructor params", 1024, true, comp, document)
{
}
void setText (const String& newText)
{
document.perform (new GenericCompParamsChangeAction (component, *document.getComponentLayout(), newText),
T("Change generic component class"));
"Change generic component class");
}
const String getText() const


+ 9
- 12
extras/the jucer/src/model/components/jucer_GroupComponentHandler.h View File

@@ -44,7 +44,7 @@ public:
//==============================================================================
Component* createNewComponent (JucerDocument*)
{
return new GroupComponent (T("new group"), T("group"));
return new GroupComponent ("new group", "group");
}
XmlElement* createXmlFor (Component* comp, const ComponentLayout* layout)
@@ -52,12 +52,12 @@ public:
GroupComponent* const g = (GroupComponent*) comp;
XmlElement* e = ComponentTypeHandler::createXmlFor (comp, layout);
e->setAttribute (T("title"), g->getText());
e->setAttribute ("title", g->getText());
GroupComponent defaultComp (String::empty, String::empty);
if (g->getTextLabelPosition().getFlags() != defaultComp.getTextLabelPosition().getFlags())
e->setAttribute (T("textpos"), g->getTextLabelPosition().getFlags());
e->setAttribute ("textpos", g->getTextLabelPosition().getFlags());
return e;
}
@@ -69,8 +69,8 @@ public:
if (! ComponentTypeHandler::restoreFromXml (xml, comp, layout))
return false;
g->setText (xml.getStringAttribute (T("title"), g->getText()));
g->setTextLabelPosition (Justification (xml.getIntAttribute (T("textpos"), g->getTextLabelPosition().getFlags())));
g->setText (xml.getStringAttribute ("title", g->getText()));
g->setTextLabelPosition (Justification (xml.getIntAttribute ("textpos", g->getTextLabelPosition().getFlags())));
return true;
}
@@ -117,23 +117,20 @@ public:
addColourProperties (component, document, properties);
}
//==============================================================================
juce_UseDebuggingNewOperator
private:
//==============================================================================
class GroupTitleProperty : public ComponentTextProperty <GroupComponent>
{
public:
GroupTitleProperty (GroupComponent* component_, JucerDocument& document_)
: ComponentTextProperty <GroupComponent> (T("text"), 200, false, component_, document_)
: ComponentTextProperty <GroupComponent> ("text", 200, false, component_, document_)
{}
//==============================================================================
void setText (const String& newText)
{
document.perform (new GroupTitleChangeAction (component, *document.getComponentLayout(), newText),
T("Change group title"));
"Change group title");
}
const String getText() const
@@ -178,7 +175,7 @@ private:
{
public:
GroupJustificationProperty (GroupComponent* const group_, JucerDocument& document_)
: JustificationProperty (T("layout"), true),
: JustificationProperty ("layout", true),
group (group_),
document (document_)
{
@@ -193,7 +190,7 @@ private:
void setJustification (const Justification& newJustification)
{
document.perform (new GroupJustifyChangeAction (group, *document.getComponentLayout(), newJustification),
T("Change text label position"));
"Change text label position");
}
const Justification getJustification() const


+ 5
- 7
extras/the jucer/src/model/components/jucer_HyperlinkButtonHandler.h View File

@@ -45,7 +45,7 @@ public:
//==============================================================================
Component* createNewComponent (JucerDocument*)
{
HyperlinkButton* hb = new HyperlinkButton (T("new hyperlink"), URL (T("http://www.rawmaterialsoftware.com/juce")));
HyperlinkButton* hb = new HyperlinkButton ("new hyperlink", URL ("http://www.rawmaterialsoftware.com/juce"));
setNeedsButtonListener (hb, false);
return hb;
@@ -68,7 +68,7 @@ public:
XmlElement* const e = ButtonHandler::createXmlFor (comp, layout);
e->setAttribute (T("url"), hb->getURL().toString (false));
e->setAttribute ("url", hb->getURL().toString (false));
return e;
}
@@ -80,7 +80,7 @@ public:
if (! ButtonHandler::restoreFromXml (xml, comp, layout))
return false;
hb->setURL (URL (xml.getStringAttribute (T("url"), hb->getURL().toString (false))));
hb->setURL (URL (xml.getStringAttribute ("url", hb->getURL().toString (false))));
return true;
}
@@ -103,22 +103,20 @@ public:
<< '\n';
}
juce_UseDebuggingNewOperator
private:
//==============================================================================
class HyperlinkURLProperty : public ComponentTextProperty <HyperlinkButton>
{
public:
HyperlinkURLProperty (HyperlinkButton* component_, JucerDocument& document_)
: ComponentTextProperty <HyperlinkButton> (T("URL"), 512, false, component_, document_)
: ComponentTextProperty <HyperlinkButton> ("URL", 512, false, component_, document_)
{}
//==============================================================================
void setText (const String& newText)
{
document.perform (new HyperlinkURLChangeAction (component, *document.getComponentLayout(), URL (newText)),
T("Change hyperlink URL"));
"Change hyperlink URL");
}
const String getText() const


+ 23
- 28
extras/the jucer/src/model/components/jucer_ImageButtonHandler.h View File

@@ -53,7 +53,7 @@ public:
//==============================================================================
Component* createNewComponent (JucerDocument*)
{
return new ImageButton (T("new button"));
return new ImageButton ("new button");
}
void getEditableProperties (Component* component, JucerDocument& document, Array <PropertyComponent*>& properties)
@@ -87,19 +87,19 @@ public:
ImageButton* const ib = (ImageButton*) comp;
e->setAttribute (T("keepProportions"), doesImageKeepProportions (ib));
e->setAttribute ("keepProportions", doesImageKeepProportions (ib));
e->setAttribute (T("resourceNormal"), getImageResource (ib, normalImage));
e->setAttribute (T("opacityNormal"), getImageOpacity (ib, normalImage));
e->setAttribute (T("colourNormal"), getImageColour (ib, normalImage).toString());
e->setAttribute ("resourceNormal", getImageResource (ib, normalImage));
e->setAttribute ("opacityNormal", getImageOpacity (ib, normalImage));
e->setAttribute ("colourNormal", getImageColour (ib, normalImage).toString());
e->setAttribute (T("resourceOver"), getImageResource (ib, overImage));
e->setAttribute (T("opacityOver"), getImageOpacity (ib, overImage));
e->setAttribute (T("colourOver"), getImageColour (ib, overImage).toString());
e->setAttribute ("resourceOver", getImageResource (ib, overImage));
e->setAttribute ("opacityOver", getImageOpacity (ib, overImage));
e->setAttribute ("colourOver", getImageColour (ib, overImage).toString());
e->setAttribute (T("resourceDown"), getImageResource (ib, downImage));
e->setAttribute (T("opacityDown"), getImageOpacity (ib, downImage));
e->setAttribute (T("colourDown"), getImageColour (ib, downImage).toString());
e->setAttribute ("resourceDown", getImageResource (ib, downImage));
e->setAttribute ("opacityDown", getImageOpacity (ib, downImage));
e->setAttribute ("colourDown", getImageColour (ib, downImage).toString());
return e;
}
@@ -112,19 +112,19 @@ public:
ImageButton* const ib = (ImageButton*) comp;
ComponentLayout& l = const_cast <ComponentLayout&> (*layout);
setImageKeepProportions (l, ib, xml.getBoolAttribute (T("keepProportions"), true), false);
setImageKeepProportions (l, ib, xml.getBoolAttribute ("keepProportions", true), false);
setImageResource (l, ib, normalImage, xml.getStringAttribute (T("resourceNormal"), String::empty), false);
setImageOpacity (l, ib, normalImage, (float) xml.getDoubleAttribute (T("opacityNormal"), 1.0f), false);
setImageColour (l, ib, normalImage, Colour::fromString (xml.getStringAttribute (T("colourNormal"), T("0"))), false);
setImageResource (l, ib, normalImage, xml.getStringAttribute ("resourceNormal", String::empty), false);
setImageOpacity (l, ib, normalImage, (float) xml.getDoubleAttribute ("opacityNormal", 1.0f), false);
setImageColour (l, ib, normalImage, Colour::fromString (xml.getStringAttribute ("colourNormal", "0")), false);
setImageResource (l, ib, overImage, xml.getStringAttribute (T("resourceOver"), String::empty), false);
setImageOpacity (l, ib, overImage, (float) xml.getDoubleAttribute (T("opacityOver"), 1.0f), false);
setImageColour (l, ib, overImage, Colour::fromString (xml.getStringAttribute (T("colourOver"), T("0"))), false);
setImageResource (l, ib, overImage, xml.getStringAttribute ("resourceOver", String::empty), false);
setImageOpacity (l, ib, overImage, (float) xml.getDoubleAttribute ("opacityOver", 1.0f), false);
setImageColour (l, ib, overImage, Colour::fromString (xml.getStringAttribute ("colourOver", "0")), false);
setImageResource (l, ib, downImage, xml.getStringAttribute (T("resourceDown"), String::empty), false);
setImageOpacity (l, ib, downImage, (float) xml.getDoubleAttribute (T("opacityDown"), 1.0f), false);
setImageColour (l, ib, downImage, Colour::fromString (xml.getStringAttribute (T("colourDown"), T("0"))), false);
setImageResource (l, ib, downImage, xml.getStringAttribute ("resourceDown", String::empty), false);
setImageOpacity (l, ib, downImage, (float) xml.getDoubleAttribute ("opacityDown", 1.0f), false);
setImageColour (l, ib, downImage, Colour::fromString (xml.getStringAttribute ("colourDown", "0")), false);
return true;
}
@@ -140,7 +140,7 @@ public:
s << getColourIntialisationCode (component, memberVariableName)
<< '\n';
const String indent (String::repeatedString (T(" "), memberVariableName.length() + 13));
const String indent (String::repeatedString (" ", memberVariableName.length() + 13));
s << memberVariableName << "->setImages (false, true, "
<< boolToString (doesImageKeepProportions (ib)) << ",\n"
@@ -243,7 +243,7 @@ public:
if (undoable)
{
layout.getDocument()->perform (new SetImageResourceAction (button, layout, role, newName),
T("Change image resource"));
"Change image resource");
}
else
{
@@ -537,11 +537,6 @@ public:
getImageOpacity (ib, downImage),
getImageColour (ib, downImage));
}
//==============================================================================
juce_UseDebuggingNewOperator
private:
};


+ 13
- 17
extras/the jucer/src/model/components/jucer_JucerComponentHandler.h View File

@@ -50,15 +50,15 @@ public:
return new TestComponent (doc, 0, false);
}
const String getXmlTagName() const throw() { return T("JUCERCOMP"); }
const String getXmlTagName() const throw() { return "JUCERCOMP"; }
XmlElement* createXmlFor (Component* comp, const ComponentLayout* layout)
{
TestComponent* const tc = dynamic_cast <TestComponent*> (comp);
XmlElement* e = ComponentTypeHandler::createXmlFor (comp, layout);
e->setAttribute (T("sourceFile"), tc->getFilename());
e->setAttribute (T("constructorParams"), tc->getConstructorParams());
e->setAttribute ("sourceFile", tc->getFilename());
e->setAttribute ("constructorParams", tc->getConstructorParams());
return e;
}
@@ -70,8 +70,8 @@ public:
if (! ComponentTypeHandler::restoreFromXml (xml, comp, layout))
return false;
tc->setFilename (xml.getStringAttribute (T("sourceFile"), tc->getFilename()));
tc->setConstructorParams (xml.getStringAttribute (T("constructorParams")));
tc->setFilename (xml.getStringAttribute ("sourceFile", tc->getFilename()));
tc->setConstructorParams (xml.getStringAttribute ("constructorParams"));
return true;
}
@@ -86,7 +86,7 @@ public:
jucerCompClassName = tc->getDocument()->getClassName();
if (jucerCompClassName.isEmpty())
jucerCompClassName = T("Component");
jucerCompClassName = "Component";
return jucerCompClassName;
}
@@ -114,7 +114,7 @@ public:
TestComponent* const tc = dynamic_cast <TestComponent*> (component);
code.includeFilesH.add (tc->getFilename().replace (T(".cpp"), T(".h")));
code.includeFilesH.add (tc->getFilename().replace (".cpp", ".h"));
}
//==============================================================================
@@ -153,21 +153,17 @@ public:
if (comp != 0)
document.perform (new JucerCompFileChangeAction (comp, *document.getComponentLayout(), newFilename),
T("Change Jucer component file"));
"Change Jucer component file");
}
//==============================================================================
juce_UseDebuggingNewOperator
private:
//==============================================================================
class JucerCompFileProperty : public FilePropertyComponent,
public ChangeListener
{
public:
JucerCompFileProperty (TestComponent* const component_, JucerDocument& document_)
: FilePropertyComponent (T("Jucer file"), false, true),
: FilePropertyComponent ("Jucer file", false, true),
component (component_),
document (document_)
{
@@ -207,7 +203,7 @@ private:
{
public:
JucerCompOpenDocProperty (TestComponent* const component_)
: ButtonPropertyComponent (T("edit"), false),
: ButtonPropertyComponent ("edit", false),
component (component_)
{
}
@@ -223,7 +219,7 @@ private:
const String getButtonText() const
{
return T("Open file for editing");
return "Open file for editing";
}
private:
@@ -235,14 +231,14 @@ private:
{
public:
ConstructorParamsProperty (TestComponent* comp, JucerDocument& document)
: ComponentTextProperty <TestComponent> (T("constructor params"), 512, false, comp, document)
: ComponentTextProperty <TestComponent> ("constructor params", 512, false, comp, document)
{
}
void setText (const String& newText)
{
document.perform (new ConstructorParamChangeAction (component, *document.getComponentLayout(), newText),
T("Change Viewport content constructor params"));
"Change Viewport content constructor params");
}
const String getText() const


+ 45
- 48
extras/the jucer/src/model/components/jucer_LabelHandler.h View File

@@ -52,7 +52,7 @@ public:
//==============================================================================
Component* createNewComponent (JucerDocument*)
{
return new Label (T("new label"), T("label text"));
return new Label ("new label", "label text");
}
XmlElement* createXmlFor (Component* comp, const ComponentLayout* layout)
@@ -60,17 +60,17 @@ public:
Label* const l = dynamic_cast <Label*> (comp);
XmlElement* e = ComponentTypeHandler::createXmlFor (comp, layout);
e->setAttribute (T("labelText"), l->getText());
e->setAttribute ("labelText", l->getText());
e->setAttribute (T("editableSingleClick"), l->isEditableOnSingleClick());
e->setAttribute (T("editableDoubleClick"), l->isEditableOnDoubleClick());
e->setAttribute (T("focusDiscardsChanges"), l->doesLossOfFocusDiscardChanges());
e->setAttribute ("editableSingleClick", l->isEditableOnSingleClick());
e->setAttribute ("editableDoubleClick", l->isEditableOnDoubleClick());
e->setAttribute ("focusDiscardsChanges", l->doesLossOfFocusDiscardChanges());
e->setAttribute (T("fontname"), l->getProperties().getWithDefault ("typefaceName", FontPropertyComponent::defaultFont).toString());
e->setAttribute (T("fontsize"), roundToInt (l->getFont().getHeight() * 100.0) / 100.0);
e->setAttribute (T("bold"), l->getFont().isBold());
e->setAttribute (T("italic"), l->getFont().isItalic());
e->setAttribute (T("justification"), l->getJustificationType().getFlags());
e->setAttribute ("fontname", l->getProperties().getWithDefault ("typefaceName", FontPropertyComponent::defaultFont).toString());
e->setAttribute ("fontsize", roundToInt (l->getFont().getHeight() * 100.0) / 100.0);
e->setAttribute ("bold", l->getFont().isBold());
e->setAttribute ("italic", l->getFont().isItalic());
e->setAttribute ("justification", l->getJustificationType().getFlags());
return e;
}
@@ -85,21 +85,21 @@ public:
Label defaultLabel (String::empty, String::empty);
Font font;
font.setHeight ((float) xml.getDoubleAttribute (T("fontsize"), 15.0));
font.setBold (xml.getBoolAttribute (T("bold"), false));
font.setItalic (xml.getBoolAttribute (T("italic"), false));
font.setHeight ((float) xml.getDoubleAttribute ("fontsize", 15.0));
font.setBold (xml.getBoolAttribute ("bold", false));
font.setItalic (xml.getBoolAttribute ("italic", false));
l->setFont (font);
l->getProperties().set ("typefaceName", xml.getStringAttribute (T("fontname"), FontPropertyComponent::defaultFont));
l->getProperties().set ("typefaceName", xml.getStringAttribute ("fontname", FontPropertyComponent::defaultFont));
updateLabelFont (l);
l->setJustificationType (Justification (xml.getIntAttribute (T("justification"), Justification::centred)));
l->setJustificationType (Justification (xml.getIntAttribute ("justification", Justification::centred)));
l->setText (xml.getStringAttribute (T("labelText"), T("Label Text")), false);
l->setText (xml.getStringAttribute ("labelText", "Label Text"), false);
l->setEditable (xml.getBoolAttribute (T("editableSingleClick"), defaultLabel.isEditableOnSingleClick()),
xml.getBoolAttribute (T("editableDoubleClick"), defaultLabel.isEditableOnDoubleClick()),
xml.getBoolAttribute (T("focusDiscardsChanges"), defaultLabel.doesLossOfFocusDiscardChanges()));
l->setEditable (xml.getBoolAttribute ("editableSingleClick", defaultLabel.isEditableOnSingleClick()),
xml.getBoolAttribute ("editableDoubleClick", defaultLabel.isEditableOnDoubleClick()),
xml.getBoolAttribute ("focusDiscardsChanges", defaultLabel.doesLossOfFocusDiscardChanges()));
return true;
}
@@ -154,9 +154,9 @@ public:
if (needsCallback (component))
{
String& callback = code.getCallbackCode (T("public LabelListener"),
T("void"),
T("labelTextChanged (Label* labelThatHasChanged)"),
String& callback = code.getCallbackCode ("public LabelListener",
"void",
"labelTextChanged (Label* labelThatHasChanged)",
true);
if (callback.trim().isNotEmpty())
@@ -197,9 +197,6 @@ public:
|| ((Label*) label)->isEditableOnDoubleClick(); // xxx should be configurable
}
//==============================================================================
juce_UseDebuggingNewOperator
private:
//==============================================================================
@@ -207,13 +204,13 @@ private:
{
public:
LabelTextProperty (Label* component_, JucerDocument& document_)
: ComponentTextProperty <Label> (T("text"), 10000, true, component_, document_)
: ComponentTextProperty <Label> ("text", 10000, true, component_, document_)
{}
void setText (const String& newText)
{
document.perform (new LabelTextChangeAction (component, *document.getComponentLayout(), newText),
T("Change Label text"));
"Change Label text");
}
const String getText() const
@@ -258,17 +255,17 @@ private:
public:
LabelEditableProperty (Label* component_,
JucerDocument& document_)
: ComponentChoiceProperty <Label> (T("editing"), component_, document_)
: ComponentChoiceProperty <Label> ("editing", component_, document_)
{
choices.add (T("read-only"));
choices.add (T("edit on single-click"));
choices.add (T("edit on double-click"));
choices.add ("read-only");
choices.add ("edit on single-click");
choices.add ("edit on double-click");
}
void setIndex (int newIndex)
{
document.perform (new LabelEditableChangeAction (component, *document.getComponentLayout(), newIndex),
T("Change Label editability"));
"Change Label editability");
}
int getIndex() const
@@ -319,16 +316,16 @@ private:
public:
LabelLossOfFocusProperty (Label* component_,
JucerDocument& document_)
: ComponentChoiceProperty <Label> (T("focus"), component_, document_)
: ComponentChoiceProperty <Label> ("focus", component_, document_)
{
choices.add (T("loss of focus discards changes"));
choices.add (T("loss of focus commits changes"));
choices.add ("loss of focus discards changes");
choices.add ("loss of focus commits changes");
}
void setIndex (int newIndex)
{
document.perform (new LabelFocusLossChangeAction (component, *document.getComponentLayout(), newIndex == 0),
T("Change Label focus behaviour"));
"Change Label focus behaviour");
}
int getIndex() const
@@ -377,7 +374,7 @@ private:
{
public:
LabelJustificationProperty (Label* const label_, JucerDocument& document_)
: JustificationProperty (T("layout"), false),
: JustificationProperty ("layout", false),
label (label_),
document (document_)
{
@@ -392,7 +389,7 @@ private:
void setJustification (const Justification& newJustification)
{
document.perform (new LabelJustifyChangeAction (label, *document.getComponentLayout(), newJustification),
T("Change Label justification"));
"Change Label justification");
}
const Justification getJustification() const
@@ -443,7 +440,7 @@ private:
public:
FontNameProperty (Label* const label_,
JucerDocument& document_)
: FontPropertyComponent (T("font")),
: FontPropertyComponent ("font"),
label (label_),
document (document_)
{
@@ -458,7 +455,7 @@ private:
void setTypefaceName (const String& newFontName)
{
document.perform (new FontNameChangeAction (label, *document.getComponentLayout(), newFontName),
T("Change Label typeface"));
"Change Label typeface");
}
const String getTypefaceName() const
@@ -510,7 +507,7 @@ private:
{
public:
FontSizeProperty (Label* const label_, JucerDocument& document_)
: SliderPropertyComponent (T("size"), 1.0, 250.0, 0.1, 0.3),
: SliderPropertyComponent ("size", 1.0, 250.0, 0.1, 0.3),
label (label_),
document (document_)
{
@@ -527,7 +524,7 @@ private:
document.getUndoManager().undoCurrentTransactionOnly();
document.perform (new FontSizeChangeAction (label, *document.getComponentLayout(), (float) newValue),
T("Change Label font size"));
"Change Label font size");
}
double getValue() const
@@ -581,16 +578,16 @@ private:
{
public:
FontStyleProperty (Label* const label_, JucerDocument& document_)
: ChoicePropertyComponent (T("style")),
: ChoicePropertyComponent ("style"),
label (label_),
document (document_)
{
document.addChangeListener (this);
choices.add (T("normal"));
choices.add (T("bold"));
choices.add (T("italic"));
choices.add (T("bold + italic"));
choices.add ("normal");
choices.add ("bold");
choices.add ("italic");
choices.add ("bold + italic");
}
~FontStyleProperty()
@@ -606,7 +603,7 @@ private:
f.setItalic (newIndex == 2 || newIndex == 3);
document.perform (new FontStyleChangeAction (label, *document.getComponentLayout(), f),
T("Change Label font style"));
"Change Label font style");
}
int getIndex() const


+ 68
- 70
extras/the jucer/src/model/components/jucer_SliderHandler.h View File

@@ -50,7 +50,7 @@ public:
//==============================================================================
Component* createNewComponent (JucerDocument*)
{
return new Slider (T("new slider"));
return new Slider ("new slider");
}
//==============================================================================
@@ -59,15 +59,15 @@ public:
XmlElement* e = ComponentTypeHandler::createXmlFor (comp, layout);
Slider* const s = dynamic_cast <Slider*> (comp);
e->setAttribute (T("min"), s->getMinimum());
e->setAttribute (T("max"), s->getMaximum());
e->setAttribute (T("int"), s->getInterval());
e->setAttribute (T("style"), sliderStyleToString (s->getSliderStyle()));
e->setAttribute (T("textBoxPos"), textBoxPosToString (s->getTextBoxPosition()));
e->setAttribute (T("textBoxEditable"), s->isTextBoxEditable());
e->setAttribute (T("textBoxWidth"), s->getTextBoxWidth());
e->setAttribute (T("textBoxHeight"), s->getTextBoxHeight());
e->setAttribute (T("skewFactor"), s->getSkewFactor());
e->setAttribute ("min", s->getMinimum());
e->setAttribute ("max", s->getMaximum());
e->setAttribute ("int", s->getInterval());
e->setAttribute ("style", sliderStyleToString (s->getSliderStyle()));
e->setAttribute ("textBoxPos", textBoxPosToString (s->getTextBoxPosition()));
e->setAttribute ("textBoxEditable", s->isTextBoxEditable());
e->setAttribute ("textBoxWidth", s->getTextBoxWidth());
e->setAttribute ("textBoxHeight", s->getTextBoxHeight());
e->setAttribute ("skewFactor", s->getSkewFactor());
return e;
}
@@ -79,18 +79,18 @@ public:
Slider* const s = dynamic_cast <Slider*> (comp);
s->setRange (xml.getDoubleAttribute (T("min"), 0.0),
xml.getDoubleAttribute (T("max"), 10.0),
xml.getDoubleAttribute (T("int"), 0.0));
s->setRange (xml.getDoubleAttribute ("min", 0.0),
xml.getDoubleAttribute ("max", 10.0),
xml.getDoubleAttribute ("int", 0.0));
s->setSliderStyle (sliderStringToStyle (xml.getStringAttribute (T("style"), T("LinearHorizontal"))));
s->setSliderStyle (sliderStringToStyle (xml.getStringAttribute ("style", "LinearHorizontal")));
s->setTextBoxStyle (stringToTextBoxPos (xml.getStringAttribute (T("textBoxPos"), T("TextBoxLeft"))),
! xml.getBoolAttribute (T("textBoxEditable"), true),
xml.getIntAttribute (T("textBoxWidth"), 80),
xml.getIntAttribute (T("textBoxHeight"), 20));
s->setTextBoxStyle (stringToTextBoxPos (xml.getStringAttribute ("textBoxPos", "TextBoxLeft")),
! xml.getBoolAttribute ("textBoxEditable", true),
xml.getIntAttribute ("textBoxWidth", 80),
xml.getIntAttribute ("textBoxHeight", 20));
s->setSkewFactor (xml.getDoubleAttribute (T("skewFactor"), 1.0));
s->setSkewFactor (xml.getDoubleAttribute ("skewFactor", 1.0));
return true;
}
@@ -135,9 +135,9 @@ public:
if (needsCallback (component))
{
String& callback = code.getCallbackCode (T("public SliderListener"),
T("void"),
T("sliderValueChanged (Slider* sliderThatWasMoved)"),
String& callback = code.getCallbackCode ("public SliderListener",
"void",
"sliderValueChanged (Slider* sliderThatWasMoved)",
true);
if (callback.isNotEmpty())
@@ -160,9 +160,9 @@ public:
Slider* s = dynamic_cast <Slider*> (component);
jassert (s != 0);
properties.add (new SliderRangeProperty (s, document, T("minimum"), 0));
properties.add (new SliderRangeProperty (s, document, T("maximum"), 1));
properties.add (new SliderRangeProperty (s, document, T("interval"), 2));
properties.add (new SliderRangeProperty (s, document, "minimum", 0));
properties.add (new SliderRangeProperty (s, document, "maximum", 1));
properties.add (new SliderRangeProperty (s, document, "interval", 2));
properties.add (new SliderTypeProperty (s, document));
properties.add (new SliderTextboxProperty (s, document));
properties.add (new SliderTextboxEditableProperty (s, document));
@@ -178,15 +178,13 @@ public:
return true; //xxx should be a property
}
juce_UseDebuggingNewOperator
private:
//==============================================================================
class SliderTypeProperty : public ComponentChoiceProperty <Slider>
{
public:
SliderTypeProperty (Slider* slider, JucerDocument& document)
: ComponentChoiceProperty <Slider> (T("type"), slider, document)
: ComponentChoiceProperty <Slider> ("type", slider, document)
{
choices.add ("Linear Horizontal");
choices.add ("Linear Vertical");
@@ -218,7 +216,7 @@ private:
if (newIndex >= 0 && newIndex < numElementsInArray (types))
{
document.perform (new SliderTypeChangeAction (component, *document.getComponentLayout(), types [newIndex]),
T("Change Slider style"));
"Change Slider style");
}
}
@@ -279,7 +277,7 @@ private:
{
public:
SliderTextboxProperty (Slider* slider, JucerDocument& document)
: ComponentChoiceProperty <Slider> (T("text position"), slider, document)
: ComponentChoiceProperty <Slider> ("text position", slider, document)
{
choices.add ("No text box");
choices.add ("Text box on left");
@@ -299,7 +297,7 @@ private:
if (newIndex >= 0 && newIndex < numElementsInArray (types))
{
document.perform (new SliderTextBoxChangeAction (component, *document.getComponentLayout(), types [newIndex]),
T("Change Slider textbox"));
"Change Slider textbox");
}
}
@@ -360,14 +358,14 @@ private:
{
public:
SliderTextboxEditableProperty (Slider* slider, JucerDocument& document)
: ComponentBooleanProperty <Slider> (T("text box mode"), T("Editable"), T("Editable"), slider, document)
: ComponentBooleanProperty <Slider> ("text box mode", "Editable", "Editable", slider, document)
{
}
void setState (bool newState)
{
document.perform (new SliderEditableChangeAction (component, *document.getComponentLayout(), newState),
T("Change Slider editability"));
"Change Slider editability");
}
bool getState() const
@@ -411,7 +409,7 @@ private:
{
public:
SliderTextboxSizeProperty (Slider* slider, JucerDocument& document, const bool isWidth_)
: ComponentTextProperty <Slider> (isWidth_ ? T("text box width") : T("text box height"),
: ComponentTextProperty <Slider> (isWidth_ ? "text box width" : "text box height",
12, false, slider, document),
isWidth (isWidth_)
{
@@ -420,7 +418,7 @@ private:
void setText (const String& newText)
{
document.perform (new SliderBoxSizeChangeAction (component, *document.getComponentLayout(), isWidth, newText.getIntValue()),
T("Change Slider textbox size"));
"Change Slider textbox size");
}
const String getText() const
@@ -506,7 +504,7 @@ private:
state [rangeParam] = newText.getDoubleValue();
document.perform (new SliderRangeChangeAction (component, *document.getComponentLayout(), state),
T("Change Slider range"));
"Change Slider range");
}
const String getText() const
@@ -576,7 +574,7 @@ private:
{
public:
SliderSkewProperty (Slider* slider, JucerDocument& document)
: ComponentTextProperty <Slider> (T("skew factor"), 12, false, slider, document)
: ComponentTextProperty <Slider> ("skew factor", 12, false, slider, document)
{
}
@@ -585,7 +583,7 @@ private:
const double skew = jlimit (0.001, 1000.0, newText.getDoubleValue());
document.perform (new SliderSkewChangeAction (component, *document.getComponentLayout(), skew),
T("Change Slider skew"));
"Change Slider skew");
}
const String getText() const
@@ -633,27 +631,27 @@ private:
switch (style)
{
case Slider::LinearHorizontal:
return T("LinearHorizontal");
return "LinearHorizontal";
case Slider::LinearVertical:
return T("LinearVertical");
return "LinearVertical";
case Slider::LinearBar:
return T("LinearBar");
return "LinearBar";
case Slider::Rotary:
return T("Rotary");
return "Rotary";
case Slider::RotaryHorizontalDrag:
return T("RotaryHorizontalDrag");
return "RotaryHorizontalDrag";
case Slider::RotaryVerticalDrag:
return T("RotaryVerticalDrag");
return "RotaryVerticalDrag";
case Slider::IncDecButtons:
return T("IncDecButtons");
return "IncDecButtons";
case Slider::TwoValueHorizontal:
return T("TwoValueHorizontal");
return "TwoValueHorizontal";
case Slider::TwoValueVertical:
return T("TwoValueVertical");
return "TwoValueVertical";
case Slider::ThreeValueHorizontal:
return T("ThreeValueHorizontal");
return "ThreeValueHorizontal";
case Slider::ThreeValueVertical:
return T("ThreeValueVertical");
return "ThreeValueVertical";
default:
jassertfalse
@@ -665,27 +663,27 @@ private:
static Slider::SliderStyle sliderStringToStyle (const String& s)
{
if (s == T("LinearHorizontal"))
if (s == "LinearHorizontal")
return Slider::LinearHorizontal;
else if (s == T("LinearVertical"))
else if (s == "LinearVertical")
return Slider::LinearVertical;
else if (s == T("LinearBar"))
else if (s == "LinearBar")
return Slider::LinearBar;
else if (s == T("Rotary"))
else if (s == "Rotary")
return Slider::Rotary;
else if (s == T("RotaryHorizontalDrag"))
else if (s == "RotaryHorizontalDrag")
return Slider::RotaryHorizontalDrag;
else if (s == T("RotaryVerticalDrag"))
else if (s == "RotaryVerticalDrag")
return Slider::RotaryVerticalDrag;
else if (s == T("IncDecButtons"))
else if (s == "IncDecButtons")
return Slider::IncDecButtons;
else if (s.startsWithIgnoreCase (T("TwoValueHoriz")))
else if (s.startsWithIgnoreCase ("TwoValueHoriz"))
return Slider::TwoValueHorizontal;
else if (s.startsWithIgnoreCase (T("TwoValueVert")))
else if (s.startsWithIgnoreCase ("TwoValueVert"))
return Slider::TwoValueVertical;
else if (s.startsWithIgnoreCase (T("ThreeValueHoriz")))
else if (s.startsWithIgnoreCase ("ThreeValueHoriz"))
return Slider::ThreeValueHorizontal;
else if (s.startsWithIgnoreCase (T("ThreeValueVert")))
else if (s.startsWithIgnoreCase ("ThreeValueVert"))
return Slider::ThreeValueVertical;
jassertfalse
@@ -697,15 +695,15 @@ private:
switch (pos)
{
case Slider::NoTextBox:
return T("NoTextBox");
return "NoTextBox";
case Slider::TextBoxLeft:
return T("TextBoxLeft");
return "TextBoxLeft";
case Slider::TextBoxRight:
return T("TextBoxRight");
return "TextBoxRight";
case Slider::TextBoxAbove:
return T("TextBoxAbove");
return "TextBoxAbove";
case Slider::TextBoxBelow:
return T("TextBoxBelow");
return "TextBoxBelow";
default:
jassertfalse
break;
@@ -716,15 +714,15 @@ private:
static const Slider::TextEntryBoxPosition stringToTextBoxPos (const String& s)
{
if (s == T("NoTextBox"))
if (s == "NoTextBox")
return Slider::NoTextBox;
else if (s == T("TextBoxLeft"))
else if (s == "TextBoxLeft")
return Slider::TextBoxLeft;
else if (s == T("TextBoxRight"))
else if (s == "TextBoxRight")
return Slider::TextBoxRight;
else if (s == T("TextBoxAbove"))
else if (s == "TextBoxAbove")
return Slider::TextBoxAbove;
else if (s == T("TextBoxBelow"))
else if (s == "TextBoxBelow")
return Slider::TextBoxBelow;
jassertfalse


+ 56
- 59
extras/the jucer/src/model/components/jucer_TabbedComponentHandler.h View File

@@ -42,7 +42,7 @@ public:
Component* createNewComponent (JucerDocument*)
{
TabbedComponent* const t = new TabbedComponent (TabbedButtonBar::TabsAtTop);
t->setName (T("new tabbed component"));
t->setName ("new tabbed component");
for (int i = 3; --i >= 0;)
addNewTab (t);
@@ -56,16 +56,16 @@ public:
XmlElement* const e = ComponentTypeHandler::createXmlFor (comp, layout);
if (t->getOrientation() == TabbedButtonBar::TabsAtTop)
e->setAttribute (T("orientation"), T("top"));
e->setAttribute ("orientation", "top");
else if (t->getOrientation() == TabbedButtonBar::TabsAtBottom)
e->setAttribute (T("orientation"), T("bottom"));
e->setAttribute ("orientation", "bottom");
else if (t->getOrientation() == TabbedButtonBar::TabsAtLeft)
e->setAttribute (T("orientation"), T("left"));
e->setAttribute ("orientation", "left");
else if (t->getOrientation() == TabbedButtonBar::TabsAtRight)
e->setAttribute (T("orientation"), T("right"));
e->setAttribute ("orientation", "right");
e->setAttribute (T("tabBarDepth"), t->getTabBarDepth());
e->setAttribute (T("initialTab"), t->getCurrentTabIndex());
e->setAttribute ("tabBarDepth", t->getTabBarDepth());
e->setAttribute ("initialTab", t->getCurrentTabIndex());
for (int i = 0; i < t->getNumTabs(); ++i)
e->addChildElement (getTabState (t, i));
@@ -80,18 +80,18 @@ public:
TabbedComponent* const t = dynamic_cast <TabbedComponent*> (comp);
if (xml.getStringAttribute (T("orientation")) == T("top"))
if (xml.getStringAttribute ("orientation") == "top")
t->setOrientation (TabbedButtonBar::TabsAtTop);
else if (xml.getStringAttribute (T("orientation")) == T("bottom"))
else if (xml.getStringAttribute ("orientation") == "bottom")
t->setOrientation (TabbedButtonBar::TabsAtBottom);
else if (xml.getStringAttribute (T("orientation")) == T("left"))
else if (xml.getStringAttribute ("orientation") == "left")
t->setOrientation (TabbedButtonBar::TabsAtLeft);
else if (xml.getStringAttribute (T("orientation")) == T("right"))
else if (xml.getStringAttribute ("orientation") == "right")
t->setOrientation (TabbedButtonBar::TabsAtRight);
TabbedComponent defaultTabComp (TabbedButtonBar::TabsAtTop);
t->setTabBarDepth (xml.getIntAttribute (T("tabBarDepth"), defaultTabComp.getTabBarDepth()));
t->setTabBarDepth (xml.getIntAttribute ("tabBarDepth", defaultTabComp.getTabBarDepth()));
t->clearTabs();
@@ -101,7 +101,7 @@ public:
restoreTabState (t, t->getNumTabs() - 1, *e);
}
t->setCurrentTabIndex (xml.getIntAttribute (T("initialTab"), 0));
t->setCurrentTabIndex (xml.getIntAttribute ("initialTab", 0));
return true;
}
@@ -220,7 +220,7 @@ public:
code.constructorCode << ", new " << contentClassName;
if (getTabConstructorParams (t, i).trim().isNotEmpty())
code.constructorCode << T(" ");
code.constructorCode << " ";
code.constructorCode << "(" << getTabConstructorParams (t, i).trim() << "), true);\n";
}
@@ -255,10 +255,10 @@ public:
if (tdc != 0)
{
xml->setAttribute (T("useJucerComp"), tdc->isUsingJucerComp);
xml->setAttribute (T("contentClassName"), tdc->contentClassName);
xml->setAttribute (T("constructorParams"), tdc->constructorParams);
xml->setAttribute (T("jucerComponentFile"), tdc->jucerComponentFile);
xml->setAttribute ("useJucerComp", tdc->isUsingJucerComp);
xml->setAttribute ("contentClassName", tdc->contentClassName);
xml->setAttribute ("constructorParams", tdc->constructorParams);
xml->setAttribute ("jucerComponentFile", tdc->jucerComponentFile);
}
return xml;
@@ -274,10 +274,10 @@ public:
if (tdc != 0)
{
tdc->isUsingJucerComp = xml.getBoolAttribute (T("useJucerComp"), false);
tdc->contentClassName = xml.getStringAttribute (T("contentClassName"));
tdc->constructorParams = xml.getStringAttribute (T("constructorParams"));
tdc->jucerComponentFile = xml.getStringAttribute (T("jucerComponentFile"));
tdc->isUsingJucerComp = xml.getBoolAttribute ("useJucerComp", false);
tdc->contentClassName = xml.getStringAttribute ("contentClassName");
tdc->constructorParams = xml.getStringAttribute ("constructorParams");
tdc->jucerComponentFile = xml.getStringAttribute ("jucerComponentFile");
tdc->updateContent();
}
@@ -364,9 +364,6 @@ public:
}
}
//==============================================================================
juce_UseDebuggingNewOperator
private:
//==============================================================================
class TabDemoContentComp : public Component
@@ -446,12 +443,12 @@ private:
{
public:
TabOrientationProperty (TabbedComponent* comp, JucerDocument& document)
: ComponentChoiceProperty <TabbedComponent> (T("tab position"), comp, document)
: ComponentChoiceProperty <TabbedComponent> ("tab position", comp, document)
{
choices.add (T("Tabs at top"));
choices.add (T("Tabs at bottom"));
choices.add (T("Tabs at left"));
choices.add (T("Tabs at right"));
choices.add ("Tabs at top");
choices.add ("Tabs at bottom");
choices.add ("Tabs at left");
choices.add ("Tabs at right");
}
void setIndex (int newIndex)
@@ -462,7 +459,7 @@ private:
TabbedButtonBar::TabsAtRight };
document.perform (new TabOrienationChangeAction (component, *document.getComponentLayout(), orientations [newIndex]),
T("Change TabComponent orientation"));
"Change TabComponent orientation");
}
int getIndex() const
@@ -521,7 +518,7 @@ private:
{
public:
TabInitialTabProperty (TabbedComponent* comp, JucerDocument& document)
: ComponentChoiceProperty <TabbedComponent> (T("initial tab"), comp, document)
: ComponentChoiceProperty <TabbedComponent> ("initial tab", comp, document)
{
for (int i = 0; i < comp->getNumTabs(); ++i)
choices.add ("Tab " + String (i) + ": \"" + comp->getTabNames() [i] + "\"");
@@ -576,7 +573,7 @@ private:
{
public:
TabDepthProperty (TabbedComponent* comp, JucerDocument& document_)
: SliderPropertyComponent (T("tab depth"), 10.0, 80.0, 1.0, 1.0),
: SliderPropertyComponent ("tab depth", 10.0, 80.0, 1.0, 1.0),
component (comp),
document (document_)
{
@@ -593,7 +590,7 @@ private:
document.getUndoManager().undoCurrentTransactionOnly();
document.perform (new TabDepthChangeAction (component, *document.getComponentLayout(), roundToInt (newValue)),
T("Change TabComponent tab depth"));
"Change TabComponent tab depth");
}
double getValue() const
@@ -645,7 +642,7 @@ private:
{
public:
TabAddTabProperty (TabbedComponent* comp, JucerDocument& document_)
: ButtonPropertyComponent (T("add tab"), false),
: ButtonPropertyComponent ("add tab", false),
component (comp),
document (document_)
{
@@ -654,12 +651,12 @@ private:
void buttonClicked()
{
document.perform (new AddTabAction (component, *document.getComponentLayout()),
T("Add a new tab"));
"Add a new tab");
}
const String getButtonText() const
{
return T("Create a new tab");
return "Create a new tab";
}
TabbedComponent* const component;
@@ -699,7 +696,7 @@ private:
{
public:
TabRemoveTabProperty (TabbedComponent* comp, JucerDocument& document_)
: ButtonPropertyComponent (T("remove tab"), true),
: ButtonPropertyComponent ("remove tab", true),
component (comp),
document (document_)
{
@@ -719,13 +716,13 @@ private:
if (r > 0)
{
document.perform (new RemoveTabAction (component, *document.getComponentLayout(), r - 1),
T("Remove a tab"));
"Remove a tab");
}
}
const String getButtonText() const
{
return T("Delete a tab...");
return "Delete a tab...";
}
TabbedComponent* const component;
@@ -779,7 +776,7 @@ private:
{
public:
TabNameProperty (TabbedComponent* comp, JucerDocument& document, const int tabIndex_)
: ComponentTextProperty <TabbedComponent> (T("name"), 200, false, comp, document),
: ComponentTextProperty <TabbedComponent> ("name", 200, false, comp, document),
tabIndex (tabIndex_)
{
}
@@ -787,7 +784,7 @@ private:
void setText (const String& newText)
{
document.perform (new TabNameChangeAction (component, *document.getComponentLayout(), tabIndex, newText),
T("Change tab name"));
"Change tab name");
}
const String getText() const
@@ -837,7 +834,7 @@ private:
{
public:
TabColourProperty (TabbedComponent* comp, JucerDocument& document_, const int tabIndex_)
: ColourPropertyComponent (T("colour"), false),
: ColourPropertyComponent ("colour", false),
component (comp),
document (document_),
tabIndex (tabIndex_)
@@ -855,7 +852,7 @@ private:
document.getUndoManager().undoCurrentTransactionOnly();
document.perform (new TabColourChangeAction (component, *document.getComponentLayout(), tabIndex, newColour),
T("Change tab colour"));
"Change tab colour");
}
const Colour getColour() const
@@ -913,17 +910,17 @@ private:
{
public:
TabContentTypeProperty (TabbedComponent* comp, JucerDocument& document, const int tabIndex_)
: ComponentChoiceProperty <TabbedComponent> (T("content type"), comp, document),
: ComponentChoiceProperty <TabbedComponent> ("content type", comp, document),
tabIndex (tabIndex_)
{
choices.add (T("Jucer content component"));
choices.add (T("Named content component"));
choices.add ("Jucer content component");
choices.add ("Named content component");
}
void setIndex (int newIndex)
{
document.perform (new TabContentTypeChangeAction (component, *document.getComponentLayout(), tabIndex, newIndex == 0),
T("Change tab content type"));
"Change tab content type");
}
int getIndex() const
@@ -975,7 +972,7 @@ private:
{
public:
TabJucerFileProperty (TabbedComponent* const component_, JucerDocument& document_, const int tabIndex_)
: FilePropertyComponent (T("jucer file"), false, true),
: FilePropertyComponent ("jucer file", false, true),
component (component_),
document (document_),
tabIndex (tabIndex_)
@@ -994,7 +991,7 @@ private:
document.perform (new JucerCompFileChangeAction (component, *document.getComponentLayout(), tabIndex,
newFile.getRelativePathFrom (document.getFile().getParentDirectory())
.replaceCharacter ('\\', '/')),
T("Change tab component file"));
"Change tab component file");
}
const File getFile() const
@@ -1046,7 +1043,7 @@ private:
{
public:
TabContentClassProperty (TabbedComponent* comp, JucerDocument& document, const int tabIndex_)
: ComponentTextProperty <TabbedComponent> (T("content class"), 256, false, comp, document),
: ComponentTextProperty <TabbedComponent> ("content class", 256, false, comp, document),
tabIndex (tabIndex_)
{
}
@@ -1054,7 +1051,7 @@ private:
void setText (const String& newText)
{
document.perform (new TabClassNameChangeAction (component, *document.getComponentLayout(), tabIndex, newText),
T("Change TabbedComponent content class"));
"Change TabbedComponent content class");
}
const String getText() const
@@ -1104,7 +1101,7 @@ private:
{
public:
TabContentConstructorParamsProperty (TabbedComponent* comp, JucerDocument& document, const int tabIndex_)
: ComponentTextProperty <TabbedComponent> (T("constructor params"), 512, false, comp, document),
: ComponentTextProperty <TabbedComponent> ("constructor params", 512, false, comp, document),
tabIndex (tabIndex_)
{
}
@@ -1112,7 +1109,7 @@ private:
void setText (const String& newText)
{
document.perform (new TabConstructorParamChangeAction (component, *document.getComponentLayout(), tabIndex, newText),
T("Change TabbedComponent content constructor param"));
"Change TabbedComponent content constructor param");
}
const String getText() const
@@ -1163,7 +1160,7 @@ private:
public:
TabMoveProperty (TabbedComponent* comp, JucerDocument& document_,
const int tabIndex_, const int totalNumTabs_)
: ButtonPropertyComponent (T("move tab"), false),
: ButtonPropertyComponent ("move tab", false),
component (comp),
document (document_),
tabIndex (tabIndex_),
@@ -1175,21 +1172,21 @@ private:
void buttonClicked()
{
PopupMenu m;
m.addItem (1, T("Move this tab up"), tabIndex > 0);
m.addItem (2, T("Move this tab down"), tabIndex < totalNumTabs - 1);
m.addItem (1, "Move this tab up", tabIndex > 0);
m.addItem (2, "Move this tab down", tabIndex < totalNumTabs - 1);
const int r = m.showAt (this);
if (r != 0)
{
document.perform (new MoveTabAction (component, *document.getComponentLayout(), tabIndex, tabIndex + (r == 2 ? 1 : -1)),
T("Move a tab"));
"Move a tab");
}
}
const String getButtonText() const
{
return T("Move this tab...");
return "Move this tab...";
}
TabbedComponent* const component;


+ 1
- 7
extras/the jucer/src/model/components/jucer_TextButtonHandler.h View File

@@ -49,7 +49,7 @@ public:
//==============================================================================
Component* createNewComponent (JucerDocument*)
{
return new TextButton (T("new button"), String::empty);
return new TextButton ("new button", String::empty);
}
void getEditableProperties (Component* component, JucerDocument& document, Array <PropertyComponent*>& properties)
@@ -92,12 +92,6 @@ public:
code.constructorCode += s;
}
//==============================================================================
juce_UseDebuggingNewOperator
private:
};


+ 30
- 33
extras/the jucer/src/model/components/jucer_TextEditorHandler.h View File

@@ -48,7 +48,7 @@ public:
//==============================================================================
Component* createNewComponent (JucerDocument*)
{
return new TextEditor (T("new text editor"));
return new TextEditor ("new text editor");
}
XmlElement* createXmlFor (Component* comp, const ComponentLayout* layout)
@@ -56,14 +56,14 @@ public:
XmlElement* e = ComponentTypeHandler::createXmlFor (comp, layout);
TextEditor* te = (TextEditor*) comp;
e->setAttribute (T("initialText"), comp->getProperties() ["initialText"].toString());
e->setAttribute ("initialText", comp->getProperties() ["initialText"].toString());
e->setAttribute (T("multiline"), te->isMultiLine());
e->setAttribute (T("retKeyStartsLine"), te->getReturnKeyStartsNewLine());
e->setAttribute (T("readonly"), te->isReadOnly());
e->setAttribute (T("scrollbars"), te->areScrollbarsShown());
e->setAttribute (T("caret"), te->isCaretVisible());
e->setAttribute (T("popupmenu"), te->isPopupMenuEnabled());
e->setAttribute ("multiline", te->isMultiLine());
e->setAttribute ("retKeyStartsLine", te->getReturnKeyStartsNewLine());
e->setAttribute ("readonly", te->isReadOnly());
e->setAttribute ("scrollbars", te->areScrollbarsShown());
e->setAttribute ("caret", te->isCaretVisible());
e->setAttribute ("popupmenu", te->isPopupMenuEnabled());
return e;
}
@@ -76,14 +76,14 @@ public:
TextEditor* te = (TextEditor*) comp;
TextEditor defaultEditor;
te->setMultiLine (xml.getBoolAttribute (T("multiline"), defaultEditor.isMultiLine()));
te->setReturnKeyStartsNewLine (xml.getBoolAttribute (T("retKeyStartsLine"), defaultEditor.getReturnKeyStartsNewLine()));
te->setReadOnly (xml.getBoolAttribute (T("readonly"), defaultEditor.isReadOnly()));
te->setScrollbarsShown (xml.getBoolAttribute (T("scrollbars"), defaultEditor.areScrollbarsShown()));
te->setCaretVisible (xml.getBoolAttribute (T("caret"), defaultEditor.isCaretVisible()));
te->setPopupMenuEnabled (xml.getBoolAttribute (T("popupmenu"), defaultEditor.isPopupMenuEnabled()));
te->setMultiLine (xml.getBoolAttribute ("multiline", defaultEditor.isMultiLine()));
te->setReturnKeyStartsNewLine (xml.getBoolAttribute ("retKeyStartsLine", defaultEditor.getReturnKeyStartsNewLine()));
te->setReadOnly (xml.getBoolAttribute ("readonly", defaultEditor.isReadOnly()));
te->setScrollbarsShown (xml.getBoolAttribute ("scrollbars", defaultEditor.areScrollbarsShown()));
te->setCaretVisible (xml.getBoolAttribute ("caret", defaultEditor.isCaretVisible()));
te->setPopupMenuEnabled (xml.getBoolAttribute ("popupmenu", defaultEditor.isPopupMenuEnabled()));
const String initialText (xml.getStringAttribute (T("initialText")));
const String initialText (xml.getStringAttribute ("initialText"));
te->setText (initialText, false);
te->getProperties().set ("initialText", initialText);
return true;
@@ -131,27 +131,24 @@ public:
code.constructorCode += s;
}
//==============================================================================
juce_UseDebuggingNewOperator
private:
//==============================================================================
class TextEditorMultiLineProperty : public ComponentChoiceProperty <TextEditor>
{
public:
TextEditorMultiLineProperty (TextEditor* component_, JucerDocument& document_)
: ComponentChoiceProperty <TextEditor> (T("mode"), component_, document_)
: ComponentChoiceProperty <TextEditor> ("mode", component_, document_)
{
choices.add (T("single line"));
choices.add (T("multi-line, return key starts new line"));
choices.add (T("multi-line, return key disabled"));
choices.add ("single line");
choices.add ("multi-line, return key starts new line");
choices.add ("multi-line, return key disabled");
}
//==============================================================================
void setIndex (int newIndex)
{
document.perform (new TextEditorMultilineChangeAction (component, *document.getComponentLayout(), newIndex),
T("Change TextEditor multiline mode"));
"Change TextEditor multiline mode");
}
int getIndex() const
@@ -197,7 +194,7 @@ private:
{
public:
TextEditorReadOnlyProperty (TextEditor* component_, JucerDocument& document_)
: ComponentBooleanProperty <TextEditor> (T("editable"), T("Editable"), T("Editable"), component_, document_)
: ComponentBooleanProperty <TextEditor> ("editable", "Editable", "Editable", component_, document_)
{
}
@@ -205,7 +202,7 @@ private:
void setState (bool newState)
{
document.perform (new TextEditorReadonlyChangeAction (component, *document.getComponentLayout(), ! newState),
T("Change TextEditor read-only mode"));
"Change TextEditor read-only mode");
}
bool getState() const { return ! component->isReadOnly(); }
@@ -246,7 +243,7 @@ private:
{
public:
TextEditorScrollbarsProperty (TextEditor* component_, JucerDocument& document_)
: ComponentBooleanProperty <TextEditor> (T("scrollbars"), T("Scrollbars enabled"), T("Scrollbars enabled"), component_, document_)
: ComponentBooleanProperty <TextEditor> ("scrollbars", "Scrollbars enabled", "Scrollbars enabled", component_, document_)
{
}
@@ -254,7 +251,7 @@ private:
void setState (bool newState)
{
document.perform (new TextEditorScrollbarChangeAction (component, *document.getComponentLayout(), newState),
T("Change TextEditor scrollbars"));
"Change TextEditor scrollbars");
}
bool getState() const { return component->areScrollbarsShown(); }
@@ -295,7 +292,7 @@ private:
{
public:
TextEditorCaretProperty (TextEditor* component_, JucerDocument& document_)
: ComponentBooleanProperty <TextEditor> (T("caret"), T("Caret visible"), T("Caret visible"), component_, document_)
: ComponentBooleanProperty <TextEditor> ("caret", "Caret visible", "Caret visible", component_, document_)
{
}
@@ -303,7 +300,7 @@ private:
void setState (bool newState)
{
document.perform (new TextEditorCaretChangeAction (component, *document.getComponentLayout(), newState),
T("Change TextEditor caret"));
"Change TextEditor caret");
}
bool getState() const { return component->isCaretVisible(); }
@@ -344,7 +341,7 @@ private:
{
public:
TextEditorPopupMenuProperty (TextEditor* component_, JucerDocument& document_)
: ComponentBooleanProperty <TextEditor> (T("popup menu"), T("Popup menu enabled"), T("Popup menu enabled"), component_, document_)
: ComponentBooleanProperty <TextEditor> ("popup menu", "Popup menu enabled", "Popup menu enabled", component_, document_)
{
}
@@ -352,7 +349,7 @@ private:
void setState (bool newState)
{
document.perform (new TextEditorPopupMenuChangeAction (component, *document.getComponentLayout(), newState),
T("Change TextEditor popup menu"));
"Change TextEditor popup menu");
}
bool getState() const { return component->isPopupMenuEnabled(); }
@@ -393,14 +390,14 @@ private:
{
public:
TextEditorInitialTextProperty (TextEditor* component_, JucerDocument& document_)
: ComponentTextProperty <TextEditor> (T("initial text"), 10000, true, component_, document_)
: ComponentTextProperty <TextEditor> ("initial text", 10000, true, component_, document_)
{}
//==============================================================================
void setText (const String& newText)
{
document.perform (new TextEditorInitialTextChangeAction (component, *document.getComponentLayout(), newText),
T("Change TextEditor initial text"));
"Change TextEditor initial text");
}
const String getText() const


+ 5
- 8
extras/the jucer/src/model/components/jucer_ToggleButtonHandler.h View File

@@ -46,7 +46,7 @@ public:
//==============================================================================
Component* createNewComponent (JucerDocument*)
{
return new ToggleButton (T("new toggle button"));
return new ToggleButton ("new toggle button");
}
void getEditableProperties (Component* component, JucerDocument& document, Array <PropertyComponent*>& properties)
@@ -63,7 +63,7 @@ public:
ToggleButton* tb = (ToggleButton*) comp;
XmlElement* e = ButtonHandler::createXmlFor (comp, layout);
e->setAttribute (T("state"), tb->getToggleState());
e->setAttribute ("state", tb->getToggleState());
return e;
}
@@ -75,7 +75,7 @@ public:
if (! ButtonHandler::restoreFromXml (xml, comp, layout))
return false;
tb->setToggleState (xml.getBoolAttribute (T("state"), false), false);
tb->setToggleState (xml.getBoolAttribute ("state", false), false);
return true;
}
@@ -96,22 +96,19 @@ public:
code.constructorCode += s;
}
//==============================================================================
juce_UseDebuggingNewOperator
private:
class ToggleButtonStateProperty : public ComponentBooleanProperty <ToggleButton>
{
public:
ToggleButtonStateProperty (ToggleButton* button_, JucerDocument& document_)
: ComponentBooleanProperty <ToggleButton> (T("initial state"), T("on"), T("off"), button_, document_)
: ComponentBooleanProperty <ToggleButton> ("initial state", "on", "off", button_, document_)
{
}
void setState (bool newState)
{
document.perform (new ToggleStateChangeAction (component, *document.getComponentLayout(), newState),
T("Change ToggleButton state"));
"Change ToggleButton state");
}
bool getState() const


+ 12
- 15
extras/the jucer/src/model/components/jucer_TreeViewHandler.h View File

@@ -52,8 +52,8 @@ public:
TreeView* const t = dynamic_cast <TreeView*> (comp);
XmlElement* const e = ComponentTypeHandler::createXmlFor (comp, layout);
e->setAttribute (T("rootVisible"), t->isRootItemVisible());
e->setAttribute (T("openByDefault"), t->areItemsOpenByDefault());
e->setAttribute ("rootVisible", t->isRootItemVisible());
e->setAttribute ("openByDefault", t->areItemsOpenByDefault());
return e;
}
@@ -66,8 +66,8 @@ public:
TreeView defaultTreeView;
TreeView* const t = dynamic_cast <TreeView*> (comp);
t->setRootItemVisible (xml.getBoolAttribute (T("rootVisible"), defaultTreeView.isRootItemVisible()));
t->setDefaultOpenness (xml.getBoolAttribute (T("openByDefault"), defaultTreeView.areItemsOpenByDefault()));
t->setRootItemVisible (xml.getBoolAttribute ("rootVisible", defaultTreeView.isRootItemVisible()));
t->setDefaultOpenness (xml.getBoolAttribute ("openByDefault", defaultTreeView.areItemsOpenByDefault()));
return true;
}
@@ -114,18 +114,15 @@ public:
code.constructorCode << "\n";
}
//==============================================================================
juce_UseDebuggingNewOperator
private:
//==============================================================================
class DemoTreeView : public TreeView
{
public:
DemoTreeView()
: TreeView (T("new treeview"))
: TreeView ("new treeview")
{
setRootItem (new DemoTreeViewItem (T("Demo root node"), 4));
setRootItem (new DemoTreeViewItem ("Demo root node", 4));
}
~DemoTreeView()
@@ -174,14 +171,14 @@ private:
{
public:
TreeViewRootItemProperty (TreeView* comp, JucerDocument& document)
: ComponentBooleanProperty <TreeView> (T("show root item"), T("Root item visible"), T("Root item visible"), comp, document)
: ComponentBooleanProperty <TreeView> ("show root item", "Root item visible", "Root item visible", comp, document)
{
}
void setState (bool newState)
{
document.perform (new TreeviewRootChangeAction (component, *document.getComponentLayout(), newState),
T("Change TreeView root item"));
"Change TreeView root item");
}
bool getState() const
@@ -225,16 +222,16 @@ private:
{
public:
TreeViewRootOpennessProperty (TreeView* comp, JucerDocument& document)
: ComponentChoiceProperty <TreeView> (T("default openness"), comp, document)
: ComponentChoiceProperty <TreeView> ("default openness", comp, document)
{
choices.add (T("Items open by default"));
choices.add (T("Items closed by default"));
choices.add ("Items open by default");
choices.add ("Items closed by default");
}
void setIndex (int newIndex)
{
document.perform (new TreeviewOpennessChangeAction (component, *document.getComponentLayout(), newIndex == 0),
T("Change TreeView openness"));
"Change TreeView openness");
}
int getIndex() const


+ 32
- 42
extras/the jucer/src/model/components/jucer_ViewportHandler.h View File

@@ -41,7 +41,7 @@ public:
//==============================================================================
Component* createNewComponent (JucerDocument*)
{
Viewport* const v = new UpdatingViewport (T("new viewport"));
Viewport* const v = new UpdatingViewport ("new viewport");
v->setViewedComponent (new ViewportDemoContentComp());
return v;
@@ -52,14 +52,14 @@ public:
Viewport* const v = dynamic_cast <Viewport*> (comp);
XmlElement* const e = ComponentTypeHandler::createXmlFor (comp, layout);
e->setAttribute (T("vscroll"), v->isVerticalScrollBarShown());
e->setAttribute (T("hscroll"), v->isHorizontalScrollBarShown());
e->setAttribute (T("scrollbarThickness"), v->getScrollBarThickness());
e->setAttribute ("vscroll", v->isVerticalScrollBarShown());
e->setAttribute ("hscroll", v->isHorizontalScrollBarShown());
e->setAttribute ("scrollbarThickness", v->getScrollBarThickness());
e->setAttribute (T("contentType"), getViewportContentType (v));
e->setAttribute (T("jucerFile"), getViewportJucerComponentFile (v));
e->setAttribute (T("contentClass"), getViewportGenericComponentClass (v));
e->setAttribute (T("constructorParams"), getViewportConstructorParams (v));
e->setAttribute ("contentType", getViewportContentType (v));
e->setAttribute ("jucerFile", getViewportJucerComponentFile (v));
e->setAttribute ("contentClass", getViewportGenericComponentClass (v));
e->setAttribute ("constructorParams", getViewportConstructorParams (v));
return e;
}
@@ -71,15 +71,15 @@ public:
Viewport defaultViewport;
Viewport* const v = dynamic_cast <Viewport*> (comp);
v->setScrollBarsShown (xml.getBoolAttribute (T("vscroll"), defaultViewport.isVerticalScrollBarShown()),
xml.getBoolAttribute (T("hscroll"), defaultViewport.isHorizontalScrollBarShown()));
v->setScrollBarsShown (xml.getBoolAttribute ("vscroll", defaultViewport.isVerticalScrollBarShown()),
xml.getBoolAttribute ("hscroll", defaultViewport.isHorizontalScrollBarShown()));
v->setScrollBarThickness (xml.getIntAttribute (T("scrollbarThickness"), defaultViewport.getScrollBarThickness()));
v->setScrollBarThickness (xml.getIntAttribute ("scrollbarThickness", defaultViewport.getScrollBarThickness()));
setViewportJucerComponentFile (v, xml.getStringAttribute (T("jucerFile"), String::empty));
setViewportGenericComponentClass (v, xml.getStringAttribute (T("contentClass")));
setViewportContentType (v, xml.getIntAttribute (T("contentType"), 0));
setViewportConstructorParams (v, xml.getStringAttribute (T("constructorParams")));
setViewportJucerComponentFile (v, xml.getStringAttribute ("jucerFile", String::empty));
setViewportGenericComponentClass (v, xml.getStringAttribute ("contentClass"));
setViewportContentType (v, xml.getIntAttribute ("contentType", 0));
setViewportConstructorParams (v, xml.getStringAttribute ("constructorParams"));
return true;
}
@@ -152,7 +152,7 @@ public:
if (doc != 0)
{
code.includeFilesCPP.add (doc->getFile().withFileExtension (T("h"))
code.includeFilesCPP.add (doc->getFile().withFileExtension ("h")
.getRelativePathFrom (code.document->getFile().getParentDirectory())
.replaceCharacter ('\\', '/'));
@@ -259,8 +259,6 @@ public:
}
}
juce_UseDebuggingNewOperator
private:
//==============================================================================
class UpdatingViewport : public Viewport
@@ -271,10 +269,6 @@ private:
{
}
~UpdatingViewport()
{
}
void parentHierarchyChanged()
{
Viewport::parentHierarchyChanged();
@@ -291,10 +285,6 @@ private:
setSize (2048, 2048);
}
~ViewportDemoContentComp()
{
}
void paint (Graphics& g)
{
g.fillCheckerBoard (getLocalBounds(), 50, 50,
@@ -308,8 +298,8 @@ private:
{
public:
ViewportScrollbarShownProperty (Viewport* comp, JucerDocument& document, const bool vertical_)
: ComponentBooleanProperty <Viewport> (vertical_ ? T("V scrollbar") : T("H scrollbar"),
T("enabled"), T("enabled"),
: ComponentBooleanProperty <Viewport> (vertical_ ? "V scrollbar" : "H scrollbar",
"enabled", "enabled",
comp, document),
vertical (vertical_)
{
@@ -318,7 +308,7 @@ private:
void setState (bool newState)
{
document.perform (new ViewportScrollbarChangeAction (component, *document.getComponentLayout(), vertical, newState),
T("Change Viewport scrollbar"));
"Change Viewport scrollbar");
}
bool getState() const
@@ -375,7 +365,7 @@ private:
{
public:
ViewportScrollbarSizeProperty (Viewport* comp, JucerDocument& document_)
: SliderPropertyComponent (T("scrollbar size"), 3.0, 30.0, 1.0, 1.0),
: SliderPropertyComponent ("scrollbar size", 3.0, 30.0, 1.0, 1.0),
component (comp),
document (document_)
{
@@ -392,7 +382,7 @@ private:
document.getUndoManager().undoCurrentTransactionOnly();
document.perform (new ViewportScrollbarSizeChangeAction (component, *document.getComponentLayout(), roundToInt (newValue)),
T("Change Viewport scrollbar size"));
"Change Viewport scrollbar size");
}
double getValue() const
@@ -444,17 +434,17 @@ private:
{
public:
ViewportContentTypeProperty (Viewport* comp, JucerDocument& document)
: ComponentChoiceProperty <Viewport> (T("content"), comp, document)
: ComponentChoiceProperty <Viewport> ("content", comp, document)
{
choices.add (T("No content component"));
choices.add (T("Jucer content component"));
choices.add (T("Named content component"));
choices.add ("No content component");
choices.add ("Jucer content component");
choices.add ("Named content component");
}
void setIndex (int newIndex)
{
document.perform (new ViewportContentTypeChangeAction (component, *document.getComponentLayout(), newIndex),
T("Change Viewport content type"));
"Change Viewport content type");
}
int getIndex() const
@@ -501,7 +491,7 @@ private:
{
public:
ViewportJucerFileProperty (Viewport* const component_, JucerDocument& document_)
: FilePropertyComponent (T("Jucer file"), false, true),
: FilePropertyComponent ("Jucer file", false, true),
component (component_),
document (document_)
{
@@ -520,7 +510,7 @@ private:
newFile.getRelativePathFrom (document.getFile().getParentDirectory())
.replaceCharacter ('\\', '/')
),
T("Change Jucer component file"));
"Change Jucer component file");
}
const File getFile() const
@@ -577,14 +567,14 @@ private:
{
public:
ViewportContentClassProperty (Viewport* comp, JucerDocument& document)
: ComponentTextProperty <Viewport> (T("content class"), 256, false, comp, document)
: ComponentTextProperty <Viewport> ("content class", 256, false, comp, document)
{
}
void setText (const String& newText)
{
document.perform (new ViewportClassNameChangeAction (component, *document.getComponentLayout(), newText),
T("Change Viewport content class"));
"Change Viewport content class");
}
const String getText() const
@@ -630,14 +620,14 @@ private:
{
public:
ConstructorParamsProperty (Viewport* comp, JucerDocument& document)
: ComponentTextProperty <Viewport> (T("constructor params"), 512, false, comp, document)
: ComponentTextProperty <Viewport> ("constructor params", 512, false, comp, document)
{
}
void setText (const String& newText)
{
document.perform (new ConstructorParamChangeAction (component, *document.getComponentLayout(), newText),
T("Change Viewport content constructor params"));
"Change Viewport content constructor params");
}
const String getText() const


+ 13
- 13
extras/the jucer/src/model/documents/jucer_ButtonDocument.cpp View File

@@ -47,7 +47,7 @@ ButtonDocument::ButtonDocument()
paintStatesEnabled [downOn] = false;
paintStatesEnabled [background] = false;
parentClasses = T("public Button");
parentClasses = "public Button";
for (int i = 7; --i >= 0;)
{
@@ -174,7 +174,7 @@ int ButtonDocument::chooseBestEnabledPaintRoutine (int paintRoutineWanted) const
//==============================================================================
const String ButtonDocument::getTypeName() const
{
return T("Button");
return "Button";
}
JucerDocument* ButtonDocument::createCopy()
@@ -198,8 +198,8 @@ XmlElement* ButtonDocument::createXml() const
for (int i = 0; i < 7; ++i)
{
XmlElement* e = paintRoutines [i]->createXml();
e->setAttribute (T("buttonState"), stateNames [i]);
e->setAttribute (T("enabled"), paintStatesEnabled [i]);
e->setAttribute ("buttonState", stateNames [i]);
e->setAttribute ("enabled", paintStatesEnabled [i]);
doc->addChildElement (e);
}
@@ -216,10 +216,10 @@ bool ButtonDocument::loadFromXml (const XmlElement& xml)
forEachXmlChildElementWithTagName (xml, e, PaintRoutine::xmlTagName)
{
const int stateIndex = stateNameToIndex (e->getStringAttribute (T("buttonState")));
const int stateIndex = stateNameToIndex (e->getStringAttribute ("buttonState"));
paintRoutines [stateIndex]->loadFromXml (*e);
paintStatesEnabled [stateIndex] = e->getBoolAttribute (T("enabled"), stateIndex < normalOn);
paintStatesEnabled [stateIndex] = e->getBoolAttribute ("enabled", stateIndex < normalOn);
}
changed();
@@ -247,7 +247,7 @@ class ButtonStatePaintEnabledProperty : public BooleanPropertyComponent,
{
public:
ButtonStatePaintEnabledProperty (const String& name, ButtonDocument& document_, const int stateMethod_)
: BooleanPropertyComponent (name, T("enabled"), T("disabled")),
: BooleanPropertyComponent (name, "enabled", "disabled"),
document (document_),
stateMethod (stateMethod_)
{
@@ -286,7 +286,7 @@ void ButtonDocument::addExtraClassProperties (PropertyPanel* panel)
for (int i = 1; i < 7; ++i)
props.add (new ButtonStatePaintEnabledProperty (stateNames[i], *this, i));
panel->addSection (T("Button paint routines"), props);
panel->addSection ("Button paint routines", props);
}
//==============================================================================
@@ -341,8 +341,8 @@ void ButtonDocument::fillInGeneratedCode (GeneratedCode& code) const
{
JucerDocument::fillInGeneratedCode (code);
code.parentClassInitialiser = T("Button (") + quotedString (code.componentName) + T(")");
code.removeCallback (T("void"), T("paint (Graphics& g)"));
code.parentClassInitialiser = "Button (" + quotedString (code.componentName) + ")";
code.removeCallback ("void", "paint (Graphics& g)");
}
void ButtonDocument::fillInPaintCode (GeneratedCode& code) const
@@ -354,9 +354,9 @@ void ButtonDocument::fillInPaintCode (GeneratedCode& code) const
if (paintStatesEnabled [i])
paintRoutines[i]->fillInGeneratedCode (code, paintCode [i]);
String& s = code.getCallbackCode (T("public Button"),
T("void"),
T("paintButton (Graphics& g, bool isMouseOverButton, bool isButtonDown)"),
String& s = code.getCallbackCode ("public Button",
"void",
"paintButton (Graphics& g, bool isMouseOverButton, bool isButtonDown)",
false);
int numPaintRoutines = getNumPaintRoutines();


+ 0
- 5
extras/the jucer/src/model/documents/jucer_ButtonDocument.h View File

@@ -73,11 +73,6 @@ public:
//==============================================================================
PaintRoutine* paintRoutines[7];
bool paintStatesEnabled [7];
//==============================================================================
juce_UseDebuggingNewOperator
private:
};


+ 1
- 1
extras/the jucer/src/model/documents/jucer_ComponentDocument.cpp View File

@@ -46,7 +46,7 @@ ComponentDocument::~ComponentDocument()
//==============================================================================
const String ComponentDocument::getTypeName() const
{
return T("Component");
return "Component";
}
JucerDocument* ComponentDocument::createCopy()


+ 1
- 5
extras/the jucer/src/model/documents/jucer_ComponentDocument.h View File

@@ -46,7 +46,7 @@ public:
Component* createTestComponent (const bool alwaysFillBackground);
int getNumPaintRoutines() const { return 1; }
const StringArray getPaintRoutineNames() const { StringArray s; s.add (T("Graphics")); return s; }
const StringArray getPaintRoutineNames() const { return StringArray ("Graphics"); }
PaintRoutine* getPaintRoutine (const int index) const { return index == 0 ? backgroundGraphics : 0; }
ComponentLayout* getComponentLayout() const { return components; }
@@ -57,10 +57,6 @@ public:
void fillInGeneratedCode (GeneratedCode& code) const;
//==============================================================================
juce_UseDebuggingNewOperator
private:
//==============================================================================
ComponentLayout* components;


+ 5
- 5
extras/the jucer/src/model/jucer_BinaryResources.cpp View File

@@ -218,10 +218,10 @@ void BinaryResources::loadFromCpp (const File& cppFileLocation, const String& cp
for (int i = 0; i < cpp.size(); ++i)
{
if (cpp[i].contains (T("JUCER_RESOURCE:")))
if (cpp[i].contains ("JUCER_RESOURCE:"))
{
StringArray tokens;
tokens.addTokens (cpp[i].fromFirstOccurrenceOf (T(":"), false, false), T(","), T("\"'"));
tokens.addTokens (cpp[i].fromFirstOccurrenceOf (":", false, false), ",", "\"'");
tokens.trim();
tokens.removeEmptyStrings();
@@ -236,11 +236,11 @@ void BinaryResources::loadFromCpp (const File& cppFileLocation, const String& cp
const int firstLine = i;
while (i < cpp.size())
if (cpp [i++].contains (T("}")))
if (cpp [i++].contains ("}"))
break;
const String dataString (cpp.joinIntoString (T(" "), firstLine, i - firstLine)
.fromFirstOccurrenceOf (T("{"), false, false));
const String dataString (cpp.joinIntoString (" ", firstLine, i - firstLine)
.fromFirstOccurrenceOf ("{", false, false));
MemoryOutputStream out;
String::CharPointerType t (dataString.getCharPointer());


+ 0
- 2
extras/the jucer/src/model/jucer_BinaryResources.h View File

@@ -91,8 +91,6 @@ public:
void fillInGeneratedCode (GeneratedCode& code) const;
//==============================================================================
juce_UseDebuggingNewOperator
private:
//==============================================================================


+ 4
- 4
extras/the jucer/src/model/jucer_ComponentLayout.cpp View File

@@ -178,7 +178,7 @@ void ComponentLayout::removeComponent (Component* comp, const bool undoable)
{
if (undoable)
{
perform (new DeleteCompAction (comp, *this), T("Delete components"));
perform (new DeleteCompAction (comp, *this), "Delete components");
}
else
{
@@ -401,7 +401,7 @@ Component* ComponentLayout::addComponentFromXml (const XmlElement& xml, const bo
if (undoable)
{
AddCompAction* const action = new AddCompAction (new XmlElement (xml), *this);
perform (action, T("Add new components"));
perform (action, "Add new components");
return components [action->indexAdded];
}
@@ -549,7 +549,7 @@ PopupMenu ComponentLayout::getRelativeTargetMenu (Component* comp, int whichDime
Component* const current = getComponentRelativePosTarget (comp, whichDimension);
m.addItem (menuIdBase, T("Relative to parent component"), true, current == 0);
m.addItem (menuIdBase, "Relative to parent component", true, current == 0);
m.addSeparator();
for (int i = 0; i < components.size(); ++i)
@@ -616,7 +616,7 @@ void ComponentLayout::setComponentPosition (Component* comp,
{
if (undoable)
{
perform (new ChangeCompPositionAction (comp, *this, newPos), T("Move components"));
perform (new ChangeCompPositionAction (comp, *this, newPos), "Move components");
}
else
{


+ 4
- 4
extras/the jucer/src/model/jucer_GeneratedCode.cpp View File

@@ -173,7 +173,7 @@ const String GeneratedCode::getCallbackDefinitions() const
const String GeneratedCode::getClassDeclaration() const
{
StringArray parentClassLines;
parentClassLines.addTokens (parentClasses, T(","), String::empty);
parentClassLines.addTokens (parentClasses, ",", String::empty);
parentClassLines.addArray (getExtraParentClasses());
parentClassLines.trim();
@@ -236,7 +236,7 @@ static const String getIncludeFileCode (StringArray files)
String s;
for (int i = 0; i < files.size(); ++i)
s << T("#include \"") << files[i] << T("\"\n");
s << "#include \"" << files[i] << "\"\n";
return s;
}
@@ -371,8 +371,8 @@ void GeneratedCode::applyToCode (String& code,
}
else
{
replaceTemplate (code, "metadata", T(" << Metadata isn't shown in the code preview >>\n"));
replaceTemplate (code, "staticMemberDefinitions", T("// Static member declarations and resources would go here... (these aren't shown in the code preview)"));
replaceTemplate (code, "metadata", " << Metadata isn't shown in the code preview >>\n");
replaceTemplate (code, "staticMemberDefinitions", "// Static member declarations and resources would go here... (these aren't shown in the code preview)");
}
copyAcrossUserSections (code, oldFileWithUserData);


+ 45
- 45
extras/the jucer/src/model/jucer_JucerDocument.cpp View File

@@ -129,7 +129,7 @@ void JucerDocument::setParentClasses (const String& classes)
if (classes != parentClasses)
{
StringArray parentClassLines;
parentClassLines.addTokens (classes, T(","), String::empty);
parentClassLines.addTokens (classes, ",", String::empty);
parentClassLines.trim();
parentClassLines.removeEmptyStrings();
parentClassLines.removeDuplicates (false);
@@ -139,12 +139,12 @@ void JucerDocument::setParentClasses (const String& classes)
String s (parentClassLines[i]);
String type;
if (s.startsWith (T("public "))
|| s.startsWith (T("protected "))
|| s.startsWith (T("private ")))
if (s.startsWith ("public ")
|| s.startsWith ("protected ")
|| s.startsWith ("private "))
{
type = s.upToFirstOccurrenceOf (T(" "), true, false);
s = s.fromFirstOccurrenceOf (T(" "), false, false);
type = s.upToFirstOccurrenceOf (" ", true, false);
s = s.fromFirstOccurrenceOf (" ", false, false);
if (s.trim().isEmpty())
type = s = String::empty;
@@ -155,7 +155,7 @@ void JucerDocument::setParentClasses (const String& classes)
parentClassLines.set (i, s);
}
parentClasses = parentClassLines.joinIntoString (T(", "));
parentClasses = parentClassLines.joinIntoString (", ");
changed();
}
}
@@ -331,30 +331,30 @@ XmlElement* JucerDocument::createXml() const
{
XmlElement* doc = new XmlElement (jucerCompXmlTag);
doc->setAttribute (T("documentType"), getTypeName());
doc->setAttribute (T("className"), className);
doc->setAttribute (T("componentName"), componentName);
doc->setAttribute (T("parentClasses"), parentClasses);
doc->setAttribute (T("constructorParams"), constructorParams);
doc->setAttribute (T("variableInitialisers"), variableInitialisers);
doc->setAttribute (T("snapPixels"), snapGridPixels);
doc->setAttribute (T("snapActive"), snapActive);
doc->setAttribute (T("snapShown"), snapShown);
doc->setAttribute (T("overlayOpacity"), (double) componentOverlayOpacity);
doc->setAttribute (T("fixedSize"), fixedSize);
doc->setAttribute (T("initialWidth"), initialWidth);
doc->setAttribute (T("initialHeight"), initialHeight);
doc->setAttribute ("documentType", getTypeName());
doc->setAttribute ("className", className);
doc->setAttribute ("componentName", componentName);
doc->setAttribute ("parentClasses", parentClasses);
doc->setAttribute ("constructorParams", constructorParams);
doc->setAttribute ("variableInitialisers", variableInitialisers);
doc->setAttribute ("snapPixels", snapGridPixels);
doc->setAttribute ("snapActive", snapActive);
doc->setAttribute ("snapShown", snapShown);
doc->setAttribute ("overlayOpacity", (double) componentOverlayOpacity);
doc->setAttribute ("fixedSize", fixedSize);
doc->setAttribute ("initialWidth", initialWidth);
doc->setAttribute ("initialHeight", initialHeight);
if (activeExtraMethods.size() > 0)
{
XmlElement* extraMethods = new XmlElement (T("METHODS"));
XmlElement* extraMethods = new XmlElement ("METHODS");
doc->addChildElement (extraMethods);
for (int i = 0; i < activeExtraMethods.size(); ++i)
{
XmlElement* e = new XmlElement (T("METHOD"));
XmlElement* e = new XmlElement ("METHOD");
extraMethods ->addChildElement (e);
e->setAttribute (T("name"), activeExtraMethods[i]);
e->setAttribute ("name", activeExtraMethods[i]);
}
}
@@ -364,17 +364,17 @@ XmlElement* JucerDocument::createXml() const
bool JucerDocument::loadFromXml (const XmlElement& xml)
{
if (xml.hasTagName (jucerCompXmlTag)
&& getTypeName().equalsIgnoreCase (xml.getStringAttribute (T("documentType"), ObjectTypes::documentTypeNames[0])))
&& getTypeName().equalsIgnoreCase (xml.getStringAttribute ("documentType", ObjectTypes::documentTypeNames[0])))
{
className = xml.getStringAttribute (T("className"), defaultClassName);
componentName = xml.getStringAttribute (T("componentName"), String::empty);
parentClasses = xml.getStringAttribute (T("parentClasses"), defaultParentClasses);
constructorParams = xml.getStringAttribute (T("constructorParams"), String::empty);
variableInitialisers = xml.getStringAttribute (T("variableInitialisers"), String::empty);
className = xml.getStringAttribute ("className", defaultClassName);
componentName = xml.getStringAttribute ("componentName", String::empty);
parentClasses = xml.getStringAttribute ("parentClasses", defaultParentClasses);
constructorParams = xml.getStringAttribute ("constructorParams", String::empty);
variableInitialisers = xml.getStringAttribute ("variableInitialisers", String::empty);
fixedSize = xml.getBoolAttribute (T("fixedSize"), false);
initialWidth = xml.getIntAttribute (T("initialWidth"), 300);
initialHeight = xml.getIntAttribute (T("initialHeight"), 200);
fixedSize = xml.getBoolAttribute ("fixedSize", false);
initialWidth = xml.getIntAttribute ("initialWidth", 300);
initialHeight = xml.getIntAttribute ("initialHeight", 200);
snapGridPixels = xml.getIntAttribute ("snapPixels", snapGridPixels);
snapActive = xml.getBoolAttribute ("snapActive", snapActive);
@@ -410,7 +410,7 @@ const String JucerDocument::loadDocument (const File& file)
{
String error (TRANS("Not a valid Jucer cpp file"));
const File cppFile (file.withFileExtension (T(".cpp")));
const File cppFile (file.withFileExtension (".cpp"));
const String cppFileString (cppFile.loadFileAsString());
@@ -467,18 +467,18 @@ XmlElement* JucerDocument::pullMetaDataFromCppFile (const String& cpp)
StringArray lines;
lines.addLines (cpp);
int startLine = indexOfLineStartingWith (lines, T("BEGIN_JUCER_METADATA"), 0);
int startLine = indexOfLineStartingWith (lines, "BEGIN_JUCER_METADATA", 0);
if (startLine > 0)
{
int endLine = indexOfLineStartingWith (lines, T("END_JUCER_METADATA"), 0);
int endLine = indexOfLineStartingWith (lines, "END_JUCER_METADATA", 0);
if (endLine > startLine)
{
String xmlText;
for (int i = startLine + 1; i < endLine; ++i)
xmlText << lines[i] << T("\n");
xmlText << lines[i] << "\n";
XmlDocument doc (xmlText);
return doc.getDocumentElement();
@@ -525,10 +525,10 @@ void JucerDocument::fillInGeneratedCode (GeneratedCode& code) const
code.constructorCode
<< "\nsetSize (" << initialWidth << ", " << initialHeight << ");\n";
code.getCallbackCode (String::empty, T("void"), T("paint (Graphics& g)"), false)
code.getCallbackCode (String::empty, "void", "paint (Graphics& g)", false)
<< "//[UserPaint] Add your own custom painting code here..\n//[/UserPaint]";
code.getCallbackCode (String::empty, T("void"), T("resized()"), false)
code.getCallbackCode (String::empty, "void", "resized()", false)
<< "//[UserResized] Add your own custom resize handling here..\n//[/UserResized]";
// add optional methods
@@ -541,10 +541,10 @@ void JucerDocument::fillInGeneratedCode (GeneratedCode& code) const
{
String& s = code.getCallbackCode (baseClasses[i], returnValues[i], methods[i], false);
if (! s.contains (T("//[")))
if (! s.contains ("//["))
{
String userCommentTag (T("UserCode_"));
userCommentTag += methods[i].upToFirstOccurrenceOf (T("("), false, false).trim();
String userCommentTag ("UserCode_");
userCommentTag += methods[i].upToFirstOccurrenceOf ("(", false, false).trim();
s << "\n//["
<< userCommentTag
@@ -567,7 +567,7 @@ void JucerDocument::fillInPaintCode (GeneratedCode& code) const
for (int i = 0; i < getNumPaintRoutines(); ++i)
{
getPaintRoutine (i)
->fillInGeneratedCode (code, code.getCallbackCode (String::empty, T("void"), T("paint (Graphics& g)"), false));
->fillInGeneratedCode (code, code.getCallbackCode (String::empty, "void", "paint (Graphics& g)", false));
}
}
@@ -576,8 +576,8 @@ bool JucerDocument::findTemplateFiles (String& templateH, String& templateCpp) c
{
const File templateDir (StoredSettings::getInstance()->getTemplatesDir());
const File hTemplate (templateDir.getChildFile (T("jucer_ComponentTemplate.h")));
const File cppTemplate (templateDir.getChildFile (T("jucer_ComponentTemplate.cpp")));
const File hTemplate (templateDir.getChildFile ("jucer_ComponentTemplate.h"));
const File cppTemplate (templateDir.getChildFile ("jucer_ComponentTemplate.cpp"));
if (! (cppTemplate.existsAsFile() && hTemplate.existsAsFile()))
return false;
@@ -608,7 +608,7 @@ void JucerDocument::getPreviewFiles (String& h, String& cpp)
{
GeneratedCode generated (this);
fillInGeneratedCode (generated);
generated.includeFilesCPP.insert (0, getFile().withFileExtension (T("h")).getFileName());
generated.includeFilesCPP.insert (0, getFile().withFileExtension ("h").getFileName());
generated.applyToCode (h, getClassName(), true);
generated.applyToCode (cpp, getClassName(), true);


+ 0
- 2
extras/the jucer/src/model/jucer_JucerDocument.h View File

@@ -155,8 +155,6 @@ public:
/** Generates and returns the header and cpp file contents for this component. */
void getPreviewFiles (String& header, String& cpp);
//==============================================================================
juce_UseDebuggingNewOperator
protected:
const String getDocumentTitle();


+ 3
- 3
extras/the jucer/src/model/jucer_ObjectTypes.cpp View File

@@ -97,9 +97,9 @@ JucerDocument* loadDocumentFromFile (const File& f, const bool showErrorMessage)
if (file == File::nonexistent && showErrorMessage)
{
FileChooser fc (T("Open a Jucer C++ file..."),
FileChooser fc ("Open a Jucer C++ file...",
StoredSettings::getInstance()->recentFiles.getFile (0),
T("*.cpp"));
"*.cpp");
if (! fc.browseForFileToOpen())
return 0;
@@ -120,7 +120,7 @@ JucerDocument* loadDocumentFromFile (const File& f, const bool showErrorMessage)
return 0;
}
const String docType (xml->getStringAttribute (T("documentType")));
const String docType (xml->getStringAttribute ("documentType"));
delete xml;
// (reverse order so ComponentDocument is default last-case)


+ 3
- 3
extras/the jucer/src/model/jucer_PaintRoutine.cpp View File

@@ -227,7 +227,7 @@ void PaintRoutine::removeElement (PaintElement* element, const bool undoable)
if (undoable)
{
perform (new DeleteElementAction (element),
T("Delete ") + element->getTypeName());
"Delete " + element->getTypeName());
}
else
{
@@ -591,7 +591,7 @@ XmlElement* PaintRoutine::createXml() const
{
XmlElement* const xml = new XmlElement (xmlTagName);
xml->setAttribute (T("backgroundColour"), colourToHex (backgroundColour));
xml->setAttribute ("backgroundColour", colourToHex (backgroundColour));
for (int i = 0; i < elements.size(); ++i)
xml->addChildElement (elements.getUnchecked (i)->createXml());
@@ -603,7 +603,7 @@ bool PaintRoutine::loadFromXml (const XmlElement& xml)
{
if (xml.hasTagName (xmlTagName))
{
backgroundColour = Colour (xml.getStringAttribute (T("backgroundColour"), colourToHex (Colours::white)).getHexValue32());
backgroundColour = Colour (xml.getStringAttribute ("backgroundColour", colourToHex (Colours::white)).getHexValue32());
clear();


+ 48
- 48
extras/the jucer/src/model/paintelements/jucer_ColouredElement.cpp View File

@@ -39,14 +39,14 @@ class ElementFillModeProperty : public ChoicePropertyComponent,
{
public:
ElementFillModeProperty (ColouredElement* const owner_, const bool isForStroke_)
: ChoicePropertyComponent (T("fill mode")),
: ChoicePropertyComponent ("fill mode"),
owner (owner_),
isForStroke (isForStroke_)
{
choices.add (T("Solid Colour"));
choices.add (T("Linear Gradient"));
choices.add (T("Radial Gradient"));
choices.add (T("Image Brush"));
choices.add ("Solid Colour");
choices.add ("Linear Gradient");
choices.add ("Radial Gradient");
choices.add ("Image Brush");
owner->getDocument()->addChangeListener (this);
}
@@ -282,7 +282,7 @@ class EnableStrokeProperty : public BooleanPropertyComponent,
{
public:
EnableStrokeProperty (ColouredElement* const owner_)
: BooleanPropertyComponent (T("outline"), T("Outline enabled"), T("No outline")),
: BooleanPropertyComponent ("outline", "Outline enabled", "No outline"),
owner (owner_)
{
owner->getDocument()->addChangeListener (this);
@@ -309,7 +309,7 @@ class StrokeThicknessProperty : public SliderPropertyComponent,
{
public:
StrokeThicknessProperty (ColouredElement* const owner_)
: SliderPropertyComponent (T("outline thickness"), 0.1, 200.0, 0.1, 0.3),
: SliderPropertyComponent ("outline thickness", 0.1, 200.0, 0.1, 0.3),
owner (owner_)
{
owner->getDocument()->addChangeListener (this);
@@ -344,12 +344,12 @@ class StrokeJointProperty : public ChoicePropertyComponent,
{
public:
StrokeJointProperty (ColouredElement* const owner_)
: ChoicePropertyComponent (T("joint style")),
: ChoicePropertyComponent ("joint style"),
owner (owner_)
{
choices.add (T("mitered"));
choices.add (T("curved"));
choices.add (T("beveled"));
choices.add ("mitered");
choices.add ("curved");
choices.add ("beveled");
owner->getDocument()->addChangeListener (this);
}
@@ -403,12 +403,12 @@ class StrokeEndCapProperty : public ChoicePropertyComponent,
{
public:
StrokeEndCapProperty (ColouredElement* const owner_)
: ChoicePropertyComponent (T("end-cap style")),
: ChoicePropertyComponent ("end-cap style"),
owner (owner_)
{
choices.add (T("butt"));
choices.add (T("square"));
choices.add (T("round"));
choices.add ("butt");
choices.add ("square");
choices.add ("round");
owner->getDocument()->addChangeListener (this);
}
@@ -461,8 +461,8 @@ class ImageBrushResourceProperty : public ImageResourceProperty <ColouredElem
{
public:
ImageBrushResourceProperty (ColouredElement* const element_, const bool isForStroke_)
: ImageResourceProperty <ColouredElement> (element_, isForStroke_ ? T("stroke image")
: T("fill image")),
: ImageResourceProperty <ColouredElement> (element_, isForStroke_ ? "stroke image"
: "fill image"),
isForStroke (isForStroke_)
{
}
@@ -554,7 +554,7 @@ class ImageBrushOpacityProperty : public SliderPropertyComponent,
{
public:
ImageBrushOpacityProperty (ColouredElement* const element_, const bool isForStroke_)
: SliderPropertyComponent (T("opacity"), 0.0, 1.0, 0.001),
: SliderPropertyComponent ("opacity", 0.0, 1.0, 0.001),
element (element_),
isForStroke (isForStroke_)
{
@@ -635,23 +635,23 @@ void ColouredElement::getColourSpecificProperties (Array <PropertyComponent*>& p
switch (getFillType().mode)
{
case JucerFillType::solidColour:
properties.add (new ElementFillColourProperty (T("colour"), this, ElementFillColourProperty::solidColour, false));
properties.add (new ElementFillColourProperty ("colour", this, ElementFillColourProperty::solidColour, false));
break;
case JucerFillType::linearGradient:
case JucerFillType::radialGradient:
properties.add (new ElementFillColourProperty (T("colour 1"), this, ElementFillColourProperty::gradientColour1, false));
properties.add (new ElementFillPositionProperty (this, T("x1"), PositionPropertyBase::componentX, true, false));
properties.add (new ElementFillPositionProperty (this, T("y1"), PositionPropertyBase::componentY, true, false));
properties.add (new ElementFillColourProperty (T("colour 2"), this, ElementFillColourProperty::gradientColour2, false));
properties.add (new ElementFillPositionProperty (this, T("x2"), PositionPropertyBase::componentX, false, false));
properties.add (new ElementFillPositionProperty (this, T("y2"), PositionPropertyBase::componentY, false, false));
properties.add (new ElementFillColourProperty ("colour 1", this, ElementFillColourProperty::gradientColour1, false));
properties.add (new ElementFillPositionProperty (this, "x1", PositionPropertyBase::componentX, true, false));
properties.add (new ElementFillPositionProperty (this, "y1", PositionPropertyBase::componentY, true, false));
properties.add (new ElementFillColourProperty ("colour 2", this, ElementFillColourProperty::gradientColour2, false));
properties.add (new ElementFillPositionProperty (this, "x2", PositionPropertyBase::componentX, false, false));
properties.add (new ElementFillPositionProperty (this, "y2", PositionPropertyBase::componentY, false, false));
break;
case JucerFillType::imageBrush:
properties.add (new ImageBrushResourceProperty (this, false));
properties.add (new ImageBrushPositionProperty (this, T("anchor x"), PositionPropertyBase::componentX, false));
properties.add (new ImageBrushPositionProperty (this, T("anchor y"), PositionPropertyBase::componentY, false));
properties.add (new ImageBrushPositionProperty (this, "anchor x", PositionPropertyBase::componentX, false));
properties.add (new ImageBrushPositionProperty (this, "anchor y", PositionPropertyBase::componentY, false));
properties.add (new ImageBrushOpacityProperty (this, false));
break;
@@ -679,23 +679,23 @@ void ColouredElement::getColourSpecificProperties (Array <PropertyComponent*>& p
switch (getStrokeType().fill.mode)
{
case JucerFillType::solidColour:
properties.add (new ElementFillColourProperty (T("colour"), this, ElementFillColourProperty::solidColour, true));
properties.add (new ElementFillColourProperty ("colour", this, ElementFillColourProperty::solidColour, true));
break;
case JucerFillType::linearGradient:
case JucerFillType::radialGradient:
properties.add (new ElementFillColourProperty (T("colour 1"), this, ElementFillColourProperty::gradientColour1, true));
properties.add (new ElementFillPositionProperty (this, T("x1"), PositionPropertyBase::componentX, true, true));
properties.add (new ElementFillPositionProperty (this, T("y1"), PositionPropertyBase::componentY, true, true));
properties.add (new ElementFillColourProperty (T("colour 2"), this, ElementFillColourProperty::gradientColour2, true));
properties.add (new ElementFillPositionProperty (this, T("x2"), PositionPropertyBase::componentX, false, true));
properties.add (new ElementFillPositionProperty (this, T("y2"), PositionPropertyBase::componentY, false, true));
properties.add (new ElementFillColourProperty ("colour 1", this, ElementFillColourProperty::gradientColour1, true));
properties.add (new ElementFillPositionProperty (this, "x1", PositionPropertyBase::componentX, true, true));
properties.add (new ElementFillPositionProperty (this, "y1", PositionPropertyBase::componentY, true, true));
properties.add (new ElementFillColourProperty ("colour 2", this, ElementFillColourProperty::gradientColour2, true));
properties.add (new ElementFillPositionProperty (this, "x2", PositionPropertyBase::componentX, false, true));
properties.add (new ElementFillPositionProperty (this, "y2", PositionPropertyBase::componentY, false, true));
break;
case JucerFillType::imageBrush:
properties.add (new ImageBrushResourceProperty (this, true));
properties.add (new ImageBrushPositionProperty (this, T("stroke anchor x"), PositionPropertyBase::componentX, true));
properties.add (new ImageBrushPositionProperty (this, T("stroke anchor y"), PositionPropertyBase::componentY, true));
properties.add (new ImageBrushPositionProperty (this, "stroke anchor x", PositionPropertyBase::componentX, true));
properties.add (new ImageBrushPositionProperty (this, "stroke anchor y", PositionPropertyBase::componentY, true));
properties.add (new ImageBrushOpacityProperty (this, true));
break;
@@ -748,7 +748,7 @@ void ColouredElement::setFillType (const JucerFillType& newType, const bool undo
if (undoable)
{
perform (new FillTypeChangeAction (this, newType),
T("Change fill type"));
"Change fill type");
}
else
{
@@ -809,7 +809,7 @@ void ColouredElement::enableStroke (bool enable, const bool undoable)
if (undoable)
{
perform (new StrokeEnableChangeAction (this, enable),
T("Change stroke mode"));
"Change stroke mode");
}
else
{
@@ -864,7 +864,7 @@ void ColouredElement::setStrokeType (const PathStrokeType& newType, const bool u
if (undoable)
{
perform (new StrokeTypeChangeAction (this, newType),
T("Change stroke type"));
"Change stroke type");
}
else
{
@@ -910,7 +910,7 @@ void ColouredElement::setStrokeFill (const JucerFillType& newType, const bool un
if (undoable)
{
perform (new StrokeFillTypeChangeAction (this, newType),
T("Change stroke fill type"));
"Change stroke fill type");
}
else
{
@@ -998,24 +998,24 @@ void ColouredElement::setCurrentBounds (const Rectangle<int>& newBounds,
//==============================================================================
void ColouredElement::addColourAttributes (XmlElement* const e) const
{
e->setAttribute (T("fill"), fillType.toString());
e->setAttribute (T("hasStroke"), isStrokePresent);
e->setAttribute ("fill", fillType.toString());
e->setAttribute ("hasStroke", isStrokePresent);
if (isStrokePresent && showOutline)
{
e->setAttribute (T("stroke"), strokeType.toString());
e->setAttribute (T("strokeColour"), strokeType.fill.toString());
e->setAttribute ("stroke", strokeType.toString());
e->setAttribute ("strokeColour", strokeType.fill.toString());
}
}
bool ColouredElement::loadColourAttributes (const XmlElement& xml)
{
fillType.restoreFromString (xml.getStringAttribute (T("fill"), String::empty));
fillType.restoreFromString (xml.getStringAttribute ("fill", String::empty));
isStrokePresent = showOutline && xml.getBoolAttribute (T("hasStroke"), false);
isStrokePresent = showOutline && xml.getBoolAttribute ("hasStroke", false);
strokeType.restoreFromString (xml.getStringAttribute (T("stroke"), String::empty));
strokeType.fill.restoreFromString (xml.getStringAttribute (T("strokeColour"), String::empty));
strokeType.restoreFromString (xml.getStringAttribute ("stroke", String::empty));
strokeType.fill.restoreFromString (xml.getStringAttribute ("strokeColour", String::empty));
return true;
}


+ 0
- 3
extras/the jucer/src/model/paintelements/jucer_ColouredElement.h View File

@@ -72,9 +72,6 @@ public:
void addColourAttributes (XmlElement* const e) const;
bool loadColourAttributes (const XmlElement& xml);
//==============================================================================
juce_UseDebuggingNewOperator
protected:
JucerFillType fillType;


+ 23
- 23
extras/the jucer/src/model/paintelements/jucer_FillType.cpp View File

@@ -94,14 +94,14 @@ void JucerFillType::reset()
gradCol1 = Colours::red;
gradCol2 = Colours::green;
gradPos1 = RelativePositionedRectangle();
gradPos1.rect = PositionedRectangle (T("50 50"));
gradPos1.rect = PositionedRectangle ("50 50");
gradPos2 = RelativePositionedRectangle();
gradPos2.rect = PositionedRectangle (T("100 100"));
gradPos2.rect = PositionedRectangle ("100 100");
imageResourceName = String::empty;
imageOpacity = 1.0;
imageAnchor = RelativePositionedRectangle();
imageAnchor.rect = PositionedRectangle (T("0 0"));
imageAnchor.rect = PositionedRectangle ("0 0");
}
//==============================================================================
@@ -152,7 +152,7 @@ void JucerFillType::fillInGeneratedCode (GeneratedCode& code, String& paintMetho
s << "g.setGradientFill (ColourGradient (";
const String indent (String::repeatedString (T(" "), s.length()));
const String indent (String::repeatedString (" ", s.length()));
s << colourToCode (gradCol1) << ",\n"
<< indent << castToFloat (x1) << ", " << castToFloat (y1) << ",\n"
@@ -173,7 +173,7 @@ void JucerFillType::fillInGeneratedCode (GeneratedCode& code, String& paintMetho
s << "g.setTiledImageFill (";
const String indent (String::repeatedString (T(" "), s.length()));
const String indent (String::repeatedString (" ", s.length()));
s << imageVariable << ",\n"
<< indent << x << ", " << y << ",\n"
@@ -195,23 +195,23 @@ const String JucerFillType::toString() const
switch (mode)
{
case solidColour:
return T("solid: ") + colourToHex (colour);
return "solid: " + colourToHex (colour);
case linearGradient:
case radialGradient:
return (mode == linearGradient ? T("linear: ")
: T(" radial: "))
return (mode == linearGradient ? "linear: "
: " radial: ")
+ positionToString (gradPos1)
+ T(", ")
+ ", "
+ positionToString (gradPos2)
+ T(", 0=") + colourToHex (gradCol1)
+ T(", 1=") + colourToHex (gradCol2);
+ ", 0=" + colourToHex (gradCol1)
+ ", 1=" + colourToHex (gradCol2);
case imageBrush:
return T("image: ") + imageResourceName
+ T(", ")
return "image: " + imageResourceName
+ ", "
+ String (imageOpacity)
+ T(", ")
+ ", "
+ positionToString (imageAnchor);
default:
@@ -229,28 +229,28 @@ void JucerFillType::restoreFromString (const String& s)
if (s.isNotEmpty())
{
StringArray toks;
toks.addTokens (s, T(",:"), String::empty);
toks.addTokens (s, ",:", String::empty);
toks.trim();
if (toks[0] == T("solid"))
if (toks[0] == "solid")
{
mode = solidColour;
colour = Colour (toks[1].getHexValue32());
}
else if (toks[0] == T("linear")
|| toks[0] == T("radial"))
else if (toks[0] == "linear"
|| toks[0] == "radial")
{
mode = (toks[0] == T("linear")) ? linearGradient : radialGradient;
mode = (toks[0] == "linear") ? linearGradient : radialGradient;
gradPos1 = RelativePositionedRectangle();
gradPos1.rect = PositionedRectangle (toks[1]);
gradPos2 = RelativePositionedRectangle();
gradPos2.rect = PositionedRectangle (toks[2]);
gradCol1 = Colour (toks[3].fromFirstOccurrenceOf (T("="), false, false).getHexValue32());
gradCol2 = Colour (toks[4].fromFirstOccurrenceOf (T("="), false, false).getHexValue32());
gradCol1 = Colour (toks[3].fromFirstOccurrenceOf ("=", false, false).getHexValue32());
gradCol2 = Colour (toks[4].fromFirstOccurrenceOf ("=", false, false).getHexValue32());
}
else if (toks[0] == T("image"))
else if (toks[0] == "image")
{
mode = imageBrush;
imageResourceName = toks[1];
@@ -334,7 +334,7 @@ void JucerFillType::loadImage (JucerDocument* const document)
g.setFont (12.0f);
g.setColour (Colours::grey);
g.drawText (T("(image missing)"), 0, 0, image.getWidth(), image.getHeight() / 2, Justification::centred, true);
g.drawText ("(image missing)", 0, 0, image.getWidth(), image.getHeight() / 2, Justification::centred, true);
ImageCache::addImageToCache (image, hashCode);
}


+ 7
- 7
extras/the jucer/src/model/paintelements/jucer_ImageResourceProperty.h View File

@@ -46,10 +46,10 @@ public:
document (document_),
allowChoiceOfNoResource (allowChoiceOfNoResource_)
{
choices.add (T("-- create a new image resource -- "));
choices.add ("-- create a new image resource -- ");
choices.add (String::empty);
if (allowChoiceOfNoResource_)
choices.add (T("<< none >>"));
choices.add ("<< none >>");
choices.addArray (document_.getResources().getResourceNames());
document_.addChangeListener (this);
@@ -63,10 +63,10 @@ public:
document (*element_->getDocument()),
allowChoiceOfNoResource (allowChoiceOfNoResource_)
{
choices.add (T("-- create a new image resource -- "));
choices.add ("-- create a new image resource -- ");
choices.add (String::empty);
if (allowChoiceOfNoResource_)
choices.add (T("<< none >>"));
choices.add ("<< none >>");
choices.addArray (document.getResources().getResourceNames());
@@ -89,8 +89,8 @@ public:
if (newIndex == 0)
{
String resource (document.getResources()
.browseForResource (T("Select an image file to add as a resource"),
T("*.jpg;*.jpeg;*.png;*.gif;*.svg"),
.browseForResource ("Select an image file to add as a resource",
"*.jpg;*.jpeg;*.png;*.gif;*.svg",
File::nonexistent,
String::empty));
@@ -99,7 +99,7 @@ public:
}
else
{
if (choices[newIndex] == T("<< none >>") && allowChoiceOfNoResource)
if (choices[newIndex] == "<< none >>" && allowChoiceOfNoResource)
setResource (String::empty);
else
setResource (choices [newIndex]);


+ 5
- 5
extras/the jucer/src/model/paintelements/jucer_PaintElement.cpp View File

@@ -121,7 +121,7 @@ void PaintElement::setPosition (const RelativePositionedRectangle& newPosition,
if (undoable)
{
perform (new PaintElementMoveAction (this, newPosition),
T("Move ") + getTypeName());
"Move " + getTypeName());
}
else
{
@@ -207,10 +207,10 @@ private:
//==============================================================================
void PaintElement::getEditableProperties (Array <PropertyComponent*>& properties)
{
properties.add (new ElementPositionProperty (this, T("x"), PositionPropertyBase::componentX));
properties.add (new ElementPositionProperty (this, T("y"), PositionPropertyBase::componentY));
properties.add (new ElementPositionProperty (this, T("width"), PositionPropertyBase::componentWidth));
properties.add (new ElementPositionProperty (this, T("height"), PositionPropertyBase::componentHeight));
properties.add (new ElementPositionProperty (this, "x", PositionPropertyBase::componentX));
properties.add (new ElementPositionProperty (this, "y", PositionPropertyBase::componentY));
properties.add (new ElementPositionProperty (this, "width", PositionPropertyBase::componentWidth));
properties.add (new ElementPositionProperty (this, "height", PositionPropertyBase::componentHeight));
}
//==============================================================================


+ 0
- 1
extras/the jucer/src/model/paintelements/jucer_PaintElement.h View File

@@ -94,7 +94,6 @@ public:
void parentHierarchyChanged();
int borderThickness;
juce_UseDebuggingNewOperator
protected:
PaintRoutine* const owner;


+ 3
- 6
extras/the jucer/src/model/paintelements/jucer_PaintElementEllipse.h View File

@@ -37,7 +37,7 @@ class PaintElementEllipse : public ColouredElement
public:
//==============================================================================
PaintElementEllipse (PaintRoutine* owner)
: ColouredElement (owner, T("Ellipse"), true, false)
: ColouredElement (owner, "Ellipse", true, false)
{
}
@@ -137,16 +137,13 @@ public:
convertToNewPathElement (path);
}
juce_UseDebuggingNewOperator
private:
//==============================================================================
class ShapeToPathProperty : public ButtonPropertyComponent
{
public:
ShapeToPathProperty (PaintElementEllipse* const element_)
: ButtonPropertyComponent (T("path"), false),
: ButtonPropertyComponent ("path", false),
element (element_)
{
}
@@ -158,7 +155,7 @@ private:
const String getButtonText() const
{
return T("convert to a path");
return "convert to a path";
}
private:


+ 3
- 5
extras/the jucer/src/model/paintelements/jucer_PaintElementGroup.h View File

@@ -38,7 +38,7 @@ class PaintElementGroup : public PaintElement
public:
//==============================================================================
PaintElementGroup (PaintRoutine* owner)
: PaintElement (owner, T("Group"))
: PaintElement (owner, "Group")
{
}
@@ -229,8 +229,6 @@ public:
}
}
juce_UseDebuggingNewOperator
private:
OwnedArray <PaintElement> subElements;
@@ -238,7 +236,7 @@ private:
{
public:
UngroupProperty (PaintElementGroup* const element_)
: ButtonPropertyComponent (T("ungroup"), false),
: ButtonPropertyComponent ("ungroup", false),
element (element_)
{
}
@@ -250,7 +248,7 @@ private:
const String getButtonText() const
{
return T("Ungroup");
return "Ungroup";
}
private:


+ 20
- 23
extras/the jucer/src/model/paintelements/jucer_PaintElementImage.h View File

@@ -47,7 +47,7 @@ public:
//==============================================================================
PaintElementImage (PaintRoutine* owner)
: PaintElement (owner, T("Image")),
: PaintElement (owner, "Image"),
opacity (1.0),
mode (stretched)
{
@@ -88,7 +88,7 @@ public:
g.fillRect (r);
g.setColour (Colours::black);
g.drawText (T("(image missing)"),
g.drawText ("(image missing)",
r.getX(), r.getY(), r.getWidth(), r.getHeight(),
Justification::centred, true);
}
@@ -178,7 +178,7 @@ public:
<< imageVariable << "->drawWithin (g, "
<< x << ", " << y << ", " << w << ", " << h
<< ",\n"
<< String::repeatedString (T(" "), imageVariable.length() + 18)
<< String::repeatedString (" ", imageVariable.length() + 18)
<< (mode == stretched ? "RectanglePlacement::stretchToFit"
: (mode == proportionalReducingOnly ? "RectanglePlacement::centred | RectanglePlacement::onlyReduceInSize"
: "RectanglePlacement::centred"))
@@ -231,7 +231,7 @@ public:
if (undoable)
{
perform (new SetResourceAction (this, newName),
T("Change image resource"));
"Change image resource");
}
else
{
@@ -286,7 +286,7 @@ public:
if (undoable)
{
perform (new SetOpacityAction (this, newOpacity),
T("Change image opacity"));
"Change image opacity");
}
else
{
@@ -356,7 +356,7 @@ public:
if (undoable)
{
perform (new SetStretchModeAction (this, newMode),
T("Change image mode"));
"Change image mode");
}
else
{
@@ -371,9 +371,9 @@ public:
{
XmlElement* e = new XmlElement (getTagName());
position.applyToXml (*e);
e->setAttribute (T("resource"), resourceName);
e->setAttribute (T("opacity"), opacity);
e->setAttribute (T("mode"), (int) mode);
e->setAttribute ("resource", resourceName);
e->setAttribute ("opacity", opacity);
e->setAttribute ("mode", (int) mode);
return e;
}
@@ -383,9 +383,9 @@ public:
if (xml.hasTagName (getTagName()))
{
position.restoreFromXml (xml, position);
resourceName = xml.getStringAttribute (T("resource"), String::empty);
opacity = xml.getDoubleAttribute (T("opacity"), 1.0);
mode = (StretchMode) xml.getIntAttribute (T("mode"), (int) stretched);
resourceName = xml.getStringAttribute ("resource", String::empty);
opacity = xml.getDoubleAttribute ("opacity", 1.0);
mode = (StretchMode) xml.getIntAttribute ("mode", (int) stretched);
repaint();
return true;
@@ -397,9 +397,6 @@ public:
}
}
//==============================================================================
juce_UseDebuggingNewOperator
private:
String resourceName;
double opacity;
@@ -410,7 +407,7 @@ private:
{
public:
ImageElementResourceProperty (PaintElementImage* const element_)
: ImageResourceProperty <PaintElementImage> (element_, T("image source"))
: ImageResourceProperty <PaintElementImage> (element_, "image source")
{
}
@@ -432,7 +429,7 @@ private:
{
public:
OpacityProperty (PaintElementImage* const element_)
: SliderPropertyComponent (T("opacity"), 0.0, 1.0, 0.001),
: SliderPropertyComponent ("opacity", 0.0, 1.0, 0.001),
element (element_)
{
element->getDocument()->addChangeListener (this);
@@ -469,12 +466,12 @@ private:
{
public:
StretchModeProperty (PaintElementImage* const element_)
: ChoicePropertyComponent (T("stretch mode")),
: ChoicePropertyComponent ("stretch mode"),
element (element_)
{
choices.add (T("Stretched to fit"));
choices.add (T("Maintain aspect ratio"));
choices.add (T("Maintain aspect ratio, only reduce in size"));
choices.add ("Stretched to fit");
choices.add ("Maintain aspect ratio");
choices.add ("Maintain aspect ratio, only reduce in size");
element->getDocument()->addChangeListener (this);
}
@@ -507,7 +504,7 @@ private:
{
public:
ResetSizeProperty (PaintElementImage* const element_)
: ButtonPropertyComponent (T("reset"), false),
: ButtonPropertyComponent ("reset", false),
element (element_)
{
}
@@ -517,7 +514,7 @@ private:
element->resetToImageSize();
}
const String getButtonText() const { return T("reset to image size"); }
const String getButtonText() const { return "reset to image size"; }
private:
PaintElementImage* const element;


+ 21
- 21
extras/the jucer/src/model/paintelements/jucer_PaintElementPath.cpp View File

@@ -102,11 +102,11 @@ class PathWindingModeProperty : public ChoicePropertyComponent,
{
public:
PathWindingModeProperty (PaintElementPath* const owner_)
: ChoicePropertyComponent (T("winding rule")),
: ChoicePropertyComponent ("winding rule"),
owner (owner_)
{
choices.add (T("Non-zero winding"));
choices.add (T("Even/odd winding"));
choices.add ("Non-zero winding");
choices.add ("Even/odd winding");
owner->getDocument()->addChangeListener (this);
}
@@ -129,7 +129,7 @@ private:
//==============================================================================
PaintElementPath::PaintElementPath (PaintRoutine* owner)
: ColouredElement (owner, T("Path"), true, true),
: ColouredElement (owner, "Path", true, true),
nonZeroWinding (true)
{
}
@@ -213,7 +213,7 @@ void PaintElementPath::setCurrentBounds (const Rectangle<int>& b,
scaleStartX, scaleStartY,
parentArea);
perform (new ChangePointAction (destPoint, i, p), T("Move path"));
perform (new ChangePointAction (destPoint, i, p), "Move path");
}
}
}
@@ -372,7 +372,7 @@ static const String positionToPairOfValues (const RelativePositionedRectangle& p
{
String x, y, w, h;
positionToCode (position, layout, x, y, w, h);
return castToFloat (x) + T(", ") + castToFloat (y);
return castToFloat (x) + ", " + castToFloat (y);
}
void PaintElementPath::fillInGeneratedCode (GeneratedCode& code, String& paintMethodCode)
@@ -438,7 +438,7 @@ void PaintElementPath::fillInGeneratedCode (GeneratedCode& code, String& paintMe
r << '\n';
if (somePointsAreRelative)
code.getCallbackCode (String::empty, T("void"), T("resized()"), false)
code.getCallbackCode (String::empty, "void", "resized()", false)
<< pathVariable << ".clear();\n" << r;
else
code.constructorCode << r;
@@ -469,7 +469,7 @@ XmlElement* PaintElementPath::createXml() const
XmlElement* e = new XmlElement (getTagName());
position.applyToXml (*e);
addColourAttributes (e);
e->setAttribute (T("nonZeroWinding"), nonZeroWinding);
e->setAttribute ("nonZeroWinding", nonZeroWinding);
e->addTextElement (pathToString());
@@ -482,7 +482,7 @@ bool PaintElementPath::loadFromXml (const XmlElement& xml)
{
position.restoreFromXml (xml, position);
loadColourAttributes (xml);
nonZeroWinding = xml.getBoolAttribute (T("nonZeroWinding"), true);
nonZeroWinding = xml.getBoolAttribute ("nonZeroWinding", true);
restorePathFromString (xml.getAllSubText().trim());
@@ -588,21 +588,21 @@ void PaintElementPath::restorePathFromString (const String& s)
{
PathPoint* p = new PathPoint (this);
if (tokens[i] == T("s"))
if (tokens[i] == "s")
{
p->type = Path::Iterator::startNewSubPath;
p->pos [0] = RelativePositionedRectangle();
p->pos [0].rect = PositionedRectangle (tokens [i + 1] + " " + tokens [i + 2]);
i += 2;
}
else if (tokens[i] == T("l"))
else if (tokens[i] == "l")
{
p->type = Path::Iterator::lineTo;
p->pos [0] = RelativePositionedRectangle();
p->pos [0].rect = PositionedRectangle (tokens [i + 1] + " " + tokens [i + 2]);
i += 2;
}
else if (tokens[i] == T("q"))
else if (tokens[i] == "q")
{
p->type = Path::Iterator::quadraticTo;
p->pos [0] = RelativePositionedRectangle();
@@ -611,7 +611,7 @@ void PaintElementPath::restorePathFromString (const String& s)
p->pos [1].rect = PositionedRectangle (tokens [i + 3] + " " + tokens [i + 4]);
i += 4;
}
else if (tokens[i] == T("c"))
else if (tokens[i] == "c")
{
p->type = Path::Iterator::cubicTo;
p->pos [0] = RelativePositionedRectangle();
@@ -622,7 +622,7 @@ void PaintElementPath::restorePathFromString (const String& s)
p->pos [2].rect = PositionedRectangle (tokens [i + 5] + " " + tokens [i + 6]);
i += 6;
}
else if (tokens[i] == T("x"))
else if (tokens[i] == "x")
{
p->type = Path::Iterator::closePath;
}
@@ -771,7 +771,7 @@ void PaintElementPath::setNonZeroWinding (const bool nonZero, const bool undoabl
{
if (undoable)
{
perform (new ChangeWindingAction (this, nonZero), T("Change path winding rule"));
perform (new ChangeWindingAction (this, nonZero), "Change path winding rule");
}
else
{
@@ -818,7 +818,7 @@ void PaintElementPath::setSubpathClosed (int index, const bool closed, const boo
PathPoint p2 (*p);
p2.type = Path::Iterator::closePath;
perform (new ChangePointAction (p, p2), T("Close subpath"));
perform (new ChangePointAction (p, p2), "Close subpath");
return;
}
}
@@ -828,7 +828,7 @@ void PaintElementPath::setSubpathClosed (int index, const bool closed, const boo
PathPoint* p = addPoint (points.size() - 1, undoable);
PathPoint p2 (*p);
p2.type = Path::Iterator::closePath;
perform (new ChangePointAction (p, p2), T("Close subpath"));
perform (new ChangePointAction (p, p2), "Close subpath");
}
}
@@ -880,7 +880,7 @@ PathPoint* PaintElementPath::addPoint (int pointIndexToAddItAfter, const bool un
if (undoable)
{
AddPointAction* action = new AddPointAction (this, pointIndexToAddItAfter);
perform (action, T("Add path point"));
perform (action, "Add path point");
return points [action->indexAdded];
}
else
@@ -990,7 +990,7 @@ void PaintElementPath::deletePoint (int pointIndex, const bool undoable)
{
if (undoable)
{
perform (new DeletePointAction (this, pointIndex), T("Delete path point"));
perform (new DeletePointAction (this, pointIndex), "Delete path point");
}
else
{
@@ -1131,7 +1131,7 @@ void PaintElementPath::movePoint (int index, int pointNumber,
if (undoable)
{
perform (new ChangePointAction (p, index, newPoint), T("Move path point"));
perform (new ChangePointAction (p, index, newPoint), "Move path point");
}
else
{
@@ -1174,7 +1174,7 @@ void PaintElementPath::setPoint (int index, int pointNumber, const RelativePosit
if (undoable)
{
perform (new ChangePointAction (p, index, newPoint), T("Change path point position"));
perform (new ChangePointAction (p, index, newPoint), "Change path point position");
}
else
{


+ 0
- 9
extras/the jucer/src/model/paintelements/jucer_PaintElementPath.h View File

@@ -61,9 +61,6 @@ public:
void deleteFromPath();
void getEditableProperties (Array <PropertyComponent*>& properties);
//==============================================================================
juce_UseDebuggingNewOperator
private:
const PathPoint withChangedPointType (const Path::Iterator::PathElementType newType,
const Rectangle<int>& parentArea) const;
@@ -136,9 +133,6 @@ public:
void createSiblingComponents();
void changed();
//==============================================================================
juce_UseDebuggingNewOperator
private:
friend class PathPoint;
friend class PathPointComponent;
@@ -185,9 +179,6 @@ public:
void changeListenerCallback (ChangeBroadcaster*);
//==============================================================================
juce_UseDebuggingNewOperator
private:
PaintElementPath* const path;
PaintRoutine* const routine;


+ 0
- 4
extras/the jucer/src/model/paintelements/jucer_PaintElementRectangle.h View File

@@ -145,10 +145,6 @@ public:
convertToNewPathElement (path);
}
//==============================================================================
juce_UseDebuggingNewOperator
private:
class ShapeToPathProperty : public ButtonPropertyComponent
{


+ 7
- 10
extras/the jucer/src/model/paintelements/jucer_PaintElementRoundedRectangle.h View File

@@ -37,7 +37,7 @@ class PaintElementRoundedRectangle : public ColouredElement
public:
//==============================================================================
PaintElementRoundedRectangle (PaintRoutine* owner)
: ColouredElement (owner, T("Rounded Rectangle"), true, false)
: ColouredElement (owner, "Rounded Rectangle", true, false)
{
cornerSize = 10.0;
}
@@ -107,7 +107,7 @@ public:
if (undoable)
{
perform (new SetCornerSizeAction (this, newSize),
T("Change rounded rectangle corner size"));
"Change rounded rectangle corner size");
}
else
{
@@ -163,7 +163,7 @@ public:
XmlElement* const e = new XmlElement (getTagName());
position.applyToXml (*e);
e->setAttribute (T("cornerSize"), cornerSize);
e->setAttribute ("cornerSize", cornerSize);
addColourAttributes (e);
return e;
@@ -174,7 +174,7 @@ public:
if (xml.hasTagName (getTagName()))
{
position.restoreFromXml (xml, position);
cornerSize = xml.getDoubleAttribute (T("cornerSize"), 10.0);
cornerSize = xml.getDoubleAttribute ("cornerSize", 10.0);
loadColourAttributes (xml);
return true;
@@ -197,9 +197,6 @@ public:
convertToNewPathElement (path);
}
//==============================================================================
juce_UseDebuggingNewOperator
private:
double cornerSize;
@@ -209,7 +206,7 @@ private:
{
public:
CornerSizeProperty (PaintElementRoundedRectangle* const owner_)
: SliderPropertyComponent (T("corner size"), 1.0, 200.0, 0.5, 0.4),
: SliderPropertyComponent ("corner size", 1.0, 200.0, 0.5, 0.4),
owner (owner_)
{
owner->getDocument()->addChangeListener (this);
@@ -240,7 +237,7 @@ private:
{
public:
ShapeToPathProperty (PaintElementRoundedRectangle* const element_)
: ButtonPropertyComponent (T("path"), false),
: ButtonPropertyComponent ("path", false),
element (element_)
{
}
@@ -252,7 +249,7 @@ private:
const String getButtonText() const
{
return T("convert to a path");
return "convert to a path";
}
private:


+ 2
- 5
extras/the jucer/src/model/paintelements/jucer_PaintElementText.h View File

@@ -39,8 +39,8 @@ class PaintElementText : public ColouredElement
public:
//==============================================================================
PaintElementText (PaintRoutine* owner)
: ColouredElement (owner, T("Text"), false, false),
text (T("Your text goes here")),
: ColouredElement (owner, "Text", false, false),
text ("Your text goes here"),
font (15.0f),
typefaceName (FontPropertyComponent::defaultFont),
justification (Justification::centred)
@@ -356,9 +356,6 @@ public:
convertToNewPathElement (path);
}
//==============================================================================
juce_UseDebuggingNewOperator
private:
String text;
Font font;


+ 7
- 7
extras/the jucer/src/model/paintelements/jucer_StrokeType.cpp View File

@@ -154,24 +154,24 @@ void StrokeType::restoreFromString (const String& s)
if (s.isNotEmpty())
{
const float thickness = (float) s.upToFirstOccurrenceOf (T(","), false, false).getDoubleValue();
const float thickness = (float) s.upToFirstOccurrenceOf (",", false, false).getDoubleValue();
PathStrokeType::JointStyle joint = stroke.getJointStyle();
if (s.containsIgnoreCase (T("miter")))
if (s.containsIgnoreCase ("miter"))
joint = PathStrokeType::mitered;
else if (s.containsIgnoreCase (T("curve")))
else if (s.containsIgnoreCase ("curve"))
joint = PathStrokeType::curved;
else if (s.containsIgnoreCase (T("bevel")))
else if (s.containsIgnoreCase ("bevel"))
joint = PathStrokeType::beveled;
PathStrokeType::EndCapStyle end = stroke.getEndStyle();
if (s.containsIgnoreCase (T("butt")))
if (s.containsIgnoreCase ("butt"))
end = PathStrokeType::butt;
else if (s.containsIgnoreCase (T("square")))
else if (s.containsIgnoreCase ("square"))
end = PathStrokeType::square;
else if (s.containsIgnoreCase (T("round")))
else if (s.containsIgnoreCase ("round"))
end = PathStrokeType::rounded;
stroke = PathStrokeType (thickness, joint, end);


+ 0
- 3
extras/the jucer/src/properties/jucer_ColourPropertyComponent.h View File

@@ -58,9 +58,6 @@ public:
((ColourPropEditorComponent*) getChildComponent (0))->refresh();
}
//==============================================================================
juce_UseDebuggingNewOperator
private:
class ColourPropEditorComponent : public ColourEditorComponent
{


+ 2
- 5
extras/the jucer/src/properties/jucer_ComponentColourProperty.h View File

@@ -102,7 +102,7 @@ public:
colourId,
newColour,
false),
T("Change colour"));
"Change colour");
}
}
@@ -115,12 +115,9 @@ public:
colourId,
Colours::black,
true),
T("Reset colour"));
"Reset colour");
}
//==============================================================================
juce_UseDebuggingNewOperator
private:
const int colourId;


+ 1
- 4
extras/the jucer/src/properties/jucer_FilePropertyComponent.h View File

@@ -38,7 +38,7 @@ public:
FilePropertyComponent (const String& name,
const bool isDirectory,
const bool allowEditingOfFilename,
const String& fileBrowserWildcard = T("*"));
const String& fileBrowserWildcard = "*");
~FilePropertyComponent();
@@ -51,9 +51,6 @@ public:
void refresh();
void filenameComponentChanged (FilenameComponent*);
//==============================================================================
juce_UseDebuggingNewOperator
private:
FilenameComponent* filenameComp;
};


+ 11
- 11
extras/the jucer/src/properties/jucer_FontPropertyComponent.cpp View File

@@ -58,10 +58,10 @@ void FontPropertyComponent::preloadAllFonts()
}
//==============================================================================
const String FontPropertyComponent::defaultFont (T("Default font"));
const String FontPropertyComponent::defaultSans (T("Default sans-serif font"));
const String FontPropertyComponent::defaultSerif (T("Default serif font"));
const String FontPropertyComponent::defaultMono (T("Default monospaced font"));
const String FontPropertyComponent::defaultFont ("Default font");
const String FontPropertyComponent::defaultSans ("Default sans-serif font");
const String FontPropertyComponent::defaultSerif ("Default serif font");
const String FontPropertyComponent::defaultMono ("Default monospaced font");
FontPropertyComponent::FontPropertyComponent (const String& name)
: ChoicePropertyComponent (name)
@@ -115,13 +115,13 @@ const String FontPropertyComponent::getTypefaceNameCode (const String& typefaceN
if (typefaceName == defaultFont)
return String::empty;
else if (typefaceName == defaultSans)
return T("Font::getDefaultSansSerifFontName(), ");
return "Font::getDefaultSansSerifFontName(), ";
else if (typefaceName == defaultSerif)
return T("Font::getDefaultSerifFontName(), ");
return "Font::getDefaultSerifFontName(), ";
else if (typefaceName == defaultMono)
return T("Font::getDefaultMonospacedFontName(), ");
return "Font::getDefaultMonospacedFontName(), ";
return T("T(\"") + typefaceName + T("\"), ");
return "L\"" + typefaceName + "\", ";
}
const String FontPropertyComponent::getFontStyleCode (const Font& font)
@@ -138,10 +138,10 @@ const String FontPropertyComponent::getFontStyleCode (const Font& font)
const String FontPropertyComponent::getCompleteFontCode (const Font& font, const String& typefaceName)
{
return T("Font (")
return "Font ("
+ getTypefaceNameCode (typefaceName)
+ valueToFloat (font.getHeight())
+ T(", ")
+ ", "
+ getFontStyleCode (font)
+ T(")");
+ ")";
}

+ 0
- 2
extras/the jucer/src/properties/jucer_FontPropertyComponent.h View File

@@ -54,8 +54,6 @@ public:
static const String getCompleteFontCode (const Font& font, const String& typefaceName);
//==============================================================================
juce_UseDebuggingNewOperator
void setIndex (int newIndex);
int getIndex() const;
};


+ 15
- 18
extras/the jucer/src/properties/jucer_PositionPropertyBase.h View File

@@ -59,7 +59,7 @@ public:
includeAnchorOptions (includeAnchorOptions_),
allowRelativeOptions (allowRelativeOptions_)
{
addAndMakeVisible (button = new TextButton (T("mode")));
addAndMakeVisible (button = new TextButton ("mode"));
button->addListener (this);
button->setTriggeredOnMouseDown (true);
button->setConnectedEdges (TextButton::ConnectedOnLeft | TextButton::ConnectedOnRight);
@@ -186,7 +186,7 @@ public:
PositionedRectangle::SizeMode sizeW = p.getWidthMode();
PositionedRectangle::SizeMode sizeH = p.getHeightMode();
String relCompName (T("parent"));
String relCompName ("parent");
Component* const relComp = layout != 0 ? layout->getComponentRelativePosTarget (component, (int) dimension) : 0;
@@ -201,19 +201,19 @@ public:
{
const PositionedRectangle::PositionMode posMode = (dimension == componentX) ? xMode : yMode;
m.addItem (10, ((dimension == componentX) ? T("Absolute distance from left of ")
: T("Absolute distance from top of ")) + relCompName,
m.addItem (10, ((dimension == componentX) ? "Absolute distance from left of "
: "Absolute distance from top of ") + relCompName,
true, posMode == PositionedRectangle::absoluteFromParentTopLeft);
m.addItem (11, ((dimension == componentX) ? T("Absolute distance from right of ")
: T("Absolute distance from bottom of ")) + relCompName,
m.addItem (11, ((dimension == componentX) ? "Absolute distance from right of "
: "Absolute distance from bottom of ") + relCompName,
true, posMode == PositionedRectangle::absoluteFromParentBottomRight);
m.addItem (12, T("Absolute distance from centre of ") + relCompName,
m.addItem (12, "Absolute distance from centre of " + relCompName,
true, posMode == PositionedRectangle::absoluteFromParentCentre);
m.addItem (13, ((dimension == componentX) ? T("Percentage of width of ")
: T("Percentage of height of ")) + relCompName,
m.addItem (13, ((dimension == componentX) ? "Percentage of width of "
: "Percentage of height of ") + relCompName,
true, posMode == PositionedRectangle::proportionOfParentSize);
m.addSeparator();
@@ -222,14 +222,14 @@ public:
{
const PositionedRectangle::AnchorPoint anchor = (dimension == componentX) ? xAnchor : yAnchor;
m.addItem (14, (dimension == componentX) ? T("Anchored at left of component")
: T("Anchored at top of component"),
m.addItem (14, (dimension == componentX) ? "Anchored at left of component"
: "Anchored at top of component",
true, anchor == PositionedRectangle::anchorAtLeftOrTop);
m.addItem (15, T("Anchored at centre of component"), true, anchor == PositionedRectangle::anchorAtCentre);
m.addItem (15, "Anchored at centre of component", true, anchor == PositionedRectangle::anchorAtCentre);
m.addItem (16, (dimension == componentX) ? T("Anchored at right of component")
: T("Anchored at bottom of component"),
m.addItem (16, (dimension == componentX) ? "Anchored at right of component"
: "Anchored at bottom of component",
true, anchor == PositionedRectangle::anchorAtRightOrBottom);
}
}
@@ -415,9 +415,6 @@ public:
virtual const RelativePositionedRectangle getPosition() const = 0;
//==============================================================================
juce_UseDebuggingNewOperator
protected:
class PositionPropLabel : public Label
{
@@ -448,7 +445,7 @@ protected:
TextEditor* createEditorComponent()
{
TextEditor* textEditor = Label::createEditorComponent();
textEditor->setInputRestrictions (14, T("0123456789.-%"));
textEditor->setInputRestrictions (14, "0123456789.-%");
return textEditor;
}


+ 0
- 3
extras/the jucer/src/ui/jucer_ComponentLayoutEditor.h View File

@@ -74,9 +74,6 @@ public:
const Image createComponentLayerSnapshot() const;
//==============================================================================
juce_UseDebuggingNewOperator
private:
JucerDocument& document;
ComponentLayout& layout;


+ 0
- 3
extras/the jucer/src/ui/jucer_ComponentLayoutPanel.cpp View File

@@ -84,9 +84,6 @@ public:
}
}
//==============================================================================
juce_UseDebuggingNewOperator
private:
JucerDocument& document;
ComponentLayout& layout;


+ 0
- 3
extras/the jucer/src/ui/jucer_ComponentLayoutPanel.h View File

@@ -47,9 +47,6 @@ public:
const Image createComponentSnapshot() const;
//==============================================================================
juce_UseDebuggingNewOperator
private:
ComponentLayout& layout;
};


+ 0
- 3
extras/the jucer/src/ui/jucer_ComponentOverlayComponent.h View File

@@ -78,9 +78,6 @@ public:
Component::SafePointer<Component> target;
const int borderThickness;
//==============================================================================
juce_UseDebuggingNewOperator
private:
ResizableBorderComponent* border;


+ 0
- 3
extras/the jucer/src/ui/jucer_EditingPanelBase.h View File

@@ -66,9 +66,6 @@ public:
class MagnifierComponent;
//==============================================================================
juce_UseDebuggingNewOperator
protected:
JucerDocument& document;


+ 74
- 74
extras/the jucer/src/ui/jucer_JucerDocumentHolder.cpp View File

@@ -42,7 +42,7 @@ class ExtraMethodsList : public PropertyComponent,
{
public:
ExtraMethodsList (JucerDocument& doc)
: PropertyComponent (T("extra callbacks"), 250),
: PropertyComponent ("extra callbacks", 250),
document (doc)
{
addAndMakeVisible (listBox = new ListBox (String::empty, this));
@@ -72,7 +72,7 @@ public:
g.setColour (Colours::black);
g.setFont (height * 0.6f);
g.drawText (returnValues [row] + T(" ") + baseClasses [row] + T("::") + methods [row],
g.drawText (returnValues [row] + " " + baseClasses [row] + "::" + methods [row],
30, 0, width - 32, height,
Justification::centredLeft, true);
@@ -149,11 +149,11 @@ public:
props.add (new ComponentInitialSizeProperty (document_, false));
props.add (new FixedSizeProperty (document_));
panel1->addSection (T("General class settings"), props);
panel1->addSection ("General class settings", props);
Array <PropertyComponent*> props2;
props2.add (new ExtraMethodsList (document_));
panel2->addSection (T("Extra callback methods to generate"), props2);
panel2->addSection ("Extra callback methods to generate", props2);
document_.addExtraClassProperties (panel1);
@@ -190,7 +190,7 @@ private:
{
public:
ComponentClassNameProperty (JucerDocument& document_)
: ComponentTextProperty <Component> (T("class name"), 128, false, 0, document_)
: ComponentTextProperty <Component> ("class name", 128, false, 0, document_)
{}
void setText (const String& newText) { document.setClassName (newText); }
@@ -202,7 +202,7 @@ private:
{
public:
ComponentCompNameProperty (JucerDocument& document_)
: ComponentTextProperty <Component> (T("component name"), 200, false, 0, document_)
: ComponentTextProperty <Component> ("component name", 200, false, 0, document_)
{}
void setText (const String& newText) { document.setComponentName (newText); }
@@ -214,7 +214,7 @@ private:
{
public:
ComponentParentClassesProperty (JucerDocument& document_)
: ComponentTextProperty <Component> (T("parent classes"), 512, false, 0, document_)
: ComponentTextProperty <Component> ("parent classes", 512, false, 0, document_)
{}
void setText (const String& newText) { document.setParentClasses (newText); }
@@ -226,7 +226,7 @@ private:
{
public:
ComponentConstructorParamsProperty (JucerDocument& document_)
: ComponentTextProperty <Component> (T("constructor params"), 2048, false, 0, document_)
: ComponentTextProperty <Component> ("constructor params", 2048, false, 0, document_)
{}
void setText (const String& newText) { document.setConstructorParams (newText); }
@@ -238,7 +238,7 @@ private:
{
public:
ComponentInitialisersProperty (JucerDocument& document_)
: ComponentTextProperty <Component> (T("member intialisers"), 2048, true, 0, document_)
: ComponentTextProperty <Component> ("member intialisers", 2048, true, 0, document_)
{
preferredHeight = 24 * 3;
}
@@ -253,7 +253,7 @@ private:
{
public:
ComponentInitialSizeProperty (JucerDocument& document_, const bool isWidth_)
: ComponentTextProperty <Component> (isWidth_ ? T("initial width") : T("initial height"),
: ComponentTextProperty <Component> (isWidth_ ? "initial width" : "initial height",
10, false, 0, document_),
isWidth (isWidth_)
{}
@@ -281,10 +281,10 @@ private:
{
public:
FixedSizeProperty (JucerDocument& document_)
: ComponentChoiceProperty <Component> (T("fixed size"), 0, document_)
: ComponentChoiceProperty <Component> ("fixed size", 0, document_)
{
choices.add (T("Resize component to fit workspace"));
choices.add (T("Keep component size fixed"));
choices.add ("Resize component to fit workspace");
choices.add ("Keep component size fixed");
}
void setIndex (int newIndex) { document.setFixedSize (newIndex != 0); }
@@ -320,7 +320,7 @@ public:
{
isHeader = isHeader_;
editor->loadContent (isHeader ? h : cpp);
switchButton->setButtonText (isHeader ? T("Show .cpp") : T("Show .h"));
switchButton->setButtonText (isHeader ? "Show .cpp" : "Show .h");
}
void resized()
@@ -380,16 +380,16 @@ JucerDocumentHolder::JucerDocumentHolder (JucerDocument* const document_)
addAndMakeVisible (tabbedComponent = new TabbedComponent (TabbedButtonBar::TabsAtRight));
tabbedComponent->setOutline (0);
tabbedComponent->addTab (T("Class"), tabColour, new ClassPropertiesPanel (*document), true);
tabbedComponent->addTab ("Class", tabColour, new ClassPropertiesPanel (*document), true);
if (document->getComponentLayout() != 0)
{
tabbedComponent->addTab (T("Subcomponents"), tabColour,
tabbedComponent->addTab ("Subcomponents", tabColour,
compLayoutPanel = new ComponentLayoutPanel (*document, *document->getComponentLayout()), true);
}
tabbedComponent->addTab (T("Resources"), tabColour, new ResourceEditorPanel (*document), true);
tabbedComponent->addTab (T("Code Preview"), tabColour, new CodeViewerComp (*document), true);
tabbedComponent->addTab ("Resources", tabColour, new ResourceEditorPanel (*document), true);
tabbedComponent->addTab ("Code Preview", tabColour, new CodeViewerComp (*document), true);
updateTabs();
@@ -495,7 +495,7 @@ void JucerDocumentHolder::paint (Graphics& g)
if (tabbedComponent == 0)
{
g.setColour (Colours::black);
g.drawText (T("no component currently open"), 0, 0, getWidth(), getHeight(), Justification::centred, false);
g.drawText ("no component currently open", 0, 0, getWidth(), getHeight(), Justification::centred, false);
}
}
@@ -668,7 +668,7 @@ void JucerDocumentHolder::addComponent (const int index)
{
const Rectangle<int> area (panel->getComponentArea());
document->getUndoManager().beginNewTransaction (T("Add new ") + ObjectTypes::componentTypeHandlers [index]->getTypeName());
document->getUndoManager().beginNewTransaction ("Add new " + ObjectTypes::componentTypeHandlers [index]->getTypeName());
const int randomness = jmin (80, area.getWidth() / 2, area.getHeight() / 2);
int x = area.getWidth() / 2 + Random::getSystemRandom().nextInt (randomness) - randomness / 2;
@@ -785,14 +785,14 @@ void JucerDocumentHolder::getCommandInfo (const CommandID commandID, Application
switch (commandID)
{
case CommandIDs::close:
result.setInfo (T("Close"),
T("Closes the component that's currently being edited."),
result.setInfo ("Close",
"Closes the component that's currently being edited.",
CommandCategories::general, 0);
break;
case CommandIDs::save:
result.setInfo (T("Save"),
T("Saves the current component."),
result.setInfo ("Save",
"Saves the current component.",
CommandCategories::general, 0);
result.defaultKeypresses.add (KeyPress ('s', cmd, 0));
@@ -800,23 +800,23 @@ void JucerDocumentHolder::getCommandInfo (const CommandID commandID, Application
case CommandIDs::saveAs:
result.setInfo (T("Save As..."),
T("Saves the current component to a specified file."),
result.setInfo ("Save As...",
"Saves the current component to a specified file.",
CommandCategories::general, 0);
result.defaultKeypresses.add (KeyPress ('s', cmd | shift, 0));
break;
case CommandIDs::undo:
result.setInfo (T("Undo"),
T("Undoes the last operation."),
result.setInfo ("Undo",
"Undoes the last operation.",
CommandCategories::editing, 0);
result.setActive (document->getUndoManager().canUndo());
result.defaultKeypresses.add (KeyPress ('z', cmd, 0));
break;
case CommandIDs::redo:
result.setInfo (T("Redo"),
T("Redoes the last operation."),
result.setInfo ("Redo",
"Redoes the last operation.",
CommandCategories::editing, 0);
result.setActive (document->getUndoManager().canRedo());
result.defaultKeypresses.add (KeyPress ('z', cmd | shift, 0));
@@ -824,24 +824,24 @@ void JucerDocumentHolder::getCommandInfo (const CommandID commandID, Application
break;
case CommandIDs::toFront:
result.setInfo (T("Bring to front"),
T("Brings the currently selected component to the front."),
result.setInfo ("Bring to front",
"Brings the currently selected component to the front.",
CommandCategories::editing, 0);
result.setActive (isSomethingSelected());
result.defaultKeypresses.add (KeyPress ('f', cmd, 0));
break;
case CommandIDs::toBack:
result.setInfo (T("Send to back"),
T("Sends the currently selected component to the back."),
result.setInfo ("Send to back",
"Sends the currently selected component to the back.",
CommandCategories::editing, 0);
result.setActive (isSomethingSelected());
result.defaultKeypresses.add (KeyPress ('b', cmd, 0));
break;
case CommandIDs::group:
result.setInfo (T("Group selected items"),
T("Turns the currently selected elements into a single group object."),
result.setInfo ("Group selected items",
"Turns the currently selected elements into a single group object.",
CommandCategories::editing, 0);
result.setActive (currentPaintRoutine != 0
&& currentPaintRoutine->getSelectedElements().getNumSelected() > 1);
@@ -849,41 +849,41 @@ void JucerDocumentHolder::getCommandInfo (const CommandID commandID, Application
break;
case CommandIDs::ungroup:
result.setInfo (T("Ungroup selected items"),
T("Turns the currently selected elements into a single group object."),
result.setInfo ("Ungroup selected items",
"Turns the currently selected elements into a single group object.",
CommandCategories::editing, 0);
result.setActive (currentPaintRoutine != 0
&& currentPaintRoutine->getSelectedElements().getNumSelected() == 1
&& currentPaintRoutine->getSelectedElements().getSelectedItem (0)->getTypeName() == T("Group"));
&& currentPaintRoutine->getSelectedElements().getSelectedItem (0)->getTypeName() == "Group");
result.defaultKeypresses.add (KeyPress ('k', cmd | shift, 0));
break;
case CommandIDs::test:
result.setInfo (T("Test component..."),
T("Runs the current component interactively."),
result.setInfo ("Test component...",
"Runs the current component interactively.",
CommandCategories::view, 0);
result.defaultKeypresses.add (KeyPress ('t', cmd, 0));
break;
case CommandIDs::enableSnapToGrid:
result.setInfo (T("Enable snap-to-grid"),
T("Toggles whether components' positions are aligned to a grid."),
result.setInfo ("Enable snap-to-grid",
"Toggles whether components' positions are aligned to a grid.",
CommandCategories::view, 0);
result.setTicked (document->isSnapActive (false));
result.defaultKeypresses.add (KeyPress ('g', cmd, 0));
break;
case CommandIDs::showGrid:
result.setInfo (T("Show snap-to-grid"),
T("Toggles whether the snapping grid is displayed on-screen."),
result.setInfo ("Show snap-to-grid",
"Toggles whether the snapping grid is displayed on-screen.",
CommandCategories::view, 0);
result.setTicked (document->isSnapShown());
result.defaultKeypresses.add (KeyPress ('g', cmd | shift, 0));
break;
case CommandIDs::editCompLayout:
result.setInfo (T("Edit sub-component layout"),
T("Switches to the sub-component editor view."),
result.setInfo ("Edit sub-component layout",
"Switches to the sub-component editor view.",
CommandCategories::view, 0);
result.setActive (tabbedComponent != 0);
result.setTicked (currentLayout != 0);
@@ -891,8 +891,8 @@ void JucerDocumentHolder::getCommandInfo (const CommandID commandID, Application
break;
case CommandIDs::editCompGraphics:
result.setInfo (T("Edit background graphics"),
T("Switches to the background graphics editor view."),
result.setInfo ("Edit background graphics",
"Switches to the background graphics editor view.",
CommandCategories::view, 0);
result.setActive (tabbedComponent != 0);
result.setTicked (currentPaintRoutine != 0);
@@ -900,40 +900,40 @@ void JucerDocumentHolder::getCommandInfo (const CommandID commandID, Application
break;
case CommandIDs::bringBackLostItems:
result.setInfo (T("Retrieve offscreen items"),
T("Moves any items that are lost beyond the edges of the screen back to the centre."),
result.setInfo ("Retrieve offscreen items",
"Moves any items that are lost beyond the edges of the screen back to the centre.",
CommandCategories::editing, 0);
result.setActive (currentPaintRoutine != 0 || currentLayout != 0);
result.defaultKeypresses.add (KeyPress ('m', cmd, 0));
break;
case CommandIDs::zoomIn:
result.setInfo (T("Zoom in"),
T("Zooms in on the current component."),
result.setInfo ("Zoom in",
"Zooms in on the current component.",
CommandCategories::editing, 0);
result.setActive (currentPaintRoutine != 0 || currentLayout != 0);
result.defaultKeypresses.add (KeyPress (']', cmd, 0));
break;
case CommandIDs::zoomOut:
result.setInfo (T("Zoom out"),
T("Zooms out on the current component."),
result.setInfo ("Zoom out",
"Zooms out on the current component.",
CommandCategories::editing, 0);
result.setActive (currentPaintRoutine != 0 || currentLayout != 0);
result.defaultKeypresses.add (KeyPress ('[', cmd, 0));
break;
case CommandIDs::zoomNormal:
result.setInfo (T("Zoom to 100%"),
T("Restores the zoom level to normal."),
result.setInfo ("Zoom to 100%",
"Restores the zoom level to normal.",
CommandCategories::editing, 0);
result.setActive (currentPaintRoutine != 0 || currentLayout != 0);
result.defaultKeypresses.add (KeyPress ('1', cmd, 0));
break;
case CommandIDs::spaceBarDrag:
result.setInfo (T("Scroll while dragging mouse"),
T("When held down, this key lets you scroll around by dragging with the mouse."),
result.setInfo ("Scroll while dragging mouse",
"When held down, this key lets you scroll around by dragging with the mouse.",
CommandCategories::view, ApplicationCommandInfo::wantsKeyUpDownCallbacks);
result.setActive (currentPaintRoutine != 0 || currentLayout != 0);
result.defaultKeypresses.add (KeyPress (KeyPress::spaceKey, 0, 0));
@@ -973,9 +973,9 @@ void JucerDocumentHolder::getCommandInfo (const CommandID commandID, Application
currentAmount = 33;
result.setInfo (commandID == CommandIDs::compOverlay0
? T("No component overlay")
: T("Overlay with opacity of ") + String (amount) + "%",
T("Changes the opacity of the components that are shown over the top of the graphics editor."),
? "No component overlay"
: "Overlay with opacity of " + String (amount) + "%",
"Changes the opacity of the components that are shown over the top of the graphics editor.",
CommandCategories::view, 0);
result.setActive (currentPaintRoutine != 0 && document->getComponentLayout() != 0);
result.setTicked (amount == currentAmount);
@@ -983,16 +983,16 @@ void JucerDocumentHolder::getCommandInfo (const CommandID commandID, Application
break;
case StandardApplicationCommandIDs::cut:
result.setInfo (T("Cut"),
T("Copies the currently selected components to the clipboard and deletes them."),
result.setInfo ("Cut",
"Copies the currently selected components to the clipboard and deletes them.",
CommandCategories::editing, 0);
result.setActive (isSomethingSelected());
result.defaultKeypresses.add (KeyPress ('x', cmd, 0));
break;
case StandardApplicationCommandIDs::copy:
result.setInfo (T("Copy"),
T("Copies the currently selected components to the clipboard."),
result.setInfo ("Copy",
"Copies the currently selected components to the clipboard.",
CommandCategories::editing, 0);
result.setActive (isSomethingSelected());
result.defaultKeypresses.add (KeyPress ('c', cmd, 0));
@@ -1000,8 +1000,8 @@ void JucerDocumentHolder::getCommandInfo (const CommandID commandID, Application
case StandardApplicationCommandIDs::paste:
{
result.setInfo (T("Paste"),
T("Pastes any components from the clipboard."),
result.setInfo ("Paste",
"Pastes any components from the clipboard.",
CommandCategories::editing, 0);
result.defaultKeypresses.add (KeyPress ('v', cmd, 0));
@@ -1025,8 +1025,8 @@ void JucerDocumentHolder::getCommandInfo (const CommandID commandID, Application
break;
case StandardApplicationCommandIDs::del:
result.setInfo (T("Delete"),
T("Deletes any selected components."),
result.setInfo ("Delete",
"Deletes any selected components.",
CommandCategories::editing, 0);
result.setActive (isSomethingSelected());
result.defaultKeypresses.add (KeyPress (KeyPress::deleteKey, 0, 0));
@@ -1034,16 +1034,16 @@ void JucerDocumentHolder::getCommandInfo (const CommandID commandID, Application
break;
case StandardApplicationCommandIDs::selectAll:
result.setInfo (T("Select All"),
T("Selects all of whatever item is currently selected."),
result.setInfo ("Select All",
"Selects all of whatever item is currently selected.",
CommandCategories::editing, 0);
result.setActive (currentPaintRoutine != 0 || currentLayout != 0);
result.defaultKeypresses.add (KeyPress ('a', cmd, 0));
break;
case StandardApplicationCommandIDs::deselectAll:
result.setInfo (T("Deselect All"),
T("Deselects whatever is currently selected."),
result.setInfo ("Deselect All",
"Deselects whatever is currently selected.",
CommandCategories::editing, 0);
result.setActive (currentPaintRoutine != 0 || currentLayout != 0);
result.defaultKeypresses.add (KeyPress ('d', cmd, 0));


+ 0
- 3
extras/the jucer/src/ui/jucer_JucerDocumentHolder.h View File

@@ -72,9 +72,6 @@ public:
static JucerDocumentHolder* getActiveDocumentHolder();
//==============================================================================
juce_UseDebuggingNewOperator
private:
JucerDocument* const document;
TabbedComponent* tabbedComponent;


+ 7
- 7
extras/the jucer/src/ui/jucer_MainWindow.cpp View File

@@ -61,7 +61,7 @@ public:
//==============================================================================
MainWindow::MainWindow()
: DocumentWindow (T("The Jucer"),
: DocumentWindow ("The Jucer",
Colours::azure,
DocumentWindow::allButtons)
{
@@ -84,7 +84,7 @@ MainWindow::MainWindow()
// restore the last size and position from our settings file..
restoreWindowStateFromString (StoredSettings::getInstance()->getProps()
.getValue (T("lastMainWindowPos")));
.getValue ("lastMainWindowPos"));
// Register all the app commands..
{
@@ -98,7 +98,7 @@ MainWindow::MainWindow()
commandManager->getKeyMappings()->resetToDefaultMappings();
XmlElement* const keys = StoredSettings::getInstance()->getProps().getXmlValue (T("keyMappings"));
XmlElement* const keys = StoredSettings::getInstance()->getProps().getXmlValue ("keyMappings");
if (keys != 0)
{
@@ -129,7 +129,7 @@ MainWindow::~MainWindow()
// save the current size and position to our settings file..
StoredSettings::getInstance()->getProps()
.setValue (T("lastMainWindowPos"), getWindowStateAsString());
.setValue ("lastMainWindowPos", getWindowStateAsString());
clearContentComponent();
@@ -251,7 +251,7 @@ const PopupMenu MainWindow::getMenuForIndex (int topLevelMenuIndex,
PopupMenu recentFiles;
StoredSettings::getInstance()->recentFiles.createPopupMenuItems (recentFiles, 100, true, true);
menu.addSubMenu (T("Open recent file"), recentFiles);
menu.addSubMenu ("Open recent file", recentFiles);
menu.addSeparator();
menu.addCommandItem (commandManager, CommandIDs::close);
@@ -279,13 +279,13 @@ const PopupMenu MainWindow::getMenuForIndex (int topLevelMenuIndex,
for (i = 0; i < ObjectTypes::numComponentTypes; ++i)
newComps.addCommandItem (commandManager, CommandIDs::newComponentBase + i);
menu.addSubMenu (T("Add new component"), newComps);
menu.addSubMenu ("Add new component", newComps);
PopupMenu newElements;
for (i = 0; i < ObjectTypes::numElementTypes; ++i)
newElements.addCommandItem (commandManager, CommandIDs::newElementBase + i);
menu.addSubMenu (T("Add new graphic element"), newElements);
menu.addSubMenu ("Add new graphic element", newElements);
menu.addSeparator();
menu.addCommandItem (commandManager, StandardApplicationCommandIDs::cut);


+ 0
- 3
extras/the jucer/src/ui/jucer_MainWindow.h View File

@@ -71,9 +71,6 @@ public:
bool isCommandActive (const CommandID commandID);
bool perform (const InvocationInfo& info);
//==============================================================================
juce_UseDebuggingNewOperator
private:
MultiDocHolder* multiDocHolder;


+ 0
- 3
extras/the jucer/src/ui/jucer_PaintRoutineEditor.h View File

@@ -70,9 +70,6 @@ public:
//==============================================================================
void refreshAllElements();
//==============================================================================
juce_UseDebuggingNewOperator
private:
PaintRoutine& graphics;
JucerDocument& document;


+ 0
- 3
extras/the jucer/src/ui/jucer_PaintRoutinePanel.cpp View File

@@ -156,9 +156,6 @@ public:
}
}
//==============================================================================
juce_UseDebuggingNewOperator
private:
PaintRoutine& paintRoutine;
JucerDocument* document;


+ 0
- 3
extras/the jucer/src/ui/jucer_PaintRoutinePanel.h View File

@@ -48,9 +48,6 @@ public:
void updatePropertiesList();
const Rectangle<int> getComponentArea() const;
//==============================================================================
juce_UseDebuggingNewOperator
private:
PaintRoutine& routine;
};


+ 8
- 8
extras/the jucer/src/ui/jucer_PrefsPanel.cpp View File

@@ -35,14 +35,14 @@ public:
MiscPage()
{
addAndMakeVisible (templateDir
= new FilenameComponent (T("C++ template folder:"),
= new FilenameComponent ("C++ template folder:",
StoredSettings::getInstance()->getTemplatesDir(),
true,
true,
false,
T("*.*"),
"*.*",
String::empty,
T("(select the directory containing template .cpp and .h files)")));
"(select the directory containing template .cpp and .h files)"));
(new Label (String::empty, templateDir->getName()))->attachToComponent (templateDir, true);
}
@@ -78,11 +78,11 @@ public:
text1.appendText ("Jucer", Font (13.0f, Font::bold));
text1.appendText (" component design tool.", Font (13.0f));
text2.appendText (T("Jucer v") + JUCEApplication::getInstance()->getApplicationVersion()
+ T(", ") + SystemStats::getJUCEVersion(), Font (14.0f, Font::bold));
text2.appendText ("Jucer v" + JUCEApplication::getInstance()->getApplicationVersion()
+ ", " + SystemStats::getJUCEVersion(), Font (14.0f, Font::bold));
addAndMakeVisible (link = new HyperlinkButton (T("www.rawmaterialsoftware.com/juce"),
URL (T("http://www.rawmaterialsoftware.com/juce"))));
addAndMakeVisible (link = new HyperlinkButton ("www.rawmaterialsoftware.com/juce",
URL ("http://www.rawmaterialsoftware.com/juce")));
link->setFont (Font (10.0f, Font::bold | Font::underlined), true);
}
@@ -157,7 +157,7 @@ public:
static String prefsWindowPos;
PrefsPanel::PrefsPanel()
: DialogWindow (T("Jucer Preferences"), Colour::greyLevel (0.92f), true)
: DialogWindow ("Jucer Preferences", Colour::greyLevel (0.92f), true)
{
PrefsTabComp* const p = new PrefsTabComp();
p->setSize (456, 510);


+ 4
- 4
extras/the jucer/src/ui/jucer_ResourceEditorPanel.cpp View File

@@ -36,7 +36,7 @@ public:
: document (document_)
{
setInterceptsMouseClicks (false, true);
addAndMakeVisible (reloadButton = new TextButton (T("Reload")));
addAndMakeVisible (reloadButton = new TextButton ("Reload"));
reloadButton->addListener (this);
}
@@ -65,8 +65,8 @@ public:
if (r != 0)
{
document.getResources()
.browseForResource (T("Select a file to replace this resource"),
T("*"),
.browseForResource ("Select a file to replace this resource",
"*",
File (r->originalFilename),
r->name);
}
@@ -280,7 +280,7 @@ void ResourceEditorPanel::buttonClicked (Button* b)
AlertWindow::showMessageBox (AlertWindow::WarningIcon,
TRANS("Reloading resources"),
TRANS("The following resources couldn't be reloaded from their original files:\n\n")
+ failed.joinIntoString (T(", ")));
+ failed.joinIntoString (", "));
}
}
}

+ 0
- 3
extras/the jucer/src/ui/jucer_ResourceEditorPanel.h View File

@@ -56,9 +56,6 @@ public:
void sortOrderChanged (int newSortColumnId, bool isForwards);
void selectedRowsChanged (int lastRowSelected);
//==============================================================================
juce_UseDebuggingNewOperator
private:
JucerDocument& document;
TableListBox* listBox;


+ 0
- 3
extras/the jucer/src/ui/jucer_SnapGridPainter.h View File

@@ -46,9 +46,6 @@ public:
bool updateFromDesign (JucerDocument& design);
void updateColour();
//==============================================================================
juce_UseDebuggingNewOperator
private:
int snapGridSize;
bool snapShown;


+ 3
- 3
extras/the jucer/src/ui/jucer_TestComponent.cpp View File

@@ -150,10 +150,10 @@ void TestComponent::paint (Graphics& g)
g.drawLine (0.0f, (float) getHeight(), (float) getWidth(), 0.0f);
g.setFont (14.0f);
g.drawText (T("Jucer Component"),
g.drawText ("Jucer Component",
0, 0, getWidth(), getHeight() / 2,
Justification::centred, true);
g.drawText (T("(no file loaded)"),
g.drawText ("(no file loaded)",
0, getHeight() / 2, getWidth(), getHeight() / 2,
Justification::centred, true);
}
@@ -177,7 +177,7 @@ void TestComponent::showInDialogBox (JucerDocument& document)
TestComponent testComp (0, document.createCopy(), true);
DialogWindow::showModalDialog (T("Testing: ") + document.getClassName(),
DialogWindow::showModalDialog ("Testing: " + document.getClassName(),
&testComp, 0,
Colours::azure,
true, true);


+ 0
- 3
extras/the jucer/src/ui/jucer_TestComponent.h View File

@@ -65,9 +65,6 @@ public:
// reloads any test comps that need to do so
static void reloadAll();
//==============================================================================
juce_UseDebuggingNewOperator
private:
JucerDocument* ownerDocument;
JucerDocument* loadedDocument;


+ 2
- 4
extras/the jucer/src/utility/jucer_ColourEditorComponent.h View File

@@ -93,8 +93,6 @@ public:
setColour (cs->getCurrentColour());
}
juce_UseDebuggingNewOperator
private:
Colour colour;
bool canResetToDefault;
@@ -109,13 +107,13 @@ private:
defaultButton (0)
{
addAndMakeVisible (selector = new ColourSelectorWithSwatches());
selector->setName (T("Colour"));
selector->setName ("Colour");
selector->setCurrentColour (owner->getColour());
selector->addChangeListener (owner);
if (canResetToDefault)
{
addAndMakeVisible (defaultButton = new TextButton (T("Reset to Default")));
addAndMakeVisible (defaultButton = new TextButton ("Reset to Default"));
defaultButton->addListener (this);
}
}


+ 10
- 10
extras/the jucer/src/utility/jucer_StoredSettings.cpp View File

@@ -54,32 +54,32 @@ void StoredSettings::flush()
{
if (props != 0)
{
props->setValue (T("recentFiles"), recentFiles.toString());
props->setValue ("recentFiles", recentFiles.toString());
props->removeValue (T("keyMappings"));
props->removeValue ("keyMappings");
XmlElement* keys = commandManager->getKeyMappings()->createXml (true);
if (keys != 0)
{
props->setValue (T("keyMappings"), keys);
props->setValue ("keyMappings", keys);
delete keys;
}
for (int i = 0; i < swatchColours.size(); ++i)
props->setValue (T("swatchColour") + String (i), colourToHex (swatchColours [i]));
props->setValue ("swatchColour" + String (i), colourToHex (swatchColours [i]));
}
deleteAndZero (props);
props = PropertiesFile::createDefaultAppPropertiesFile (T("Jucer"),
T("settings"),
props = PropertiesFile::createDefaultAppPropertiesFile ("Jucer",
"settings",
String::empty,
false, 3000,
PropertiesFile::storeAsXML);
// recent files...
recentFiles.restoreFromString (props->getValue (T("recentFiles")));
recentFiles.restoreFromString (props->getValue ("recentFiles"));
recentFiles.removeNonExistentFiles();
// swatch colours...
@@ -99,7 +99,7 @@ void StoredSettings::flush()
{
Colour defaultCol (colours [2 + i]);
swatchColours.add (Colour (props->getValue (T("swatchColour") + String (i),
swatchColours.add (Colour (props->getValue ("swatchColour" + String (i),
colourToHex (defaultCol)).getHexValue32()));
}
}
@@ -109,11 +109,11 @@ const File StoredSettings::getTemplatesDir() const
File defaultTemplateDir (File::getSpecialLocation (File::currentExecutableFile)
.getParentDirectory());
return File (props->getValue (T("templateDir"),
return File (props->getValue ("templateDir",
defaultTemplateDir.getFullPathName()));
}
void StoredSettings::setTemplatesDir (const File& newDir)
{
props->setValue (T("templateDir"), newDir.getFullPathName());
props->setValue ("templateDir", newDir.getFullPathName());
}

+ 0
- 3
extras/the jucer/src/utility/jucer_StoredSettings.h View File

@@ -52,9 +52,6 @@ public:
Array <Colour> swatchColours;
//==============================================================================
juce_UseDebuggingNewOperator
private:
PropertiesFile* props;
};


+ 6
- 6
extras/the jucer/src/utility/jucer_UtilityFunctions.cpp View File

@@ -125,7 +125,7 @@ const String quotedString (const String& s)
}
}
return "T(\"" + replaceCEscapeChars (s) + "\")";
return "L\"" + replaceCEscapeChars (s) + "\"";
}
const String replaceStringTranslations (String s, JucerDocument* document)
@@ -190,7 +190,7 @@ const String makeValidCppIdentifier (String s,
&& CharacterFunctions::isLetter (s[i - 1])
&& CharacterFunctions::isUpperCase (s[i])
&& ! CharacterFunctions::isUpperCase (s[i - 1]))
s = s.substring (0, i) + T(" ") + s.substring (i);
s = s.substring (0, i) + " " + s.substring (i);
String allowedChars ("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_ 0123456789");
if (allowTemplates)
@@ -218,7 +218,7 @@ const String makeValidCppIdentifier (String s,
}
if (CharacterFunctions::isDigit (n[0]))
n = T("_") + n;
n = "_" + n;
// make sure it's not a reserved c++ keyword..
static const char* const reservedWords[] =
@@ -328,7 +328,7 @@ const String positionToString (const RelativePositionedRectangle& pos)
StringArray toks;
toks.addTokens (pos.rect.toString(), false);
return toks[0] + T(" ") + toks[1];
return toks[0] + " " + toks[1];
}
void positionToXY (const RelativePositionedRectangle& position,
@@ -451,7 +451,7 @@ void positionToCode (const RelativePositionedRectangle& position,
x << " + " << d;
}
if (w != T("0"))
if (w != "0")
{
if (position.rect.getAnchorPointX() == PositionedRectangle::anchorAtRightOrBottom)
x << " - " << w;
@@ -497,7 +497,7 @@ void positionToCode (const RelativePositionedRectangle& position,
y << " + " << d;
}
if (h != T("0"))
if (h != "0")
{
if (position.rect.getAnchorPointY() == PositionedRectangle::anchorAtRightOrBottom)
y << " - " << h;


+ 1
- 1
src/audio/processors/juce_AudioProcessorGraph.h View File

@@ -399,7 +399,7 @@ private:
//==============================================================================
ReferenceCountedArray <Node> nodes;
OwnedArray <Connection> connections;
int lastNodeId;
uint32 lastNodeId;
AudioSampleBuffer renderingBuffers;
OwnedArray <MidiBuffer> midiBuffers;


+ 1
- 1
src/containers/juce_NamedValueSet.cpp View File

@@ -127,7 +127,7 @@ const var NamedValueSet::getWithDefault (const Identifier& name, const var& defa
return v != nullptr ? *v : defaultReturnValue;
}
var* NamedValueSet::getVarPointer (const Identifier& name) const
var* NamedValueSet::getVarPointer (const Identifier& name) const noexcept
{
for (NamedValue* i = values; i != nullptr; i = i->nextListItem)
if (i->name == name)


+ 1
- 1
src/containers/juce_NamedValueSet.h View File

@@ -105,7 +105,7 @@ public:
Do not use this method unless you really need access to the internal var object
for some reason - for normal reading and writing always prefer operator[]() and set().
*/
var* getVarPointer (const Identifier& name) const;
var* getVarPointer (const Identifier& name) const noexcept;
//==============================================================================
/** Sets properties to the values of all of an XML element's attributes. */


+ 0
- 14
src/core/juce_SystemStats.cpp View File

@@ -78,19 +78,5 @@ const String SystemStats::getJUCEVersion()
static JuceVersionPrinter juceVersionPrinter;
#endif
//==============================================================================
#ifdef JUCE_DLL
void* juce_Malloc (int size) { return malloc (size); }
void* juce_Calloc (int size) { return calloc (1, size); }
void* juce_Realloc (void* block, int size) { return realloc (block, size); }
void juce_Free (void* block) { free (block); }
#if JUCE_MSVC && JUCE_CHECK_MEMORY_LEAKS
void* juce_DebugMalloc (int size, const char* file, int line) { return _malloc_dbg (size, _NORMAL_BLOCK, file, line); }
void* juce_DebugCalloc (int size, const char* file, int line) { return _calloc_dbg (1, size, _NORMAL_BLOCK, file, line); }
void* juce_DebugRealloc (void* block, int size, const char* file, int line) { return _realloc_dbg (block, size, _NORMAL_BLOCK, file, line); }
void juce_DebugFree (void* block) { _free_dbg (block, _NORMAL_BLOCK); }
#endif
#endif
END_JUCE_NAMESPACE

+ 8
- 6
src/gui/components/filebrowser/juce_FileChooserDialogBox.h View File

@@ -44,22 +44,24 @@
@code
{
WildcardFileFilter wildcardFilter ("*.foo", "Foo files");
WildcardFileFilter wildcardFilter ("*.foo", String::empty, "Foo files");
FileBrowserComponent browser (FileBrowserComponent::loadFileMode,
FileBrowserComponent browser (FileBrowserComponent::canSelectFiles,
File::nonexistent,
&wildcardFilter,
0);
nullptr);
FileChooserDialogBox dialogBox ("Open some kind of file",
"Please choose some kind of file that you want to open...",
browser,
getLookAndFeel().alertWindowBackground);
false,
Colours::lightgrey);
if (dialogBox.show())
{
File selectedFile = browser.getCurrentFile();
...
File selectedFile = browser.getSelectedFile (0);
...etc..
}
}
@endcode


+ 4
- 0
src/gui/components/filebrowser/juce_WildcardFileFilter.h View File

@@ -49,6 +49,10 @@ public:
patterns, e.g. "*.wav;*.aiff" would look for files ending in either .wav
or .aiff.
Passing an empty string as a pattern will fail to match anything, so by leaving
either the file or directory pattern parameter empty means you can control
whether files or directories are found.
The description is a name to show the user in a list of possible patterns, so
for the wav/aiff example, your description might be "audio files".
*/


+ 1
- 3
src/gui/components/windows/juce_ComponentPeer.cpp View File

@@ -564,9 +564,7 @@ void ComponentPeer::addMaskedRegion (int x, int y, int w, int h)
//==============================================================================
const StringArray ComponentPeer::getAvailableRenderingEngines()
{
StringArray s;
s.add ("Software Renderer");
return s;
return StringArray ("Software Renderer");
}
int ComponentPeer::getCurrentRenderingEngine() const


+ 10
- 10
src/gui/components/windows/juce_ResizableWindow.cpp View File

@@ -204,12 +204,12 @@ void ResizableWindow::resized()
{
if (resizableBorder != nullptr)
{
#if JUCE_WINDOWS || JUCE_LINUX
#if JUCE_WINDOWS || JUCE_LINUX
// hide the resizable border if the OS already provides one..
resizableBorder->setVisible (! (isFullScreen() || isUsingNativeTitleBar()));
#else
#else
resizableBorder->setVisible (! isFullScreen());
#endif
#endif
resizableBorder->setBorderThickness (getBorderThickness());
resizableBorder->setSize (getWidth(), getHeight());
@@ -218,12 +218,12 @@ void ResizableWindow::resized()
if (resizableCorner != nullptr)
{
#if JUCE_MAC
#if JUCE_MAC
// hide the resizable border if the OS already provides one..
resizableCorner->setVisible (! (isFullScreen() || isUsingNativeTitleBar()));
#else
#else
resizableCorner->setVisible (! isFullScreen());
#endif
#endif
const int resizerSize = 18;
resizableCorner->setBounds (getWidth() - resizerSize,
@@ -236,9 +236,9 @@ void ResizableWindow::resized()
updateLastPos();
#if JUCE_DEBUG
#if JUCE_DEBUG
hasBeenResized = true;
#endif
#endif
}
void ResizableWindow::childBoundsChanged (Component* child)
@@ -369,7 +369,7 @@ void ResizableWindow::paint (Graphics& g)
getBorderThickness(), *this);
}
#if JUCE_DEBUG
#if JUCE_DEBUG
/* If this fails, then you've probably written a subclass with a resized()
callback but forgotten to make it call its parent class's resized() method.
@@ -382,7 +382,7 @@ void ResizableWindow::paint (Graphics& g)
layout.
*/
jassert (hasBeenResized || (getWidth() == 0 && getHeight() == 0));
#endif
#endif
}
void ResizableWindow::lookAndFeelChanged()


+ 25
- 98
src/memory/juce_Memory.h View File

@@ -26,104 +26,6 @@
#ifndef __JUCE_MEMORY_JUCEHEADER__
#define __JUCE_MEMORY_JUCEHEADER__
//==============================================================================
/*
This file defines the various juce_malloc(), juce_free() macros that can be used in
preference to the standard calls.
None of this stuff is actually used in the library itself, and will probably be
deprecated at some point in the future, to force everyone to use HeapBlock and other
safer allocation methods.
*/
#if JUCE_MSVC && JUCE_CHECK_MEMORY_LEAKS && ! DOXYGEN
#ifndef JUCE_DLL
//==============================================================================
// Win32 debug non-DLL versions..
#define juce_malloc(numBytes) _malloc_dbg (numBytes, _NORMAL_BLOCK, __FILE__, __LINE__)
#define juce_calloc(numBytes) _calloc_dbg (1, numBytes, _NORMAL_BLOCK, __FILE__, __LINE__)
#define juce_realloc(location, numBytes) _realloc_dbg (location, numBytes, _NORMAL_BLOCK, __FILE__, __LINE__)
#define juce_free(location) _free_dbg (location, _NORMAL_BLOCK)
#else
//==============================================================================
// Win32 debug DLL versions..
// For the DLL, we'll define some functions in the DLL that will be used for allocation - that
// way all juce calls in the DLL and in the host API will all use the same allocator.
extern JUCE_API void* juce_DebugMalloc (int size, const char* file, int line);
extern JUCE_API void* juce_DebugCalloc (int size, const char* file, int line);
extern JUCE_API void* juce_DebugRealloc (void* block, int size, const char* file, int line);
extern JUCE_API void juce_DebugFree (void* block);
#define juce_malloc(numBytes) JUCE_NAMESPACE::juce_DebugMalloc (numBytes, __FILE__, __LINE__)
#define juce_calloc(numBytes) JUCE_NAMESPACE::juce_DebugCalloc (numBytes, __FILE__, __LINE__)
#define juce_realloc(location, numBytes) JUCE_NAMESPACE::juce_DebugRealloc (location, numBytes, __FILE__, __LINE__)
#define juce_free(location) JUCE_NAMESPACE::juce_DebugFree (location)
#define JUCE_LEAK_DETECTOR(OwnerClass) public:\
static void* operator new (size_t sz) { void* const p = juce_malloc ((int) sz); return (p != 0) ? p : ::operator new (sz); } \
static void* operator new (size_t, void* p) { return p; } \
static void operator delete (void* p) { juce_free (p); } \
static void operator delete (void*, void*) {}
#endif
#elif defined (JUCE_DLL) && ! DOXYGEN
//==============================================================================
// Win32 DLL (release) versions..
// For the DLL, we'll define some functions in the DLL that will be used for allocation - that
// way all juce calls in the DLL and in the host API will all use the same allocator.
extern JUCE_API void* juce_Malloc (int size);
extern JUCE_API void* juce_Calloc (int size);
extern JUCE_API void* juce_Realloc (void* block, int size);
extern JUCE_API void juce_Free (void* block);
#define juce_malloc(numBytes) JUCE_NAMESPACE::juce_Malloc (numBytes)
#define juce_calloc(numBytes) JUCE_NAMESPACE::juce_Calloc (numBytes)
#define juce_realloc(location, numBytes) JUCE_NAMESPACE::juce_Realloc (location, numBytes)
#define juce_free(location) JUCE_NAMESPACE::juce_Free (location)
#define JUCE_LEAK_DETECTOR(OwnerClass) public:\
static void* operator new (size_t sz) { void* const p = juce_malloc ((int) sz); return (p != 0) ? p : ::operator new (sz); } \
static void* operator new (size_t, void* p) { return p; } \
static void operator delete (void* p) { juce_free (p); } \
static void operator delete (void*, void*) {}
#else
//==============================================================================
// Mac, Linux and Win32 (release) versions..
/** This can be used instead of calling malloc directly.
Only use direct memory allocation if there's really no way to use a HeapBlock object instead!
*/
#define juce_malloc(numBytes) malloc (numBytes)
/** This can be used instead of calling calloc directly.
Only use direct memory allocation if there's really no way to use a HeapBlock object instead!
*/
#define juce_calloc(numBytes) calloc (1, numBytes)
/** This can be used instead of calling realloc directly.
Only use direct memory allocation if there's really no way to use a HeapBlock object instead!
*/
#define juce_realloc(location, numBytes) realloc (location, numBytes)
/** This can be used instead of calling free directly.
Only use direct memory allocation if there's really no way to use a HeapBlock object instead!
*/
#define juce_free(location) free (location)
#endif
//==============================================================================
/** (Deprecated) This was a win32-specific way of checking for object leaks - now please
use the JUCE_LEAK_DETECTOR instead.
*/
#ifndef juce_UseDebuggingNewOperator
#define juce_UseDebuggingNewOperator
#endif
//==============================================================================
#if JUCE_MSVC || DOXYGEN
/** This is a compiler-independent way of declaring a variable as being thread-local.
@@ -167,5 +69,30 @@ inline void deleteAndZero (Type& pointer) { delete poi
template <typename Type>
inline Type* addBytesToPointer (Type* pointer, int bytes) noexcept { return (Type*) (((char*) pointer) + bytes); }
//==============================================================================
/* In a win32 DLL build, we'll expose some malloc/free functions that live inside the DLL, and use these for
allocating all the objects - that way all juce objects in the DLL and in the host will live in the same heap,
avoiding problems when an object is created in one module and passed across to another where it is deleted.
By piggy-backing on the JUCE_LEAK_DETECTOR macro, these allocators can be injected into most juce classes.
*/
#if JUCE_MSVC && defined (JUCE_DLL) && ! DOXYGEN
extern JUCE_API void* juceDLL_malloc (size_t);
extern JUCE_API void juceDLL_free (void*);
#define JUCE_LEAK_DETECTOR(OwnerClass) public:\
static void* operator new (size_t sz) { return JUCE_NAMESPACE::juceDLL_malloc ((int) sz); } \
static void* operator new (size_t, void* p) { return p; } \
static void operator delete (void* p) { JUCE_NAMESPACE::juceDLL_free (p); } \
static void operator delete (void*, void*) {}
#endif
//==============================================================================
/** (Deprecated) This was a win32-specific way of checking for object leaks - now please
use the JUCE_LEAK_DETECTOR instead.
*/
#ifndef juce_UseDebuggingNewOperator
#define juce_UseDebuggingNewOperator
#endif
#endif // __JUCE_MEMORY_JUCEHEADER__

+ 0
- 4
src/native/windows/juce_win32_Messaging.cpp View File

@@ -41,10 +41,6 @@ HWND juce_messageWindowHandle = 0;
extern long improbableWindowNumber; // defined in windowing.cpp
#ifndef WM_APPCOMMAND
#define WM_APPCOMMAND 0x0319
#endif
//==============================================================================
static LRESULT CALLBACK juce_MessageWndProc (HWND h,


+ 4
- 0
src/native/windows/juce_win32_NativeIncludes.h View File

@@ -185,6 +185,10 @@
#include <dwrite.h>
#endif
#ifndef WM_APPCOMMAND
#define WM_APPCOMMAND 0x0319
#endif
//==============================================================================
/** A simple COM smart pointer.
Avoids having to include ATL just to get one of these.


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save