OptionsSelector Class Reference
#include <OptionsSelector.h>
![](../class_options_selector.png)
# Public Types | |
enum | OptionTypes |
enum | OptionsAlignment |
# Public Member Functions | |
void | constructor (uint16 cols, uint16 rows, char *font, char *leftMark, char *rightMark) |
void | setColumnWidth (uint8 width) |
void | setMarkCharacters (char *leftMark, char *rightMark) |
void | setOptions (VirtualList options) |
bool | setSelectedOption (int32 optionIndex) |
void | selectNext () |
Select the next option. | |
void | selectPrevious () |
Select the previous option. | |
int32 | getSelectedOption () |
int32 | getNumberOfOptions () |
void | print (uint8 x, uint8 y, uint32 alignment, uint8 spacing) |
# Protected Attributes | |
VirtualList | pages |
List of pages, each being a VirtualLists of Options. | |
VirtualNode | currentPage |
Current page's node. | |
VirtualNode | currentOption |
Current option's node. | |
int32 | totalOptions |
Total number of options. | |
int32 | currentPageIndex |
Current page index. | |
int32 | currentOptionIndex |
int8 | x |
Screen x coordinate where to print. | |
int8 | y |
Screen y coordinate where to print. | |
int8 | optionsLength |
The maximum length of all the options. | |
uint32 | alignment |
Text alignement. | |
int8 | spacing |
Text row spacing. | |
uint16 | cols |
Number of columns per page. | |
uint16 | rows |
Number of rows per page. | |
uint8 | columnWidth |
Width of a column (in chars) | |
char * | leftMark |
Left selection mark character. | |
char * | rightMark |
Right selection mark character. | |
char * | font |
Font to use for printing the options. |
# Additional Inherited Members | |
![]() | |
void | constructor () |
Class' constructor. | |
void | destructor () |
Class' destructor. | |
void | addEventListener (ListenerObject listener, uint16 eventCode) |
void | removeEventListener (ListenerObject listener, uint16 eventCode) |
void | removeEventListeners (uint16 eventCode) |
void | removeAllEventListeners () |
Remove all listener objects. | |
bool | hasActiveEventListeners () |
void | fireEvent (uint16 eventCode) |
void | sendMessageTo (ListenerObject receiver, uint32 message, uint32 delay, uint32 randomDelay) |
void | sendMessageToSelf (uint32 message, uint32 delay, uint32 randomDelay) |
void | discardAllMessages () |
Discard all messages, both to be sent and to be received. | |
void | discardMessages (uint32 message) |
virtual bool | onEvent (ListenerObject eventFirer, uint16 eventCode) |
virtual bool | handleMessage (Telegram telegram) |
![]() | |
VirtualList | events |
List of registered events. | |
int8 | eventFirings |
Counter that keeps track of the number of fired events to prevent race conditions in nested firings. |
# Detailed Description
Class Sprite
Inherits from VisualComponent
Implements a simple interactive menu.
Definition at line 82 of file OptionsSelector.h.
# Member Enumeration Documentation
# OptionsAlignment
enum OptionsAlignment |
Types of text alignments
Definition at line 66 of file OptionsSelector.h.
# OptionTypes
enum OptionTypes |
Types of Options
Definition at line 50 of file OptionsSelector.h.
# Member Function Documentation
# constructor()
void OptionsSelector::constructor | ( | uint16 | cols, |
uint16 | rows, | ||
char * | font, | ||
char * | leftMark, | ||
char * | rightMark ) |
Class' constructor
- Parameters
-
cols Number of columns per page rows Number of rows per page font Font to use for printing the options leftMark Left selection mark character rightMark Right selection mark character
Definition at line 89 of file OptionsSelector.c.
# getNumberOfOptions()
int32 OptionsSelector::getNumberOfOptions | ( | ) |
Retrieve the total number of options.
- Returns
- The total number of options
Definition at line 340 of file OptionsSelector.c.
# getSelectedOption()
int32 OptionsSelector::getSelectedOption | ( | ) |
Retrieve the selected option's index.
- Returns
- Index of the selected option
Definition at line 333 of file OptionsSelector.c.
# print()
Print the options.
- Parameters
-
x Screen x coordinate where to print y Screen y coordinate where to print alignment Text alignment spacing Text spacing
Definition at line 347 of file OptionsSelector.c.
# selectNext()
void OptionsSelector::selectNext | ( | ) |
Select the next option.
Definition at line 227 of file OptionsSelector.c.
# selectPrevious()
void OptionsSelector::selectPrevious | ( | ) |
Select the previous option.
Definition at line 280 of file OptionsSelector.c.
# setColumnWidth()
void OptionsSelector::setColumnWidth | ( | uint8 | width | ) |
Set the maximum with of each column.
- Parameters
-
width Columns' with
Definition at line 125 of file OptionsSelector.c.
# setMarkCharacters()
void OptionsSelector::setMarkCharacters | ( | char * | leftMark, |
char * | rightMark ) |
Set the markers characters.
- Parameters
-
leftMark Left selection mark character rightMark Right selection mark character
Definition at line 140 of file OptionsSelector.c.
# setOptions()
void OptionsSelector::setOptions | ( | VirtualList | options | ) |
Set the available options.
- Parameters
-
options List of options to set
Definition at line 148 of file OptionsSelector.c.
# setSelectedOption()
Set the selection option.
- Parameters
-
optionIndex Index of the option to select
Definition at line 195 of file OptionsSelector.c.
# Member Data Documentation
# alignment
|
protected |
Text alignement.
Definition at line 114 of file OptionsSelector.h.
# cols
|
protected |
Number of columns per page.
Definition at line 120 of file OptionsSelector.h.
# columnWidth
|
protected |
Width of a column (in chars)
Definition at line 126 of file OptionsSelector.h.
# currentOption
|
protected |
Current option's node.
Definition at line 93 of file OptionsSelector.h.
# currentOptionIndex
|
protected |
Definition at line 102 of file OptionsSelector.h.
# currentPage
|
protected |
Current page's node.
Definition at line 90 of file OptionsSelector.h.
# currentPageIndex
|
protected |
Current page index.
Definition at line 99 of file OptionsSelector.h.
# font
|
protected |
Font to use for printing the options.
Definition at line 135 of file OptionsSelector.h.
# leftMark
|
protected |
Left selection mark character.
Definition at line 129 of file OptionsSelector.h.
# optionsLength
|
protected |
The maximum length of all the options.
Definition at line 111 of file OptionsSelector.h.
# pages
|
protected |
List of pages, each being a VirtualLists of Options.
Definition at line 87 of file OptionsSelector.h.
# rightMark
|
protected |
Right selection mark character.
Definition at line 132 of file OptionsSelector.h.
# rows
|
protected |
Number of rows per page.
Definition at line 123 of file OptionsSelector.h.
# spacing
|
protected |
Text row spacing.
Definition at line 117 of file OptionsSelector.h.
# totalOptions
|
protected |
Total number of options.
Definition at line 96 of file OptionsSelector.h.
# x
|
protected |
Screen x coordinate where to print.
Definition at line 105 of file OptionsSelector.h.
# y
|
protected |
Screen y coordinate where to print.
Definition at line 108 of file OptionsSelector.h.
The documentation for this class was generated from the following files:
- VUEngine-Core/source/Misc/OptionsSelector/OptionsSelector.h
- VUEngine-Core/source/Misc/OptionsSelector/OptionsSelector.c