|
Krotos Modules 3
|
Interface for a UI Component that controls a KwidgetProcessor. More...
#include <KwidgetGUI.h>
Public Types | |
| enum class | RenderStyle { normal = 0 , borderless , borderless_with_buttons , minimised , NUM_STYLES } |
Public Member Functions | |
| KwidgetGUI (Kwidget &owner) | |
| ~KwidgetGUI () override=default | |
| void | moved () override |
| void | paint (Graphics &g) override |
| void | resized () override |
| void | mouseDown (const MouseEvent &event) override |
| const String & | getKwidgetType () const |
| const String & | getKwidgetID () const |
| void | setRenderStyle (RenderStyle newStyle) |
| int | divideIntByFloat (int dividend, float divisor) |
| int | multiplyIntByFloat (int mult, float factor) |
| virtual void | finalSetup () |
| void | ignorePadding (bool ignore) |
| TopBarComponent & | getTopBarComponent () |
| Kwidget & | getOwner () |
Public Attributes | |
| std::function< void(const String &)> | onDelete |
Protected Member Functions | |
| std::unique_ptr< SliderParameterAttachment > | createParameterAttachment (const String ¶mID, Slider &slider) |
| std::unique_ptr< ButtonParameterAttachment > | createParameterAttachment (const String ¶mID, Button &button) |
| std::unique_ptr< ComboBoxParameterAttachment > | createParameterAttachment (const String ¶mID, ComboBox &comboBox) |
| std::unique_ptr< ParameterAttachment > | createParameterAttachment (const String ¶mID, std::function< void(float)> callback) |
| std::unique_ptr< LabelCustomParameterAttachment > | createCustomParameterAttachment (const String ¶mID, Label &label) |
| template<typename AttachedComponentType > | |
| void | addAttachedComponent (AttachedComponentType &component, const String ¶mID, bool isDraggable=true) |
| template<typename AttachedComponentType > | |
| void | addAttachedComponent (Component &parent, AttachedComponentType &component, const String ¶mID, bool isDraggable=true) |
| void | addParameterCallback (const String ¶mID, std::function< void(float)> callback) |
Protected Attributes | |
| bool | m_ignorePadding {false} |
| Rectangle< int > | m_currentBounds |
| TextButton | m_selectButton |
| TextButton | m_deleteButton |
| Colour | m_borderColour {Colours::fuchsia} |
| TopBarComponent | m_topBarComponent |
| RenderStyle | m_renderStyle {RenderStyle::normal} |
Private Attributes | |
| Kwidget & | m_owner |
| UndoManager * | m_undoManager {nullptr} |
| OwnedArray< KParameter::AsyncListenerObject > | m_parameterCallbacks |
| ComponentDragger | m_dragger |
| bool | m_allowDrag {false} |
Interface for a UI Component that controls a KwidgetProcessor.
The KwidgetGUI class provides an interface for creating and managing the graphical user interface (GUI) of a specific type of Kwidget. Inherit from this class to define the UI of a custom Kwidget.
This class offers various functionalities to manage the UI, including rendering, resizing, and handling mouse events. Additionally, KwidgetGUI inherits from ActionBroadcaster to facilitate the broadcasting of analytics events and other actions to registered listeners.
|
strong |
| krotos::KwidgetGUI::KwidgetGUI | ( | Kwidget & | owner | ) |
|
overridedefault |
Destructor.
|
inlineprotected |
Code duplication saving helper function for an AttachedSlider or AttachedToggleButton, to addAndMakeVisible, enable drag and drop, and create a parameter attachment.
|
inlineprotected |
Code duplication saving helper function for an AttachedSlider or AttachedToggleButton, to addAndMakeVisible, enable drag and drop, and create a parameter attachment.
|
protected |
Add an action to be performed when a specified parameter changes value.
| paramID | The ID of the parameter to listen to. |
| callback | The action to be performed when the parameter changes value. |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
inline |
Helper function for dividing bounds (usually integers) by floats
|
inlinevirtual |
Your GUI can override this to get a callback when everything is created and after the first resize() is called
Reimplemented in krotos::KwidgetGUI_CoreEngine, and krotos::KwidgetGUI_Reformer.
| const String & krotos::KwidgetGUI::getKwidgetID | ( | ) | const |
Get the ID of the Kwidget represented by this UI object (ex. "Sine0").
| const String & krotos::KwidgetGUI::getKwidgetType | ( | ) | const |
Get the type of Kwidget represented by this UI object (ex. "Sine").
|
inline |
Return the topBarComponent.
|
inline |
Should this kwidget have padding around it's border
|
override |
Component MouseEvent overrides.
|
override |
|
inline |
Helper function for multiplying bounds (usually integers) by floats
|
override |
Perform any paint functions common to all Kwidgets here.
|
override |
Resize the elements of this class using this function. Subclasses will use kwidgetResized() to set their bounds.
| void krotos::KwidgetGUI::setRenderStyle | ( | RenderStyle | newStyle | ) |
Set the style we wish derived classes to use when they render themselves Derived classes have access to the style choice via protected member enum m_renderStyle
|
private |
|
protected |
|
protected |
|
protected |
|
private |
|
protected |
|
private |
|
private |
|
protected |
|
protected |
|
protected |
|
private |
| std::function<void(const String&)> krotos::KwidgetGUI::onDelete |
Callback on deletion of the kwidget gui