LMMS
Loading...
Searching...
No Matches
juce::SidePanel Class Reference

#include <juce_SidePanel.h>

Inheritance diagram for juce::SidePanel:
juce::Component juce::ComponentListener juce::ChangeListener juce::MouseListener

Classes

struct  LookAndFeelMethods

Public Types

enum  ColourIds {
  backgroundColour = 0x100f001 , titleTextColour = 0x100f002 , shadowBaseColour = 0x100f003 , dismissButtonNormalColour = 0x100f004 ,
  dismissButtonOverColour = 0x100f005 , dismissButtonDownColour = 0x100f006
}
Public Types inherited from juce::Component
enum class  FocusContainerType { none , focusContainer , keyboardFocusContainer }
enum  FocusChangeType { focusChangedByMouseClick , focusChangedByTabKey , focusChangedDirectly }

Public Member Functions

 SidePanel (StringRef title, int width, bool positionOnLeft, Component *contentComponent=nullptr, bool deleteComponentWhenNoLongerNeeded=true)
 ~SidePanel () override
void setContent (Component *newContentComponent, bool deleteComponentWhenNoLongerNeeded=true)
ComponentgetContent () const noexcept
void setTitleBarComponent (Component *titleBarComponentToUse, bool keepDismissButton, bool deleteComponentWhenNoLongerNeeded=true)
ComponentgetTitleBarComponent () const noexcept
void showOrHide (bool show)
bool isPanelShowing () const noexcept
bool isPanelOnLeft () const noexcept
void setShadowWidth (int newWidth) noexcept
int getShadowWidth () const noexcept
void setTitleBarHeight (int newHeight) noexcept
int getTitleBarHeight () const noexcept
String getTitleText () const noexcept
void moved () override
void resized () override
void paint (Graphics &g) override
void parentHierarchyChanged () override
void mouseDrag (const MouseEvent &) override
void mouseUp (const MouseEvent &) override
Public Member Functions inherited from juce::Component
 Component () noexcept
 ~Component () override
 Component (const String &componentName) noexcept
