|
TinyMaterialDesign
|
Pill-shaped search input: leading magnifier glyph, typed text, and a trailing "x" clear glyph shown once there's something to clear. More...
#include <SearchBar.h>


Public Member Functions | |
| SearchBar ()=default | |
| SearchBar (Bounds bounds, const char *placeholder=nullptr) | |
| const std::string & | text () const |
| void | setText (const char *text) |
| bool | focused () const |
| void | focus () |
| void | blur () override |
| void | insertChar (char c) override |
| void | backspace () override |
| void | submit () |
| bool | handleEnter () override |
| void | draw (tinygpu::ISurface< RGB_T > &target) override |
| bool | onGesture (const tinygpu::GestureEvent &event) override |
| Handles one gesture event. Returns true if this widget consumed it. | |
| bool | update (uint32_t nowMs) override |
Public Member Functions inherited from Widget< RGB_T > | |
| virtual | ~Widget ()=default |
| virtual void | setTheme (const MaterialTheme< RGB_T > &theme) |
| virtual void | draw (tinygpu::ISurface< RGB_T > &target)=0 |
| virtual bool | onGesture (const tinygpu::GestureEvent &event) |
| Handles one gesture event. Returns true if this widget consumed it. | |
| virtual bool | update (uint32_t nowMs) |
| virtual bool | isDraggable () const |
| virtual bool | isDraggableAt (int32_t x, int32_t y) const |
| virtual int | childCount () const |
| virtual Widget< RGB_T > * | child (int index) |
| virtual void | drawBackground (tinygpu::ISurface< RGB_T > &target) |
| virtual void | setThemeTint (RGB_T background, RGB_T foreground) |
| virtual bool | isContainer () const |
| Provides true if the widget is a container. | |
Public Member Functions inherited from TextInputTarget | |
| virtual | ~TextInputTarget ()=default |
| virtual InputType | inputType () const |
| The kind of input - Keyboard picks its layout from it. Default: text. | |
| virtual void | insertChar (char c)=0 |
| virtual void | backspace ()=0 |
| virtual void | blur ()=0 |
| virtual bool | handleEnter ()=0 |
Public Attributes | |
| std::function< void()> | onFocus |
| std::function< void(const std::string &)> | onChange |
| std::function< void()> | onSubmit |
Public Attributes inherited from Widget< RGB_T > | |
| Bounds | bounds |
| bool | visible = true |
| bool | enabled = true |
Additional Inherited Members | |
Protected Member Functions inherited from Widget< RGB_T > | |
| const MaterialTheme< RGB_T > & | theme () const |
| Convenience accessor for draw() overrides - see theme_. | |
Protected Attributes inherited from Widget< RGB_T > | |
| const MaterialTheme< RGB_T > * | theme_ = nullptr |
Pill-shaped search input: leading magnifier glyph, typed text, and a trailing "x" clear glyph shown once there's something to clear.
Implements TextInputTarget the same way TextField does, so it can be driven by a Keyboard via Keyboard::manage() - see TextField.h's class comment for the field/keyboard wiring example, which applies here unchanged. Enter submits, same single-line semantics as TextField.
|
default |
|
inlineoverridevirtual |
Implements TextInputTarget.
|
inlineoverridevirtual |
Implements TextInputTarget.
|
inlineoverridevirtual |
Renders the widget into target using colors/fonts/tokens from its own theme (see theme()/setTheme()).
Implements Widget< RGB_T >.
|
inline |
|
inline |
|
inlineoverridevirtual |
Called when the keyboard's Done key is tapped (a separate Enter key handles literal newlines via insertChar('
') directly, without going through this).
Implements TextInputTarget.
|
inlineoverridevirtual |
Implements TextInputTarget.
|
inlineoverridevirtual |
Handles one gesture event. Returns true if this widget consumed it.
Reimplemented from Widget< RGB_T >.
|
inline |
|
inline |
|
inline |
|
inlineoverridevirtual |
Called once per frame, before draw(), to advance any time-based animation (ripple fade, indeterminate progress sweep, ...). Returns true if that advance changed anything this widget will draw differently, so Screen can decide whether a redraw is actually needed - see Screen::isDirty(). Default: no-op, not dirty, so widgets that don't animate cost nothing extra.
Reimplemented from Widget< RGB_T >.
| std::function<void(const std::string&)> onChange |
| std::function<void()> onFocus |
| std::function<void()> onSubmit |