openshot-audio  0.1.5
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
juce::ResizableWindow Class Reference

#include <juce_gui_basics.h>

Inheritance diagram for juce::ResizableWindow:
juce::TopLevelWindow juce::Component juce::MouseListener juce::DocumentWindow juce::FileChooserDialogBox juce::DialogWindow juce::MultiDocumentPanelWindow juce::DefaultDialogWindow juce::Toolbar::CustomisationDialog

Classes

struct  LookAndFeelMethods
 

Public Types

enum  ColourIds { backgroundColourId = 0x1005700 }
 
- Public Types inherited from juce::Component
enum  FocusChangeType { focusChangedByMouseClick, focusChangedByTabKey, focusChangedDirectly }
 

Public Member Functions

 ResizableWindow (const String &name, bool addToDesktop)
 
 ResizableWindow (const String &name, Colour backgroundColour, bool addToDesktop)
 
 ~ResizableWindow ()
 
Colour getBackgroundColour () const noexcept
 
void setBackgroundColour (Colour newColour)
 
void setResizable (bool shouldBeResizable, bool useBottomRightCornerResizer)
 
bool isResizable () const noexcept
 
void setResizeLimits (int newMinimumWidth, int newMinimumHeight, int newMaximumWidth, int newMaximumHeight) noexcept
 
void setDraggable (bool shouldBeDraggable) noexcept
 
bool isDraggable () const noexcept
 
ComponentBoundsConstrainergetConstrainer () noexcept
 
void setConstrainer (ComponentBoundsConstrainer *newConstrainer)
 
void setBoundsConstrained (const Rectangle< int > &bounds)
 
bool isFullScreen () const
 
void setFullScreen (bool shouldBeFullScreen)
 
bool isMinimised () const
 
void setMinimised (bool shouldMinimise)
 
bool isKioskMode () const
 
String getWindowStateAsString ()
 
bool restoreWindowStateFromString (const String &previousState)
 
ComponentgetContentComponent () const noexcept
 
void setContentOwned (Component *newContentComponent, bool resizeToFitWhenContentChangesSize)
 
void setContentNonOwned (Component *newContentComponent, bool resizeToFitWhenContentChangesSize)
 
void clearContentComponent ()
 
void setContentComponentSize (int width, int height)
 
virtual BorderSize< int > getBorderThickness ()
 
virtual BorderSize< int > getContentComponentBorder ()
 
 JUCE_DEPRECATED (void setContentComponent(Component *newContentComponent, bool deleteOldOne=true, bool resizeToFit=false))
 
- Public Member Functions inherited from juce::TopLevelWindow
 TopLevelWindow (const String &name, bool addToDesktop)
 
 ~TopLevelWindow ()
 
bool isActiveWindow () const noexcept
 
void centreAroundComponent (Component *componentToCentreAround, int width, int height)
 
void setDropShadowEnabled (bool useShadow)
 
bool isDropShadowEnabled () const noexcept
 
void setUsingNativeTitleBar (bool useNativeTitleBar)
 
bool isUsingNativeTitleBar () const noexcept
 
void addToDesktop ()
 
void addToDesktop (int windowStyleFlags, void *nativeWindowToAttachTo=nullptr) override
 
- Public Member Functions inherited from juce::Component
 Component () noexcept
 
virtual ~Component ()
 
 Component (const String &componentName) noexcept
 
const StringgetName () const noexcept
 
virtual void setName (const String &newName)
 
const StringgetComponentID () const noexcept
 
void setComponentID (const String &newID)
 
virtual void setVisible (bool shouldBeVisible)
 
bool isVisible () const noexcept
 
bool isShowing () const
 
void removeFromDesktop ()
 
bool isOnDesktop () const noexcept
 
ComponentPeergetPeer () const
 
virtual void userTriedToCloseWindow ()
 
virtual void minimisationStateChanged (bool isNowMinimised)
 
virtual float getDesktopScaleFactor () const
 
