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

#include <Button.h>

Inheritance diagram for MomentaryButton:
Button

Public Member Functions

Constructors and Destructors
 MomentaryButton (Canvas &DestCanvas, const Block_Image &DestLoc, callback_function callback)
 Constructor for creating a Momentary button.
 
 ~MomentaryButton (void)=default
 Default destructor.
 
General Methods
virtual void release (void)
 Releases the button if it has been pressed.
 
- 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 bool press (FT5316::TouchLocation loc)
 Presses the button if loc is within the bounds of the button.
 
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

◆ MomentaryButton()

MomentaryButton::MomentaryButton ( Canvas & DestCanvas,
const Block_Image & DestLoc,
callback_function callback )
inline

Constructor for creating a Momentary button.

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]Img1Location within SrcCanvas for button in state 1
[in]callbackCallback function when the button is released

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

◆ ~MomentaryButton()

MomentaryButton::~MomentaryButton ( void )
default

Default destructor.

Parameters
None.

Member Function Documentation

◆ release()

virtual void MomentaryButton::release ( void )
inlinevirtual

Releases the button if it has been pressed.

Parameters
None.

Reimplemented from Button.


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