|
LMMS
|
#include <juce_CallOutBox.h>
Classes | |
| struct | LookAndFeelMethods |
Static Public Member Functions | |
| static CallOutBox & | launchAsynchronously (std::unique_ptr< Component > contentComponent, Rectangle< int > areaToPointTo, Component *parentComponent) |
| 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 |
Private Member Functions | |
| std::unique_ptr< AccessibilityHandler > | createAccessibilityHandler () override |
| void | refreshPath () |
| void | timerCallback () override |
| Private Member Functions inherited from juce::Timer | |
| virtual | ~Timer () |
| void | startTimer (int intervalInMilliseconds) noexcept |
| void | startTimerHz (int timerFrequencyHz) noexcept |
| void | stopTimer () noexcept |
| bool | isTimerRunning () const noexcept |
| int | getTimerInterval () const noexcept |
| Timer () noexcept | |
| Timer (const Timer &) noexcept | |
Private Attributes | |
| Component & | content |
| Path | outline |
| Point< float > | targetPoint |
| Rectangle< int > | availableArea |
| Rectangle< int > | targetArea |
| Image | background |
| float | arrowSize = 16.0f |
| bool | dismissalMouseClicksAreAlwaysConsumed = false |
| Time | creationTime |
Additional Inherited Members | |
| Public Types inherited from juce::Component | |
| enum class | FocusContainerType { none , focusContainer , keyboardFocusContainer } |
| enum | FocusChangeType { focusChangedByMouseClick , focusChangedByTabKey , focusChangedDirectly } |
| Protected Member Functions inherited from juce::Component | |
| virtual ComponentPeer * | createNewPeer (int styleFlags, void *nativeWindowToAttachTo) |
| Static Protected Member Functions inherited from juce::Component | |
| static std::unique_ptr< AccessibilityHandler > | createIgnoredAccessibilityHandler (Component &) |
| Static Private Member Functions inherited from juce::Timer | |
| static void JUCE_CALLTYPE | callAfterDelay (int milliseconds, std::function< void()> functionToCall) |
| static void JUCE_CALLTYPE | callPendingTimersSynchronously () |
A box with a small arrow that can be used as a temporary pop-up window to show extra controls when a button or other component is clicked.
Using one of these is similar to having a popup menu attached to a button or other component - but it looks fancier, and has an arrow that can indicate the object that it applies to.
The class works best when shown modally, but obviously running modal loops is evil and must never be done, so the launchAsynchronously method is provided as a handy way of launching an instance of a CallOutBox and automatically managing its lifetime, e.g.
The call-out will resize and position itself when the content changes size.
@tags{GUI}
| juce::CallOutBox::CallOutBox | ( | Component & | contentComponent, |
| Rectangle< int > | areaToPointTo, | ||
| Component * | parentComponent ) |
Creates a CallOutBox.
| contentComponent | the component to display inside the call-out. This should already have a size set (although the call-out will also update itself when the component's size is changed later). Obviously this component must not be deleted until the call-out box has been deleted. |
| areaToPointTo | the area that the call-out's arrow should point towards. If a parentComponent is supplied, then this is relative to that parent; otherwise, it's a global screen coord. |
| parentComponent | if not a nullptr, this is the component to add the call-out to. If this is a nullptr, the call-out will be added to the desktop. |
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.
Reimplemented from juce::Component.
|
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.
Reimplemented from juce::Component.
| void juce::CallOutBox::dismiss | ( | ) |
Posts a message which will dismiss the callout box asynchronously. NB: it's safe to call this method from any thread.
|
noexcept |
Called to handle a command that was sent by postCommandMessage().
This is called by the message thread when a command message arrives, and the component can override this method to process it in any way it needs to.
Reimplemented from juce::Component.
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.
|
overridevirtual |
Called when the user tries to click on a component that is blocked by another modal component.
When a component is modal and the user clicks on one of the other components, the modal component will receive this callback.
The default implementation of this method will play a beep, and bring the currently modal component to the front, but it can be overridden to do other tasks.
Reimplemented from juce::Component.
Called when a key is pressed.
When a key is pressed, the component that has the keyboard focus will have this method called. Remember that a component will only be given the focus if its setWantsKeyboardFocus() method has been used to enable this.
If your implementation returns true, the event will be consumed and not passed on to any other listeners. If it returns false, the key will be passed to any KeyListeners that have been registered with this component. As soon as one of these returns true, the process will stop, but if they all return false, the event will be passed upwards to this component's parent, and so on.
The default implementation of this method does nothing and returns false.
Reimplemented from juce::Component.
|
static |
This will launch a callout box containing the given content, pointing to the specified target component.
This method will create and display a callout, returning immediately, after which the box will continue to run modally until the user clicks on some other component, at which point it will be dismissed and deleted automatically.
It returns a reference to the newly-created box so that you can customise it, but don't keep a pointer to it, as it'll be deleted at some point when it gets closed.
| contentComponent | the component to display inside the call-out. This should already have a size set (although the call-out will also update itself when the component's size is changed later). |
| areaToPointTo | the area that the call-out's arrow should point towards. If a parentComponent is supplied, then this is relative to that parent; otherwise, it's a global screen coord. |
| parentComponent | if not a nullptr, this is the component to add the call-out to. If this is a nullptr, the call-out will be added to the desktop. |
|
overridevirtual |
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.
Reimplemented from juce::Component.
|
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.
Reimplemented from juce::Component.
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.
|
private |
|
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.
Reimplemented from juce::Component.
| void juce::CallOutBox::setArrowSize | ( | float | newSize | ) |
Changes the base width of the arrow.
|
noexcept |
Determines whether the mouse events for clicks outside the calloutbox are consumed, or allowed to arrive at the other component that they were aimed at.
By default this is false, so that when you click on something outside the calloutbox, that event will also be sent to the component that was clicked on. If you set it to true, then the first click will always just dismiss the box and not be sent to anything else.
|
overrideprivatevirtual |
The user-defined callback routine that actually gets called periodically.
It's perfectly ok to call startTimer() or stopTimer() from within this callback to change the subsequent intervals.
Implements juce::Timer.
| void juce::CallOutBox::updatePosition | ( | const Rectangle< int > & | newAreaToPointTo, |
| const Rectangle< int > & | newAreaToFitIn ) |
Updates the position and size of the box.
You shouldn't normally need to call this, unless you need more precise control over the layout.
| newAreaToPointTo | the rectangle to make the box's arrow point to |
| newAreaToFitIn | the area within which the box's position should be constrained |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |