Browse Source

Introjucer: code editor popup menu helper function to insert a new class declaration.

tags/2021-05-28
jules 12 years ago
parent
commit
97ed2ac915
16 changed files with 186 additions and 14 deletions
  1. +4
    -0
      extras/Introjucer/Builds/CodeBlocks/The Introjucer.cbp
  2. +6
    -4
      extras/Introjucer/Builds/MacOSX/The Introjucer.xcodeproj/project.pbxproj
  3. +10
    -0
      extras/Introjucer/Builds/VisualStudio2005/The Introjucer.vcproj
  4. +10
    -0
      extras/Introjucer/Builds/VisualStudio2008/The Introjucer.vcproj
  5. +1
    -0
      extras/Introjucer/Builds/VisualStudio2010/The Introjucer.vcxproj
  6. +3
    -0
      extras/Introjucer/Builds/VisualStudio2010/The Introjucer.vcxproj.filters
  7. +1
    -0
      extras/Introjucer/Builds/VisualStudio2012/The Introjucer.vcxproj
  8. +3
    -0
      extras/Introjucer/Builds/VisualStudio2012/The Introjucer.vcxproj.filters
  9. +2
    -0
      extras/Introjucer/Introjucer.jucer
  10. +46
    -0
      extras/Introjucer/JuceLibraryCode/BinaryData.cpp
  11. +3
    -0
      extras/Introjucer/JuceLibraryCode/BinaryData.h
  12. +3
    -8
      extras/Introjucer/Source/Application/jucer_OpenDocumentManager.cpp
  13. +40
    -0
      extras/Introjucer/Source/BinaryData/jucer_InlineComponentTemplate.h
  14. +48
    -1
      extras/Introjucer/Source/Code Editor/jucer_SourceCodeEditor.cpp
  15. +5
    -0
      extras/Introjucer/Source/Code Editor/jucer_SourceCodeEditor.h
  16. +1
    -1
      modules/juce_core/memory/juce_ReferenceCountedObject.h

+ 4
- 0
extras/Introjucer/Builds/CodeBlocks/The Introjucer.cbp View File

@@ -605,6 +605,10 @@
<Option compile="0"/>
<Option link="0"/>
</Unit>
<Unit filename="../../Source/BinaryData/jucer_InlineComponentTemplate.h">
<Option compile="0"/>
<Option link="0"/>
</Unit>
<Unit filename="../../Source/BinaryData/jucer_MainConsoleAppTemplate.cpp">
<Option compile="0"/>
<Option link="0"/>


+ 6
- 4
extras/Introjucer/Builds/MacOSX/The Introjucer.xcodeproj/project.pbxproj View File

