Skip to content

Class daisy::FullScreenItemMenu

ClassList > daisy > FullScreenItemMenu

A menu page for small screens. More...

  • #include <FullScreenItemMenu.h>

Inherits the following classes: daisy::AbstractMenu

Public Types inherited from daisy::AbstractMenu

See daisy::AbstractMenu

Type Name
enum ItemType
enum Orientation

Public Functions

Type Name
virtual void Draw (const UiCanvasDescriptor & canvas) override
void Init (const AbstractMenu::ItemConfig * items, uint16_t numItems, AbstractMenu::Orientation orientation=AbstractMenu::Orientation::leftRightSelectUpDownModify, bool allowEntering=true)
void SetOneBitGraphicsDisplayToDrawTo (uint16_t canvasId)

Public Functions inherited from daisy::AbstractMenu

See daisy::AbstractMenu

Type Name
AbstractMenu () = default
const ItemConfig & GetItem (uint16_t itemIdx) const
uint16_t GetNumItems () const
int16_t GetSelectedItemIdx () const
virtual bool OnArrowButton (ArrowButtonType arrowType, uint8_t numberOfPresses, bool isRetriggering) override
virtual bool OnCancelButton (uint8_t numberOfPresses, bool isRetriggering) override
virtual bool OnFunctionButton (uint8_t numberOfPresses, bool isRetriggering) override
virtual bool OnMenuEncoderTurned (int16_t turns, uint16_t stepsPerRevolution) override
virtual bool OnOkayButton (uint8_t numberOfPresses, bool isRetriggering) override
virtual void OnShow () override
virtual bool OnValueEncoderTurned (int16_t turns, uint16_t stepsPerRevolution) override
virtual bool OnValuePotMoved (float newPosition) override
void SelectItem (uint16_t itemIdx)
virtual ~AbstractMenu () override

Public Functions inherited from daisy::UiPage

See daisy::UiPage

Type Name
void Close ()
virtual void Draw (const UiCanvasDescriptor & canvas) = 0
UI * GetParentUI ()
const UI * GetParentUI () const
bool IsActive ()
virtual bool IsOpaque (const UiCanvasDescriptor & display)
virtual bool OnArrowButton (ArrowButtonType arrowType, uint8_t numberOfPresses, bool isRetriggering)
virtual bool OnButton (uint16_t buttonID, uint8_t numberOfPresses, bool isRetriggering)
virtual bool OnCancelButton (uint8_t numberOfPresses, bool isRetriggering)
virtual bool OnEncoderActivityChanged (uint16_t encoderID, bool isCurrentlyActive)
virtual bool OnEncoderTurned (uint16_t encoderID, int16_t turns, uint16_t stepsPerRevolution)
virtual void OnFocusGained ()
virtual void OnFocusLost ()
virtual bool OnFunctionButton (uint8_t numberOfPresses, bool isRetriggering)
virtual void OnHide ()
virtual bool OnMenuEncoderActivityChanged (bool isCurrentlyActive)
virtual bool OnMenuEncoderTurned (int16_t turns, uint16_t stepsPerRevolution)
virtual bool OnOkayButton (uint8_t numberOfPresses, bool isRetriggering)
virtual bool OnPotActivityChanged (uint16_t potID, bool isCurrentlyActive)
virtual bool OnPotMoved (uint16_t potID, float newPosition)
virtual void OnShow ()
virtual void OnUserInteraction ()
virtual bool OnValueEncoderActivityChanged (bool isCurrentlyActive)
virtual bool OnValueEncoderTurned (int16_t turns, uint16_t stepsPerRevolution)
virtual bool OnValuePotActivityChanged (bool isCurrentlyActive)
virtual bool OnValuePotMoved (float newPosition)
UiPage ()
virtual ~UiPage ()

Protected Attributes inherited from daisy::AbstractMenu

See daisy::AbstractMenu

Type Name
bool allowEntering_ = [**true**](classdaisy_1_1Apds9960.md)
bool isEditing_ = [**false**](classdaisy_1_1Apds9960.md)
const ItemConfig * items_ = [**nullptr**](classdaisy_1_1Apds9960.md)
uint16_t numItems_ = 0
Orientation orientation_ = Orientation::upDownSelectLeftRightModify
int16_t selectedItemIdx_ = -1

Protected Functions inherited from daisy::AbstractMenu

See daisy::AbstractMenu

Type Name
void Init (const ItemConfig * items, uint16_t numItems, Orientation orientation, bool allowEntering)
bool IsFunctionButtonDown () const

Detailed Description

Author:

jelliesen

This class builds upon the menu logic of AbstractMenu and adds drawing routines that are suitable for small screens.

By default, it will paint to the canvas returned by UI::GetPrimaryOneBitGraphicsDisplayId(). It can also be configured to paint to a different canvas.

Each item will occupy the entire display. FullScreenItemMenu uses the LookAndFeel system to draw draw the items. This means that you can create your own graphics design by creating your own LookAndFeel based on the OneBitGraphicsLookAndFeel class and apply that either globally (UI::SetOneBitGraphicsLookAndFeel()) or to this page only (UiPage::SetOneBitGraphicsLookAndFeel()).

Public Functions Documentation

function Draw

virtual void daisy::FullScreenItemMenu::Draw (
    const  UiCanvasDescriptor & canvas
) override

Called to make the UIPage repaint everything on a canvas. Check the ID to determine which display this corresponds to. Cast the handle to the corresponding type and do your draw operations on it.

Implements daisy::UiPage::Draw


function Init

void daisy::FullScreenItemMenu::Init (
    const  AbstractMenu::ItemConfig * items,
    uint16_t numItems,
    AbstractMenu::Orientation orientation=AbstractMenu::Orientation::leftRightSelectUpDownModify,
    bool allowEntering=true
) 

Call this to initialize the menu. It's okay to re-initialize a FullScreenItemMenu multiple times, even while it's displayed on the UI.

Parameters:

  • items An array of ItemConfig that determine which items are available in the menu.
  • numItems The number of items in the items array.
  • orientation Controls which pair of arrow buttons are used for selection / editing
  • allowEntering Globally controls if the Ok button can enter items for editing. If you have a physical controls that can edit selected items directly (value slider, a second arrow button pair, value encoder) you can set this to false, otherwise you set it to true so that the controls used for selecting items can now also be used to edit the values.

function SetOneBitGraphicsDisplayToDrawTo

void daisy::FullScreenItemMenu::SetOneBitGraphicsDisplayToDrawTo (
    uint16_t canvasId
) 

Call this to change which canvas this menu will draw to. The canvas must be a OneBitGraphicsDisplay, e.g. the OledDisplay class. If canvasId == UI::invalidCanvasId then this menu will draw to the canvas returned by UI::GetPrimaryOneBitGraphicsDisplayId(). This is also the default behaviour.



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