void toFront (bool shouldAlsoGainFocus)
 
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< int > getPosition () const noexcept
 
int getBottom () const noexcept
 
const Rectangle< int > & getBounds () const noexcept
 
Rectangle< int > getLocalBounds () const noexcept
 
Rectangle< int > getBoundsInParent () const noexcept
 
int getScreenX () const
 
int getScreenY () const
 
Point< int > getScreenPosition () const
 
Rectangle< int > getScreenBounds () const
 
Point< int > getLocalPoint (const Component *sourceComponent, Point< int > pointRelativeToSourceComponent) const
 
Point< float > getLocalPoint (const Component *sourceComponent, Point< float > pointRelativeToSourceComponent) const
 
Rectangle< int > getLocalArea (const Component *sourceComponent, const Rectangle< int > &areaRelativeToSourceComponent) const
 
Point< int > localPointToGlobal (Point< int > localPoint) const
 
Point< float > localPointToGlobal (Point< float > localPoint) const
 
Rectangle< int > localAreaToGlobal (const Rectangle< int > &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 (const Rectangle< int > &newBounds)
 
void setBounds (const RelativeRectangle &newBounds)
 
void setBounds (const String &newBoundsExpression)
 
void setBoundsRelative (float proportionalX, float proportionalY, float proportionalWidth, float proportionalHeight)
 
void setBoundsInset (const BorderSize< int > &borders)
 
void setBoundsToFit (int x, int y, int width, int height, Justification justification, bool onlyReduceInSize)
 
void setCentrePosition (int x, int y)
 
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< int > getParentMonitorArea () const
 
int getNumChildComponents () const noexcept
 
ComponentgetChildComponent (int index) const noexcept
 
int getIndexOfChildComponent (const Component *child) 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 reallyContains (Point< int > localPoint, bool returnTrueIfWithinAChild)
 
ComponentgetComponentAt (int x, int y)
 
ComponentgetComponentAt (Point< int > position)
 
void repaint ()
 
void repaint (int x, int y, int width, int height)
 
void repaint (const Rectangle< int > &area)
 
void setBufferedToImage (bool shouldBeBuffered)
 
Image createComponentSnapshot (const Rectangle< int > &areaToGrab, bool clipImageToComponentBounds=true, float scaleFactor=1.0f)
 
void paintEntireComponent (Graphics &context, bool ignoreAlphaLevel)
 
void setPaintingIsUnclipped (bool shouldPaintWithoutClipping) 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 setWantsKeyboardFocus (bool wantsFocus) noexcept
 
bool getWantsKeyboardFocus () const noexcept
 
void setMouseClickGrabsKeyboardFocus (bool shouldGrabFocus)
 
bool getMouseClickGrabsKeyboardFocus () const noexcept
 
void grabKeyboardFocus ()
 
bool hasKeyboardFocus (bool trueIfChildIsFocused) const
 
void moveKeyboardFocusToSibling (bool moveToNext)
 
virtual KeyboardFocusTraversercreateFocusTraverser ()
 
int getExplicitFocusOrder () const
 
void setExplicitFocusOrder (int newFocusOrderIndex)
 
void setFocusContainer (bool shouldBeFocusContainer) noexcept
 
bool isFocusContainer () const noexcept
 
bool isEnabled () const noexcept
 
void setEnabled (bool shouldBeEnabled)
 
virtual void enablementChanged ()
 
void setAlpha (float newAlpha)
 
float getAlpha () const
 
void setMouseCursor (const MouseCursor &cursorType)
 
virtual MouseCursor getMouseCursor ()
 
void updateMouseCursor () const
 
virtual void paintOverChildren (Graphics &g)
 
virtual void mouseMove (const MouseEvent &event) override
 
virtual void mouseEnter (const MouseEvent &event) override
 
virtual void mouseExit (const MouseEvent &event) override
 
virtual void mouseDoubleClick (const MouseEvent &event) override
 
virtual void mouseWheelMove (const MouseEvent &event, const MouseWheelDetails &wheel) override
 
virtual void mouseMagnify (const MouseEvent &event, float scaleFactor)
 
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)
 
bool isMouseOver (bool includeChildren=false) const
 
bool isMouseButtonDown () const
 
bool isMouseOverOrDragging () const
 
Point< int > getMouseXYRelative () const
 
virtual void broughtToFront ()
 
void addComponentListener (ComponentListener *newListener)
 
void removeComponentListener (ComponentListener *listenerToRemove)
 
void postCommandMessage (int commandId)
 
virtual void handleCommandMessage (int commandId)
 
int runModalLoop ()
 
void enterModalState (bool takeKeyboardFocus=true, ModalComponentManager::Callback *callback=nullptr, bool deleteWhenDismissed=false)
 
void exitModalState (int returnValue)
 
bool isCurrentlyModal () 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 ()
 
virtual MarkerListgetMarkers (bool xAxis)
 
void * getWindowHandle () const
 
PositionergetPositioner () const noexcept
 
void setPositioner (Positioner *newPositioner)
 
void setCachedComponentImage (CachedComponentImage *newCachedImage)
 
CachedComponentImagegetCachedComponentImage () const noexcept
 
 JUCE_DEPRECATED (Point< int > relativePositionToGlobal(Point< int >) const)
 
 JUCE_DEPRECATED (Point< int > globalPositionToRelative(Point< int >) const)
 
 JUCE_DEPRECATED (Point< int > relativePositionToOtherComponent(const Component *, Point< int >) const)
 
- Public Member Functions inherited from juce::MouseListener
virtual ~MouseListener ()
 

Protected Member Functions

void paint (Graphics &) override
 
void moved () override
 
void resized () override
 
void mouseDown (const MouseEvent &) override
 
void mouseDrag (const MouseEvent &) override
 
void mouseUp (const MouseEvent &) override
 
void lookAndFeelChanged () override
 
void childBoundsChanged (Component *) override
 
void parentSizeChanged () override
 
void visibilityChanged () override
 
void activeWindowStatusChanged () override
 
int getDesktopWindowStyleFlags () const override
 
- Protected Member Functions inherited from juce::TopLevelWindow
void focusOfChildComponentChanged (FocusChangeType) override
 
void parentHierarchyChanged () override
 
void recreateDesktopWindow ()
 
- Protected Member Functions inherited from juce::Component
virtual ComponentPeercreateNewPeer (int styleFlags, void *nativeWindowToAttachTo)
 

Protected Attributes

ScopedPointer< ResizableCornerComponentresizableCorner
 
ScopedPointer< ResizableBorderComponentresizableBorder
 

Additional Inherited Members

- Static Public Member Functions inherited from juce::TopLevelWindow
static int getNumTopLevelWindows () noexcept
 
static TopLevelWindowgetTopLevelWindow (int index) noexcept
 
static TopLevelWindowgetActiveTopLevelWindow () noexcept
 
- Static Public Member Functions inherited from juce::Component
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
 

Detailed Description

A base class for top-level windows that can be dragged around and resized.

To add content to the window, use its setContentOwned() or setContentNonOwned() methods to give it a component that will remain positioned inside it (leaving a gap around the edges for a border).

It's not advisable to add child components directly to a ResizableWindow: put them inside your content component instead. And overriding methods like resized(), moved(), etc is also not recommended - instead override these methods for your content component. (If for some obscure reason you do need to override these methods, always remember to call the super-class's resized() method too, otherwise it'll fail to lay out the window decorations correctly).

By default resizing isn't enabled - use the setResizable() method to enable it and to choose the style of resizing to use.

See also
TopLevelWindow

Member Enumeration Documentation

◆ ColourIds

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

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
backgroundColourId 

A colour to use to fill the window's background.

Constructor & Destructor Documentation

◆ ResizableWindow() [1/2]

ResizableWindow::ResizableWindow ( const String name,
bool  addToDesktop 
)

