LCDGFX LCD display driver  1.1.5
This library is developed to control SSD1306/SSD1325/SSD1327/SSD1331/SSD1351/IL9163/PCD8554 RGB i2c/spi LED displays
NanoMenu< T > Class Template Referenceabstract

#include <menu.h>

Inheritance diagram for NanoMenu< T >:
Collaboration diagram for NanoMenu< T >:

Public Member Functions

 NanoMenu (const NanoPoint &pos)
 
 NanoMenu ()
 
void add (NanoObject< T > &item)
 
void insert (NanoObject< T > &item)
 
NanoObject< T > * getSelected ()
 
void down ()
 
void up ()
 
- Public Member Functions inherited from NanoObjectList< T >
NanoObject< T > * getNext (NanoObject< T > *prev=nullptr)
 
NanoObject< T > * getPrev (NanoObject< T > *curr=nullptr)
 
void update () override
 
void refresh () override
 
void draw () override
 
bool has (NanoObject< T > &object)
 
void add (NanoObject< T > &object)
 
void insert (NanoObject< T > &object)
 
void remove (NanoObject< T > &object)
 
- Public Member Functions inherited from NanoObject< T >
 NanoObject (const NanoPoint &pos)
 
 NanoObject (const NanoPoint &pos, const NanoPoint &size)
 
lcdint_t width () const
 
lcdint_t height () const
 
void moveTo (const NanoPoint &p)
 
void moveBy (const NanoPoint &p)
 
void resize (const NanoPoint &size)
 
void setSize (const NanoPoint &size)
 
void setPos (const NanoPoint &p)
 
const NanoPoint bottom () const
 
const NanoPoint top () const
 
const NanoPoint left () const
 
const NanoPoint right () const
 
const NanoPoint center () const
 
lcdint_t x () const
 
lcdint_t y () const
 
const NanoPointgetPosition () const
 
const NanoRectgetRect () const
 
- Public Member Functions inherited from NanoEngineObject< T >
void focus ()
 
void defocus ()
 
bool isFocused ()
 
bool hasTiler ()
 
T & getTiler ()
 

Protected Member Functions

virtual void updateMenuItemsPosition ()=0
 
- Protected Member Functions inherited from NanoEngineObject< T >
void setTiler (T *tiler)
 

Additional Inherited Members

- Protected Attributes inherited from NanoObject< T >
NanoRect m_rect
 
- Protected Attributes inherited from NanoEngineObject< T >
T * m_tiler = nullptr
 Active tiler, assigned to the NanoEngineObject.
 
NanoEngineObject< T > * m_next = nullptr
 Next NanoEngineObject in the list.
 

Detailed Description

template<class T>
class NanoMenu< T >

This is base class for user menu implementations. NanoMenu can work only as part of NanoEngine.

Definition at line 51 of file menu.h.

Constructor & Destructor Documentation

◆ NanoMenu() [1/2]

template<class T >
NanoMenu< T >::NanoMenu ( const NanoPoint pos)
inlineexplicit

Creates menu object.

Parameters
posposition of the sprite in global coordinates

Definition at line 59 of file menu.h.

◆ NanoMenu() [2/2]

template<class T >
NanoMenu< T >::NanoMenu ( )
inline

Creates instance of NanoMenu at 0,0 position

Definition at line 67 of file menu.h.

Member Function Documentation

◆ add()

template<class T >
void NanoMenu< T >::add ( NanoObject< T > &  item)
inline

Adds new menu item to the end of the list

Parameters
itemmenu item to add

Definition at line 77 of file menu.h.

◆ down()

template<class T >
void NanoMenu< T >::down ( )
inline

Moves active menu item position to the next item. If active menu item is the last one, then first menu item becomes active.

Definition at line 120 of file menu.h.

◆ getSelected()

template<class T >
NanoObject<T>* NanoMenu< T >::getSelected ( )
inline

Returns pointer to active menu item. If nothing is selected returns nullptr.

Definition at line 110 of file menu.h.

◆ insert()

template<class T >
void NanoMenu< T >::insert ( NanoObject< T > &  item)
inline

Inserts new menu item to the beginning of the list

Parameters
itemmenu item to insert

Definition at line 94 of file menu.h.

◆ up()

template<class T >
void NanoMenu< T >::up ( )
inline

Moves active menu item position to the previous item. If active menu item is the first one, then last menu item becomes active.

Definition at line 142 of file menu.h.

◆ updateMenuItemsPosition()

template<class T >
virtual void NanoMenu< T >::updateMenuItemsPosition ( )
protectedpure virtual

Recalculates position of all menu items by aligning each item in accordance with menu type.


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