Skip to content

Class daisy::UiPage

ClassList > 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

void daisy::UiPage::Close () 

Closes the current page. This calls the parent UI and asks it to Remove this page from the page stack.


function Draw

virtual void daisy::UiPage::Draw (
    const  UiCanvasDescriptor & canvas
) = 0

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 [½]

inline UI * daisy::UiPage::GetParentUI () 

Returns a reference to the parent UI object, or nullptr if not added to any UI at the moment.


function GetParentUI [2/2]

inline const  UI * daisy::UiPage::GetParentUI () const

Returns a reference to the parent UI object, or nullptr if not added to any UI at the moment.


function IsActive

inline bool daisy::UiPage::IsActive () 

Returns true if the page is currently active on a UI - it may not be visible, though.


function IsOpaque

inline virtual bool daisy::UiPage::IsOpaque (
    const  UiCanvasDescriptor & display
) 

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

inline virtual bool daisy::UiPage::OnCancelButton (
    uint8_t numberOfPresses,
    bool isRetriggering
) 

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

inline virtual void daisy::UiPage::OnFocusGained () 

Called when the page becomes the topmost page in the page stack.


function OnFocusLost

inline virtual void daisy::UiPage::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

inline virtual void daisy::UiPage::OnHide () 

Called when the page is removed from the UI.


function OnMenuEncoderActivityChanged

inline virtual bool daisy::UiPage::OnMenuEncoderActivityChanged (
    bool isCurrentlyActive
) 

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

inline virtual bool daisy::UiPage::OnOkayButton (
    uint8_t numberOfPresses,
    bool isRetriggering
) 

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

inline virtual bool daisy::UiPage::OnPotActivityChanged (
    uint16_t potID,
    bool isCurrentlyActive
) 

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

inline virtual bool daisy::UiPage::OnPotMoved (
    uint16_t potID,
    float newPosition
) 

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

inline virtual void daisy::UiPage::OnShow () 

Called when the page is added to the UI.


function OnUserInteraction

inline virtual void daisy::UiPage::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

inline virtual bool daisy::UiPage::OnValueEncoderActivityChanged (
    bool isCurrentlyActive
) 

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

inline virtual bool daisy::UiPage::OnValuePotActivityChanged (
    bool isCurrentlyActive
) 

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

inline virtual bool daisy::UiPage::OnValuePotMoved (
    float newPosition
) 

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

inline daisy::UiPage::UiPage () 

function ~UiPage

inline virtual daisy::UiPage::~UiPage () 


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