String getName () const noexcept
virtual void setName (const String &newName)
String getComponentID () const noexcept
void setComponentID (const String &newID)
virtual void setVisible (bool shouldBeVisible)
bool isVisible () const noexcept
virtual void visibilityChanged ()
bool isShowing () const
virtual void addToDesktop (int windowStyleFlags, void *nativeWindowToAttachTo=nullptr)
void removeFromDesktop ()
bool isOnDesktop () const noexcept
ComponentPeergetPeer () const
virtual void userTriedToCloseWindow ()
virtual void minimisationStateChanged (bool isNowMinimised)
virtual float getDesktopScaleFactor () const
void toFront (bool shouldAlsoGainKeyboardFocus)
void toBack ()
void toBehind (Component *other)
void setAlwaysOnTop (bool shouldStayOnTop)
bool isAlwaysOnTop () const noexcept
int getX () const noexcept
int getY () const noexcept
int getWidth () const noexcept
int getHeight () const noexcept
int getRight () const noexcept
Point< intgetPosition () const noexcept
int getBottom () const noexcept
Rectangle< intgetBounds () const noexcept
Rectangle< intgetLocalBounds () const noexcept
Rectangle< intgetBoundsInParent () const noexcept
int getScreenX () const
int getScreenY () const
Point< intgetScreenPosition () const
Rectangle< intgetScreenBounds () const
Point< intgetLocalPoint (const Component *sourceComponent, Point< int > pointRelativeToSourceComponent) const
Point< float > getLocalPoint (const Component *sourceComponent, Point< float > pointRelativeToSourceComponent) const
Rectangle< intgetLocalArea (const Component *sourceComponent, Rectangle< int > areaRelativeToSourceComponent) const
Rectangle< float > getLocalArea (const Component *sourceComponent, Rectangle< float > areaRelativeToSourceComponent) const
Point< intlocalPointToGlobal (Point< int > localPoint) const
Point< float > localPointToGlobal (Point< float > localPoint) const
Rectangle< intlocalAreaToGlobal (Rectangle< int > localArea) const
Rectangle< float > localAreaToGlobal (Rectangle< float > localArea) const
void setTopLeftPosition (int x, int y)
void setTopLeftPosition (Point< int > newTopLeftPosition)
void setTopRightPosition (int x, int y)
void setSize (int newWidth, int newHeight)
void setBounds (int x, int y, int width, int height)
void setBounds (Rectangle< int > newBounds)
void setBoundsRelative (float proportionalX, float proportionalY, float proportionalWidth, float proportionalHeight)
void setBoundsRelative (Rectangle< float > proportionalArea)
void setBoundsInset (BorderSize< int > borders)
void setBoundsToFit (Rectangle< int > targetArea, Justification justification, bool onlyReduceInSize)
void setCentrePosition (int x, int y)
void setCentrePosition (Point< int > newCentrePosition)
void setCentreRelative (float x, float y)
void centreWithSize (int width, int height)
void setTransform (const AffineTransform &transform)
AffineTransform getTransform () const
bool isTransformed () const noexcept
int proportionOfWidth (float proportion) const noexcept
int proportionOfHeight (float proportion) const noexcept
int getParentWidth () const noexcept
int getParentHeight () const noexcept
Rectangle< intgetParentMonitorArea () const
int getNumChildComponents () const noexcept
ComponentgetChildComponent (int index) const noexcept
int getIndexOfChildComponent (const Component *child) const noexcept
const Array< Component * > & getChildren () const noexcept
ComponentfindChildWithID (StringRef componentID) const noexcept
void addChildComponent (Component *child, int zOrder=-1)
void addChildComponent (Component &child, int zOrder=-1)
void addAndMakeVisible (Component *child, int zOrder=-1)
void addAndMakeVisible (Component &child, int zOrder=-1)
void addChildAndSetID (Component *child, const String &componentID)
void removeChildComponent (Component *childToRemove)
ComponentremoveChildComponent (int childIndexToRemove)
void removeAllChildren ()
void deleteAllChildren ()
ComponentgetParentComponent () const noexcept
template<class TargetClass>
TargetClass * findParentComponentOfClass () const
ComponentgetTopLevelComponent () const noexcept
bool isParentOf (const Component *possibleChild) const noexcept
virtual void childrenChanged ()
virtual bool hitTest (int x, int y)
void setInterceptsMouseClicks (bool allowClicksOnThisComponent, bool allowClicksOnChildComponents) noexcept
void getInterceptsMouseClicks (bool &allowsClicksOnThisComponent, bool &allowsClicksOnChildComponents) const noexcept
bool contains (Point< int > localPoint)
bool contains (Point< float > localPoint)
bool reallyContains (Point< int > localPoint, bool returnTrueIfWithinAChild)
bool reallyContains (Point< float > localPoint, bool returnTrueIfWithinAChild)
ComponentgetComponentAt (int x, int y)
ComponentgetComponentAt (Point< int > position)
ComponentgetComponentAt (Point< float > position)
void repaint ()
void repaint (int x, int y, int width, int height)
void repaint (Rectangle< int > area)
void setBufferedToImage (bool shouldBeBuffered)
Image createComponentSnapshot (Rectangle< int > areaToGrab, bool clipImageToComponentBounds=true, float scaleFactor=1.0f)
void paintEntireComponent (Graphics &context, bool ignoreAlphaLevel)
void setPaintingIsUnclipped (bool shouldPaintWithoutClipping) noexcept
bool isPaintingUnclipped () const noexcept
void setComponentEffect (ImageEffectFilter *newEffect)
ImageEffectFiltergetComponentEffect () const noexcept
LookAndFeelgetLookAndFeel () const noexcept
void setLookAndFeel (LookAndFeel *newLookAndFeel)
void sendLookAndFeelChange ()
void setOpaque (bool shouldBeOpaque)
bool isOpaque () const noexcept
void setBroughtToFrontOnMouseClick (bool shouldBeBroughtToFront) noexcept
bool isBroughtToFrontOnMouseClick () const noexcept
void setExplicitFocusOrder (int newFocusOrderIndex)
int getExplicitFocusOrder () const
void setFocusContainerType (FocusContainerType containerType) noexcept
bool isFocusContainer () const noexcept
bool isKeyboardFocusContainer () const noexcept
ComponentfindFocusContainer () const
ComponentfindKeyboardFocusContainer () const
void setWantsKeyboardFocus (bool wantsFocus) noexcept
bool getWantsKeyboardFocus () const noexcept
void setMouseClickGrabsKeyboardFocus (bool shouldGrabFocus)
bool getMouseClickGrabsKeyboardFocus () const noexcept
void grabKeyboardFocus ()
void giveAwayKeyboardFocus ()
bool hasKeyboardFocus (bool trueIfChildIsFocused) const
void moveKeyboardFocusToSibling (bool moveToNext)
virtual std::unique_ptr< ComponentTraversercreateFocusTraverser ()
virtual std::unique_ptr< ComponentTraversercreateKeyboardFocusTraverser ()
void setHasFocusOutline (bool hasFocusOutline) noexcept
bool hasFocusOutline () const noexcept
bool isEnabled () const noexcept
void setEnabled (bool shouldBeEnabled)
virtual void enablementChanged ()
float getAlpha () const noexcept
void setAlpha (float newAlpha)
virtual void alphaChanged ()
void setMouseCursor (const MouseCursor &cursorType)
virtual MouseCursor getMouseCursor ()
void updateMouseCursor () const
virtual void paintOverChildren (Graphics &g)
void mouseMove (const MouseEvent &event) override
void mouseEnter (const MouseEvent &event) override
void mouseExit (const MouseEvent &event) override
void mouseDown (const MouseEvent &event) override
void mouseDoubleClick (const MouseEvent &event) override
void mouseWheelMove (const MouseEvent &event, const MouseWheelDetails &wheel) override
void mouseMagnify (const MouseEvent &event, float scaleFactor) override
void setRepaintsOnMouseActivity (bool shouldRepaint) noexcept
void addMouseListener (MouseListener *newListener, bool wantsEventsForAllNestedChildComponents)
void removeMouseListener (MouseListener *listenerToRemove)
void addKeyListener (KeyListener *newListener)
void removeKeyListener (KeyListener *listenerToRemove)
virtual bool keyPressed (const KeyPress &key)
virtual bool keyStateChanged (bool isKeyDown)
virtual void modifierKeysChanged (const ModifierKeys &modifiers)
virtual void focusGained (FocusChangeType cause)
virtual void focusLost (FocusChangeType cause)
virtual void focusOfChildComponentChanged (FocusChangeType cause)
bool isMouseOver (bool includeChildren=false) const
bool isMouseButtonDown (bool includeChildren=false) const
bool isMouseOverOrDragging (bool includeChildren=false) const
Point< intgetMouseXYRelative () const
virtual void childBoundsChanged (Component *child)
virtual void parentSizeChanged ()
virtual void broughtToFront ()
void addComponentListener (ComponentListener *newListener)
void removeComponentListener (ComponentListener *listenerToRemove)
void postCommandMessage (int commandId)
virtual void handleCommandMessage (int commandId)
void enterModalState (bool takeKeyboardFocus=true, ModalComponentManager::Callback *callback=nullptr, bool deleteWhenDismissed=false)
void exitModalState (int returnValue)
bool isCurrentlyModal (bool onlyConsiderForemostModalComponent=true) const noexcept
bool isCurrentlyBlockedByAnotherModalComponent () const
virtual bool canModalEventBeSentToComponent (const Component *targetComponent)
virtual void inputAttemptWhenModal ()
NamedValueSetgetProperties () noexcept
const NamedValueSetgetProperties () const noexcept
Colour findColour (int colourID, bool inheritFromParent=false) const
void setColour (int colourID, Colour newColour)
void removeColour (int colourID)
bool isColourSpecified (int colourID) const
void copyAllExplicitColoursTo (Component &target) const
virtual void colourChanged ()
voidgetWindowHandle () const
PositionergetPositioner () const noexcept
void setPositioner (Positioner *newPositioner)
void setCachedComponentImage (CachedComponentImage *newCachedImage)
CachedComponentImagegetCachedComponentImage () const noexcept
void setViewportIgnoreDragFlag (bool ignoreDrag) noexcept
bool getViewportIgnoreDragFlag () const noexcept
String getTitle () const noexcept
void setTitle (const String &newTitle)
String getDescription () const noexcept
void setDescription (const String &newDescription)
String getHelpText () const noexcept
void setHelpText (const String &newHelpText)
void setAccessible (bool shouldBeAccessible)
bool isAccessible () const noexcept
AccessibilityHandlergetAccessibilityHandler ()
void invalidateAccessibilityHandler ()
void setFocusContainer (bool shouldBeFocusContainer) noexcept
void contains (int, int)=delete
Public Member Functions inherited from juce::MouseListener
virtual ~MouseListener ()=default

