Defines a momentary buttons with 2 states. Upon release, the button automatically returns to state 0.
More...
|
| void | release (void) override |
| | Releases the button if it has been pressed.
|
| |
|
| | MomentaryButton (const char *buttonName, Canvas &Destination, const Block_Image &DestLoc, const char *buttonText0, FontList::FontID Font0, uint16_t fillColor0, const char *buttonText1, FontList::FontID Font1, uint16_t fillColor1, ButtonState::buttonCallbackFunction callback, uint16_t fontBaseline, const ButtonConfig_t< 2 > config=DEFAULT_BUTTON_CONFIG) |
| | Constructor for a Momentary Button that displays text in each state.
|
| |
| | MomentaryButton (const char *buttonName, Canvas &Destination, const Block_Image &DestLoc, ROM_Image ButtonImg0, uint16_t ButtonImgColor0, uint16_t ButtonFillColor0, ROM_Image ButtonImg1, uint16_t ButtonImgColor1, uint16_t ButtonFillColor1, ButtonState::buttonCallbackFunction callback, const ButtonConfig_t< 2 > config=DEFAULT_BUTTON_CONFIG) |
| | Constructor for a Momentary Button that displays images in each state.
|
| |
| | ~MomentaryButton (void)=default |
| | Default destructor.
|
| |
| | ToggleButton (const char *buttonName, Canvas &Destination, const Block_Image &DestLoc, const char *buttonText0, FontList::FontID Font0, uint16_t fillColor0, ButtonState::buttonCallbackFunction callback0, const char *buttonText1, FontList::FontID Font1, uint16_t fillColor1, ButtonState::buttonCallbackFunction callback1, uint16_t fontBaseline, const ButtonConfig_t< 2 > config=DEFAULT_BUTTON_CONFIG) |
| | Constructor for a Toggle Button that displays text in each state.
|
| |
| | ToggleButton (const char *buttonName, Canvas &Destination, const Block_Image &DestLoc, ROM_Image ButtonImg0, uint16_t ButtonImgColor0, uint16_t ButtonFillColor0, ButtonState::buttonCallbackFunction callback0, ROM_Image ButtonImg1, uint16_t ButtonImgColor1, uint16_t ButtonFillColor1, ButtonState::buttonCallbackFunction callback1, const ButtonConfig_t< 2 > config=DEFAULT_BUTTON_CONFIG) |
| | Constructor for a Toggle Button that displays images in each state.
|
| |
| | ~ToggleButton (void)=default |
| | Default destructor.
|
| |
| void | begin (void) override |
| | Initializes the button. This method should be called before first use.
|
| |
| | Button (const char *buttonName, Canvas &DestCanvas, uint16_t dest_x, uint16_t dest_y, uint16_t width, uint16_t height, callback_type whenCallback) |
| | Constructor for creating a Button object.
|
| |
| virtual | ~Button (void)=default |
| | Default destructor.
|
| |
| virtual bool | press (FT5316::TouchLocation loc) |
| | Presses the button if loc is within the bounds of the button.
|
| |
| void | enable (void) |
| | Enables the button, making it accept button presses.
|
| |
| void | disable (void) |
| | Disables the button, so that it ignores button presses.
|
| |
| void | setState (uint8_t state) |
| | Sets the button to the specified state.
|
| |
| void | nextState (void) |
| | Advances the button to the next state.
|
| |
| void | draw (void) |
| | Draws the image from the current ButtonState onto the destination canvas.
|
| |
| void | draw (Canvas &newCanvas) |
| | Draws the image from the current ButtonState onto the specified canvas.
|
| |
| bool | isEnabled (void) const |
| | Indicates whether the Button is enabled.
|
| |
| uint16_t | width (void) const |
| | Returns the width of the button in pixels.
|
| |
| uint16_t | height (void) const |
| | Returns the height of the button in pixels.
|
| |
| uint8_t | state (void) const |
| | Returns the current state of the button.
|
| |
Defines a momentary buttons with 2 states. Upon release, the button automatically returns to state 0.
This button has two images (pressed and unpressed). The button's single callback function is called when the button is released.