DISTRHO Plugin Framework
|
#include <SubWidget.hpp>
Public Member Functions | |
SubWidget (Widget *parentWidget) | |
virtual | ~SubWidget () |
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 |
Widget * | getParentWidget () const noexcept |
void | repaint () noexcept override |
void | setNeedsFullViewportDrawing (bool needsFullViewportForDrawing=true) |
![]() | |
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 |
void | setId (uint id) noexcept |
Application & | getApp () const noexcept |
Window & | getWindow () const noexcept |
const GraphicsContext & | getGraphicsContext () const noexcept |
TopLevelWidget * | getTopLevelWidget () const noexcept |
Application & | getParentApp () const noexcept |
Window & | getParentWindow () const noexcept |
Protected Member Functions | |
virtual void | onPositionChanged (const PositionChangedEvent &) |
![]() | |
virtual void | onDisplay ()=0 |
virtual bool | onKeyboard (const KeyboardEvent &) |
virtual bool | onSpecial (const SpecialEvent &) |
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 &) |
Friends | |
class | Widget |
template<class BaseWidget > | |
class | NanoBaseWidget |
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.
|
virtual |
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 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.
void SubWidget::setNeedsFullViewportDrawing | ( | bool | needsFullViewportForDrawing = true | ) |
Indicate that this subwidget will draw out of bounds, and thus needs the entire viewport available for drawing.
|
protectedvirtual |
A function called when the subwidget's absolute position is changed.