Public Attributes

std::function< void()> onPanelMove
std::function< void(bool)> onPanelShowHide

Private Member Functions

std::unique_ptr< AccessibilityHandlercreateAccessibilityHandler () override
void lookAndFeelChanged () override
void componentMovedOrResized (Component &, bool wasMoved, bool wasResized) override
void changeListenerCallback (ChangeBroadcaster *) override
Rectangle< intcalculateBoundsInParent (Component &) const
void calculateAndRemoveShadowBounds (Rectangle< int > &bounds)
bool isMouseEventInThisOrChildren (Component *)
Private Member Functions inherited from juce::ComponentListener
virtual ~ComponentListener ()=default
virtual void componentBroughtToFront (Component &component)
virtual void componentVisibilityChanged (Component &component)
virtual void componentChildrenChanged (Component &component)
virtual void componentParentHierarchyChanged (Component &component)
virtual void componentNameChanged (Component &component)
virtual void componentBeingDeleted (Component &component)
virtual void componentEnablementChanged (Component &component)
Private Member Functions inherited from juce::ChangeListener
virtual ~ChangeListener ()=default

Private Attributes

Componentparent = nullptr
OptionalScopedPointer< ComponentcontentComponent
OptionalScopedPointer< ComponenttitleBarComponent
Label titleLabel
ShapeButton dismissButton { "dismissButton", Colours::lightgrey, Colours::lightgrey, Colours::white }
Rectangle< intshadowArea
bool isOnLeft = false
bool isShowing = false
int panelWidth = 0
int shadowWidth = 15
int titleBarHeight = 40
Rectangle< intstartingBounds
bool shouldResize = false
int amountMoved = 0
bool shouldShowDismissButton = true