Creates a ResizableWindow.

This constructor doesn't specify a background colour, so the LookAndFeel's default background colour will be used.

Parameters
namethe name to give the component
addToDesktopif true, the window will be automatically added to the desktop; if false, you can use it as a child component

◆ ResizableWindow() [2/2]

ResizableWindow::ResizableWindow ( const String name,
Colour  backgroundColour,
bool  addToDesktop 
)

Creates a ResizableWindow.

Parameters
namethe name to give the component
backgroundColourthe colour to use for filling the window's background.
addToDesktopif true, the window will be automatically added to the desktop; if false, you can use it as a child component

◆ ~ResizableWindow()

ResizableWindow::~ResizableWindow ( )

Destructor. If a content component has been set with setContentOwned(), it will be deleted.

Member Function Documentation

◆ activeWindowStatusChanged()

void ResizableWindow::activeWindowStatusChanged ( )
overrideprotectedvirtual

This callback happens when this window becomes active or inactive.

See also
isActiveWindow

Reimplemented from juce::TopLevelWindow.

Reimplemented in juce::DocumentWindow, and juce::MultiDocumentPanelWindow.

◆ childBoundsChanged()

void ResizableWindow::childBoundsChanged ( Component child)
overrideprotectedvirtual

Called when one of this component's children is moved or resized.

If the parent wants to know about changes to its immediate children (not to children of its children), this is the method to override.

See also
moved, resized, parentSizeChanged

Reimplemented from juce::Component.

◆ clearContentComponent()

void ResizableWindow::clearContentComponent ( )

Removes the current content component. If the previous content component was added with setContentOwned(), it will also be deleted. If it was added with setContentNonOwned(), it will simply be removed from this component.

◆ getBackgroundColour()

Colour ResizableWindow::getBackgroundColour ( ) const
noexcept

Returns the colour currently being used for the window's background.

As a convenience the window will fill itself with this colour, but you can override the paint() method if you need more customised behaviour.

This method is the same as retrieving the colour for ResizableWindow::backgroundColourId.

See also
setBackgroundColour

◆ getBorderThickness()

BorderSize< int > ResizableWindow::getBorderThickness ( )
virtual

Returns the width of the frame to use around the window.

See also
getContentComponentBorder

Reimplemented in juce::DocumentWindow.

◆ getConstrainer()

ComponentBoundsConstrainer* juce::ResizableWindow::getConstrainer ( )
inlinenoexcept

Returns the bounds constrainer object that this window is using. You can access this to change its properties.

◆ getContentComponent()

Component* juce::ResizableWindow::getContentComponent ( ) const
inlinenoexcept

Returns the current content component.

This will be the component set by setContentOwned() or setContentNonOwned, or nullptr if none has yet been specified.

See also
setContentOwned, setContentNonOwned

◆ getContentComponentBorder()

BorderSize< int > ResizableWindow::getContentComponentBorder ( )
virtual

Returns the insets to use when positioning the content component.

See also
getBorderThickness

Reimplemented in juce::DocumentWindow.

◆ getDesktopWindowStyleFlags()

int ResizableWindow::getDesktopWindowStyleFlags ( ) const
overrideprotectedvirtual

Reimplemented from juce::TopLevelWindow.

Reimplemented in juce::DocumentWindow.

◆ getWindowStateAsString()

String ResizableWindow::getWindowStateAsString ( )

Returns a string which encodes the window's current size and position.

This string will encapsulate the window's size, position, and whether it's in full-screen mode. It's intended for letting your application save and restore a window's position.

Use the restoreWindowStateFromString() to restore from a saved state.

See also
restoreWindowStateFromString

◆ isDraggable()

bool juce::ResizableWindow::isDraggable ( ) const
inlinenoexcept

Returns true if the window can be dragged around by the user.

◆ isFullScreen()

bool ResizableWindow::isFullScreen ( ) const

Returns true if the window is currently in full-screen mode.

See also
setFullScreen

