daisy::UiPage¶
The base class for a page in the UI system. More...
#include <UI.h>
Inherited by daisy::AbstractMenu
Public Functions¶
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() |
virtual void | Draw(const UiCanvasDescriptor & canvas) =0 |
UI * | GetParentUI() |
const UI * | GetParentUI() const |
Friends¶
Name | |
---|---|
class | UI |
Detailed Description¶
The base class for a page in the UI system.
Author: jelliesen
Public Functions Documentation¶
function UiPage¶
function ~UiPage¶
function IsOpaque¶
Returns true, if the page fills the entire canvas. A canvas can be individual leds, text displays, alphanumeric displays, graphics displays, etc. The UI class will use this to determine if underlying pages must be drawn before this page.
function IsActive¶
Returns true if the page is currently active on a UI - it may not be visible, though.
function OnUserInteraction¶
Called on any user input event, after the respective callback has completed. OnUserInteraction will be invoked for all pages in the page stack and can be used to track general user activity.
function Close¶
Closes the current page. This calls the parent UI and asks it to Remove this page from the page stack.
function OnOkayButton¶
Parameters:
- numberOfPresses Holds the number of successive button presses. It will be 1 on the first call and increasing by 1 with each successive call. A button down event is signaled by numberOfButtonPresses == 0.
- isRetriggering True if the button is auto-retriggering (due to being held down)
Return: false, if you want the event to be passed on to the page below.
Reimplemented by: daisy::AbstractMenu::OnOkayButton
Called when the okay button is pressed or released.
function OnCancelButton¶
Parameters:
- numberOfPresses Holds the number of successive button presses. It will be 1 on the first call and increasing by 1 with each successive call. A button down event is signaled by numberOfButtonPresses == 0.
- isRetriggering True if the button is auto-retriggering (due to being held down)
Return: false, if you want the event to be passed on to the page below.
Reimplemented by: daisy::AbstractMenu::OnCancelButton
Called when the cancel button is pressed or released.
function OnArrowButton¶
inline virtual bool OnArrowButton(
ArrowButtonType arrowType,
uint8_t numberOfPresses,
bool isRetriggering
)
Parameters:
- arrowType The arrow button affected.
- numberOfPresses Holds the number of successive button presses. It will be 1 on the first call and increasing by 1 with each successive call. A button down event is signaled by numberOfButtonPresses == 0.
- isRetriggering True if the button is auto-retriggering (due to being held down)
Return: false, if you want the event to be passed on to the page below.
Reimplemented by: daisy::AbstractMenu::OnArrowButton
Called when an arrow button is pressed or released.
function OnFunctionButton¶
Parameters:
- numberOfPresses Holds the number of successive button presses. It will be 1 on the first call and increasing by 1 with each successive call. A button down event is signaled by numberOfButtonPresses == 0.
- isRetriggering True if the button is auto-retriggering (due to being held down)
Return: false, if you want the event to be passed on to the page below.
Reimplemented by: daisy::AbstractMenu::OnFunctionButton
Called when the function button is pressed or released.
function OnButton¶
Parameters:
- buttonID The ID of the affected button.
- numberOfPresses Holds the number of successive button presses. It will be 1 on the first call and increasing by 1 with each successive call. A button down event is signaled by numberOfButtonPresses == 0.
- isRetriggering True if the button is auto-retriggering (due to being held down)
Return: false, if you want the event to be passed on to the page below.
Called when any button is pressed or released that is not an arrow button, the function button or the okay / cancel buttons.
function OnMenuEncoderTurned¶
Parameters:
- turns The number of increments, positive is clockwise.
- stepsPerRevolution The total number of increments per revolution on this encoder.
Return: false, if you want the event to be passed on to the page below.
Reimplemented by: daisy::AbstractMenu::OnMenuEncoderTurned
Called when the menu encoder is turned.
function OnValueEncoderTurned¶
Parameters:
- turns The number of increments, positive is clockwise.
- stepsPerRevolution The total number of increments per revolution on this encoder.
Return: false, if you want the event to be passed on to the page below.
Reimplemented by: daisy::AbstractMenu::OnValueEncoderTurned
Called when the menu encoder is turned.
function OnEncoderTurned¶
inline virtual bool OnEncoderTurned(
uint16_t encoderID,
int16_t turns,
uint16_t stepsPerRevolution
)
Parameters:
- encoderID The ID of the affected encoder.
- turns The number of increments, positive is clockwise.
- stepsPerRevolution The total number of increments per revolution on this encoder.
Return: false, if you want the event to be passed on to the page below.
Called when an encoder is turned that is not the menu encoder or the value encoder.
function OnMenuEncoderActivityChanged¶
Parameters:
- isCurrentlyActive True, if the user currently moves this encoder.
Return: false, if you want the event to be passed on to the page below.
Called when the user starts or stops turning the menu encoder.
function OnValueEncoderActivityChanged¶
Parameters:
- isCurrentlyActive True, if the user currently moves this encoder.
Return: false, if you want the event to be passed on to the page below.
Called when the user starts or stops turning the value encoder.
function OnEncoderActivityChanged¶
Parameters:
- encoderID The ID of the affected encoder.
- isCurrentlyActive True, if the user currently moves this encoder.
Return: false, if you want the event to be passed on to the page below.
Called when the user starts or stops turning an encoder that is not the menu encoder or the value encoder.
function OnValuePotMoved¶
Parameters:
- newPosition The new position in the range 0 .. 1
Return: false, if you want the event to be passed on to the page below.
Reimplemented by: daisy::AbstractMenu::OnValuePotMoved
Called when the value potentiometer is turned.
function OnPotMoved¶
Parameters:
- potID The ID of the affected potentiometer.
- newPosition The new position in the range 0 .. 1
Return: false, if you want the event to be passed on to the page below.
Called when a potentiometer is turned that's not the value potentiometer.
function OnValuePotActivityChanged¶
Parameters:
- isCurrentlyActive True, if the user currently moves this potentiometer.
Return: false, if you want the event to be passed on to the page below.
Called when the user starts or stops turning the value potentiometer.
function OnPotActivityChanged¶
Parameters:
- potID The ID of the affected potentiometer.
- isCurrentlyActive True, if the user currently moves this potentiometer.
Return: false, if you want the event to be passed on to the page below.
Called when the user starts or stops turning a potentiometer that's not the value potentiometer.
function OnShow¶
Reimplemented by: daisy::AbstractMenu::OnShow
Called when the page is added to the UI.
function OnHide¶
Called when the page is removed from the UI.
function OnFocusGained¶
Called when the page becomes the topmost page in the page stack.
function OnFocusLost¶
Called when the page is no longer the topmost page in the page stack.
function Draw¶
Reimplemented by: daisy::FullScreenItemMenu::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.
function GetParentUI¶
Returns a reference to the parent UI object, or nullptr if not added to any UI at the moment.
function GetParentUI¶
Returns a reference to the parent UI object, or nullptr if not added to any UI at the moment.
Friends¶
friend UI¶
Updated on 2024-01-03 at 19:41:01 +0000