Additional Inherited Members

Static Public Member Functions inherited from juce::Component
static float JUCE_CALLTYPE getApproximateScaleFactorForComponent (const Component *targetComponent)
static Component *JUCE_CALLTYPE getCurrentlyFocusedComponent () noexcept
static void JUCE_CALLTYPE unfocusAllComponents ()
static void JUCE_CALLTYPE beginDragAutoRepeat (int millisecondsBetweenCallbacks)
static bool JUCE_CALLTYPE isMouseButtonDownAnywhere () noexcept
static int JUCE_CALLTYPE getNumCurrentlyModalComponents () noexcept
static Component *JUCE_CALLTYPE getCurrentlyModalComponent (int index=0) noexcept
Protected Member Functions inherited from juce::Component
virtual ComponentPeercreateNewPeer (int styleFlags, void *nativeWindowToAttachTo)
Static Protected Member Functions inherited from juce::Component
static std::unique_ptr< AccessibilityHandlercreateIgnoredAccessibilityHandler (Component &)

Detailed Description

A component that is positioned on either the left- or right-hand side of its parent, containing a header and some content. This sort of component is typically used for navigation and forms in mobile applications.

When triggered with the showOrHide() method, the SidePanel will animate itself to its new position. This component also contains some logic to reactively resize and dismiss itself when the user drags it.

@tags{GUI}

Member Enumeration Documentation

◆ ColourIds

enum juce::SidePanel::ColourIds

A set of colour IDs to use to change the colour of various aspects of the SidePanel.

These constants can be used either via the Component::setColour(), or LookAndFeel::setColour() methods.