@@ -197,6 +197,7 @@
240BCAD873E4360E54CA2A81 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_linux_SystemStats.cpp"; path = "../../../../modules/juce_core/native/juce_linux_SystemStats.cpp"; sourceTree = "SOURCE_ROOT"; };
2411094E8B601FD897AD24F9 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_PropertySet.h"; path = "../../../../modules/juce_core/containers/juce_PropertySet.h"; sourceTree = "SOURCE_ROOT"; };
2416644BBABFD1F95EE12792 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_MemoryBlock.cpp"; path = "../../../../modules/juce_core/memory/juce_MemoryBlock.cpp"; sourceTree = "SOURCE_ROOT"; };
24C34D0578AE6C7A3EA18781 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "jucer_InlineComponentTemplate.h"; path = "../../Source/BinaryData/jucer_InlineComponentTemplate.h"; sourceTree = "SOURCE_ROOT"; };
24CA69C0CC466CD524021099 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_HashMap.h"; path = "../../../../modules/juce_core/containers/juce_HashMap.h"; sourceTree = "SOURCE_ROOT"; };
24CB53290AE7A023C1BDD0DC = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_InterProcessLock.h"; path = "../../../../modules/juce_core/threads/juce_InterProcessLock.h"; sourceTree = "SOURCE_ROOT"; };
25D76CD621FC2A211CF7BB52 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_ChildProcess.h"; path = "../../../../modules/juce_core/threads/juce_ChildProcess.h"; sourceTree = "SOURCE_ROOT"; };
@@ -717,6 +718,8 @@
CDCAF0EC777DA2884AEB2B59 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_Label.cpp"; path = "../../../../modules/juce_gui_basics/widgets/juce_Label.cpp"; sourceTree = "SOURCE_ROOT"; };
CDDF5BDC75277F7B83A38885 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_PropertySet.cpp"; path = "../../../../modules/juce_core/containers/juce_PropertySet.cpp"; sourceTree = "SOURCE_ROOT"; };
CDF8F65F9079B2C14A740F0F = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_ImageButton.h"; path = "../../../../modules/juce_gui_basics/buttons/juce_ImageButton.h"; sourceTree = "SOURCE_ROOT"; };
CE1DFE4E3908943656E180AD = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_UnitTest.cpp"; path = "../../../../modules/juce_core/unit_tests/juce_UnitTest.cpp"; sourceTree = "SOURCE_ROOT"; };
CF0615A1AF1A514A60322B50 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_MouseCursor.h"; path = "../../../../modules/juce_gui_basics/mouse/juce_MouseCursor.h"; sourceTree = "SOURCE_ROOT"; };
CF21D9DB3AEC0A4DCAB36A99 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "jucer_Icons.cpp"; path = "../../Source/Utility/jucer_Icons.cpp"; sourceTree = "SOURCE_ROOT"; };
CF6C8BD0DA3D8CD4E99EBADA = { isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
CF8011B3C67B609032974DA5 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "jucer_NewCppFileTemplate.cpp"; path = "../../Source/BinaryData/jucer_NewCppFileTemplate.cpp"; sourceTree = "SOURCE_ROOT"; };
@@ -738,13 +741,13 @@
D5057D7B18ABD5E810A6F830 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_win32_DirectWriteTypeface.cpp"; path = "../../../../modules/juce_graphics/native/juce_win32_DirectWriteTypeface.cpp"; sourceTree = "SOURCE_ROOT"; };
D526C38D581425949BA0E4AC = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "jucer_FilePreviewComponent.h"; path = "../../Source/Application/jucer_FilePreviewComponent.h"; sourceTree = "SOURCE_ROOT"; };
D53B54D1786A1FFC024BF064 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_cryptography.mm"; path = "../../../../modules/juce_cryptography/juce_cryptography.mm"; sourceTree = "SOURCE_ROOT"; };
D5A6D00DEFDC650AF432A698 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_Initialisation.h"; path = "../../../../modules/juce_gui_basics/application/juce_Initialisation.h"; sourceTree = "SOURCE_ROOT"; };
D678882D133090214AF681BC = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_ThreadLocalValue.h"; path = "../../../../modules/juce_core/threads/juce_ThreadLocalValue.h"; sourceTree = "SOURCE_ROOT"; };
D6C91E2BF537F75A80F5C1DB = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_ListBox.h"; path = "../../../../modules/juce_gui_basics/widgets/juce_ListBox.h"; sourceTree = "SOURCE_ROOT"; };
D75EAC16FAECCC51E3669193 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_ApplicationCommandInfo.h"; path = "../../../../modules/juce_gui_basics/commands/juce_ApplicationCommandInfo.h"; sourceTree = "SOURCE_ROOT"; };
D782DA091AD3ECE158FC6A5F = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_ButtonPropertyComponent.h"; path = "../../../../modules/juce_gui_basics/properties/juce_ButtonPropertyComponent.h"; sourceTree = "SOURCE_ROOT"; };
D87FC8F6834E9DC9C8E88B94 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "jucer_JustificationProperty.h"; path = "../../Source/ComponentEditor/properties/jucer_JustificationProperty.h"; sourceTree = "SOURCE_ROOT"; };
D92A6E9404A30EED32DCE4ED = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "jucer_RelativePositionedRectangle.h"; path = "../../Source/ComponentEditor/ui/jucer_RelativePositionedRectangle.h"; sourceTree = "SOURCE_ROOT"; };
D95D7B49EC6C6BDCB5A1B988 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_ios_MessageManager.mm"; path = "../../../../modules/juce_events/native/juce_ios_MessageManager.mm"; sourceTree = "SOURCE_ROOT"; };
DA345D5B9DABD049F90DC96F = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "jucer_GeneratedCode.h"; path = "../../Source/ComponentEditor/jucer_GeneratedCode.h"; sourceTree = "SOURCE_ROOT"; };
DAF84A553D264705FA6EB6FF = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "jucer_TreeViewHandler.h"; path = "../../Source/ComponentEditor/components/jucer_TreeViewHandler.h"; sourceTree = "SOURCE_ROOT"; };
DB20268A566DABEAE3F2CBEE = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_RectanglePlacement.cpp"; path = "../../../../modules/juce_graphics/placement/juce_RectanglePlacement.cpp"; sourceTree = "SOURCE_ROOT"; };
@@ -767,16 +770,14 @@
E7F7033084AC10FB77B0F77A = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "jucer_ConfigPage.cpp"; path = "../../Source/Project/jucer_ConfigPage.cpp"; sourceTree = "SOURCE_ROOT"; };
E96597BBC6A98255B51B94DC = { isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
25F52316D256B4534BED16D1 = { isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Introjucer.app; sourceTree = "BUILT_PRODUCTS_DIR"; };
CE1DFE4E3908943656E180AD = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_UnitTest.cpp"; path = "../../../../modules/juce_core/unit_tests/juce_UnitTest.cpp"; sourceTree = "SOURCE_ROOT"; };
CF0615A1AF1A514A60322B50 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_MouseCursor.h"; path = "../../../../modules/juce_gui_basics/mouse/juce_MouseCursor.h"; sourceTree = "SOURCE_ROOT"; };
D253F74B7F5734984E568CA7 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_linux_Files.cpp"; path = "../../../../modules/juce_core/native/juce_linux_Files.cpp"; sourceTree = "SOURCE_ROOT"; };
D376B9B54EC944E766AFEC45 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_PopupMenu.cpp"; path = "../../../../modules/juce_gui_basics/menus/juce_PopupMenu.cpp"; sourceTree = "SOURCE_ROOT"; };
D5A6D00DEFDC650AF432A698 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_Initialisation.h"; path = "../../../../modules/juce_gui_basics/application/juce_Initialisation.h"; sourceTree = "SOURCE_ROOT"; };
D780ED33573AED5AD383A036 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_CaretComponent.h"; path = "../../../../modules/juce_gui_basics/keyboard/juce_CaretComponent.h"; sourceTree = "SOURCE_ROOT"; };
D7A7F1AA9F313B0CCAAA73A0 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_MathsFunctions.h"; path = "../../../../modules/juce_core/maths/juce_MathsFunctions.h"; sourceTree = "SOURCE_ROOT"; };
D800DE818BEDBF4579D15B1D = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_mac_AppleRemote.mm"; path = "../../../../modules/juce_gui_extra/native/juce_mac_AppleRemote.mm"; sourceTree = "SOURCE_ROOT"; };
D926E13AB5AD647A7A00F486 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_linux_Network.cpp"; path = "../../../../modules/juce_core/native/juce_linux_Network.cpp"; sourceTree = "SOURCE_ROOT"; };
D9342535EA61901A1AD816C6 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_linux_WebBrowserComponent.cpp"; path = "../../../../modules/juce_gui_extra/native/juce_linux_WebBrowserComponent.cpp"; sourceTree = "SOURCE_ROOT"; };
D95D7B49EC6C6BDCB5A1B988 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_ios_MessageManager.mm"; path = "../../../../modules/juce_events/native/juce_ios_MessageManager.mm"; sourceTree = "SOURCE_ROOT"; };
D9B077E2ECDDA94961E134D7 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_StringPairArray.h"; path = "../../../../modules/juce_core/text/juce_StringPairArray.h"; sourceTree = "SOURCE_ROOT"; };
D9E59DE07A815AB303A297D9 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_data_structures.mm"; path = "../../../../modules/juce_data_structures/juce_data_structures.mm"; sourceTree = "SOURCE_ROOT"; };
DB876F7873F42DC685A58CA7 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_JPEGLoader.cpp"; path = "../../../../modules/juce_graphics/image_formats/juce_JPEGLoader.cpp"; sourceTree = "SOURCE_ROOT"; };
@@ -1056,6 +1057,7 @@
963E0740B7B4D59EF2D16740,
9683B04CA3BD7F73E8236FE2,
35E6EE1E98DD7050DDFECD9B,
24C34D0578AE6C7A3EA18781,
18D9EBA1DAE45EEF81FD5C8F,
AE1BC6DCCFC1A18E2ACE23F1,
86E8A40E5A83781A8478454D,


+ 10
- 0
extras/Introjucer/Builds/VisualStudio2005/The Introjucer.vcproj View File

@@ -422,6 +422,16 @@
<Tool Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File RelativePath="..\..\Source\BinaryData\jucer_InlineComponentTemplate.h">
<FileConfiguration Name="Debug|Win32"
ExcludedFromBuild="true">
<Tool Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration Name="Release|Win32"
ExcludedFromBuild="true">
<Tool Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File RelativePath="..\..\Source\BinaryData\jucer_MainConsoleAppTemplate.cpp">
<FileConfiguration Name="Debug|Win32"
ExcludedFromBuild="true">


+ 10
- 0
extras/Introjucer/Builds/VisualStudio2008/The Introjucer.vcproj View File

@@ -422,6 +422,16 @@
<Tool Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File RelativePath="..\..\Source\BinaryData\jucer_InlineComponentTemplate.h">
<FileConfiguration Name="Debug|Win32"
ExcludedFromBuild="true">
<Tool Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration Name="Release|Win32"
ExcludedFromBuild="true">
<Tool Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File RelativePath="..\..\Source\BinaryData\jucer_MainConsoleAppTemplate.cpp">
<FileConfiguration Name="Debug|Win32"
ExcludedFromBuild="true">


+ 1
- 0
extras/Introjucer/Builds/VisualStudio2010/The Introjucer.vcxproj View File

@@ -1117,6 +1117,7 @@
<ClInclude Include="..\..\Source\BinaryData\jucer_AudioPluginFilterTemplate.h"/>
<ClInclude Include="..\..\Source\BinaryData\jucer_ComponentTemplate.h"/>
<ClInclude Include="..\..\Source\BinaryData\jucer_ContentCompTemplate.h"/>
<ClInclude Include="..\..\Source\BinaryData\jucer_InlineComponentTemplate.h"/>
<ClInclude Include="..\..\Source\BinaryData\jucer_NewComponentTemplate.h"/>
<ClInclude Include="..\..\Source\BinaryData\jucer_NewCppFileTemplate.h"/>
<ClInclude Include="..\..\Source\BinaryData\jucer_NewInlineComponentTemplate.h"/>


+ 3
- 0
extras/Introjucer/Builds/VisualStudio2010/The Introjucer.vcxproj.filters View File

@@ -1623,6 +1623,9 @@
<ClInclude Include="..\..\Source\BinaryData\jucer_ContentCompTemplate.h">
<Filter>The Introjucer\BinaryData</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\BinaryData\jucer_InlineComponentTemplate.h">
<Filter>The Introjucer\BinaryData</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\BinaryData\jucer_NewComponentTemplate.h">
<Filter>The Introjucer\BinaryData</Filter>
</ClInclude>


+ 1
- 0
extras/Introjucer/Builds/VisualStudio2012/The Introjucer.vcxproj View File

@@ -1123,6 +1123,7 @@
<ClInclude Include="..\..\Source\BinaryData\jucer_AudioPluginFilterTemplate.h"/>
<ClInclude Include="..\..\Source\BinaryData\jucer_ComponentTemplate.h"/>
<ClInclude Include="..\..\Source\BinaryData\jucer_ContentCompTemplate.h"/>
<ClInclude Include="..\..\Source\BinaryData\jucer_InlineComponentTemplate.h"/>
<ClInclude Include="..\..\Source\BinaryData\jucer_NewComponentTemplate.h"/>
<ClInclude Include="..\..\Source\BinaryData\jucer_NewCppFileTemplate.h"/>
<ClInclude Include="..\..\Source\BinaryData\jucer_NewInlineComponentTemplate.h"/>


+ 3
- 0
extras/Introjucer/Builds/VisualStudio2012/The Introjucer.vcxproj.filters View File

@@ -1623,6 +1623,9 @@
<ClInclude Include="..\..\Source\BinaryData\jucer_ContentCompTemplate.h">
<Filter>The Introjucer\BinaryData</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\BinaryData\jucer_InlineComponentTemplate.h">
<Filter>The Introjucer\BinaryData</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\BinaryData\jucer_NewComponentTemplate.h">
<Filter>The Introjucer\BinaryData</Filter>
</ClInclude>


+ 2
- 0
extras/Introjucer/Introjucer.jucer View File

@@ -424,6 +424,8 @@
resource="1" file="Source/BinaryData/jucer_ContentCompTemplate.cpp"/>
<FILE id="gFj8Jl" name="jucer_ContentCompTemplate.h" compile="0" resource="1"
file="Source/BinaryData/jucer_ContentCompTemplate.h"/>
<FILE id="BnCgp2" name="jucer_InlineComponentTemplate.h" compile="0"
resource="1" file="Source/BinaryData/jucer_InlineComponentTemplate.h"/>
<FILE id="pizYtv9" name="jucer_MainConsoleAppTemplate.cpp" compile="0"
resource="1" file="Source/BinaryData/jucer_MainConsoleAppTemplate.cpp"/>
<FILE id="tZCXSl" name="jucer_MainTemplate_NoWindow.cpp" compile="0"


+ 46
- 0
extras/Introjucer/JuceLibraryCode/BinaryData.cpp View File

@@ -727,6 +727,51 @@ static const unsigned char temp_4a30078b[] =
const char* jucer_ContentCompTemplate_h = (const char*) temp_4a30078b;
//================== jucer_InlineComponentTemplate.h ==================
static const unsigned char temp_cd7c7047[] =
"//==============================================================================\r\n"
"class COMPONENTCLASS : public Component\r\n"
"{\r\n"
"public:\r\n"
" COMPONENTCLASS()\r\n"
" {\r\n"
" // In your constructor, you should add any child components, and\r\n"
" // initialise any special settings that your component needs.\r\n"
"\r\n"
" }\r\n"
"\r\n"
" ~COMPONENTCLASS()\r\n"
" {\r\n"
" }\r\n"
"\r\n"
" void paint (Graphics& g)\r\n"
" {\r\n"
" // You should replace everything in this method with your own drawing code..\r\n"
"\r\n"
" g.fillAll (Colours::white); // clear the background\r\n"
"\r\n"
" g.setColour (Colours::grey);\r\n"
" g.drawRect (getLocalBounds(), 1); // draw an outline around the component\r\n"
"\r\n"
" g.setColour (Colours::lightblue);\r\n"
" g.setFont (14.0f);\r\n"
" g.drawText (\"COMPONENTCLASS\", getLocalBounds(),\r\n"
" Justification::centred, true); // draw some placeholder text\r\n"
" }\r\n"
"\r\n"
" void resized()\r\n"
" {\r\n"
" // This method is where you should set the bounds of any child\r\n"
" // components that your component contains..\r\n"
"\r\n"
" }\r\n"
"\r\n"
"private:\r\n"
" JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (COMPONENTCLASS)\r\n"
"};\r\n";
const char* jucer_InlineComponentTemplate_h = (const char*) temp_cd7c7047;
//================== jucer_MainConsoleAppTemplate.cpp ==================
static const unsigned char temp_794304c3[] =
"/*\r\n"
@@ -1182,6 +1227,7 @@ const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) throw
case 0xfc72fe86: numBytes = 2156; return jucer_ComponentTemplate_h;
case 0x0b66646c: numBytes = 886; return jucer_ContentCompTemplate_cpp;
case 0x6fa10171: numBytes = 924; return jucer_ContentCompTemplate_h;
case 0x28d496ad: numBytes = 1143; return jucer_InlineComponentTemplate_h;
case 0x8905395b: numBytes = 470; return jucer_MainConsoleAppTemplate_cpp;
case 0x5e5ea047: numBytes = 1947; return jucer_MainTemplate_NoWindow_cpp;
case 0x400bc026: numBytes = 3613; return jucer_MainTemplate_Window_cpp;


