Skip to content

Class daisy::AbstractMenu::CustomItem

ClassList > daisy > AbstractMenu > CustomItem

More...

  • #include <AbstractMenu.h>

Public Functions

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

Detailed Description

Base class for a custom menu item

Public Functions Documentation

function CanBeEnteredForEditing

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

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


function Draw

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

Draws the item to a OneBitGraphicsDisplay.

Parameters:

  • display The display to draw to
  • currentIndex The index in the menu
  • numItemsTotal The total number of items in the menu
  • boundsToDrawIn The Rectangle to draw the item into
  • isEditing True if the enter button was pressed and the value is being edited directly.

function ModifyValue [½]

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

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


function ModifyValue [2/2]

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

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


function OnOkayButton

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

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


function ~CustomItem

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


The documentation for this class was generated from the following file external-docs/libDaisy/src/ui/AbstractMenu.h