mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
New class: ResizableEdgeComponent.
This commit is contained in:
parent
bd19111417
commit
2a86002b31
29 changed files with 596 additions and 49 deletions
|
|
@ -177,6 +177,7 @@ OBJECTS := \
|
|||
$(OBJDIR)/juce_MultiDocumentPanel_50e05aac.o \
|
||||
$(OBJDIR)/juce_ResizableBorderComponent_7f4f2182.o \
|
||||
$(OBJDIR)/juce_ResizableCornerComponent_1cac2df9.o \
|
||||
$(OBJDIR)/juce_ResizableEdgeComponent_b9c9291.o \
|
||||
$(OBJDIR)/juce_ScrollBar_89666ad4.o \
|
||||
$(OBJDIR)/juce_StretchableLayoutManager_6bf5d800.o \
|
||||
$(OBJDIR)/juce_StretchableLayoutResizerBar_a720084c.o \
|
||||
|
|
@ -1071,6 +1072,11 @@ $(OBJDIR)/juce_ResizableCornerComponent_1cac2df9.o: ../../src/gui/components/lay
|
|||
@echo "Compiling juce_ResizableCornerComponent.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/juce_ResizableEdgeComponent_b9c9291.o: ../../src/gui/components/layout/juce_ResizableEdgeComponent.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling juce_ResizableEdgeComponent.cpp"
|
||||
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
|
||||
|
||||
$(OBJDIR)/juce_ScrollBar_89666ad4.o: ../../src/gui/components/layout/juce_ScrollBar.cpp
|
||||
-@mkdir -p $(OBJDIR)
|
||||
@echo "Compiling juce_ScrollBar.cpp"
|
||||
|
|
|
|||
|
|
@ -146,6 +146,7 @@
|
|||
F5F3F25D9F377128DC74D95B = { isa = PBXBuildFile; fileRef = FF046140CCF1EDB0DFF80178; };
|
||||
C64A2BF05224582134872415 = { isa = PBXBuildFile; fileRef = A95F42C5CB0C2E5052B31568; };
|
||||
0A9C9486A6B31F21B1472D2B = { isa = PBXBuildFile; fileRef = A31221E2A50CCE9DF06B5F4B; };
|
||||
ED9F9A6CB4F8BB7FEA5384B7 = { isa = PBXBuildFile; fileRef = 3D8B0E86C98E2EE49AE868C8; };
|
||||
DE0BAD16BD5A6568EB4D228B = { isa = PBXBuildFile; fileRef = B116FEC4D544DB8E38CB571E; };
|
||||
AF6FEC311B9FDA112CEEBE03 = { isa = PBXBuildFile; fileRef = F1F65C9E7394E04E073A57A4; };
|
||||
3795ECCE9D98F872F5BCAE64 = { isa = PBXBuildFile; fileRef = 993C90B10202DA78FA31CC58; };
|
||||
|
|
@ -691,6 +692,8 @@
|
|||
600B2FDBBBE812784CB49A69 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_ResizableBorderComponent.h; path = ../../src/gui/components/layout/juce_ResizableBorderComponent.h; sourceTree = SOURCE_ROOT; };
|
||||
A31221E2A50CCE9DF06B5F4B = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_ResizableCornerComponent.cpp; path = ../../src/gui/components/layout/juce_ResizableCornerComponent.cpp; sourceTree = SOURCE_ROOT; };
|
||||
CB54AC3D311C44A1F3B463A5 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_ResizableCornerComponent.h; path = ../../src/gui/components/layout/juce_ResizableCornerComponent.h; sourceTree = SOURCE_ROOT; };
|
||||
3D8B0E86C98E2EE49AE868C8 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_ResizableEdgeComponent.cpp; path = ../../src/gui/components/layout/juce_ResizableEdgeComponent.cpp; sourceTree = SOURCE_ROOT; };
|
||||
238965266F88730956D776DB = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_ResizableEdgeComponent.h; path = ../../src/gui/components/layout/juce_ResizableEdgeComponent.h; sourceTree = SOURCE_ROOT; };
|
||||
B116FEC4D544DB8E38CB571E = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_ScrollBar.cpp; path = ../../src/gui/components/layout/juce_ScrollBar.cpp; sourceTree = SOURCE_ROOT; };
|
||||
797C94BB7F42CBBAACCFFB87 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_ScrollBar.h; path = ../../src/gui/components/layout/juce_ScrollBar.h; sourceTree = SOURCE_ROOT; };
|
||||
F1F65C9E7394E04E073A57A4 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_StretchableLayoutManager.cpp; path = ../../src/gui/components/layout/juce_StretchableLayoutManager.cpp; sourceTree = SOURCE_ROOT; };
|
||||
|
|
@ -933,6 +936,7 @@
|
|||
341631A7E86BF1C0E49093C6 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_Memory.h; path = ../../src/memory/juce_Memory.h; sourceTree = SOURCE_ROOT; };
|
||||
AD655AA04981173716022D8D = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_MemoryBlock.cpp; path = ../../src/memory/juce_MemoryBlock.cpp; sourceTree = SOURCE_ROOT; };
|
||||
F1D085B5F12E814BF1D5C395 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_MemoryBlock.h; path = ../../src/memory/juce_MemoryBlock.h; sourceTree = SOURCE_ROOT; };
|
||||
58654C2630387C4A336A5BFB = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_OptionalScopedPointer.h; path = ../../src/memory/juce_OptionalScopedPointer.h; sourceTree = SOURCE_ROOT; };
|
||||
524A70C9F23954F8F2A3F99B = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_ReferenceCountedObject.h; path = ../../src/memory/juce_ReferenceCountedObject.h; sourceTree = SOURCE_ROOT; };
|
||||
E05812E3CC31875A202D6B30 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_ScopedPointer.h; path = ../../src/memory/juce_ScopedPointer.h; sourceTree = SOURCE_ROOT; };
|
||||
224C989BF83B6EA867814BFF = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_WeakReference.h; path = ../../src/memory/juce_WeakReference.h; sourceTree = SOURCE_ROOT; };
|
||||
|
|
@ -1448,6 +1452,8 @@
|
|||
600B2FDBBBE812784CB49A69,
|
||||
A31221E2A50CCE9DF06B5F4B,
|
||||
CB54AC3D311C44A1F3B463A5,
|
||||
3D8B0E86C98E2EE49AE868C8,
|
||||
238965266F88730956D776DB,
|
||||
B116FEC4D544DB8E38CB571E,
|
||||
797C94BB7F42CBBAACCFFB87,
|
||||
F1F65C9E7394E04E073A57A4,
|
||||
|
|
@ -1748,6 +1754,7 @@
|
|||
341631A7E86BF1C0E49093C6,
|
||||
AD655AA04981173716022D8D,
|
||||
F1D085B5F12E814BF1D5C395,
|
||||
58654C2630387C4A336A5BFB,
|
||||
524A70C9F23954F8F2A3F99B,
|
||||
E05812E3CC31875A202D6B30,
|
||||
224C989BF83B6EA867814BFF ); name = memory; sourceTree = "<group>"; };
|
||||
|
|
@ -2156,6 +2163,7 @@
|
|||
F5F3F25D9F377128DC74D95B,
|
||||
C64A2BF05224582134872415,
|
||||
0A9C9486A6B31F21B1472D2B,
|
||||
ED9F9A6CB4F8BB7FEA5384B7,
|
||||
DE0BAD16BD5A6568EB4D228B,
|
||||
AF6FEC311B9FDA112CEEBE03,
|
||||
3795ECCE9D98F872F5BCAE64,
|
||||
|
|
|
|||
|
|
@ -555,6 +555,8 @@
|
|||
<File RelativePath="..\..\src\gui\components\layout\juce_ResizableBorderComponent.h"/>
|
||||
<File RelativePath="..\..\src\gui\components\layout\juce_ResizableCornerComponent.cpp"/>
|
||||
<File RelativePath="..\..\src\gui\components\layout\juce_ResizableCornerComponent.h"/>
|
||||
<File RelativePath="..\..\src\gui\components\layout\juce_ResizableEdgeComponent.cpp"/>
|
||||
<File RelativePath="..\..\src\gui\components\layout\juce_ResizableEdgeComponent.h"/>
|
||||
<File RelativePath="..\..\src\gui\components\layout\juce_ScrollBar.cpp"/>
|
||||
<File RelativePath="..\..\src\gui\components\layout\juce_ScrollBar.h"/>
|
||||
<File RelativePath="..\..\src\gui\components\layout\juce_StretchableLayoutManager.cpp"/>
|
||||
|
|
|
|||
|
|
@ -555,6 +555,8 @@
|
|||
<File RelativePath="..\..\src\gui\components\layout\juce_ResizableBorderComponent.h"/>
|
||||
<File RelativePath="..\..\src\gui\components\layout\juce_ResizableCornerComponent.cpp"/>
|
||||
<File RelativePath="..\..\src\gui\components\layout\juce_ResizableCornerComponent.h"/>
|
||||
<File RelativePath="..\..\src\gui\components\layout\juce_ResizableEdgeComponent.cpp"/>
|
||||
<File RelativePath="..\..\src\gui\components\layout\juce_ResizableEdgeComponent.h"/>
|
||||
<File RelativePath="..\..\src\gui\components\layout\juce_ScrollBar.cpp"/>
|
||||
<File RelativePath="..\..\src\gui\components\layout\juce_ScrollBar.h"/>
|
||||
<File RelativePath="..\..\src\gui\components\layout\juce_StretchableLayoutManager.cpp"/>
|
||||
|
|
|
|||
|
|
@ -557,6 +557,8 @@
|
|||
<File RelativePath="..\..\src\gui\components\layout\juce_ResizableBorderComponent.h"/>
|
||||
<File RelativePath="..\..\src\gui\components\layout\juce_ResizableCornerComponent.cpp"/>
|
||||
<File RelativePath="..\..\src\gui\components\layout\juce_ResizableCornerComponent.h"/>
|
||||
<File RelativePath="..\..\src\gui\components\layout\juce_ResizableEdgeComponent.cpp"/>
|
||||
<File RelativePath="..\..\src\gui\components\layout\juce_ResizableEdgeComponent.h"/>
|
||||
<File RelativePath="..\..\src\gui\components\layout\juce_ScrollBar.cpp"/>
|
||||
<File RelativePath="..\..\src\gui\components\layout\juce_ScrollBar.h"/>
|
||||
<File RelativePath="..\..\src\gui\components\layout\juce_StretchableLayoutManager.cpp"/>
|
||||
|
|
|
|||
|
|
@ -260,6 +260,7 @@
|
|||
<ClCompile Include="..\..\src\gui\components\layout\juce_MultiDocumentPanel.cpp"/>
|
||||
<ClCompile Include="..\..\src\gui\components\layout\juce_ResizableBorderComponent.cpp"/>
|
||||
<ClCompile Include="..\..\src\gui\components\layout\juce_ResizableCornerComponent.cpp"/>
|
||||
<ClCompile Include="..\..\src\gui\components\layout\juce_ResizableEdgeComponent.cpp"/>
|
||||
<ClCompile Include="..\..\src\gui\components\layout\juce_ScrollBar.cpp"/>
|
||||
<ClCompile Include="..\..\src\gui\components\layout\juce_StretchableLayoutManager.cpp"/>
|
||||
<ClCompile Include="..\..\src\gui\components\layout\juce_StretchableLayoutResizerBar.cpp"/>
|
||||
|
|
@ -629,6 +630,7 @@
|
|||
<ClInclude Include="..\..\src\gui\components\layout\juce_MultiDocumentPanel.h"/>
|
||||
<ClInclude Include="..\..\src\gui\components\layout\juce_ResizableBorderComponent.h"/>
|
||||
<ClInclude Include="..\..\src\gui\components\layout\juce_ResizableCornerComponent.h"/>
|
||||
<ClInclude Include="..\..\src\gui\components\layout\juce_ResizableEdgeComponent.h"/>
|
||||
<ClInclude Include="..\..\src\gui\components\layout\juce_ScrollBar.h"/>
|
||||
<ClInclude Include="..\..\src\gui\components\layout\juce_StretchableLayoutManager.h"/>
|
||||
<ClInclude Include="..\..\src\gui\components\layout\juce_StretchableLayoutResizerBar.h"/>
|
||||
|
|
|
|||
|
|
@ -640,6 +640,9 @@
|
|||
<ClCompile Include="..\..\src\gui\components\layout\juce_ResizableCornerComponent.cpp">
|
||||
<Filter>Juce\Source\gui\components\layout</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\gui\components\layout\juce_ResizableEdgeComponent.cpp">
|
||||
<Filter>Juce\Source\gui\components\layout</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\gui\components\layout\juce_ScrollBar.cpp">
|
||||
<Filter>Juce\Source\gui\components\layout</Filter>
|
||||
</ClCompile>
|
||||
|
|
@ -1821,6 +1824,9 @@
|
|||
<ClInclude Include="..\..\src\gui\components\layout\juce_ResizableCornerComponent.h">
|
||||
<Filter>Juce\Source\gui\components\layout</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\gui\components\layout\juce_ResizableEdgeComponent.h">
|
||||
<Filter>Juce\Source\gui\components\layout</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\gui\components\layout\juce_ScrollBar.h">
|
||||
<Filter>Juce\Source\gui\components\layout</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
|||
|
|
@ -146,6 +146,7 @@
|
|||
F5F3F25D9F377128DC74D95B = { isa = PBXBuildFile; fileRef = FF046140CCF1EDB0DFF80178; };
|
||||
C64A2BF05224582134872415 = { isa = PBXBuildFile; fileRef = A95F42C5CB0C2E5052B31568; };
|
||||
0A9C9486A6B31F21B1472D2B = { isa = PBXBuildFile; fileRef = A31221E2A50CCE9DF06B5F4B; };
|
||||
ED9F9A6CB4F8BB7FEA5384B7 = { isa = PBXBuildFile; fileRef = 3D8B0E86C98E2EE49AE868C8; };
|
||||
DE0BAD16BD5A6568EB4D228B = { isa = PBXBuildFile; fileRef = B116FEC4D544DB8E38CB571E; };
|
||||
AF6FEC311B9FDA112CEEBE03 = { isa = PBXBuildFile; fileRef = F1F65C9E7394E04E073A57A4; };
|
||||
3795ECCE9D98F872F5BCAE64 = { isa = PBXBuildFile; fileRef = 993C90B10202DA78FA31CC58; };
|
||||
|
|
@ -691,6 +692,8 @@
|
|||
600B2FDBBBE812784CB49A69 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_ResizableBorderComponent.h; path = ../../src/gui/components/layout/juce_ResizableBorderComponent.h; sourceTree = SOURCE_ROOT; };
|
||||
A31221E2A50CCE9DF06B5F4B = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_ResizableCornerComponent.cpp; path = ../../src/gui/components/layout/juce_ResizableCornerComponent.cpp; sourceTree = SOURCE_ROOT; };
|
||||
CB54AC3D311C44A1F3B463A5 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_ResizableCornerComponent.h; path = ../../src/gui/components/layout/juce_ResizableCornerComponent.h; sourceTree = SOURCE_ROOT; };
|
||||
3D8B0E86C98E2EE49AE868C8 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_ResizableEdgeComponent.cpp; path = ../../src/gui/components/layout/juce_ResizableEdgeComponent.cpp; sourceTree = SOURCE_ROOT; };
|
||||
238965266F88730956D776DB = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_ResizableEdgeComponent.h; path = ../../src/gui/components/layout/juce_ResizableEdgeComponent.h; sourceTree = SOURCE_ROOT; };
|
||||
B116FEC4D544DB8E38CB571E = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_ScrollBar.cpp; path = ../../src/gui/components/layout/juce_ScrollBar.cpp; sourceTree = SOURCE_ROOT; };
|
||||
797C94BB7F42CBBAACCFFB87 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_ScrollBar.h; path = ../../src/gui/components/layout/juce_ScrollBar.h; sourceTree = SOURCE_ROOT; };
|
||||
F1F65C9E7394E04E073A57A4 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_StretchableLayoutManager.cpp; path = ../../src/gui/components/layout/juce_StretchableLayoutManager.cpp; sourceTree = SOURCE_ROOT; };
|
||||
|
|
@ -933,6 +936,7 @@
|
|||
341631A7E86BF1C0E49093C6 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_Memory.h; path = ../../src/memory/juce_Memory.h; sourceTree = SOURCE_ROOT; };
|
||||
AD655AA04981173716022D8D = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = juce_MemoryBlock.cpp; path = ../../src/memory/juce_MemoryBlock.cpp; sourceTree = SOURCE_ROOT; };
|
||||
F1D085B5F12E814BF1D5C395 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_MemoryBlock.h; path = ../../src/memory/juce_MemoryBlock.h; sourceTree = SOURCE_ROOT; };
|
||||
58654C2630387C4A336A5BFB = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_OptionalScopedPointer.h; path = ../../src/memory/juce_OptionalScopedPointer.h; sourceTree = SOURCE_ROOT; };
|
||||
524A70C9F23954F8F2A3F99B = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_ReferenceCountedObject.h; path = ../../src/memory/juce_ReferenceCountedObject.h; sourceTree = SOURCE_ROOT; };
|
||||
E05812E3CC31875A202D6B30 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_ScopedPointer.h; path = ../../src/memory/juce_ScopedPointer.h; sourceTree = SOURCE_ROOT; };
|
||||
224C989BF83B6EA867814BFF = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = juce_WeakReference.h; path = ../../src/memory/juce_WeakReference.h; sourceTree = SOURCE_ROOT; };
|
||||
|
|
@ -1448,6 +1452,8 @@
|
|||
600B2FDBBBE812784CB49A69,
|
||||
A31221E2A50CCE9DF06B5F4B,
|
||||
CB54AC3D311C44A1F3B463A5,
|
||||
3D8B0E86C98E2EE49AE868C8,
|
||||
238965266F88730956D776DB,
|
||||
B116FEC4D544DB8E38CB571E,
|
||||
797C94BB7F42CBBAACCFFB87,
|
||||
F1F65C9E7394E04E073A57A4,
|
||||
|
|
@ -1748,6 +1754,7 @@
|
|||
341631A7E86BF1C0E49093C6,
|
||||
AD655AA04981173716022D8D,
|
||||
F1D085B5F12E814BF1D5C395,
|
||||
58654C2630387C4A336A5BFB,
|
||||
524A70C9F23954F8F2A3F99B,
|
||||
E05812E3CC31875A202D6B30,
|
||||
224C989BF83B6EA867814BFF ); name = memory; sourceTree = "<group>"; };
|
||||
|
|
@ -2160,6 +2167,7 @@
|
|||
F5F3F25D9F377128DC74D95B,
|
||||
C64A2BF05224582134872415,
|
||||
0A9C9486A6B31F21B1472D2B,
|
||||
ED9F9A6CB4F8BB7FEA5384B7,
|
||||
DE0BAD16BD5A6568EB4D228B,
|
||||
AF6FEC311B9FDA112CEEBE03,
|
||||
3795ECCE9D98F872F5BCAE64,
|
||||
|
|
|
|||
|
|
@ -742,6 +742,10 @@
|
|||
resource="0" file="src/gui/components/layout/juce_ResizableCornerComponent.cpp"/>
|
||||
<FILE id="BNceExpX" name="juce_ResizableCornerComponent.h" compile="0"
|
||||
resource="0" file="src/gui/components/layout/juce_ResizableCornerComponent.h"/>
|
||||
<FILE id="RqXFh" name="juce_ResizableEdgeComponent.cpp" compile="1"
|
||||
resource="0" file="src/gui/components/layout/juce_ResizableEdgeComponent.cpp"/>
|
||||
<FILE id="yO4Ojb" name="juce_ResizableEdgeComponent.h" compile="0"
|
||||
resource="0" file="src/gui/components/layout/juce_ResizableEdgeComponent.h"/>
|
||||
<FILE id="bz95sXSrm" name="juce_ScrollBar.cpp" compile="1" resource="0"
|
||||
file="src/gui/components/layout/juce_ScrollBar.cpp"/>
|
||||
<FILE id="fNljvLwAj" name="juce_ScrollBar.h" compile="0" resource="0"
|
||||
|
|
|
|||
|
|
@ -282,6 +282,7 @@
|
|||
#include "../src/gui/components/layout/juce_MultiDocumentPanel.cpp"
|
||||
#include "../src/gui/components/layout/juce_ResizableBorderComponent.cpp"
|
||||
#include "../src/gui/components/layout/juce_ResizableCornerComponent.cpp"
|
||||
#include "../src/gui/components/layout/juce_ResizableEdgeComponent.cpp"
|
||||
#include "../src/gui/components/layout/juce_ScrollBar.cpp"
|
||||
#include "../src/gui/components/layout/juce_StretchableLayoutManager.cpp"
|
||||
#include "../src/gui/components/layout/juce_StretchableLayoutResizerBar.cpp"
|
||||
|
|
|
|||
|
|
@ -33,15 +33,14 @@
|
|||
|
||||
//==============================================================================
|
||||
ProjectContentComponent::ProjectContentComponent()
|
||||
: projectTree (0), project (0),
|
||||
currentDocument (0), resizerBar (0)
|
||||
: project (0),
|
||||
currentDocument (0)
|
||||
{
|
||||
setItemLayout (0, 100, 500, 300);
|
||||
setItemLayout (1, 4, 4, 4);
|
||||
setItemLayout (2, 100, 10000, 800);
|
||||
|
||||
setOpaque (true);
|
||||
setWantsKeyboardFocus (true);
|
||||
|
||||
treeSizeConstrainer.setMinimumWidth (100);
|
||||
treeSizeConstrainer.setMaximumWidth (500);
|
||||
}
|
||||
|
||||
ProjectContentComponent::~ProjectContentComponent()
|
||||
|
|
@ -56,17 +55,6 @@ void ProjectContentComponent::paint (Graphics& g)
|
|||
g.fillAll (Colour::greyLevel (0.8f));
|
||||
}
|
||||
|
||||
void ProjectContentComponent::hasBeenMoved()
|
||||
{
|
||||
resized();
|
||||
}
|
||||
|
||||
void ProjectContentComponent::resized()
|
||||
{
|
||||
Component* comps[] = { projectTree, resizerBar, contentView };
|
||||
layOutComponents (comps, 3, 0, 0, getWidth(), getHeight(), false, true);
|
||||
}
|
||||
|
||||
void ProjectContentComponent::setProject (Project* newProject)
|
||||
{
|
||||
if (project != newProject)
|
||||
|
|
@ -74,31 +62,42 @@ void ProjectContentComponent::setProject (Project* newProject)
|
|||
if (project != 0)
|
||||
project->removeChangeListener (this);
|
||||
|
||||
if (projectTree != 0)
|
||||
projectTree->deleteRootItem();
|
||||
|
||||
projectTree = 0;
|
||||
contentView = 0;
|
||||
resizerBar = 0;
|
||||
|
||||
if (projectTree != 0)
|
||||
{
|
||||
StoredSettings::getInstance()->getProps().setValue ("projectTreeviewWidth", projectTree->getWidth());
|
||||
projectTree->deleteRootItem();
|
||||
projectTree = 0;
|
||||
}
|
||||
|
||||
project = newProject;
|
||||
|
||||
if (project != 0)
|
||||
{
|
||||
addAndMakeVisible (projectTree = new TreeView());
|
||||
projectTree->setComponentID ("tree");
|
||||
projectTree->setRootItemVisible (true);
|
||||
projectTree->setMultiSelectEnabled (true);
|
||||
projectTree->setDefaultOpenness (true);
|
||||
projectTree->setColour (TreeView::backgroundColourId, Colour::greyLevel (0.93f));
|
||||
projectTree->setIndentSize (14);
|
||||
|
||||
addAndMakeVisible (resizerBar = new StretchableLayoutResizerBar (this, 1, true));
|
||||
|
||||
resized();
|
||||
|
||||
projectTree->setRootItem (new GroupTreeViewItem (project->getMainGroup()));
|
||||
projectTree->getRootItem()->setOpen (true);
|
||||
|
||||
String lastTreeWidth (StoredSettings::getInstance()->getProps().getValue ("projectTreeviewWidth"));
|
||||
if (lastTreeWidth.getIntValue() < 150)
|
||||
lastTreeWidth = "250";
|
||||
|
||||
projectTree->setBounds (RelativeRectangle ("0, 0, left + " + lastTreeWidth + ", parent.height"));
|
||||
|
||||
addAndMakeVisible (resizerBar = new ResizableEdgeComponent (projectTree, &treeSizeConstrainer,
|
||||
ResizableEdgeComponent::rightEdge));
|
||||
resizerBar->setComponentID ("resizer");
|
||||
resizerBar->setBounds (RelativeRectangle ("tree.right, 0, tree.right + 4, parent.height"));
|
||||
|
||||
project->addChangeListener (this);
|
||||
|
||||
if (currentDocument == 0)
|
||||
|
|
@ -161,7 +160,8 @@ bool ProjectContentComponent::setEditorComponent (Component* editor, OpenDocumen
|
|||
contentView = editor;
|
||||
currentDocument = doc;
|
||||
addAndMakeVisible (editor);
|
||||
resized();
|
||||
editor->setBounds (RelativeRectangle ("resizer.right, 0, parent.right, parent.height"));
|
||||
|
||||
updateMainWindowTitle();
|
||||
commandManager->commandStatusChanged();
|
||||
|
||||
|
|
|
|||
|
|
@ -35,8 +35,7 @@
|
|||
*/
|
||||
class ProjectContentComponent : public Component,
|
||||
public ApplicationCommandTarget,
|
||||
public ChangeListener,
|
||||
public StretchableLayoutManager
|
||||
public ChangeListener
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
|
|
@ -44,7 +43,6 @@ public:
|
|||
~ProjectContentComponent();
|
||||
|
||||
void paint (Graphics& g);
|
||||
void resized();
|
||||
|
||||
void setProject (Project* project);
|
||||
|
||||
|
|
@ -56,7 +54,6 @@ public:
|
|||
void updateMissingFileStatuses();
|
||||
|
||||
void changeListenerCallback (ChangeBroadcaster*);
|
||||
void hasBeenMoved();
|
||||
|
||||
//==============================================================================
|
||||
ApplicationCommandTarget* getNextCommandTarget();
|
||||
|
|
@ -66,12 +63,14 @@ public:
|
|||
bool perform (const InvocationInfo& info);
|
||||
|
||||
private:
|
||||
ScopedPointer<TreeView> projectTree;
|
||||
Project* project;
|
||||
ScopedPointer <Component> contentView;
|
||||
OpenDocumentManager::Document* currentDocument;
|
||||
|
||||
ScopedPointer<StretchableLayoutResizerBar> resizerBar;
|
||||
ScopedPointer<TreeView> projectTree;
|
||||
ScopedPointer<ResizableEdgeComponent> resizerBar;
|
||||
ScopedPointer<Component> contentView;
|
||||
|
||||
ComponentBoundsConstrainer treeSizeConstrainer;
|
||||
|
||||
void updateMainWindowTitle();
|
||||
|
||||
|
|
|
|||
|
|
@ -61843,7 +61843,12 @@ void ComponentBoundsConstrainer::checkComponentBounds (Component* component)
|
|||
void ComponentBoundsConstrainer::applyBoundsToComponent (Component* component,
|
||||
const Rectangle<int>& bounds)
|
||||
{
|
||||
component->setBounds (bounds);
|
||||
Component::Positioner* const positioner = component->getPositioner();
|
||||
|
||||
if (positioner != 0)
|
||||
positioner->applyNewBounds (bounds);
|
||||
else
|
||||
component->setBounds (bounds);
|
||||
}
|
||||
|
||||
void ComponentBoundsConstrainer::resizeStart()
|
||||
|
|
@ -62803,13 +62808,22 @@ void ResizableBorderComponent::mouseDrag (const MouseEvent& e)
|
|||
const Rectangle<int> bounds (mouseZone.resizeRectangleBy (originalBounds, e.getOffsetFromDragStart()));
|
||||
|
||||
if (constrainer != 0)
|
||||
{
|
||||
constrainer->setBoundsForComponent (component, bounds,
|
||||
mouseZone.isDraggingTopEdge(),
|
||||
mouseZone.isDraggingLeftEdge(),
|
||||
mouseZone.isDraggingBottomEdge(),
|
||||
mouseZone.isDraggingRightEdge());
|
||||
}
|
||||
else
|
||||
component->setBounds (bounds);
|
||||
{
|
||||
Component::Positioner* const positioner = component->getPositioner();
|
||||
|
||||
if (positioner != 0)
|
||||
positioner->applyNewBounds (bounds);
|
||||
else
|
||||
component->setBounds (bounds);
|
||||
}
|
||||
}
|
||||
|
||||
void ResizableBorderComponent::mouseUp (const MouseEvent&)
|
||||
|
|
@ -62905,9 +62919,18 @@ void ResizableCornerComponent::mouseDrag (const MouseEvent& e)
|
|||
originalBounds.getHeight() + e.getDistanceFromDragStartY()));
|
||||
|
||||
if (constrainer != 0)
|
||||
{
|
||||
constrainer->setBoundsForComponent (component, r, false, false, true, true);
|
||||
}
|
||||
else
|
||||
component->setBounds (r);
|
||||
{
|
||||
Component::Positioner* const positioner = component->getPositioner();
|
||||
|
||||
if (positioner != 0)
|
||||
positioner->applyNewBounds (r);
|
||||
else
|
||||
component->setBounds (r);
|
||||
}
|
||||
}
|
||||
|
||||
void ResizableCornerComponent::mouseUp (const MouseEvent&)
|
||||
|
|
@ -62930,6 +62953,98 @@ END_JUCE_NAMESPACE
|
|||
/*** End of inlined file: juce_ResizableCornerComponent.cpp ***/
|
||||
|
||||
|
||||
/*** Start of inlined file: juce_ResizableEdgeComponent.cpp ***/
|
||||
BEGIN_JUCE_NAMESPACE
|
||||
|
||||
ResizableEdgeComponent::ResizableEdgeComponent (Component* const componentToResize,
|
||||
ComponentBoundsConstrainer* const constrainer_,
|
||||
Edge edge_)
|
||||
: component (componentToResize),
|
||||
constrainer (constrainer_),
|
||||
edge (edge_)
|
||||
{
|
||||
setRepaintsOnMouseActivity (true);
|
||||
setMouseCursor (MouseCursor (isVertical() ? MouseCursor::LeftRightResizeCursor
|
||||
: MouseCursor::UpDownResizeCursor));
|
||||
}
|
||||
|
||||
ResizableEdgeComponent::~ResizableEdgeComponent()
|
||||
{
|
||||
}
|
||||
|
||||
bool ResizableEdgeComponent::isVertical() const throw()
|
||||
{
|
||||
return edge == leftEdge || edge == rightEdge;
|
||||
}
|
||||
|
||||
void ResizableEdgeComponent::paint (Graphics& g)
|
||||
{
|
||||
getLookAndFeel().drawStretchableLayoutResizerBar (g, getWidth(), getHeight(), isVertical(),
|
||||
isMouseOver(), isMouseButtonDown());
|
||||
}
|
||||
|
||||
void ResizableEdgeComponent::mouseDown (const MouseEvent& e)
|
||||
{
|
||||
if (component == 0)
|
||||
{
|
||||
jassertfalse; // You've deleted the component that this resizer was supposed to be using!
|
||||
return;
|
||||
}
|
||||
|
||||
originalBounds = component->getBounds();
|
||||
|
||||
if (constrainer != 0)
|
||||
constrainer->resizeStart();
|
||||
}
|
||||
|
||||
void ResizableEdgeComponent::mouseDrag (const MouseEvent& e)
|
||||
{
|
||||
if (component == 0)
|
||||
{
|
||||
jassertfalse; // You've deleted the component that this resizer was supposed to be using!
|
||||
return;
|
||||
}
|
||||
|
||||
Rectangle<int> bounds (originalBounds);
|
||||
|
||||
switch (edge)
|
||||
{
|
||||
case leftEdge: bounds.setLeft (bounds.getX() + e.getDistanceFromDragStartX()); break;
|
||||
case rightEdge: bounds.setWidth (bounds.getWidth() + e.getDistanceFromDragStartX()); break;
|
||||
case topEdge: bounds.setTop (bounds.getY() + e.getDistanceFromDragStartY()); break;
|
||||
case bottomEdge: bounds.setHeight (bounds.getHeight() + e.getDistanceFromDragStartY()); break;
|
||||
default: jassertfalse; break;
|
||||
}
|
||||
|
||||
if (constrainer != 0)
|
||||
{
|
||||
constrainer->setBoundsForComponent (component, bounds,
|
||||
edge == topEdge,
|
||||
edge == leftEdge,
|
||||
edge == bottomEdge,
|
||||
edge == rightEdge);
|
||||
}
|
||||
else
|
||||
{
|
||||
Component::Positioner* const positioner = component->getPositioner();
|
||||
|
||||
if (positioner != 0)
|
||||
positioner->applyNewBounds (bounds);
|
||||
else
|
||||
component->setBounds (bounds);
|
||||
}
|
||||
}
|
||||
|
||||
void ResizableEdgeComponent::mouseUp (const MouseEvent&)
|
||||
{
|
||||
if (constrainer != 0)
|
||||
constrainer->resizeEnd();
|
||||
}
|
||||
|
||||
END_JUCE_NAMESPACE
|
||||
/*** End of inlined file: juce_ResizableEdgeComponent.cpp ***/
|
||||
|
||||
|
||||
/*** Start of inlined file: juce_ScrollBar.cpp ***/
|
||||
BEGIN_JUCE_NAMESPACE
|
||||
|
||||
|
|
@ -79954,8 +80069,19 @@ public:
|
|||
jassertfalse; // must be a recursive reference!
|
||||
}
|
||||
|
||||
void applyNewBounds (const Rectangle<int>& newBounds)
|
||||
{
|
||||
if (newBounds != getComponent().getBounds())
|
||||
{
|
||||
ComponentScope scope (getComponent());
|
||||
rectangle.moveToAbsolute (newBounds.toFloat(), &scope);
|
||||
|
||||
applyToComponentBounds();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
const RelativeRectangle rectangle;
|
||||
RelativeRectangle rectangle;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (RelativeRectangleComponentPositioner);
|
||||
};
|
||||
|
|
@ -86515,6 +86641,11 @@ public:
|
|||
owner.repaint();
|
||||
}
|
||||
|
||||
void applyNewBounds (const Rectangle<int>& newBounds)
|
||||
{
|
||||
jassertfalse; // drawables can't be resized directly!
|
||||
}
|
||||
|
||||
private:
|
||||
DrawableShape& owner;
|
||||
const DrawableShape::RelativeFillType fill;
|
||||
|
|
@ -87570,6 +87701,11 @@ public:
|
|||
owner.applyRelativePath (*owner.relativePath, &scope);
|
||||
}
|
||||
|
||||
void applyNewBounds (const Rectangle<int>& newBounds)
|
||||
{
|
||||
jassertfalse; // drawables can't be resized directly!
|
||||
}
|
||||
|
||||
private:
|
||||
DrawablePath& owner;
|
||||
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ namespace JuceDummyNamespace {}
|
|||
*/
|
||||
#define JUCE_MAJOR_VERSION 1
|
||||
#define JUCE_MINOR_VERSION 53
|
||||
#define JUCE_BUILDNUMBER 32
|
||||
#define JUCE_BUILDNUMBER 33
|
||||
|
||||
/** Current Juce version number.
|
||||
|
||||
|
|
@ -31755,6 +31755,13 @@ public:
|
|||
/** Returns the component that this positioner controls. */
|
||||
Component& getComponent() const throw() { return component; }
|
||||
|
||||
/** Attempts to set the component's position to the given rectangle.
|
||||
Unlike simply calling Component::setBounds(), this may involve the positioner
|
||||
being smart enough to adjust itself to fit the new bounds, e.g. a RelativeRectangle's
|
||||
positioner may try to reverse the expressions used to make them fit these new coordinates.
|
||||
*/
|
||||
virtual void applyNewBounds (const Rectangle<int>& newBounds) = 0;
|
||||
|
||||
private:
|
||||
Component& component;
|
||||
|
||||
|
|
@ -49126,6 +49133,11 @@ protected:
|
|||
owner.recalculateCoordinates (&scope);
|
||||
}
|
||||
|
||||
void applyNewBounds (const Rectangle<int>&)
|
||||
{
|
||||
jassertfalse; // drawables can't be resized directly!
|
||||
}
|
||||
|
||||
private:
|
||||
DrawableType& owner;
|
||||
|
||||
|
|
@ -55072,7 +55084,7 @@ private:
|
|||
#define __JUCE_RESIZABLEBORDERCOMPONENT_JUCEHEADER__
|
||||
|
||||
/**
|
||||
A component that resizes its parent window when dragged.
|
||||
A component that resizes its parent component when dragged.
|
||||
|
||||
This component forms a frame around the edge of a component, allowing it to
|
||||
be dragged by the edges or corners to resize it - like the way windows are
|
||||
|
|
@ -55240,7 +55252,7 @@ private:
|
|||
#ifndef __JUCE_RESIZABLECORNERCOMPONENT_JUCEHEADER__
|
||||
#define __JUCE_RESIZABLECORNERCOMPONENT_JUCEHEADER__
|
||||
|
||||
/** A component that resizes a parent window when dragged.
|
||||
/** A component that resizes a parent component when dragged.
|
||||
|
||||
This is the small triangular stripey resizer component you get in the bottom-right
|
||||
of windows (more commonly on the Mac than Windows). Put one in the corner of
|
||||
|
|
@ -58785,6 +58797,85 @@ private:
|
|||
#endif
|
||||
#ifndef __JUCE_RESIZABLECORNERCOMPONENT_JUCEHEADER__
|
||||
|
||||
#endif
|
||||
#ifndef __JUCE_RESIZABLEEDGECOMPONENT_JUCEHEADER__
|
||||
|
||||
/*** Start of inlined file: juce_ResizableEdgeComponent.h ***/
|
||||
#ifndef __JUCE_RESIZABLEEDGECOMPONENT_JUCEHEADER__
|
||||
#define __JUCE_RESIZABLEEDGECOMPONENT_JUCEHEADER__
|
||||
|
||||
/**
|
||||
A component that resizes its parent component when dragged.
|
||||
|
||||
This component forms a bar along one edge of a component, allowing it to
|
||||
be dragged by that edges to resize it.
|
||||
|
||||
To use it, just add it to your component, positioning it along the appropriate
|
||||
edge. Make sure you reposition the resizer component each time the parent's size
|
||||
changes, to keep it in the correct position.
|
||||
|
||||
@see ResizbleBorderComponent, ResizableCornerComponent
|
||||
*/
|
||||
class JUCE_API ResizableEdgeComponent : public Component
|
||||
{
|
||||
public:
|
||||
|
||||
enum Edge
|
||||
{
|
||||
leftEdge, /**< Indicates a vertical bar that can be dragged left/right to move the component's left-hand edge. */
|
||||
rightEdge, /**< Indicates a vertical bar that can be dragged left/right to move the component's right-hand edge. */
|
||||
topEdge, /**< Indicates a horizontal bar that can be dragged up/down to move the top of the component. */
|
||||
bottomEdge /**< Indicates a horizontal bar that can be dragged up/down to move the bottom of the component. */
|
||||
};
|
||||
|
||||
/** Creates a resizer bar.
|
||||
|
||||
Pass in the target component which you want to be resized when this one is
|
||||
dragged. The target component will usually be this component's parent, but this
|
||||
isn't mandatory.
|
||||
|
||||
Remember that when the target component is resized, it'll need to move and
|
||||
resize this component to keep it in place, as this won't happen automatically.
|
||||
|
||||
If the constrainer parameter is non-zero, then this object will be used to enforce
|
||||
limits on the size and position that the component can be stretched to. Make sure
|
||||
that the constrainer isn't deleted while still in use by this object.
|
||||
|
||||
@see ComponentBoundsConstrainer
|
||||
*/
|
||||
ResizableEdgeComponent (Component* componentToResize,
|
||||
ComponentBoundsConstrainer* constrainer,
|
||||
Edge edgeToResize);
|
||||
|
||||
/** Destructor. */
|
||||
~ResizableEdgeComponent();
|
||||
|
||||
bool isVertical() const throw();
|
||||
|
||||
protected:
|
||||
|
||||
/** @internal */
|
||||
void paint (Graphics& g);
|
||||
/** @internal */
|
||||
void mouseDown (const MouseEvent& e);
|
||||
/** @internal */
|
||||
void mouseDrag (const MouseEvent& e);
|
||||
/** @internal */
|
||||
void mouseUp (const MouseEvent& e);
|
||||
|
||||
private:
|
||||
WeakReference<Component> component;
|
||||
ComponentBoundsConstrainer* constrainer;
|
||||
Rectangle<int> originalBounds;
|
||||
const Edge edge;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ResizableEdgeComponent);
|
||||
};
|
||||
|
||||
#endif // __JUCE_RESIZABLEEDGECOMPONENT_JUCEHEADER__
|
||||
/*** End of inlined file: juce_ResizableEdgeComponent.h ***/
|
||||
|
||||
|
||||
#endif
|
||||
#ifndef __JUCE_SCROLLBAR_JUCEHEADER__
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
*/
|
||||
#define JUCE_MAJOR_VERSION 1
|
||||
#define JUCE_MINOR_VERSION 53
|
||||
#define JUCE_BUILDNUMBER 32
|
||||
#define JUCE_BUILDNUMBER 33
|
||||
|
||||
/** Current Juce version number.
|
||||
|
||||
|
|
|
|||
|
|
@ -2183,6 +2183,13 @@ public:
|
|||
/** Returns the component that this positioner controls. */
|
||||
Component& getComponent() const throw() { return component; }
|
||||
|
||||
/** Attempts to set the component's position to the given rectangle.
|
||||
Unlike simply calling Component::setBounds(), this may involve the positioner
|
||||
being smart enough to adjust itself to fit the new bounds, e.g. a RelativeRectangle's
|
||||
positioner may try to reverse the expressions used to make them fit these new coordinates.
|
||||
*/
|
||||
virtual void applyNewBounds (const Rectangle<int>& newBounds) = 0;
|
||||
|
||||
private:
|
||||
Component& component;
|
||||
|
||||
|
|
|
|||
|
|
@ -182,7 +182,12 @@ void ComponentBoundsConstrainer::checkComponentBounds (Component* component)
|
|||
void ComponentBoundsConstrainer::applyBoundsToComponent (Component* component,
|
||||
const Rectangle<int>& bounds)
|
||||
{
|
||||
component->setBounds (bounds);
|
||||
Component::Positioner* const positioner = component->getPositioner();
|
||||
|
||||
if (positioner != 0)
|
||||
positioner->applyNewBounds (bounds);
|
||||
else
|
||||
component->setBounds (bounds);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
BEGIN_JUCE_NAMESPACE
|
||||
|
||||
#include "juce_ResizableBorderComponent.h"
|
||||
#include "../juce_Desktop.h"
|
||||
#include "../../graphics/geometry/juce_RectangleList.h"
|
||||
#include "../../graphics/geometry/juce_Line.h"
|
||||
#include "../lookandfeel/juce_LookAndFeel.h"
|
||||
|
|
@ -154,13 +153,22 @@ void ResizableBorderComponent::mouseDrag (const MouseEvent& e)
|
|||
const Rectangle<int> bounds (mouseZone.resizeRectangleBy (originalBounds, e.getOffsetFromDragStart()));
|
||||
|
||||
if (constrainer != 0)
|
||||
{
|
||||
constrainer->setBoundsForComponent (component, bounds,
|
||||
mouseZone.isDraggingTopEdge(),
|
||||
mouseZone.isDraggingLeftEdge(),
|
||||
mouseZone.isDraggingBottomEdge(),
|
||||
mouseZone.isDraggingRightEdge());
|
||||
}
|
||||
else
|
||||
component->setBounds (bounds);
|
||||
{
|
||||
Component::Positioner* const positioner = component->getPositioner();
|
||||
|
||||
if (positioner != 0)
|
||||
positioner->applyNewBounds (bounds);
|
||||
else
|
||||
component->setBounds (bounds);
|
||||
}
|
||||
}
|
||||
|
||||
void ResizableBorderComponent::mouseUp (const MouseEvent&)
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
//==============================================================================
|
||||
/**
|
||||
A component that resizes its parent window when dragged.
|
||||
A component that resizes its parent component when dragged.
|
||||
|
||||
This component forms a frame around the edge of a component, allowing it to
|
||||
be dragged by the edges or corners to resize it - like the way windows are
|
||||
|
|
|
|||
|
|
@ -82,9 +82,18 @@ void ResizableCornerComponent::mouseDrag (const MouseEvent& e)
|
|||
originalBounds.getHeight() + e.getDistanceFromDragStartY()));
|
||||
|
||||
if (constrainer != 0)
|
||||
{
|
||||
constrainer->setBoundsForComponent (component, r, false, false, true, true);
|
||||
}
|
||||
else
|
||||
component->setBounds (r);
|
||||
{
|
||||
Component::Positioner* const positioner = component->getPositioner();
|
||||
|
||||
if (positioner != 0)
|
||||
positioner->applyNewBounds (r);
|
||||
else
|
||||
component->setBounds (r);
|
||||
}
|
||||
}
|
||||
|
||||
void ResizableCornerComponent::mouseUp (const MouseEvent&)
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
|
||||
//==============================================================================
|
||||
/** A component that resizes a parent window when dragged.
|
||||
/** A component that resizes a parent component when dragged.
|
||||
|
||||
This is the small triangular stripey resizer component you get in the bottom-right
|
||||
of windows (more commonly on the Mac than Windows). Put one in the corner of
|
||||
|
|
|
|||
121
src/gui/components/layout/juce_ResizableEdgeComponent.cpp
Normal file
121
src/gui/components/layout/juce_ResizableEdgeComponent.cpp
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library - "Jules' Utility Class Extensions"
|
||||
Copyright 2004-10 by Raw Material Software Ltd.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
JUCE can be redistributed and/or modified under the terms of the GNU General
|
||||
Public License (Version 2), as published by the Free Software Foundation.
|
||||
A copy of the license is included in the JUCE distribution, or can be found
|
||||
online at www.gnu.org/licenses.
|
||||
|
||||
JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
To release a closed-source product which uses JUCE, commercial licenses are
|
||||
available: visit www.rawmaterialsoftware.com/juce for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#include "../../../core/juce_StandardHeader.h"
|
||||
|
||||
BEGIN_JUCE_NAMESPACE
|
||||
|
||||
#include "juce_ResizableEdgeComponent.h"
|
||||
#include "../lookandfeel/juce_LookAndFeel.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
ResizableEdgeComponent::ResizableEdgeComponent (Component* const componentToResize,
|
||||
ComponentBoundsConstrainer* const constrainer_,
|
||||
Edge edge_)
|
||||
: component (componentToResize),
|
||||
constrainer (constrainer_),
|
||||
edge (edge_)
|
||||
{
|
||||
setRepaintsOnMouseActivity (true);
|
||||
setMouseCursor (MouseCursor (isVertical() ? MouseCursor::LeftRightResizeCursor
|
||||
: MouseCursor::UpDownResizeCursor));
|
||||
}
|
||||
|
||||
ResizableEdgeComponent::~ResizableEdgeComponent()
|
||||
{
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
bool ResizableEdgeComponent::isVertical() const throw()
|
||||
{
|
||||
return edge == leftEdge || edge == rightEdge;
|
||||
}
|
||||
|
||||
void ResizableEdgeComponent::paint (Graphics& g)
|
||||
{
|
||||
getLookAndFeel().drawStretchableLayoutResizerBar (g, getWidth(), getHeight(), isVertical(),
|
||||
isMouseOver(), isMouseButtonDown());
|
||||
}
|
||||
|
||||
void ResizableEdgeComponent::mouseDown (const MouseEvent& e)
|
||||
{
|
||||
if (component == 0)
|
||||
{
|
||||
jassertfalse; // You've deleted the component that this resizer was supposed to be using!
|
||||
return;
|
||||
}
|
||||
|
||||
originalBounds = component->getBounds();
|
||||
|
||||
if (constrainer != 0)
|
||||
constrainer->resizeStart();
|
||||
}
|
||||
|
||||
void ResizableEdgeComponent::mouseDrag (const MouseEvent& e)
|
||||
{
|
||||
if (component == 0)
|
||||
{
|
||||
jassertfalse; // You've deleted the component that this resizer was supposed to be using!
|
||||
return;
|
||||
}
|
||||
|
||||
Rectangle<int> bounds (originalBounds);
|
||||
|
||||
switch (edge)
|
||||
{
|
||||
case leftEdge: bounds.setLeft (bounds.getX() + e.getDistanceFromDragStartX()); break;
|
||||
case rightEdge: bounds.setWidth (bounds.getWidth() + e.getDistanceFromDragStartX()); break;
|
||||
case topEdge: bounds.setTop (bounds.getY() + e.getDistanceFromDragStartY()); break;
|
||||
case bottomEdge: bounds.setHeight (bounds.getHeight() + e.getDistanceFromDragStartY()); break;
|
||||
default: jassertfalse; break;
|
||||
}
|
||||
|
||||
if (constrainer != 0)
|
||||
{
|
||||
constrainer->setBoundsForComponent (component, bounds,
|
||||
edge == topEdge,
|
||||
edge == leftEdge,
|
||||
edge == bottomEdge,
|
||||
edge == rightEdge);
|
||||
}
|
||||
else
|
||||
{
|
||||
Component::Positioner* const positioner = component->getPositioner();
|
||||
|
||||
if (positioner != 0)
|
||||
positioner->applyNewBounds (bounds);
|
||||
else
|
||||
component->setBounds (bounds);
|
||||
}
|
||||
}
|
||||
|
||||
void ResizableEdgeComponent::mouseUp (const MouseEvent&)
|
||||
{
|
||||
if (constrainer != 0)
|
||||
constrainer->resizeEnd();
|
||||
}
|
||||
|
||||
END_JUCE_NAMESPACE
|
||||
102
src/gui/components/layout/juce_ResizableEdgeComponent.h
Normal file
102
src/gui/components/layout/juce_ResizableEdgeComponent.h
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library - "Jules' Utility Class Extensions"
|
||||
Copyright 2004-10 by Raw Material Software Ltd.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
JUCE can be redistributed and/or modified under the terms of the GNU General
|
||||
Public License (Version 2), as published by the Free Software Foundation.
|
||||
A copy of the license is included in the JUCE distribution, or can be found
|
||||
online at www.gnu.org/licenses.
|
||||
|
||||
JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
To release a closed-source product which uses JUCE, commercial licenses are
|
||||
available: visit www.rawmaterialsoftware.com/juce for more information.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#ifndef __JUCE_RESIZABLEEDGECOMPONENT_JUCEHEADER__
|
||||
#define __JUCE_RESIZABLEEDGECOMPONENT_JUCEHEADER__
|
||||
|
||||
#include "juce_ComponentBoundsConstrainer.h"
|
||||
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
A component that resizes its parent component when dragged.
|
||||
|
||||
This component forms a bar along one edge of a component, allowing it to
|
||||
be dragged by that edges to resize it.
|
||||
|
||||
To use it, just add it to your component, positioning it along the appropriate
|
||||
edge. Make sure you reposition the resizer component each time the parent's size
|
||||
changes, to keep it in the correct position.
|
||||
|
||||
@see ResizbleBorderComponent, ResizableCornerComponent
|
||||
*/
|
||||
class JUCE_API ResizableEdgeComponent : public Component
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
enum Edge
|
||||
{
|
||||
leftEdge, /**< Indicates a vertical bar that can be dragged left/right to move the component's left-hand edge. */
|
||||
rightEdge, /**< Indicates a vertical bar that can be dragged left/right to move the component's right-hand edge. */
|
||||
topEdge, /**< Indicates a horizontal bar that can be dragged up/down to move the top of the component. */
|
||||
bottomEdge /**< Indicates a horizontal bar that can be dragged up/down to move the bottom of the component. */
|
||||
};
|
||||
|
||||
/** Creates a resizer bar.
|
||||
|
||||
Pass in the target component which you want to be resized when this one is
|
||||
dragged. The target component will usually be this component's parent, but this
|
||||
isn't mandatory.
|
||||
|
||||
Remember that when the target component is resized, it'll need to move and
|
||||
resize this component to keep it in place, as this won't happen automatically.
|
||||
|
||||
If the constrainer parameter is non-zero, then this object will be used to enforce
|
||||
limits on the size and position that the component can be stretched to. Make sure
|
||||
that the constrainer isn't deleted while still in use by this object.
|
||||
|
||||
@see ComponentBoundsConstrainer
|
||||
*/
|
||||
ResizableEdgeComponent (Component* componentToResize,
|
||||
ComponentBoundsConstrainer* constrainer,
|
||||
Edge edgeToResize);
|
||||
|
||||
/** Destructor. */
|
||||
~ResizableEdgeComponent();
|
||||
|
||||
bool isVertical() const throw();
|
||||
|
||||
protected:
|
||||
//==============================================================================
|
||||
/** @internal */
|
||||
void paint (Graphics& g);
|
||||
/** @internal */
|
||||
void mouseDown (const MouseEvent& e);
|
||||
/** @internal */
|
||||
void mouseDrag (const MouseEvent& e);
|
||||
/** @internal */
|
||||
void mouseUp (const MouseEvent& e);
|
||||
|
||||
private:
|
||||
WeakReference<Component> component;
|
||||
ComponentBoundsConstrainer* constrainer;
|
||||
Rectangle<int> originalBounds;
|
||||
const Edge edge;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ResizableEdgeComponent);
|
||||
};
|
||||
|
||||
|
||||
#endif // __JUCE_RESIZABLEEDGECOMPONENT_JUCEHEADER__
|
||||
|
|
@ -95,5 +95,4 @@ private:
|
|||
};
|
||||
|
||||
|
||||
|
||||
#endif // __JUCE_STRETCHABLELAYOUTRESIZERBAR_JUCEHEADER__
|
||||
|
|
|
|||
|
|
@ -232,8 +232,19 @@ public:
|
|||
jassertfalse; // must be a recursive reference!
|
||||
}
|
||||
|
||||
void applyNewBounds (const Rectangle<int>& newBounds)
|
||||
{
|
||||
if (newBounds != getComponent().getBounds())
|
||||
{
|
||||
ComponentScope scope (getComponent());
|
||||
rectangle.moveToAbsolute (newBounds.toFloat(), &scope);
|
||||
|
||||
applyToComponentBounds();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
const RelativeRectangle rectangle;
|
||||
RelativeRectangle rectangle;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (RelativeRectangleComponentPositioner);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -234,6 +234,11 @@ protected:
|
|||
owner.recalculateCoordinates (&scope);
|
||||
}
|
||||
|
||||
void applyNewBounds (const Rectangle<int>&)
|
||||
{
|
||||
jassertfalse; // drawables can't be resized directly!
|
||||
}
|
||||
|
||||
private:
|
||||
DrawableType& owner;
|
||||
|
||||
|
|
|
|||
|
|
@ -123,6 +123,11 @@ public:
|
|||
owner.applyRelativePath (*owner.relativePath, &scope);
|
||||
}
|
||||
|
||||
void applyNewBounds (const Rectangle<int>& newBounds)
|
||||
{
|
||||
jassertfalse; // drawables can't be resized directly!
|
||||
}
|
||||
|
||||
private:
|
||||
DrawablePath& owner;
|
||||
|
||||
|
|
|
|||
|
|
@ -77,6 +77,11 @@ public:
|
|||
owner.repaint();
|
||||
}
|
||||
|
||||
void applyNewBounds (const Rectangle<int>& newBounds)
|
||||
{
|
||||
jassertfalse; // drawables can't be resized directly!
|
||||
}
|
||||
|
||||
private:
|
||||
DrawableShape& owner;
|
||||
const DrawableShape::RelativeFillType fill;
|
||||
|
|
|
|||
|
|
@ -446,6 +446,9 @@
|
|||
#ifndef __JUCE_RESIZABLECORNERCOMPONENT_JUCEHEADER__
|
||||
#include "gui/components/layout/juce_ResizableCornerComponent.h"
|
||||
#endif
|
||||
#ifndef __JUCE_RESIZABLEEDGECOMPONENT_JUCEHEADER__
|
||||
#include "gui/components/layout/juce_ResizableEdgeComponent.h"
|
||||
#endif
|
||||
#ifndef __JUCE_SCROLLBAR_JUCEHEADER__
|
||||
#include "gui/components/layout/juce_ScrollBar.h"
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue