OSCR
Open Source Cartridge Reader
Loading...
Searching...
No Matches
OSCR::UI::RangeSelect Class Reference

Public Member Functions

 RangeSelect (__FlashStringHelper const *menuTitle, uint16_t const rangeMin=0, uint16_t const rangeMax=UINT16_MAX)
 Create a menu interface for selecting a number from a range.
void render ()
uint16_t select ()
uint16_t select (uint16_t const startAt)
void valueIncrement ()
void valueDecrement ()

Protected Member Functions

bool valueInBounds (uint32_t newValue)
int32_t diffValue (bool willRollover, int32_t tens, int8_t rolloverNumber, int8_t step)
bool adjustValue (bool willRollover, int32_t tens, int8_t rolloverNumber, int8_t step)
uint8_t getPositionsFor (uint16_t value)
int8_t getNumberAt (uint16_t value, uint8_t position)
void _setup ()
void navigate (NavDir direction)
void onSelectionChange ()

Protected Attributes

__FlashStringHelper const * title
uint16_t minValue
uint16_t maxValue
uint16_t currentValue
uint8_t positions
uint8_t currentPosition = 0
bool rendered = false

Constructor & Destructor Documentation

◆ RangeSelect()

OSCR::UI::RangeSelect::RangeSelect ( __FlashStringHelper const * menuTitle,
uint16_t const rangeMin = 0,
uint16_t const rangeMax = UINT16_MAX )

Create a menu interface for selecting a number from a range.

Parameters
menuTitleA flash string to use for the menu title.
rangeMinThe minimum selectable number.
rangeMaxThe maximum selectable number.

Member Function Documentation

◆ select() [1/2]

uint16_t OSCR::UI::RangeSelect::select ( )

Prompt the user to select a number within range and return it.

Returns
The selected number.

◆ select() [2/2]

uint16_t OSCR::UI::RangeSelect::select ( uint16_t const startAt)

Prompt the user to select a number within range and return it.

Parameters
startAtThe number to start at.
Returns
The selected number.

◆ valueDecrement()

void OSCR::UI::RangeSelect::valueDecrement ( )

Decrement the currently selected number.

◆ valueIncrement()

void OSCR::UI::RangeSelect::valueIncrement ( )

Increment the currently selected number.


The documentation for this class was generated from the following files:
  • C:/Developer/Projects/OSCR/oscr-firmware/include/ui/interfaces.h
  • ui/interfaces.cpp