+ 3
- 0
extras/Introjucer/JuceLibraryCode/BinaryData.h View File

@@ -42,6 +42,9 @@ namespace BinaryData
extern const char* jucer_ContentCompTemplate_h;
const int jucer_ContentCompTemplate_hSize = 924;
extern const char* jucer_InlineComponentTemplate_h;
const int jucer_InlineComponentTemplate_hSize = 1143;
extern const char* jucer_MainConsoleAppTemplate_cpp;
const int jucer_MainConsoleAppTemplate_cppSize = 470;


+ 3
- 8
extras/Introjucer/Source/Application/jucer_OpenDocumentManager.cpp View File

@@ -177,17 +177,12 @@ FileBasedDocument::SaveResult OpenDocumentManager::saveIfNeededAndUserAgrees (Op
TRANS("discard changes"),
TRANS("cancel"));
if (r == 1)
{
// save changes
if (r == 1) // save changes
return doc->save() ? FileBasedDocument::savedOk
: FileBasedDocument::failedToWriteToFile;
}
else if (r == 2)
{
// discard changes
if (r == 2) // discard changes
return FileBasedDocument::savedOk;
}
return FileBasedDocument::userCancelledSave;
}


+ 40
- 0
extras/Introjucer/Source/BinaryData/jucer_InlineComponentTemplate.h View File

@@ -0,0 +1,40 @@
//==============================================================================
class COMPONENTCLASS : public Component
{
public:
COMPONENTCLASS()
{
// In your constructor, you should add any child components, and
// initialise any special settings that your component needs.
}
~COMPONENTCLASS()
{
}
void paint (Graphics& g)
{
// You should replace everything in this method with your own drawing code..
g.fillAll (Colours::white); // clear the background
g.setColour (Colours::grey);
g.drawRect (getLocalBounds(), 1); // draw an outline around the component
g.setColour (Colours::lightblue);
g.setFont (14.0f);
g.drawText ("COMPONENTCLASS", getLocalBounds(),
Justification::centred, true); // draw some placeholder text
}
void resized()
{
// This method is where you should set the bounds of any child
// components that your component contains..
}
private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (COMPONENTCLASS)
};

+ 48
- 1
extras/Introjucer/Source/Code Editor/jucer_SourceCodeEditor.cpp View File

@@ -211,7 +211,11 @@ GenericCodeEditorComponent::GenericCodeEditorComponent (const File& f, CodeDocum
GenericCodeEditorComponent::~GenericCodeEditorComponent() {}
enum { showInFinderID = 0x2fe821e3 };
enum
{
showInFinderID = 0x2fe821e3,
insertComponentID = 0x2fe821e4
};
void GenericCodeEditorComponent::addPopupMenuItems (PopupMenu& menu, const MouseEvent* e)
{
@@ -569,3 +573,46 @@ void CppCodeEditorComponent::insertTextAtCaret (const String& newText)
GenericCodeEditorComponent::insertTextAtCaret (newText);
}
void CppCodeEditorComponent::addPopupMenuItems (PopupMenu& menu, const MouseEvent* e)
{
GenericCodeEditorComponent::addPopupMenuItems (menu, e);
menu.addSeparator();
menu.addItem (insertComponentID, TRANS("Insert code for a new Component class..."));
}
void CppCodeEditorComponent::performPopupMenuAction (int menuItemID)
{
if (menuItemID == insertComponentID)
insertComponentClass();
GenericCodeEditorComponent::performPopupMenuAction (menuItemID);
}
void CppCodeEditorComponent::insertComponentClass()
{
AlertWindow aw (TRANS ("Insert a new Component class"),
TRANS ("Please enter a name for the new class"),
AlertWindow::NoIcon, nullptr);
const char* classNameField = "Class Name";
aw.addTextEditor (classNameField, String::empty, String::empty, false);
aw.addButton (TRANS ("Insert Code"), 1, KeyPress (KeyPress::returnKey));
aw.addButton (TRANS ("Cancel"), 0, KeyPress (KeyPress::escapeKey));
while (aw.runModalLoop() != 0)
{
const String className (aw.getTextEditorContents (classNameField).trim());
if (className == CodeHelpers::makeValidIdentifier (className, false, true, false))
{
String code (BinaryData::jucer_InlineComponentTemplate_h);
code = code.replace ("COMPONENTCLASS", className);
insertTextAtCaret (code);
break;
}
}
}

+ 5
- 0
extras/Introjucer/Source/Code Editor/jucer_SourceCodeEditor.h View File

@@ -213,10 +213,15 @@ public:
CppCodeEditorComponent (const File& file, CodeDocument& codeDocument);
~CppCodeEditorComponent();
void addPopupMenuItems (PopupMenu&, const MouseEvent*);
void performPopupMenuAction (int menuItemID);
void handleReturnKey();
void insertTextAtCaret (const String& newText);
private:
void insertComponentClass();
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (CppCodeEditorComponent)
};


+ 1
- 1
modules/juce_core/memory/juce_ReferenceCountedObject.h View File

@@ -125,7 +125,7 @@ private:
/**
Adds reference-counting to an object.
This is efectively a version of the ReferenceCountedObject class, but which
This is effectively a version of the ReferenceCountedObject class, but which
uses a non-atomic counter, and so is not thread-safe (but which will be more
efficient).
For more details on how to use it, see the ReferenceCountedObject class notes.


Loading…
Cancel
Save