Skip to content

daisy::AbstractMenu::CustomItem

More...

#include <AbstractMenu.h>

Public Functions

Name
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()

Detailed Description

class daisy::AbstractMenu::CustomItem;

Base class for a custom menu item

Public Functions Documentation

function ~CustomItem

inline virtual ~CustomItem()

function Draw

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

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.

Draws the item to a OneBitGraphicsDisplay.


function CanBeEnteredForEditing

inline virtual bool CanBeEnteredForEditing() const

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


function ModifyValue

inline virtual void ModifyValue(
    int16_t increments,
    uint16_t stepsPerRevolution,
    bool isFunctionButtonPressed
)

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


function ModifyValue

inline virtual void ModifyValue(
    float valueSliderPosition0To1,
    bool isFunctionButtonPressed
)

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


function OnOkayButton

inline virtual void OnOkayButton()

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

---

Updated on 2024-01-03 at 19:41:01 +0000