See also
Component::setColour, Component::findColour, LookAndFeel::setColour, LookAndFeel::findColour
Enumerator
backgroundColour 
titleTextColour 
shadowBaseColour 
dismissButtonNormalColour 
dismissButtonOverColour 
dismissButtonDownColour 

Constructor & Destructor Documentation

◆ SidePanel()

juce::SidePanel::SidePanel ( StringRef title,
int width,
bool positionOnLeft,
Component * contentComponent = nullptr,
bool deleteComponentWhenNoLongerNeeded = true )

Creates a SidePanel component.

Parameters
titlethe text to use for the SidePanel's title bar
widththe width of the SidePanel
positionOnLeftif true, the SidePanel will be positioned on the left of its parent component and if false, the SidePanel will be positioned on the right of its parent component
contentComponentthe component to add to this SidePanel - this content will take up the full size of the SidePanel, minus the height of the title bar. You can pass nullptr to this if you like and set the content component later using the setContent() method
deleteComponentWhenNoLongerNeededif true, the component will be deleted automatically when the SidePanel is deleted or when a different component is added. If false, the caller must manage the lifetime of the component

◆ ~SidePanel()

juce::SidePanel::~SidePanel ( )
override

Destructor

Member Function Documentation

◆ calculateAndRemoveShadowBounds()

void juce::SidePanel::calculateAndRemoveShadowBounds ( Rectangle< int > & bounds)
private

◆ calculateBoundsInParent()

Rectangle< int > juce::SidePanel::calculateBoundsInParent ( Component & parentComp) const
private

◆ changeListenerCallback()

void juce::SidePanel::changeListenerCallback ( ChangeBroadcaster * source)
overrideprivatevirtual

Your subclass should implement this method to receive the callback.

Parameters
sourcethe ChangeBroadcaster that triggered the callback.

Implements juce::ChangeListener.

◆ componentMovedOrResized()

void juce::SidePanel::componentMovedOrResized ( Component & component,
bool wasMoved,
bool wasResized )
overrideprivatevirtual

Called when the component's position or size changes.

Parameters
componentthe component that was moved or resized
wasMovedtrue if the component's top-left corner has just moved
wasResizedtrue if the component's width or height has just changed
See also
Component::setBounds, Component::resized, Component::moved

Reimplemented from juce::ComponentListener.

◆ createAccessibilityHandler()

std::unique_ptr< AccessibilityHandler > juce::SidePanel::createAccessibilityHandler ( )
overrideprivatevirtual

Override this method to return a custom AccessibilityHandler for this component.

The default implementation creates and returns a AccessibilityHandler object with an unspecified role, meaning that it will be visible to accessibility clients but without a specific role, action callbacks or interfaces. To control how accessibility clients see and interact with your component subclass AccessibilityHandler, implement the desired behaviours, and return an instance of it from this method in your component subclass.

The accessibility handler you return here is guaranteed to be destroyed before its Component, so it's safe to store and use a reference back to the Component inside the AccessibilityHandler if necessary.

See also
getAccessibilityHandler

Reimplemented from juce::Component.

◆ getContent()

Component * juce::SidePanel::getContent ( ) const
inlinenoexcept

Returns the component that's currently being used inside the SidePanel.

See also
setViewedComponent

◆ getShadowWidth()

int juce::SidePanel::getShadowWidth ( ) const
inlinenoexcept

Returns the width of the shadow that will be drawn on the side of the panel.

◆ getTitleBarComponent()

Component * juce::SidePanel::getTitleBarComponent ( ) const
inlinenoexcept

Returns the component that is currently being used as the title bar of the SidePanel.

See also
setTitleBarComponent

◆ getTitleBarHeight()

int juce::SidePanel::getTitleBarHeight ( ) const
inlinenoexcept

Returns the height of the title bar at the top of the SidePanel.

◆ getTitleText()

String juce::SidePanel::getTitleText ( ) const
inlinenoexcept

Returns the text that is displayed in the title bar at the top of the SidePanel.

◆ isMouseEventInThisOrChildren()

