NeoNextion
Arduino library for the Nextion displays.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
INextionWidget Class Reference

Abstract class for all UI widgets. More...

#include <INextionWidget.h>

Inheritance diagram for INextionWidget:
Inheritance graph
[legend]
Collaboration diagram for INextionWidget:
Collaboration graph
[legend]

Public Member Functions

 INextionWidget (Nextion &nex, uint8_t page, uint8_t component, const char *name)
 Create a new widget adapter. More...
 
uint8_t getPageID ()
 Gets the ID of the page this widget resides on. More...
 
uint8_t getComponentID ()
 Gets the component ID of this widget. More...
 
bool setNumberProperty (char *propertyName, uint32_t value)
 Sets the value of a numerical property of this widget. More...
 
uint32_t getNumberProperty (char *propertyName)
 Gets the value of a numerical property of this widget. More...
 
bool setStringProperty (char *propertyName, char *value)
 Sets the value of a string property of this widget. More...
 
size_t getStringProperty (char *propertyName, char *value, size_t len)
 Gets the value of a string property of this widget. More...
 

Protected Member Functions

bool sendCommand (char *commandStr, bool checkComplete=true)
 

Protected Attributes

Nextionm_nextion
 Reference to the Nextion driver.
 
uint8_t m_pageID
 ID of page this widget is on.
 
uint8_t m_componentID
 Component ID of this widget.
 
const char * m_name
 Name of this widget.
 

Detailed Description

Abstract class for all UI widgets.

Widget objects act as a adapter/API for the widgets defined in the Nextion Editor software.

Constructor & Destructor Documentation

INextionWidget::INextionWidget ( Nextion nex,
uint8_t  page,
uint8_t  component,
const char *  name 
)

Create a new widget adapter.

Parameters
nexReference to the Nextion driver
pageID of page this widget is on
componentComponent ID of this widget
nameName of this widget

Member Function Documentation

uint8_t INextionWidget::getComponentID ( )

Gets the component ID of this widget.

Returns
Component ID
uint32_t INextionWidget::getNumberProperty ( char *  propertyName)

Gets the value of a numerical property of this widget.

Parameters
propertyNameName of the property
Returns
Value (may also return 0 in case of error)
uint8_t INextionWidget::getPageID ( )

Gets the ID of the page this widget resides on.

Returns
Page ID
size_t INextionWidget::getStringProperty ( char *  propertyName,
char *  value,
size_t  len 
)

Gets the value of a string property of this widget.

Parameters
propertyNameName of the property
valuePointer to char array to store result in
lenMaximum length of value
Returns
Actual length of value
bool INextionWidget::setNumberProperty ( char *  propertyName,
uint32_t  value 
)

Sets the value of a numerical property of this widget.

Parameters
propertyNameName of the property
valueValue
Returns
True if successful
bool INextionWidget::setStringProperty ( char *  propertyName,
char *  value 
)

Sets the value of a string property of this widget.

Parameters
propertyNameName of the property
valueValue
Returns
True if successful

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