tcMenu
Public Member Functions | List of all members
EnumMenuItem Class Reference

#include <MenuItems.h>

Inheritance diagram for EnumMenuItem:
ValueMenuItem MenuItem

Public Member Functions

 EnumMenuItem (const EnumMenuInfo *info, uint8_t defaultVal, MenuItem *next=nullptr, bool infoInPgm=INFO_LOCATION_PGM)
 
void copyEnumStrToBuffer (char *buffer, int size, int idx) const
 
int getLengthOfEnumStr (int idx) const
 
- Public Member Functions inherited from ValueMenuItem
void setCurrentValue (uint16_t val, bool silent=false)
 
uint16_t getCurrentValue () const
 
- Public Member Functions inherited from MenuItem
uint8_t copyNameToBuffer (char *sz, int size) const
 
uint8_t copyNameToBuffer (char *sz, int offset, int size) const
 
menuid_t getId () const
 
uint16_t getMaximumValue () const
 
uint16_t getEepromPosition () const
 
MenuType getMenuType () const
 
void triggerCallback () const
 
bool isInfoProgMem () const
 
void setChanged (bool changed)
 
bool isChanged () const
 
bool isSendRemoteNeeded (uint8_t remoteNo) const
 
void setSendRemoteNeededAll ()
 
void clearSendRemoteNeededAll ()
 
void setSendRemoteNeeded (uint8_t remoteNo, bool needed)
 
void setActive (bool active)
 
bool isActive () const
 
void setEditing (bool active)
 
bool isEditing () const
 
void setReadOnly (bool active)
 
bool isReadOnly () const
 
void setLocalOnly (bool localOnly)
 
bool isLocalOnly () const
 
void setSecured (bool secured)
 
bool isSecured () const
 
void setVisible (bool visible)
 
bool isVisible () const
 
MenuItemgetNext () const
 
void setNext (MenuItem *next)
 
void changeOccurred (bool silent)
 

Additional Inherited Members

- Protected Member Functions inherited from ValueMenuItem
 ValueMenuItem (MenuType menuType, const AnyMenuInfo *info, uint16_t defaultVal, MenuItem *next, bool infoPgm)
 
- Protected Member Functions inherited from MenuItem
 MenuItem (MenuType menuType, const AnyMenuInfo *menuInfo, MenuItem *next, bool infoProgMem)
 
- Protected Attributes inherited from ValueMenuItem
uint16_t currentValue
 
- Protected Attributes inherited from MenuItem
uint16_t flags
 
MenuItemnext
 
union {
const AnyMenuInfoinfo
 
RuntimeRenderingFn renderFn
 
}; 
 
MenuType menuType
 

Detailed Description

An item that can represent a known series of values, somewhat like a combo box. We provide a list of choices and only one of those choices can be active at once. The choice is a zero based integer with the first choice being 0 and so on.

See also
EnumMenuInfo

Constructor & Destructor Documentation

◆ EnumMenuItem()

EnumMenuItem::EnumMenuItem ( const EnumMenuInfo info,
uint8_t  defaultVal,
MenuItem next = nullptr,
bool  infoInPgm = INFO_LOCATION_PGM 
)
inline

Create an instance of the class

Parameters
infoan EnumMenuInfo structure
defaultValthe default starting value
nextthe next menu in the chain if there is one, or NULL.

Member Function Documentation

◆ copyEnumStrToBuffer()

void EnumMenuItem::copyEnumStrToBuffer ( char *  buffer,
int  size,
int  idx 
) const

Copies one of the enum strings into a buffer

Parameters
bufferthe buffer to copy into
idxthe index of choice to copy

◆ getLengthOfEnumStr()

int EnumMenuItem::getLengthOfEnumStr ( int  idx) const

Returns the length of an enumeration string with given index

Parameters
idxthe index to get the length for

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