30 Component* contentToDisplay,
bool deleteComponentWhenNoLongerNeeded)
44 desktop.addGlobalMouseListener (
this);
45 desktop.getAnimator().addChangeListener (
this);
47 if (contentToDisplay !=
nullptr)
48 setContent (contentToDisplay, deleteComponentWhenNoLongerNeeded);
59 desktop.removeGlobalMouseListener (
this);
60 desktop.getAnimator().removeChangeListener (
this);
63 parent->removeComponentListener (
this);
70 if (deleteComponentWhenNoLongerNeeded)
82 bool keepDismissButton,
83 bool deleteComponentWhenNoLongerNeeded)
87 if (deleteComponentWhenNoLongerNeeded)
107 1.0f, 250,
true, 1.0, 0.0);
132 : titleBounds.removeFromLeft (30).withTrimmedLeft (10));
139 : titleBounds.removeFromLeft (30).withTrimmedLeft (10));
142 : titleBounds.withTrimmedLeft (40));
159 :
shadowArea.getTopLeft()).toFloat(),
false));
163 g.fillAll (bgColour);
170 if ((newParent !=
nullptr) && (
parent != newParent))
173 parent->removeComponentListener (
this);
176 parent->addComponentListener (
this);
187 convertedPoint =
e.eventComponent->localPointToGlobal (
e.getPosition());
191 auto currentMouseDragX = convertedPoint.
x;
206 auto relativeMouseDownPosition =
getLocalPoint (
e.eventComponent,
e.getMouseDownPosition());
207 auto relativeMouseDragPosition =
getLocalPoint (
e.eventComponent,
e.getPosition());
234 dismissButton.setShape (lf.getSidePanelDismissButtonShape (*
this),
false,
true,
false);
240 titleLabel.setFont (lf.getSidePanelTitleFont (*
this));
242 titleLabel.setJustificationType (lf.getSidePanelTitleJustification (*
this));
249 if (wasResized && (&component ==
parent))
276 : parentBounds.withX (parentBounds.getRight()).withWidth (
panelWidth);
287 if (eventComponent ==
this)
291 if (eventComponent == child)
Definition juce_ChangeBroadcaster.h:35
Definition juce_ColourGradient.h:38
bool contains(Point< int > localPoint)
Definition juce_Component.cpp:1434
bool isVisible() const noexcept
Definition juce_Component.h:122
Component * getParentComponent() const noexcept
Definition juce_Component.h:804
Point< int > getLocalPoint(const Component *sourceComponent, Point< int > pointRelativeToSourceComponent) const
Definition juce_Component.cpp:1136
void addAndMakeVisible(Component *child, int zOrder=-1)
Definition juce_Component.cpp:1554
void setAlwaysOnTop(bool shouldStayOnTop)
Definition juce_Component.cpp:1074
void setOpaque(bool shouldBeOpaque)
Definition juce_Component.cpp:829
Rectangle< int > getBounds() const noexcept
Definition juce_Component.h:304
Component() noexcept
Definition juce_Component.cpp:517
void setBounds(int x, int y, int width, int height)
Definition juce_Component.cpp:1147
Colour findColour(int colourID, bool inheritFromParent=false) const
Definition juce_Component.cpp:2219
LookAndFeel & getLookAndFeel() const noexcept
Definition juce_Component.cpp:2173
Rectangle< int > getLocalBounds() const noexcept
Definition juce_Component.cpp:2283
const Array< Component * > & getChildren() const noexcept
Definition juce_Component.h:685
virtual void setVisible(bool shouldBeVisible)
Definition juce_Component.cpp:575
static Desktop &JUCE_CALLTYPE getInstance()
Definition juce_Desktop.cpp:50
Definition juce_GraphicsContext.h:45
@ textColourId
Definition juce_Label.h:107
Definition juce_MouseEvent.h:39
Definition juce_Point.h:42
ValueType x
Definition juce_Point.h:246
Definition juce_Rectangle.h:67
Rectangle removeFromRight(ValueType amountToRemove) noexcept
Definition juce_Rectangle.h:542
Rectangle removeFromLeft(ValueType amountToRemove) noexcept
Definition juce_Rectangle.h:526
void setTitleBarComponent(Component *titleBarComponentToUse, bool keepDismissButton, bool deleteComponentWhenNoLongerNeeded=true)
Definition juce_SidePanel.cpp:81
void showOrHide(bool show)
Definition juce_SidePanel.cpp:100
std::function< void()> onPanelMove
Definition juce_SidePanel.h:180
int panelWidth
Definition juce_SidePanel.h:213
OptionalScopedPointer< Component > titleBarComponent
Definition juce_SidePanel.h:203
void calculateAndRemoveShadowBounds(Rectangle< int > &bounds)
Definition juce_SidePanel.cpp:279
Rectangle< int > shadowArea
Definition juce_SidePanel.h:208
OptionalScopedPointer< Component > contentComponent
Definition juce_SidePanel.h:202
int titleBarHeight
Definition juce_SidePanel.h:215
void setContent(Component *newContentComponent, bool deleteComponentWhenNoLongerNeeded=true)
Definition juce_SidePanel.cpp:66
bool shouldResize
Definition juce_SidePanel.h:218
int shadowWidth
Definition juce_SidePanel.h:214
void resized() override
Definition juce_SidePanel.cpp:120
void componentMovedOrResized(Component &, bool wasMoved, bool wasResized) override
Definition juce_SidePanel.cpp:245
void lookAndFeelChanged() override
Definition juce_SidePanel.cpp:230
Rectangle< int > calculateBoundsInParent(Component &) const
Definition juce_SidePanel.cpp:265
@ titleTextColour
Definition juce_SidePanel.h:171
@ dismissButtonOverColour
Definition juce_SidePanel.h:174
@ dismissButtonDownColour
Definition juce_SidePanel.h:175
@ shadowBaseColour
Definition juce_SidePanel.h:172
@ backgroundColour
Definition juce_SidePanel.h:170
@ dismissButtonNormalColour
Definition juce_SidePanel.h:173
void paint(Graphics &g) override
Definition juce_SidePanel.cpp:149
Rectangle< int > startingBounds
Definition juce_SidePanel.h:217
ShapeButton dismissButton
Definition juce_SidePanel.h:206
Component * parent
Definition juce_SidePanel.h:201
void changeListenerCallback(ChangeBroadcaster *) override
Definition juce_SidePanel.cpp:253
int amountMoved
Definition juce_SidePanel.h:219
void parentHierarchyChanged() override
Definition juce_SidePanel.cpp:166
void mouseUp(const MouseEvent &) override
Definition juce_SidePanel.cpp:218
void mouseDrag(const MouseEvent &) override
Definition juce_SidePanel.cpp:180
bool isShowing
Definition juce_SidePanel.h:211
std::unique_ptr< AccessibilityHandler > createAccessibilityHandler() override
Definition juce_SidePanel.cpp:298
~SidePanel() override
Definition juce_SidePanel.cpp:55
Label titleLabel
Definition juce_SidePanel.h:205
std::function< void(bool)> onPanelShowHide
Definition juce_SidePanel.h:183
bool isOnLeft
Definition juce_SidePanel.h:210
void moved() override
Definition juce_SidePanel.cpp:114
bool isMouseEventInThisOrChildren(Component *)
Definition juce_SidePanel.cpp:285
bool shouldShowDismissButton
Definition juce_SidePanel.h:221
SidePanel(StringRef title, int width, bool positionOnLeft, Component *contentComponent=nullptr, bool deleteComponentWhenNoLongerNeeded=true)
Definition juce_SidePanel.cpp:29
Definition juce_StringRef.h:62
* e
Definition inflate.c:1404
int g
Definition inflate.c:1573
static const char * title
Definition pugl.h:1747
static int width
Definition pugl.h:1593
Definition carla_juce.cpp:31
constexpr Type jmax(Type a, Type b)
Definition juce_MathsFunctions.h:94
void ignoreUnused(Types &&...) noexcept
Definition juce_MathsFunctions.h:333
@ group
Definition juce_AccessibilityRole.h:61