DISTRHO Plugin Framework
|
#include <SubWidget.hpp>
Public Member Functions | |
SubWidget (Widget *parentWidget) | |
~SubWidget () override | |
template<typename T > | |
bool | contains (T x, T y) const noexcept |
template<typename T > | |
bool | contains (const Point< T > &pos) const noexcept |
int | getAbsoluteX () const noexcept |
int | getAbsoluteY () const noexcept |
Point< int > | getAbsolutePos () const noexcept |
Rectangle< int > | getAbsoluteArea () const noexcept |
Rectangle< uint > | getConstrainedAbsoluteArea () const noexcept |
void | setAbsoluteX (int x) noexcept |
void | setAbsoluteY (int y) noexcept |
void | setAbsolutePos (int x, int y) noexcept |
void | setAbsolutePos (const Point< int > &pos) noexcept |
Point< int > | getMargin () const noexcept |
void | setMargin (int x, int y) noexcept |
void | setMargin (const Point< int > &offset) noexcept |
Widget * | getParentWidget () const noexcept |
void | repaint () noexcept override |
virtual void | toBottom () |
virtual void | toFront () |
void | setNeedsFullViewportDrawing (bool needsFullViewportForDrawing=true) |
void | setNeedsViewportScaling (bool needsViewportScaling=true, double autoScaleFactor=0.0) |
void | setSkipDrawing (bool skipDrawing=true) |
Public Member Functions inherited from Widget | |
virtual | ~Widget () |
bool | isVisible () const noexcept |
void | setVisible (bool visible) |
void | show () |
void | hide () |
uint | getWidth () const noexcept |
uint | getHeight () const noexcept |
const Size< uint > | getSize () const noexcept |
void | setWidth (uint width) noexcept |
void | setHeight (uint height) noexcept |
void | setSize (uint width, uint height) noexcept |
void | setSize (const Size< uint > &size) noexcept |
uint | getId () const noexcept |
const char * | getName () const noexcept |
void | setId (uint id) noexcept |
void | setName (const char *name) noexcept |
Application & | getApp () const noexcept |
Window & | getWindow () const noexcept |
const GraphicsContext & | getGraphicsContext () const noexcept |
TopLevelWidget * | getTopLevelWidget () const noexcept |
std::list< SubWidget * > | getChildren () const noexcept |
Application & | getParentApp () const noexcept |
Window & | getParentWindow () const noexcept |
Protected Member Functions | |
virtual void | onPositionChanged (const PositionChangedEvent &) |
Protected Member Functions inherited from Widget | |
virtual void | onDisplay ()=0 |
virtual bool | onKeyboard (const KeyboardEvent &) |
virtual bool | onCharacterInput (const CharacterInputEvent &) |
virtual bool | onMouse (const MouseEvent &) |
virtual bool | onMotion (const MotionEvent &) |
virtual bool | onScroll (const ScrollEvent &) |
virtual void | onResize (const ResizeEvent &) |
virtual bool | onSpecial (const SpecialEvent &) |
Friends | |
class | Widget |
Sub-Widget class.
This class is the main entry point for creating any reusable widgets from within DGL. It can be freely positioned from within a parent widget, thus being named subwidget.
Many subwidgets can share the same parent, and subwidgets themselves can also have its own subwidgets. It is subwidgets all the way down.
TODO check absolute vs relative position and see what makes more sense.
|
explicit |
Constructor.
|
override |
Destructor.
|
noexcept |
Check if this widget contains the point defined by x and y.
|
noexcept |
Check if this widget contains the point pos.
|
noexcept |
Get absolute X.
|
noexcept |
Get absolute Y.
|
noexcept |
Get absolute position.
|
noexcept |
Get absolute area of this subwidget. This is the same as Rectangle<int>(getAbsolutePos(), getSize());
|
noexcept |
Get absolute area of this subwidget, with special consideration for not allowing negative values.
|
noexcept |
Set absolute X.
|
noexcept |
Set absolute Y.
|
noexcept |
Set absolute position using x and y values.
|
noexcept |
Set absolute position.
|
noexcept |
Get the margin currently in use for widget coordinates. By default this value is (0,0).
|
noexcept |
Set a margin to be used for widget coordinates using x and y values.
|
noexcept |
Set a margin to be used for widget coordinates.
|
noexcept |
Get parent Widget, as passed in the constructor.
|
overridevirtualnoexcept |
Request repaint of this subwidget's area to the window this widget belongs to.
Reimplemented from Widget.
|
virtual |
Pushes this widget to the "bottom" of the parent widget. Makes the widget behave as if it was the first to be registered on the parent widget, thus being "on bottom".
|
virtual |
Bring this widget to the "front" of the parent widget. Makes the widget behave as if it was the last to be registered on the parent widget, thus being "in front".
void SubWidget::setNeedsFullViewportDrawing | ( | bool | needsFullViewportForDrawing = true | ) |
Indicate that this subwidget will draw out of bounds, and thus needs the entire viewport available for drawing.
void SubWidget::setNeedsViewportScaling | ( | bool | needsViewportScaling = true , |
double | autoScaleFactor = 0.0 |
||
) |
Indicate that this subwidget will always draw at its own internal size and needs scaling to fit target size.
void SubWidget::setSkipDrawing | ( | bool | skipDrawing = true | ) |
Indicate that this subwidget should not be drawn on screen, typically because it is managed by something else.
|
protectedvirtual |
A function called when the subwidget's absolute position is changed.