bool juce::SidePanel::isMouseEventInThisOrChildren ( Component * eventComponent)
private

◆ isPanelOnLeft()

bool juce::SidePanel::isPanelOnLeft ( ) const
inlinenoexcept

Returns true if the SidePanel is positioned on the left of its parent.

◆ isPanelShowing()

bool juce::SidePanel::isPanelShowing ( ) const
inlinenoexcept

Returns true if the SidePanel is currently showing.

◆ lookAndFeelChanged()

void juce::SidePanel::lookAndFeelChanged ( )
overrideprivatevirtual

Called to let the component react to a change in the look-and-feel setting.

When the look-and-feel is changed for a component, this will be called in all its child components, recursively.

It can also be triggered manually by the sendLookAndFeelChange() method, in case an application uses a LookAndFeel class that might have changed internally.

See also
sendLookAndFeelChange, getLookAndFeel

Reimplemented from juce::Component.

◆ mouseDrag()

void juce::SidePanel::mouseDrag ( const MouseEvent & event)
overridevirtual

Called when the mouse is moved while a button is held down.

When a mouse button is pressed inside a component, that component receives mouseDrag callbacks each time the mouse moves, even if the mouse strays outside the component's bounds.

Parameters
Eventdetails about the position and status of the mouse event, including the source component in which it occurred
See also
mouseDown, mouseUp, mouseMove, contains, setDragRepeatInterval

Reimplemented from juce::Component.

◆ mouseUp()

void juce::SidePanel::mouseUp ( const MouseEvent & event)
overridevirtual

Called when a mouse button is released.

A mouseUp callback is sent to the component in which a button was pressed even if the mouse is actually over a different component when the button is released.

The MouseEvent object passed in contains lots of methods for finding out which buttons were down just before they were released.

Parameters
Eventdetails about the position and status of the mouse event, including the source component in which it occurred
See also
mouseDown, mouseDrag, mouseDoubleClick, contains

Reimplemented from juce::Component.

◆ moved()

void juce::SidePanel::moved ( )
overridevirtual

Called when this component's position has been changed.