◆ isKioskMode()

bool ResizableWindow::isKioskMode ( ) const

Returns true if the window has been placed in kiosk-mode.

See also
Desktop::setKioskComponent

◆ isMinimised()

bool ResizableWindow::isMinimised ( ) const

Returns true if the window is currently minimised.

See also
setMinimised

◆ isResizable()

bool ResizableWindow::isResizable ( ) const
noexcept

Returns true if resizing is enabled.

See also
setResizable

◆ JUCE_DEPRECATED()

juce::ResizableWindow::JUCE_DEPRECATED ( void   setContentComponentComponent *newContentComponent, bool deleteOldOne=true, bool resizeToFit=false)

◆ lookAndFeelChanged()

void ResizableWindow::lookAndFeelChanged ( )
overrideprotectedvirtual

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.

Reimplemented in juce::DocumentWindow.

◆ mouseDown()

void ResizableWindow::mouseDown ( const MouseEvent event)
overrideprotectedvirtual

Called when a mouse button is pressed.

The MouseEvent object passed in contains lots of methods for finding out which button was pressed, as well as which modifier keys (e.g. shift, ctrl) were held down at the time.

Once a button is held down, the mouseDrag method will be called when the mouse moves, until the button is released.

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

Reimplemented from juce::Component.

◆ mouseDrag()

void ResizableWindow::mouseDrag ( const MouseEvent event)
overrideprotectedvirtual

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 ResizableWindow::mouseUp ( const MouseEvent event)
overrideprotectedvirtual

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 ResizableWindow::moved ( )
overrideprotectedvirtual

(if overriding this, make sure you call ResizableWindow::moved() in your subclass)

Reimplemented from juce::Component.

◆ paint()

void ResizableWindow::paint ( Graphics g)
overrideprotectedvirtual

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.

Reimplemented in juce::DocumentWindow.

◆ parentSizeChanged()

void ResizableWindow::parentSizeChanged ( )
overrideprotectedvirtual

Called when this component's immediate parent has been resized.

If the component is a top-level window, this indicates that the screen size has changed.

See also
childBoundsChanged, moved, resized

Reimplemented from juce::Component.

◆ resized()

void ResizableWindow::resized ( )
overrideprotectedvirtual

(if overriding this, make sure you call ResizableWindow::resized() in your subclass)

Reimplemented from juce::Component.

Reimplemented in juce::DocumentWindow, and juce::DialogWindow.

◆ restoreWindowStateFromString()

bool ResizableWindow::restoreWindowStateFromString ( const String previousState)

Restores the window to a previously-saved size and position.

This restores the window's size, positon and full-screen status from an string that was previously created with the getWindowStateAsString() method.

Returns
false if the string wasn't a valid window state
See also
getWindowStateAsString

◆ setBackgroundColour()

void ResizableWindow::setBackgroundColour ( Colour  newColour)

Changes the colour currently being used for the window's background.

As a convenience the window will fill itself with this colour, but you can override the paint() method if you need more customised behaviour.

Note that the opaque state of this window is altered by this call to reflect the opacity of the colour passed-in. On window systems which can't support semi-transparent windows this might cause problems, (though it's unlikely you'll be using this class as a base for a semi-transparent component anyway).

You can also use the ResizableWindow::backgroundColourId colour id to set this colour.

See also
getBackgroundColour

◆ setBoundsConstrained()

void ResizableWindow::setBoundsConstrained ( const Rectangle< int > &  bounds)

Calls the window's setBounds method, after first checking these bounds with the current constrainer.

See also
setConstrainer

◆ setConstrainer()

void ResizableWindow::setConstrainer ( ComponentBoundsConstrainer newConstrainer)

Sets the bounds-constrainer object to use for resizing and dragging this window.

A pointer to the object you pass in will be kept, but it won't be deleted by this object, so it's the caller's responsiblity to manage it.

If you pass a nullptr, then no contraints will be placed on the positioning of the window.

◆ setContentComponentSize()

void ResizableWindow::setContentComponentSize ( int  width,
int  height 
)

Changes the window so that the content component ends up with the specified size.

This is basically a setSize call on the window, but which adds on the borders, so you can specify the content component's target size.

◆ setContentNonOwned()

void ResizableWindow::setContentNonOwned ( Component newContentComponent,
bool  resizeToFitWhenContentChangesSize 
)

Changes the current content component.

This sets a component that will be placed in the centre of the ResizableWindow, (leaving a space around the edge for the border).

You should never add components directly to a ResizableWindow (or any of its subclasses) with addChildComponent(). Instead, add them to the content component.

Parameters
newContentComponentthe new component to use - this component will NOT be deleted by this component, so it's the caller's responsibility to manage its lifetime (it's ok to delete it while this window is still using it). To set a content component that the window will delete, call setContentOwned() instead.
resizeToFitWhenContentChangesSizeif true, then the ResizableWindow will maintain its size such that it always fits around the size of the content component. If false, the new content will be resized to fit the current space available.

◆ setContentOwned()

void ResizableWindow::setContentOwned ( Component newContentComponent,
bool  resizeToFitWhenContentChangesSize 
)

Changes the current content component.

This sets a component that will be placed in the centre of the ResizableWindow, (leaving a space around the edge for the border).

You should never add components directly to a ResizableWindow (or any of its subclasses) with addChildComponent(). Instead, add them to the content component.

Parameters
newContentComponentthe new component to use - this component will be deleted when it's no longer needed (i.e. when the window is deleted or a new content component is set for it). To set a component that this window will not delete, call setContentNonOwned() instead.
resizeToFitWhenContentChangesSizeif true, then the ResizableWindow will maintain its size such that it always fits around the size of the content component. If false, the new content will be resized to fit the current space available.

◆ setDraggable()

void ResizableWindow::setDraggable ( bool  shouldBeDraggable)
noexcept

Can be used to enable or disable user-dragging of the window.

◆ setFullScreen()

void ResizableWindow::setFullScreen ( bool  shouldBeFullScreen)

Puts the window into full-screen mode, or restores it to its normal size.

If true, the window will become full-screen; if false, it will return to the last size it was before being made full-screen.

See also
isFullScreen

◆ setMinimised()

void ResizableWindow::setMinimised ( bool  shouldMinimise)

Minimises the window, or restores it to its previous position and size.

When being un-minimised, it'll return to the last position and size it was in before being minimised.

See also
isMinimised

◆ setResizable()

void ResizableWindow::setResizable ( bool  shouldBeResizable,
bool  useBottomRightCornerResizer 
)

Make the window resizable or fixed.

Parameters
shouldBeResizablewhether it's resizable at all
useBottomRightCornerResizerif true, it'll add a ResizableCornerComponent at the bottom-right; if false, it'll use a ResizableBorderComponent around the edge
See also
setResizeLimits, isResizable

◆ setResizeLimits()

void ResizableWindow::setResizeLimits ( int  newMinimumWidth,
int  newMinimumHeight,
int  newMaximumWidth,
int  newMaximumHeight 
)
noexcept

This sets the maximum and minimum sizes for the window.

If the window's current size is outside these limits, it will be resized to make sure it's within them.

A direct call to setBounds() will bypass any constraint checks, but when the window is dragged by the user or resized by other indirect means, the constrainer will limit the numbers involved.

See also
setResizable, setFixedAspectRatio

◆ visibilityChanged()

void ResizableWindow::visibilityChanged ( )
overrideprotectedvirtual

Called when this component's visibility changes.

See also
setVisible, isVisible

Reimplemented from juce::TopLevelWindow.

Member Data Documentation

◆ resizableBorder

ScopedPointer<ResizableBorderComponent> juce::ResizableWindow::resizableBorder
protected

◆ resizableCorner

ScopedPointer<ResizableCornerComponent> juce::ResizableWindow::resizableCorner
protected

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