openshot-audio
0.1.7
|
#include <juce_gui_basics.h>
Classes | |
class | Zone |
Protected Member Functions | |
void | paint (Graphics &) override |
void | mouseEnter (const MouseEvent &) override |
void | mouseMove (const MouseEvent &) override |
void | mouseDown (const MouseEvent &) override |
void | mouseDrag (const MouseEvent &) override |
void | mouseUp (const MouseEvent &) override |
bool | hitTest (int x, int y) override |
![]() | |
virtual ComponentPeer * | createNewPeer (int styleFlags, void *nativeWindowToAttachTo) |
Additional Inherited Members | |
![]() | |
enum | FocusChangeType { focusChangedByMouseClick, focusChangedByTabKey, focusChangedDirectly } |
![]() | |
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 |
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 resized in MSWindows or Linux.
To use it, just add it to your component, making it fill the entire parent component (there's a mouse hit-test that only traps mouse-events which land around the edge of the component, so it's even ok to put it on top of any other components you're using). Make sure you rescale the resizer component to fill the parent each time the parent's size changes.
ResizableBorderComponent::ResizableBorderComponent | ( | Component * | componentToResize, |
ComponentBoundsConstrainer * | constrainer | ||
) |
Creates a resizer.
Pass in the target component which you want to be resized when this one is dragged.
The target component will usually be a parent of the resizer component, 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.
ResizableBorderComponent::~ResizableBorderComponent | ( | ) |
Destructor.
BorderSize< int > ResizableBorderComponent::getBorderThickness | ( | ) | const |
Returns the number of pixels wide that the draggable edges of this component are.
|
inlinenoexcept |
Returns the zone in which the mouse was last seen.
Tests whether a given point is inside the component.
Overriding this method allows you to create components which only intercept mouse-clicks within a user-defined area.
This is called to find out whether a particular x, y coordinate is considered to be inside the component or not, and is used by methods such as contains() and getComponentAt() to work out which component the mouse is clicked on.
Components with custom shapes will probably want to override it to perform some more complex hit-testing.
The default implementation of this method returns either true or false, depending on the value that was set by calling setInterceptsMouseClicks() (true is the default return value).
Note that the hit-test region is not related to the opacity with which areas of a component are painted.
Applications should never call hitTest() directly - instead use the contains() method, because this will also test for occlusion by the component's parent.
Note that for components on the desktop, this method will be ignored, because it's not always possible to implement this behaviour on all platforms.
x | the x coordinate to test, relative to the left hand edge of this component. This value is guaranteed to be greater than or equal to zero, and less than the component's width |
y | the y coordinate to test, relative to the top edge of this component. This value is guaranteed to be greater than or equal to zero, and less than the component's height |
Reimplemented from juce::Component.
|
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.
event | details about the position and status of the mouse event, including the source component in which it occurred |
Reimplemented from juce::Component.
|
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.
event | details about the position and status of the mouse event, including the source component in which it occurred |
Reimplemented from juce::Component.
|
overrideprotectedvirtual |
Called when the mouse first enters a component.
If the mouse button isn't pressed and the mouse moves into a component, this will be called to let the component react to this.
When the mouse button is pressed and held down while being moved in or out of a component, no mouseEnter or mouseExit callbacks are made - only mouseDrag messages are sent to the component that the mouse was originally clicked on, until the button is released.
event | details about the position and status of the mouse event, including the source component in which it occurred |
Reimplemented from juce::Component.
|
overrideprotectedvirtual |
Called when the mouse moves inside a component.
If the mouse button isn't pressed and the mouse moves over a component, this will be called to let the component react to this.
A component will always get a mouseEnter callback before a mouseMove.
event | details about the position and status of the mouse event, including the source component in which it occurred |
Reimplemented from juce::Component.
|
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.
event | details about the position and status of the mouse event, including the source component in which it occurred |
Reimplemented from juce::Component.
|
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().
g | the graphics context that must be used to do the drawing operations. |
Reimplemented from juce::Component.
void ResizableBorderComponent::setBorderThickness | ( | const BorderSize< int > & | newBorderSize | ) |
Specifies how many pixels wide the draggable edges of this component are.