daisy::FullScreenItemMenu¶
A menu page for small screens. More...
#include <FullScreenItemMenu.h>
Inherits from daisy::AbstractMenu, daisy::UiPage
Public Functions¶
Name | |
---|---|
void | Init(const AbstractMenu::ItemConfig * items, uint16_t numItems, AbstractMenu::Orientation orientation =AbstractMenu::Orientation::leftRightSelectUpDownModify, bool allowEntering =true) |
void | SetOneBitGraphicsDisplayToDrawTo(uint16_t canvasId) |
virtual void | Draw(const UiCanvasDescriptor & canvas) override |
Additional inherited members¶
Public Classes inherited from daisy::AbstractMenu
Name | |
---|---|
class | CustomItem |
struct | ItemConfig |
Public Types inherited from daisy::AbstractMenu
Name | |
---|---|
enum class | Orientation |
enum class | ItemType |
Public Functions inherited from daisy::AbstractMenu
Name | |
---|---|
AbstractMenu() =default | |
virtual | ~AbstractMenu() override |
uint16_t | GetNumItems() const |
const ItemConfig & | GetItem(uint16_t itemIdx) const |
void | SelectItem(uint16_t itemIdx) |
int16_t | GetSelectedItemIdx() const |
virtual bool | OnOkayButton(uint8_t numberOfPresses, bool isRetriggering) override |
virtual bool | OnCancelButton(uint8_t numberOfPresses, bool isRetriggering) override |
virtual bool | OnArrowButton(ArrowButtonType arrowType, 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 | OnValueEncoderTurned(int16_t turns, uint16_t stepsPerRevolution) override |
virtual bool | OnValuePotMoved(float newPosition) override |
virtual void | OnShow() override |
Protected Functions inherited from daisy::AbstractMenu
Name | |
---|---|
bool | IsFunctionButtonDown() const |
Protected Attributes inherited from daisy::AbstractMenu
Name | |
---|---|
Orientation | orientation_ |
const ItemConfig * | items_ |
uint16_t | numItems_ |
int16_t | selectedItemIdx_ |
bool | allowEntering_ |
bool | isEditing_ |
Public Functions inherited from daisy::UiPage
Name | |
---|---|
UiPage() | |
virtual | ~UiPage() |
virtual bool | IsOpaque(const UiCanvasDescriptor & display) |
bool | IsActive() |
virtual void | OnUserInteraction() |
void | Close() |
virtual bool | OnOkayButton(uint8_t numberOfPresses, bool isRetriggering) |
virtual bool | OnCancelButton(uint8_t numberOfPresses, bool isRetriggering) |
virtual bool | OnArrowButton(ArrowButtonType arrowType, uint8_t numberOfPresses, bool isRetriggering) |
virtual bool | OnFunctionButton(uint8_t numberOfPresses, bool isRetriggering) |
virtual bool | OnButton(uint16_t buttonID, uint8_t numberOfPresses, bool isRetriggering) |
virtual bool | OnMenuEncoderTurned(int16_t turns, uint16_t stepsPerRevolution) |
virtual bool | OnValueEncoderTurned(int16_t turns, uint16_t stepsPerRevolution) |
virtual bool | OnEncoderTurned(uint16_t encoderID, int16_t turns, uint16_t stepsPerRevolution) |
virtual bool | OnMenuEncoderActivityChanged(bool isCurrentlyActive) |
virtual bool | OnValueEncoderActivityChanged(bool isCurrentlyActive) |
virtual bool | OnEncoderActivityChanged(uint16_t encoderID, bool isCurrentlyActive) |
virtual bool | OnValuePotMoved(float newPosition) |
virtual bool | OnPotMoved(uint16_t potID, float newPosition) |
virtual bool | OnValuePotActivityChanged(bool isCurrentlyActive) |
virtual bool | OnPotActivityChanged(uint16_t potID, bool isCurrentlyActive) |
virtual void | OnShow() |
virtual void | OnHide() |
virtual void | OnFocusGained() |
virtual void | OnFocusLost() |
UI * | GetParentUI() |
const UI * | GetParentUI() const |
Friends inherited from daisy::UiPage
Name | |
---|---|
class | UI |
Detailed Description¶
A menu page for small screens.
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()](/libDaisy/Classes/classdaisy_1_1_u_i/#function-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 Init¶
void Init(
const AbstractMenu::ItemConfig * items,
uint16_t numItems,
AbstractMenu::Orientation orientation =AbstractMenu::Orientation::leftRightSelectUpDownModify,
bool allowEntering =true
)
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.
Call this to initialize the menu. It's okay to re-initialize a FullScreenItemMenu multiple times, even while it's displayed on the UI.
function SetOneBitGraphicsDisplayToDrawTo¶
Call this to change which canvas this menu will draw to. The canvas must be a [OneBitGraphicsDisplay](/libDaisy/Classes/classdaisy_1_1_one_bit_graphics_display/)
, e.g. the [OledDisplay](/libDaisy/Classes/classdaisy_1_1_oled_display/)
class. If canvasId == [UI::invalidCanvasId](/libDaisy/Classes/classdaisy_1_1_u_i/#variable-invalidcanvasid)
then this menu will draw to the canvas returned by [UI::GetPrimaryOneBitGraphicsDisplayId()](/libDaisy/Classes/classdaisy_1_1_u_i/#function-getprimaryonebitgraphicsdisplayid)
. This is also the default behaviour.
function Draw¶
Reimplements: daisy::UiPage::Draw
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.
---¶
Updated on 2024-01-03 at 19:41:01 +0000