libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
daisy::UiPage Class Referenceabstract

The base class for a page in the UI system. More...

Detailed Description

The base class for a page in the UI system.

Author
jelliesen

#include <UI.h>

Inheritance diagram for daisy::UiPage:
daisy::AbstractMenu daisy::FullScreenItemMenu

Public Member Functions

 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
 
UIGetParentUI ()
 
const UIGetParentUI () const
 

Friends

class UI
 

Constructor & Destructor Documentation

◆ UiPage()

daisy::UiPage::UiPage ( )
inline

◆ ~UiPage()

virtual daisy::UiPage::~UiPage ( )
inlinevirtual

Member Function Documentation

◆ 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.

◆ Draw()

virtual void daisy::UiPage::Draw ( const UiCanvasDescriptor canvas)
pure virtual

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.

Implemented in daisy::FullScreenItemMenu.

◆ GetParentUI() [1/2]

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

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

◆ GetParentUI() [2/2]

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

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

◆ IsActive()

bool daisy::UiPage::IsActive ( )
inline

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

◆ IsOpaque()

virtual bool daisy::UiPage::IsOpaque ( const UiCanvasDescriptor display)
inlinevirtual

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.

◆ OnArrowButton()

virtual bool daisy::UiPage::OnArrowButton ( ArrowButtonType  arrowType,
uint8_t  numberOfPresses,
bool  isRetriggering 
)
inlinevirtual

Called when an arrow button is pressed or released.

Parameters
arrowTypeThe arrow button affected.
numberOfPressesHolds 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.
isRetriggeringTrue 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.

Reimplemented in daisy::AbstractMenu.

◆ OnButton()

virtual bool daisy::UiPage::OnButton ( uint16_t  buttonID,
uint8_t  numberOfPresses,
bool  isRetriggering 
)
inlinevirtual

Called when any button is pressed or released that is not an arrow button, the function button or the okay / cancel buttons.

Parameters
buttonIDThe ID of the affected button.
numberOfPressesHolds 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.
isRetriggeringTrue 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.

◆ OnCancelButton()

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

Called when the cancel button is pressed or released.

Parameters
numberOfPressesHolds 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.
isRetriggeringTrue 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.

Reimplemented in daisy::AbstractMenu.

◆ OnEncoderActivityChanged()

virtual bool daisy::UiPage::OnEncoderActivityChanged ( uint16_t  encoderID,
bool  isCurrentlyActive 
)
inlinevirtual

Called when the user starts or stops turning an encoder that is not the menu encoder or the value encoder.

Parameters
encoderIDThe ID of the affected encoder.
isCurrentlyActiveTrue, if the user currently moves this encoder.
Returns
false, if you want the event to be passed on to the page below.

◆ OnEncoderTurned()

virtual bool daisy::UiPage::OnEncoderTurned ( uint16_t  encoderID,
int16_t  turns,
uint16_t  stepsPerRevolution 
)
inlinevirtual

Called when an encoder is turned that is not the menu encoder or the value encoder.

Parameters
encoderIDThe ID of the affected encoder.
turnsThe number of increments, positive is clockwise.
stepsPerRevolutionThe total number of increments per revolution on this encoder.
Returns
false, if you want the event to be passed on to the page below.

◆ OnFocusGained()

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

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

◆ OnFocusLost()

virtual void daisy::UiPage::OnFocusLost ( )
inlinevirtual

Called when the page is no longer the topmost page in the page stack.

◆ OnFunctionButton()

virtual bool daisy::UiPage::OnFunctionButton ( uint8_t  numberOfPresses,
bool  isRetriggering 
)
inlinevirtual

Called when the function button is pressed or released.

Parameters
numberOfPressesHolds 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.
isRetriggeringTrue 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.

Reimplemented in daisy::AbstractMenu.

◆ OnHide()

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

Called when the page is removed from the UI.

◆ OnMenuEncoderActivityChanged()

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

Called when the user starts or stops turning the menu encoder.

Parameters
isCurrentlyActiveTrue, if the user currently moves this encoder.
Returns
false, if you want the event to be passed on to the page below.

◆ OnMenuEncoderTurned()

virtual bool daisy::UiPage::OnMenuEncoderTurned ( int16_t  turns,
uint16_t  stepsPerRevolution 
)
inlinevirtual

Called when the menu encoder is turned.

Parameters
turnsThe number of increments, positive is clockwise.
stepsPerRevolutionThe total number of increments per revolution on this encoder.
Returns
false, if you want the event to be passed on to the page below.

Reimplemented in daisy::AbstractMenu.

◆ OnOkayButton()

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

Called when the okay button is pressed or released.

Parameters
numberOfPressesHolds 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.
isRetriggeringTrue 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.

Reimplemented in daisy::AbstractMenu.

◆ OnPotActivityChanged()

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

Called when the user starts or stops turning a potentiometer that's not the value potentiometer.

Parameters
potIDThe ID of the affected potentiometer.
isCurrentlyActiveTrue, if the user currently moves this potentiometer.
Returns
false, if you want the event to be passed on to the page below.

◆ OnPotMoved()

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

Called when a potentiometer is turned that's not the value potentiometer.

Parameters
potIDThe ID of the affected potentiometer.
newPositionThe new position in the range 0 .. 1
Returns
false, if you want the event to be passed on to the page below.

◆ OnShow()

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

Called when the page is added to the UI.

Reimplemented in daisy::AbstractMenu.

◆ OnUserInteraction()

virtual void daisy::UiPage::OnUserInteraction ( )
inlinevirtual

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.

◆ OnValueEncoderActivityChanged()

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

Called when the user starts or stops turning the value encoder.

Parameters
isCurrentlyActiveTrue, if the user currently moves this encoder.
Returns
false, if you want the event to be passed on to the page below.

◆ OnValueEncoderTurned()

virtual bool daisy::UiPage::OnValueEncoderTurned ( int16_t  turns,
uint16_t  stepsPerRevolution 
)
inlinevirtual

Called when the menu encoder is turned.

Parameters
turnsThe number of increments, positive is clockwise.
stepsPerRevolutionThe total number of increments per revolution on this encoder.
Returns
false, if you want the event to be passed on to the page below.

Reimplemented in daisy::AbstractMenu.

◆ OnValuePotActivityChanged()

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

Called when the user starts or stops turning the value potentiometer.

Parameters
isCurrentlyActiveTrue, if the user currently moves this potentiometer.
Returns
false, if you want the event to be passed on to the page below.

◆ OnValuePotMoved()

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

Called when the value potentiometer is turned.

Parameters
newPositionThe new position in the range 0 .. 1
Returns
false, if you want the event to be passed on to the page below.

Reimplemented in daisy::AbstractMenu.

Friends And Related Symbol Documentation

◆ UI

friend class UI
friend

The documentation for this class was generated from the following file: