Solo Controller Documentation 1.0
Documentation for the Solo Controller
 
Loading...
Searching...
No Matches
ToggleButton Class Reference

#include <Button.h>

Inheritance diagram for ToggleButton:
Button

Public Member Functions

Constructors and Destructors
 ToggleButton (Canvas &DestCanvas, const Block_Image &DestLoc, callback_function Img0Callback, callback_function Img1Callback)
 ToggleButton Constructor.
 
 ~ToggleButton (void)=default
 Default destructor.
 
General Methods
bool press (FT5316::TouchLocation loc) override
 Presses the button if loc is within the bounds of the button.
 
- Public Member Functions inherited from Button
 Button (Canvas &DestCanvas, const Block_Image &DestLoc, const DRAM_Canvas *Imgs, uint8_t maxNumStates)
 Constructor for creating a Button.
 
 ~Button (void)=default
 Default destructor.
 
void begin (void)
 Initializes the button. This method should be called before first use.
 
virtual void release (void)
 Releases the button if it has been pressed.
 
void enable (void)
 Enables the button, makking it accept button presses.
 
void disable (void)
 Disables the button, so that it ignores button presses.
 
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.
 

Additional Inherited Members

- Public Types inherited from Button
typedef void(* callback_function) (void)
 
- Protected Member Functions inherited from Button
void _resetToState0 (void)
 Internal method for resetting the button to state 0.
 

Constructor & Destructor Documentation

◆ ToggleButton()

ToggleButton::ToggleButton ( Canvas & DestCanvas,
const Block_Image & DestLoc,
callback_function Img0Callback,
callback_function Img1Callback )
inline

ToggleButton Constructor.

Parameters
[in]DestCanvasDestination canvas to where the current button image is copied
[in]DestLocUL x-y coordinate within DestCanvas where the button is to be copied
[in]SrcCanvasSource Canvas containing button images
[in]Img0Location within SrcCanvas for button in state 0
[in]Img0CallbackCallback function when the button transitions to state 0
[in]Img1Location within SrcCanvas for button in state 1
[in]Img1CallbackCallback function when the button transitions to state 0

This constructor assumes that all button images are located on the same SrcCanvas. The locations, Img0 and Img1, point to locations within SrcCanvas.

◆ ~ToggleButton()

ToggleButton::~ToggleButton ( void )
default

Default destructor.

Parameters
None.

Member Function Documentation

◆ press()

bool ToggleButton::press ( FT5316::TouchLocation loc)
overridevirtual

Presses the button if loc is within the bounds of the button.

Parameters
[in]locx-y coordinate where the TFT screen has been touched

Reimplemented from Button.


The documentation for this class was generated from the following files: