|
| | Input (fontsize_t scale, color_t textColor, color_t backgroundColor, const Size &size={0, 0}, radius_t borderRadius=0, const Position &pos={0, 0}, const Alignment &align={ALIGN_LEFT, ALIGN_TOP}, const Padding &padding={0}) |
| | Construct an Input widget with the default font.
|
| |
| | Input (const GFXfont &font, color_t textColor, color_t backgroundColor, const Size &size={0, 0}, radius_t borderRadius=0, const Position &pos={0, 0}, const Alignment &align={ALIGN_LEFT, ALIGN_TOP}, const Padding &padding={0}) |
| | Construct an Input widget with a specific font.
|
| |
| void | setText (const String &text) |
| | Replace the stored text with a new string.
|
| |
| const String & | getText () const |
| | Get the currently stored text.
|
| |
| void | insert (char c) |
| | Insert a character at the current cursor position.
|
| |
| int | getCursor () const |
| | Get the current cursor position.
|
| |
| void | setCursor (int index) |
| | Set the position of the cursor.
|
| |
| int | nearestCursor (const Coords &coords) const |
| | Get the nearest cursor position to a given set of screen coordinates.
|
| |
| void | draw () const override |
| | Render the widget to the screen.
|
| |
| void | update (time_t time) override |
| | Update any internal state of the widget, and check if it needs to be re-rendered.
|
| |
| | Panel (Widget *child, color_t color, const Size &size={0, 0}, radius_t borderRadius=0, const Position &pos={0, 0}, const Alignment &align={ALIGN_LEFT, ALIGN_TOP}, const Padding &padding={0}) |
| | Construct a panel with optional configuration.
|
| |
| void | draw () const override |
| | Render the widget to the screen.
|
| |
| void | update (time_t time_ms) override |
| | Update any internal state of the widget, and check if it needs to be re-rendered.
|
| |
| void | drawDone () override |
| | Reset any state variables after rendering has finished.
|
| |
| Size | size () const override |
| | Get the size of the widget.
|
| |
| void | setColor (color_t new_color) |
| | Set the panel color.
|
| |
| color_t | getColor () const |
| | Get the current widget color.
|
| |
| void | setBorderRadius (radius_t new_radius) |
| | Set the border radius.
|
| |
| | SingleChildWidget (Widget *child, const Position &pos={0, 0}, const Alignment &align={ALIGN_LEFT, ALIGN_TOP}, const Padding &padding={0}) |
| | Constructor.
|
| |
| | ~SingleChildWidget () override |
| | Destructor.
|
| |
| Size | size () const override |
| | Get the size of the widget.
|
| |
| void | update (time_t time_ms) override |
| | Update any internal state of the widget, and check if it needs to be re-rendered.
|
| |
| void | render (bool force) const override |
| | Recursively render this widget and any child widgets that need it.
|
| |
| void | drawDone () override |
| | Reset any state variables after rendering has finished.
|
| |
| void | setChild (Widget *const child) |
| | Set the child widget.
|
| |
| bool | handleEvent (Event &event) override |
| | Handle events from the touchscreen.
|
| |
| Widget * | getChild () const |
| | Get the current child widget.
|
| |
| virtual void | drawBoundingBox (time_t time) const override |
| | Render the bounding box of this and any child widgets.
|
| |
| Widget * | getWidgetById (id_t id) noexcept override |
| | Get the first widget (this or any children) that has the given ID.
|
| |
| | Widget (const Position &pos={0, 0}, const Alignment &align={ALIGN_LEFT, ALIGN_TOP}, const Padding &padding={0}) |
| | The default widget constructor.
|
| |
|
virtual | ~Widget () |
| | The default widget destructor.
|
| |
| virtual Bounds | bounds () const |
| | Get the rendering bounds of this widget.
|
| |
| void | setPosition (const Position &pos) |
| | Set the position of this widget.
|
| |
| Position | getPosition () const |
| | Get the position of this widget.
|
| |
| void | setAlign (const Alignment &align) |
| | Set the alignment of this widget.
|
| |
| void | requestRedraw () |
| | Tell this widget that it needs to be re-rendered.
|
| |
| void | requestParentRedraw () |
| | Tell the parent widget that it needs to be re-rendered.
|
| |
| bool | needsRedraw () const |
| | Check if this widget has requested to be redrawn.
|
| |
| void | setParent (Widget *parent) |
| | Set the parent widget.
|
| |
| Bounds | parentBounds () const |
| | Get the bounds of the parent widget, if any.
|
| |
| void | onpress (std::function< void(Widget &, const Event &)> callback) override |
| | Register a touchscreen event handler that triggers on press.
|
| |
| void | onblur (std::function< void(Widget &, const Event &)> callback) override |
| | Register a touchscreen event handler that triggers when the widget stops being pressed.
|
| |
| void | onhold (std::function< void(Widget &, const Event &, time_t)> callback) override |
| | Register a touchscreen event handler that repeatedly triggers when the widget is held for a while.
|
| |
| void | onrelease (std::function< void(Widget &, const Event &)> callback) override |
| | Register a touchscreen event handler that triggers on release.
|
| |
|
void | click () |
| | Manually trigger the onrelease event handler.
|
| |
|
void | press () |
| | Manually trigger the onpress event handler.
|
| |
|
void | blur () |
| | Manually trigger the onblur event handler.
|
| |
|
void | release () |
| | Manually trigger the onrelease event handler.
|
| |
| void | hold (time_t time) |
| | Manually trigger the onhold event handler.
|
| |
Public Member Functions inherited from ui::EventHandlers< Widget > |
| void | onpress (std::function< void(Widget &)> callback) |
| | Register a touchscreen event handler that triggers on press.
|
| |
| void | onpress (std::function< void(const Event &)> callback) |
| | Register a touchscreen event handler that triggers on press.
|
| |
| void | onpress (std::function< void()> callback) |
| | Register a touchscreen event handler that triggers on press.
|
| |
| void | onrelease (std::function< void(Widget &)> callback) |
| | Register a touchscreen event handler that triggers when the widget stops being pressed.
|
| |
| void | onrelease (std::function< void(const Event &)> callback) |
| | Register a touchscreen event handler that triggers when the widget stops being pressed.
|
| |
| void | onrelease (std::function< void()> callback) |
| | Register a touchscreen event handler that triggers when the widget stops being pressed.
|
| |
| void | onblur (std::function< void(Widget &)> callback) |
| | Register a touchscreen event handler that triggers when the widget stops being pressed.
|
| |
| void | onblur (std::function< void(const Event &)> callback) |
| | Register a touchscreen event handler that triggers when the widget stops being pressed.
|
| |
| void | onblur (std::function< void()> callback) |
| | Register a touchscreen event handler that triggers when the widget stops being pressed.
|
| |
| void | onhold (std::function< void(Widget &, time_t)> callback) |
| | Register a touchscreen event handler that repeatedly triggers when the widget is held for a while.
|
| |
| void | onhold (std::function< void(const Event &, time_t)> callback) |
| | Register a touchscreen event handler that repeatedly triggers when the widget is held for a while.
|
| |
| void | onhold (std::function< void(time_t)> callback) |
| | Register a touchscreen event handler that repeatedly triggers when the widget is held for a while.
|
| |
| void | onhold (std::function< void(Widget &)> callback) |
| | Register a touchscreen event handler that repeatedly triggers when the widget is held for a while.
|
| |
| void | onhold (std::function< void(const Event &)> callback) |
| | Register a touchscreen event handler that repeatedly triggers when the widget is held for a while.
|
| |
| void | onhold (std::function< void()> callback) |
| | Register a touchscreen event handler that repeatedly triggers when the widget is held for a while.
|
| |
| void | onclick (std::function< void(Widget &)> callback) |
| | Register a touchscreen event handler that triggers on release.
|
| |
| void | onclick (std::function< void(const Event &)> callback) |
| | Register a touchscreen event handler that triggers on release.
|
| |
| void | onclick (std::function< void()> callback) |
| | Register a touchscreen event handler that triggers on release.
|
| |
Public Member Functions inherited from ui::CoreEventHandlers< T > |
| virtual void | onpress (std::function< void(T &, const Event &)> callback)=0 |
| | Register a touchscreen event handler that triggers on press.
|
| |
| virtual void | onrelease (std::function< void(T &, const Event &)> callback)=0 |
| | Register a touchscreen event handler that triggers when the widget stops being pressed.
|
| |
| virtual void | onblur (std::function< void(T &, const Event &)> callback)=0 |
| | Register a touchscreen event handler that triggers when the widget stops being pressed.
|
| |
| virtual void | onhold (std::function< void(T &, const Event &, time_t)> callback)=0 |
| | Register a touchscreen event handler that repeatedly triggers when the widget is held for a while.
|
| |
| void | onclick (std::function< void(T &, const Event &)> callback) |
| | Register a touchscreen event handler that triggers on release.
|
| |
An interactive class of Widget for handling text input.
A text field is constructed as a Panel widget that contains a Text widget, plus a little extra rendering to show the cursor.