tcMenu
Public Types | Public Member Functions | List of all members
tcgfx::GridPosition Class Reference

#include <GfxMenuConfig.h>

Public Types

enum  GridDrawingMode : uint8_t {
  DRAW_TEXTUAL_ITEM , DRAW_INTEGER_AS_UP_DOWN , DRAW_INTEGER_AS_SCROLL , DRAW_AS_ICON_ONLY ,
  DRAW_AS_ICON_TEXT , DRAW_TITLE_ITEM
}
 
enum  GridJustification : uint8_t {
  CORE_JUSTIFY_LEFT = 1 , CORE_JUSTIFY_RIGHT = 2 , CORE_JUSTIFY_CENTER = 3 , CORE_JUSTIFY_VALUE_REQUIRED = 0b1000 ,
  CORE_JUSTIFY_NAME_REQUIRED = 0b0100 , JUSTIFY_TITLE_LEFT_VALUE_RIGHT = 0 , JUSTIFY_TITLE_LEFT_WITH_VALUE = CORE_JUSTIFY_LEFT | CORE_JUSTIFY_NAME_REQUIRED | CORE_JUSTIFY_VALUE_REQUIRED , JUSTIFY_CENTER_WITH_VALUE = CORE_JUSTIFY_CENTER | CORE_JUSTIFY_NAME_REQUIRED | CORE_JUSTIFY_VALUE_REQUIRED ,
  JUSTIFY_RIGHT_WITH_VALUE = CORE_JUSTIFY_RIGHT | CORE_JUSTIFY_NAME_REQUIRED | CORE_JUSTIFY_VALUE_REQUIRED , JUSTIFY_LEFT_NO_VALUE = CORE_JUSTIFY_LEFT | CORE_JUSTIFY_NAME_REQUIRED , JUSTIFY_CENTER_NO_VALUE = CORE_JUSTIFY_CENTER | CORE_JUSTIFY_NAME_REQUIRED , JUSTIFY_RIGHT_NO_VALUE = CORE_JUSTIFY_RIGHT | CORE_JUSTIFY_NAME_REQUIRED ,
  JUSTIFY_LEFT_VALUE_ONLY = CORE_JUSTIFY_LEFT | CORE_JUSTIFY_VALUE_REQUIRED , JUSTIFY_CENTER_VALUE_ONLY = CORE_JUSTIFY_CENTER | CORE_JUSTIFY_VALUE_REQUIRED , JUSTIFY_RIGHT_VALUE_ONLY = CORE_JUSTIFY_RIGHT | CORE_JUSTIFY_VALUE_REQUIRED
}
 

Public Member Functions

 GridPosition (const GridPosition &other)=default
 
GridPositionoperator= (const GridPosition &other)=default
 
 GridPosition (GridDrawingMode mode, GridJustification justification, int row, int height=0)
 
 GridPosition (GridDrawingMode mode, GridJustification just, int size, int pos, int row, int hei)
 
GridDrawingMode getDrawingMode () const
 
GridJustification getJustification () const
 
int getGridSize () const
 
int getGridHeight () const
 
int getGridPosition () const
 
int getRow () const
 

Detailed Description

Provides a platform independent means of identifying where on the screen a particular menu item resides using a simple grid layout

Member Enumeration Documentation

◆ GridDrawingMode

Represents how the item in this position should be drawn.

Enumerator
DRAW_TEXTUAL_ITEM 

Drawn as text in the form of Item on the left, value on the right

DRAW_INTEGER_AS_UP_DOWN 

Drawn two buttons with the value in the middle, to move through a range of values

DRAW_INTEGER_AS_SCROLL 

Drawn as a scroll slider, to move through a series of values

DRAW_AS_ICON_ONLY 

Drawn as an icon with no text underneath

DRAW_AS_ICON_TEXT 

Drawn as an icon with text underneath

DRAW_TITLE_ITEM 

Drawn as a title, usually reserved for the title at the top of the page

◆ GridJustification

Represents the justification of both the item name and the value within the items drawing space. This controls exactly what text is presented, and the position too.

Enumerator
CORE_JUSTIFY_LEFT 

Indicates left justification - usually use of the combined types below

CORE_JUSTIFY_RIGHT 

Indicates right justification - usually use of the combined types below

CORE_JUSTIFY_CENTER 

Indicates centre justification - usually use of the combined types below

CORE_JUSTIFY_VALUE_REQUIRED 

usually use of the combined types below

CORE_JUSTIFY_NAME_REQUIRED 

usually use of the combined types below

JUSTIFY_TITLE_LEFT_VALUE_RIGHT 

Justify the item name on the left and the value on the right

JUSTIFY_TITLE_LEFT_WITH_VALUE 

Justify the item name and value on the right

JUSTIFY_CENTER_WITH_VALUE 

Justify the item name and value centered

JUSTIFY_RIGHT_WITH_VALUE 

Justify the item name and value on the right

JUSTIFY_LEFT_NO_VALUE 

Justify just the item name to the left

JUSTIFY_CENTER_NO_VALUE 

Justify just the item name in the center

JUSTIFY_RIGHT_NO_VALUE 

Justify just the item name in the center

JUSTIFY_LEFT_VALUE_ONLY 

Justify just the items current value to the left

JUSTIFY_CENTER_VALUE_ONLY 

Justify just the items current value in the center

JUSTIFY_RIGHT_VALUE_ONLY 

Justify just the items current value to the right

Constructor & Destructor Documentation

◆ GridPosition() [1/2]

tcgfx::GridPosition::GridPosition ( GridDrawingMode  mode,
GridJustification  justification,
int  row,
int  height = 0 
)
inline

Create a simple grid position that represents a row with a single column with optional override of the row height

Parameters
modethe mode in which to draw the item
justificationthe desired justification for this item
rowthe row on which to draw the item
heightthe height of the item or leave blank for default

◆ GridPosition() [2/2]

tcgfx::GridPosition::GridPosition ( GridDrawingMode  mode,
GridJustification  just,
int  size,
int  pos,
int  row,
int  hei 
)
inline

Create a more complex multi column grid with height, this represents a single row with one or more columns, a position in the columns, and if need be, a height override.

Parameters
modethe mode in which to draw the item
justificationthe desired justification for this item
sizethe number of columns in the row
posthe column position in the row
rowthe row on which to draw the item
heithe height of the row, or 0 for the default height.

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