tcMenu
Public Types | Public Member Functions | Protected Attributes | List of all members
DashDrawParameters Class Reference

#include <DrawableDashboard.h>

Inheritance diagram for DashDrawParameters:
DashDrawParametersUpdate DashDrawParametersIntUpdateRange DashDrawParametersTextUpdateRange

Public Types

enum  DashAlign {
  TITLE_LEFT_VALUE_LEFT , TITLE_LEFT_VALUE_RIGHT , NO_TITLE_VALUE_LEFT , NO_TITLE_VALUE_RIGHT ,
  TITLE_RIGHT_VALUE_LEFT , TITLE_RIGHT_VALUE_RIGHT
}
 

Public Member Functions

 DashDrawParameters (color_t fgColor_, color_t bgColor_, const GFXfont *font_, DashAlign align=TITLE_RIGHT_VALUE_RIGHT)
 Creates a dash parameter that has a background, foreground, font, and alignment. In this case the font is an Adafruit graphics font via tcUnicodeHelper. More...
 
 DashDrawParameters (color_t fgColor_, color_t bgColor_, const UnicodeFont *font_, DashAlign align=TITLE_RIGHT_VALUE_RIGHT)
 Creates a dash parameter that has a background, foreground, font, and alignment. In this case the font is a tcUnicode font. More...
 
 DashDrawParameters (color_t fgColor_, color_t bgColor_, const NativeFontDesc &font_, DashAlign align=TITLE_RIGHT_VALUE_RIGHT)
 Creates a dash parameter that has a background, foreground, font, and alignment. In this case the font is a native font that works with the library directly. More...
 
bool isTitleDrawn ()
 
bool isTitleLeftAlign ()
 
bool isValueLeftAlign ()
 
const DeviceFontDrawingMode & getFontMode () const
 
virtual color_t getBgColor (MenuItem *item, bool updated)
 
virtual color_t getFgColor (MenuItem *item, bool updated)
 
virtual color_t getTitleBgColor (MenuItem *item, bool updated)
 
virtual color_t getTitleFgColor (MenuItem *item, bool updated)
 

Protected Attributes

DashAlign alignment
 
color_t fgColor
 
color_t bgColor
 
DeviceFontDrawingMode fontMode
 

Detailed Description

Base class for draw parameters, used for static items that do not change. This class stores the alignment of text, the font and colors are stored in this item. Fonts can be either Adafruit or TcUnicode.

Member Enumeration Documentation

◆ DashAlign

Controls the alignment of an item in the dashboard. Options are fairly self-explanatory.

Constructor & Destructor Documentation

◆ DashDrawParameters() [1/3]

DashDrawParameters::DashDrawParameters ( color_t  fgColor_,
color_t  bgColor_,
const GFXfont *  font_,
DashAlign  align = TITLE_RIGHT_VALUE_RIGHT 
)

Creates a dash parameter that has a background, foreground, font, and alignment. In this case the font is an Adafruit graphics font via tcUnicodeHelper.

Parameters
fgColor_the foreground color
bgColor_the background color
font_the font to draw with
alignthe alignment

◆ DashDrawParameters() [2/3]

DashDrawParameters::DashDrawParameters ( color_t  fgColor_,
color_t  bgColor_,
const UnicodeFont *  font_,
DashAlign  align = TITLE_RIGHT_VALUE_RIGHT 
)

Creates a dash parameter that has a background, foreground, font, and alignment. In this case the font is a tcUnicode font.

Parameters
fgColor_the foreground color
bgColor_the background color
font_the font to draw with
alignthe alignment

◆ DashDrawParameters() [3/3]

DashDrawParameters::DashDrawParameters ( color_t  fgColor_,
color_t  bgColor_,
const NativeFontDesc &  font_,
DashAlign  align = TITLE_RIGHT_VALUE_RIGHT 
)

Creates a dash parameter that has a background, foreground, font, and alignment. In this case the font is a native font that works with the library directly.

Parameters
fgColor_the foreground color
bgColor_the background color
font_the font to draw with
alignthe alignment

Member Function Documentation

◆ isTitleDrawn()

bool DashDrawParameters::isTitleDrawn ( )
inline
Returns
true if the title is drawn, otherwise it returns false

◆ isTitleLeftAlign()

bool DashDrawParameters::isTitleLeftAlign ( )
inline
Returns
true if the title is aligned to the left of the value

◆ isValueLeftAlign()

bool DashDrawParameters::isValueLeftAlign ( )
inline
Returns
true if the title is aligned to the right of the value

◆ getFontMode()

const DeviceFontDrawingMode& DashDrawParameters::getFontMode ( ) const
inline
Returns
the font mode that is being used. See the enum for details

◆ getBgColor()

virtual color_t DashDrawParameters::getBgColor ( MenuItem item,
bool  updated 
)
inlinevirtual

the background color method is overloaded, each implementation has a different way of handling it.

Returns
the background color, in this class it is fixed

Reimplemented in DashDrawParametersUpdate.

◆ getFgColor()

virtual color_t DashDrawParameters::getFgColor ( MenuItem item,
bool  updated 
)
inlinevirtual

the foreground color method is overloaded, each implementation has a different way of handling it.

Returns
the background color, in this class it is fixed

Reimplemented in DashDrawParametersUpdate.

◆ getTitleBgColor()

virtual color_t DashDrawParameters::getTitleBgColor ( MenuItem item,
bool  updated 
)
inlinevirtual

the background title color method is overloaded, each implementation has a different way of handling it.

Returns
the background color for the title, in this class it is fixed

◆ getTitleFgColor()

virtual color_t DashDrawParameters::getTitleFgColor ( MenuItem item,
bool  updated 
)
inlinevirtual

the foreground title color method is overloaded, each implementation has a different way of handling it.

Returns
the foreground color for the title, in this class it is fixed

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