RIT VEXU Core API
Loading...
Searching...
No Matches
LegacyScreen::InitializerPage Class Reference

InitializerPage provides a way to Select a desired Initialization on the Screen. More...

#include <legacy.h>

Inheritance diagram for LegacyScreen::InitializerPage:
LegacyScreen::Page

Public Member Functions

 InitializerPage (const Initializer &initializer, size_t starting_index=0)
 Creates an InitializerPage.
void update (bool was_pressed, int x, int y) override
void draw (vex::brain::lcd &, bool first_draw, unsigned int frame_number) override

Static Public Member Functions

static InitializerPageNext ()
 Creates an InitializerPage that renders the following Initializations from the last.
static size_t selector ()
 When using InitializerPage to select an Initialization, use this as the raw selector function.
static std::function< Selector::selector_ttimed_selector (unsigned int seconds, size_t fallback=DEFAULT_CANCELATION_INDEX)
 When using InitializerPage wrapped by a timeout, call this to generate the desired selector function.
static void cancel (size_t selected)
 When using a selector function wrapper that may cancel or otherwise cause the InitializerPage's selector to fail, call this.

Static Public Attributes

static const size_t DEFAULT_CANCELATION_INDEX = Selector::NO_SELECTION_INDEX - 1
 The default selected index if a cancelation occured during selection.

Detailed Description

InitializerPage provides a way to Select a desired Initialization on the Screen.

Constructor & Destructor Documentation

◆ InitializerPage()

LegacyScreen::InitializerPage::InitializerPage ( const Initializer & initializer,
size_t starting_index = 0 )

Creates an InitializerPage.

Parameters
initializerThe initializer object for which this page provides a GUI of
starting_indexThe first Initialization to be rendered on the page (note that 8 Initializations are rendered per page)

Member Function Documentation

◆ cancel()

void LegacyScreen::InitializerPage::cancel ( size_t selected)
static

When using a selector function wrapper that may cancel or otherwise cause the InitializerPage's selector to fail, call this.

Parameters
selectedThe value selected that ended up being selected.

◆ draw()

void LegacyScreen::InitializerPage::draw ( vex::brain::lcd & scr,
bool first_draw,
unsigned int frame_number )
overridevirtual
See also
Page::draw

Reimplemented from LegacyScreen::Page.

◆ timed_selector()

std::function< Selector::selector_t > LegacyScreen::InitializerPage::timed_selector ( unsigned int seconds,
size_t fallback = DEFAULT_CANCELATION_INDEX )
inlinestatic

When using InitializerPage wrapped by a timeout, call this to generate the desired selector function.

Parameters
secondsThe amount of seconds after which the selector function will timeout
fallbackThe value which ends up being selected should the selector function timeout
Returns
A selector function wrapped in a Selector::timeout

◆ update()

void LegacyScreen::InitializerPage::update ( bool was_pressed,
int x,
int y )
overridevirtual
See also
Page::update

Reimplemented from LegacyScreen::Page.


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