Class daisy::UiPage¶
The base class for a page in the UI system.More...
#include <UI.h>
Inherited by the following classes: daisy::AbstractMenu
Public Functions¶
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 () |
Detailed Description¶
Author:
jelliesen
Public Functions Documentation¶
function Close¶
Closes the current page. This calls the parent UI and asks it to Remove this page from the page stack.
function 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 [2/2]¶
Returns a reference to the parent UI object, or nullptr if not added to any UI at the moment.
function IsActive¶
Returns true if the page is currently active on a UI - it may not be visible, though.
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 OnArrowButton¶
inline virtual bool daisy::UiPage::OnArrowButton (
ArrowButtonType arrowType,
uint8_t numberOfPresses,
bool isRetriggering
)
Called when an arrow button is pressed or released.
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)
Returns:
false, if you want the event to be passed on to the page below.
function OnButton¶
inline virtual bool daisy::UiPage::OnButton (
uint16_t buttonID,
uint8_t numberOfPresses,
bool isRetriggering
)
Called when any button is pressed or released that is not an arrow button, the function button or the okay / cancel buttons.
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)
Returns:
false, if you want the event to be passed on to the page below.
function OnCancelButton¶
Called when the cancel button is pressed or released.
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)
Returns:
false, if you want the event to be passed on to the page below.
function OnEncoderActivityChanged¶
inline virtual bool daisy::UiPage::OnEncoderActivityChanged (
uint16_t encoderID,
bool isCurrentlyActive
)
Called when the user starts or stops turning an encoder that is not the menu encoder or the value encoder.
Parameters:
encoderID
The ID of the affected encoder.isCurrentlyActive
True, if the user currently moves this encoder.
Returns:
false, if you want the event to be passed on to the page below.
function OnEncoderTurned¶
inline virtual bool daisy::UiPage::OnEncoderTurned (
uint16_t encoderID,
int16_t turns,
uint16_t stepsPerRevolution
)
Called when an encoder is turned that is not the menu encoder or the value encoder.
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.
Returns:
false, if you want the event to be passed on to the page below.
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 OnFunctionButton¶
inline virtual bool daisy::UiPage::OnFunctionButton (
uint8_t numberOfPresses,
bool isRetriggering
)
Called when the function button is pressed or released.
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)
Returns:
false, if you want the event to be passed on to the page below.
function OnHide¶
Called when the page is removed from the UI.
function OnMenuEncoderActivityChanged¶
Called when the user starts or stops turning the menu encoder.
Parameters:
isCurrentlyActive
True, if the user currently moves this encoder.
Returns:
false, if you want the event to be passed on to the page below.
function OnMenuEncoderTurned¶
inline virtual bool daisy::UiPage::OnMenuEncoderTurned (
int16_t turns,
uint16_t stepsPerRevolution
)
Called when the menu encoder is turned.
Parameters:
turns
The number of increments, positive is clockwise.stepsPerRevolution
The total number of increments per revolution on this encoder.
Returns:
false, if you want the event to be passed on to the page below.
function OnOkayButton¶
Called when the okay button is pressed or released.
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)
Returns:
false, if you want the event to be passed on to the page below.
function OnPotActivityChanged¶
Called when the user starts or stops turning a potentiometer that's not the value potentiometer.
Parameters:
potID
The ID of the affected potentiometer.isCurrentlyActive
True, if the user currently moves this potentiometer.
Returns:
false, if you want the event to be passed on to the page below.
function OnPotMoved¶
Called when a potentiometer is turned that's not the value potentiometer.
Parameters:
potID
The ID of the affected potentiometer.newPosition
The new position in the range 0 .. 1
Returns:
false, if you want the event to be passed on to the page below.
function OnShow¶
Called when the page is added to the UI.
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 OnValueEncoderActivityChanged¶
Called when the user starts or stops turning the value encoder.
Parameters:
isCurrentlyActive
True, if the user currently moves this encoder.
Returns:
false, if you want the event to be passed on to the page below.
function OnValueEncoderTurned¶
inline virtual bool daisy::UiPage::OnValueEncoderTurned (
int16_t turns,
uint16_t stepsPerRevolution
)
Called when the menu encoder is turned.
Parameters:
turns
The number of increments, positive is clockwise.stepsPerRevolution
The total number of increments per revolution on this encoder.
Returns:
false, if you want the event to be passed on to the page below.
function OnValuePotActivityChanged¶
Called when the user starts or stops turning the value potentiometer.
Parameters:
isCurrentlyActive
True, if the user currently moves this potentiometer.
Returns:
false, if you want the event to be passed on to the page below.
function OnValuePotMoved¶
Called when the value potentiometer is turned.
Parameters:
newPosition
The new position in the range 0 .. 1
Returns:
false, if you want the event to be passed on to the page below.
function UiPage¶
function ~UiPage¶
The documentation for this class was generated from the following file external-docs/libDaisy/src/ui/UI.h