libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
daisy::AbstractMenu::CustomItem Class Referenceabstract

Detailed Description

Base class for a custom menu item

#include <AbstractMenu.h>

Public Member Functions

virtual ~CustomItem ()
 
virtual void Draw (OneBitGraphicsDisplay &display, int currentIndex, int numItemsTotal, Rectangle boundsToDrawIn, bool isEditing)=0
 
virtual bool CanBeEnteredForEditing () const
 
virtual void ModifyValue (int16_t increments, uint16_t stepsPerRevolution, bool isFunctionButtonPressed)
 
virtual void ModifyValue (float valueSliderPosition0To1, bool isFunctionButtonPressed)
 
virtual void OnOkayButton ()
 

Constructor & Destructor Documentation

◆ ~CustomItem()

virtual daisy::AbstractMenu::CustomItem::~CustomItem ( )
inlinevirtual

Member Function Documentation

◆ CanBeEnteredForEditing()

virtual bool daisy::AbstractMenu::CustomItem::CanBeEnteredForEditing ( ) const
inlinevirtual

Returns true, if this item can be entered for direct editing of the value.

◆ Draw()

virtual void daisy::AbstractMenu::CustomItem::Draw ( OneBitGraphicsDisplay display,
int  currentIndex,
int  numItemsTotal,
Rectangle  boundsToDrawIn,
bool  isEditing 
)
pure virtual

Draws the item to a OneBitGraphicsDisplay.

Parameters
displayThe display to draw to
currentIndexThe index in the menu
numItemsTotalThe total number of items in the menu
boundsToDrawInThe Rectangle to draw the item into
isEditingTrue if the enter button was pressed and the value is being edited directly.

◆ ModifyValue() [1/2]

virtual void daisy::AbstractMenu::CustomItem::ModifyValue ( float  valueSliderPosition0To1,
bool  isFunctionButtonPressed 
)
inlinevirtual

Called when the value slider is used to modify the value.

◆ ModifyValue() [2/2]

virtual void daisy::AbstractMenu::CustomItem::ModifyValue ( int16_t  increments,
uint16_t  stepsPerRevolution,
bool  isFunctionButtonPressed 
)
inlinevirtual

Called when the encoder of the buttons are used to modify the value.

◆ OnOkayButton()

virtual void daisy::AbstractMenu::CustomItem::OnOkayButton ( )
inlinevirtual

Called when the okay button is pressed (and CanBeEnteredForEditing() returns false).


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