This is called when the position relative to its parent changes, not when its absolute position on the screen changes (so it won't be called for all child components when a parent component is moved).

The method is called synchronously as a result of the setBounds, setTopLeftPosition or any of the other repositioning methods, and like resized(), it will be called each time those methods are called.

If the component is a top-level window on the desktop, its position could also be changed by operating-system factors beyond the application's control.

See also
resized, setBounds

Reimplemented from juce::Component.

◆ paint()

void juce::SidePanel::paint ( Graphics & g)
overridevirtual

Components can override this method to draw their content.

The paint() method gets called when a region of a component needs redrawing, either because the component's repaint() method has been called, or because something has happened on the screen that means a section of a window needs to be redrawn.

Any child components will draw themselves over whatever this method draws. If you need to paint over the top of your child components, you can also implement the paintOverChildren() method to do this.

If you want to cause a component to redraw itself, this is done asynchronously - calling the repaint() method marks a region of the component as "dirty", and the paint() method will automatically be called sometime later, by the message thread, to paint any bits that need refreshing. In JUCE (and almost all modern UI frameworks), you never redraw something synchronously.

You should never need to call this method directly - to take a snapshot of the component you could use createComponentSnapshot() or paintEntireComponent().

Parameters
gthe graphics context that must be used to do the drawing operations.
See also
repaint, paintOverChildren, Graphics

Reimplemented from juce::Component.

◆ parentHierarchyChanged()

void juce::SidePanel::parentHierarchyChanged ( )
overridevirtual

Called to indicate that the component's parents have changed.

When a component is added or removed from its parent, this method will be called on all of its children (recursively - so all children of its children will also be called as well).

Subclasses can override this if they need to react to this in some way.

See also
getParentComponent, isShowing, ComponentListener::componentParentHierarchyChanged

Reimplemented from juce::Component.

◆ resized()

void juce::SidePanel::resized ( )
overridevirtual

Called when this component's size has been changed.

A component can implement this method to do things such as laying out its child components when its width or height changes.

The method is called synchronously as a result of the setBounds or setSize methods, so repeatedly changing a components size will repeatedly call its resized method (unlike things like repainting, where multiple calls to repaint are coalesced together).

If the component is a top-level window on the desktop, its size could also be changed by operating-system factors beyond the application's control.

See also
moved, setSize

Reimplemented from juce::Component.

◆ setContent()

void juce::SidePanel::setContent ( Component * newContentComponent,
bool deleteComponentWhenNoLongerNeeded = true )

Sets the component that this SidePanel will contain.

This will add the given component to this SidePanel and position it below the title bar.

(Don't add or remove any child components directly using the normal Component::addChildComponent() methods).

Parameters
newContentComponentthe component to add to this SidePanel, or nullptr to remove the current component.
deleteComponentWhenNoLongerNeededif true, the component will be deleted automatically when the SidePanel is deleted or when a different component is added. If false, the caller must manage the lifetime of the component
See also
getContent

◆ setShadowWidth()

void juce::SidePanel::setShadowWidth ( int newWidth)
inlinenoexcept

Sets the width of the shadow that will be drawn on the side of the panel.

◆ setTitleBarComponent()

void juce::SidePanel::setTitleBarComponent ( Component * titleBarComponentToUse,
bool keepDismissButton,
bool deleteComponentWhenNoLongerNeeded = true )

Sets a custom component to be used for the title bar of this SidePanel, replacing the default. You can pass a nullptr to revert to the default title bar.

Parameters
titleBarComponentToUsethe component to use as the title bar, or nullptr to use the default
keepDismissButtonif false the specified component will take up the full width of the title bar including the dismiss button but if true, the default dismiss button will be kept
deleteComponentWhenNoLongerNeededif true, the component will be deleted automatically when the SidePanel is deleted or when a different component is added. If false, the caller must manage the lifetime of the component
See also
getTitleBarComponent

◆ setTitleBarHeight()

void juce::SidePanel::setTitleBarHeight ( int newHeight)
inlinenoexcept

Sets the height of the title bar at the top of the SidePanel.

◆ showOrHide()

void juce::SidePanel::showOrHide ( bool show)

Shows or hides the SidePanel.

This will animate the SidePanel to either its full width or to be hidden on the left- or right-hand side of its parent component depending on the value of positionOnLeft that was passed to the constructor.

Parameters
showif true, this will show the SidePanel and if false the SidePanel will be hidden

Member Data Documentation

◆ amountMoved

int juce::SidePanel::amountMoved = 0
private

◆ contentComponent

OptionalScopedPointer<Component> juce::SidePanel::contentComponent
private

◆ dismissButton

ShapeButton juce::SidePanel::dismissButton { "dismissButton", Colours::lightgrey, Colours::lightgrey, Colours::white }
private

◆ isOnLeft

bool juce::SidePanel::isOnLeft = false
private

◆ isShowing

bool juce::SidePanel::isShowing = false
private

◆ onPanelMove

std::function<void()> juce::SidePanel::onPanelMove

You can assign a lambda to this callback object and it will be called when the panel is moved.

◆ onPanelShowHide

std::function<void (bool)> juce::SidePanel::onPanelShowHide

You can assign a lambda to this callback object and it will be called when the panel is shown or hidden.

◆ panelWidth

int juce::SidePanel::panelWidth = 0
private

◆ parent

Component* juce::SidePanel::parent = nullptr
private

◆ shadowArea

Rectangle<int> juce::SidePanel::shadowArea
private

◆ shadowWidth

int juce::SidePanel::shadowWidth = 15
private

◆ shouldResize

bool juce::SidePanel::shouldResize = false
private

◆ shouldShowDismissButton

bool juce::SidePanel::shouldShowDismissButton = true
private

◆ startingBounds

Rectangle<int> juce::SidePanel::startingBounds
private

◆ titleBarComponent

OptionalScopedPointer<Component> juce::SidePanel::titleBarComponent
private

◆ titleBarHeight

int juce::SidePanel::titleBarHeight = 40
private

◆ titleLabel

Label juce::SidePanel::titleLabel
private

The documentation for this class was generated from the following files: