|
Krotos Modules 3
|
A component for dropping draggable juce objects onto. More...
#include <DropComponent.h>
Public Types | |
| enum | RoundedCorner { TopLeft = 0 , TopRight , BottomLeft , BottomRight , Top , Bottom , All , None } |
| Rounded corner state enum. More... | |
Public Member Functions | |
| DropComponent (const String &labelText, const String &kwidgetID="") | |
| void | resized () override |
| Label & | getLabel () |
| void | setText (const String &labelText) |
| void | setLabelValue (Value &labelValue) |
| Assign a Value object to the DropComponent Label text. This will assign a Listener to the given value, which will update the label with the Value when it chanes. | |
| void | paintButton (Graphics &g, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override |
| bool | isInterestedInDragSource (const SourceDetails &) override |
| void | itemDragEnter (const SourceDetails &) override |
| void | itemDragMove (const SourceDetails &) override |
| void | itemDragExit (const SourceDetails &) override |
| void | itemDropped (const SourceDetails &dragSourceDetails) override |
| var | getDescription () |
| String & | getConnectedKwidgetID () |
| Returns the ID of the kwidget this drop component is assigning modulation to. | |
| void | setRoundedCorner (RoundedCorner cornerToRound, float cornerSize=4.0f) |
| Sets which corners to draw as rounded and their size as a radius. | |
| void | setArmed (bool isArmed) |
| Sets the component to draw with a visual indication that it has active modulation assigned to it. | |
Public Attributes | |
| std::function< void(var desc)> | onDropped |
Static Public Attributes | |
| static const Identifier | DragSource {"DropComponent"} |
| Set this identifier in your drag source component properties so DropComponent will be interested in it as a drag source. | |
Private Member Functions | |
| void | valueChanged (Value &value) override |
Private Attributes | |
| Label | m_label |
| String | m_connectedKwidgetID {""} |
| bool | m_somethingIsBeingDraggedOver = false |
| var | m_lastDesc |
| Value | m_labelValue |
| RoundedCorner | m_cornerToRound {RoundedCorner::All} |
| float | m_cornerSize {4.0f} |
| const float | m_defaultOpacity {0.5f} |
| const float | m_hoverOpacity {1.0f} |
| const float | m_hoverBrightnessAmount {0.055f} |
| const float | m_armedHoverBrightnessAmount {0.15f} |
| bool | m_armed {false} |
A component for dropping draggable juce objects onto.
Picks up a drag and drop event from within a DragAndDropContainer
| krotos::krotos::DropComponent::DropComponent | ( | const String & | labelText, |
| const String & | kwidgetID = "" ) |
Constructs a new DropComponent with specified text for the label.
|
inline |
Returns the ID of the kwidget this drop component is assigning modulation to.
| var krotos::DropComponent::getDescription | ( | ) |
| Label & krotos::krotos::DropComponent::getLabel | ( | ) |
Returns reference to the label displaying the button name.
|
override |
Here is where we can determine if we are interested in whatever is being dragged over.
|
override |
|
override |
|
override |
|
override |
|
override |
|
override |
| void krotos::DropComponent::setArmed | ( | bool | isArmed | ) |
Sets the component to draw with a visual indication that it has active modulation assigned to it.
| isArmed | Draw the component in the armed visual state. |
| void krotos::DropComponent::setLabelValue | ( | Value & | labelValue | ) |
Assign a Value object to the DropComponent Label text. This will assign a Listener to the given value, which will update the label with the Value when it chanes.
|
inline |
Sets which corners to draw as rounded and their size as a radius.
| void krotos::DropComponent::setText | ( | const String & | labelText | ) |
Set the label text from string. Note: If A Value has been assigned to the label with setLabelValue(), the label will be overwritten when that Value object changes.
|
overrideprivate |
|
static |
Set this identifier in your drag source component properties so DropComponent will be interested in it as a drag source.
e.g. In the constructor of your component that you want DropComponent to be interested in as a drag source, call getProperties().set(DropComponent::DragSource, "MyComponentID")
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
| std::function<void(var desc)> krotos::DropComponent::onDropped |
Callback lambda for itemDropped, passing the dragSource description.