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

Interface for widgets that can be coloured. More...

#include <INextionColourable.h>

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

Public Member Functions

 INextionColourable (Nextion &nex, uint8_t page, uint8_t component, const char *name)
 Create a new widget adapter. More...
 
bool setForegroundColour (uint32_t colour, bool refresh=true)
 Sets the normal foreground colour. More...
 
uint32_t getForegroundColour ()
 Gets the normal foreground colour. More...
 
bool setEventForegroundColour (uint32_t colour, bool refresh=true)
 Sets the foreground colour when a touch event is active. More...
 
uint32_t getEventForegroundColour ()
 Gets the foreground colour when a touch event is active. More...
 
bool setBackgroundColour (uint32_t colour, bool refresh=true)
 Sets the normal background colour. More...
 
uint32_t getBackgroundColour ()
 Gets the normal background colour. More...
 
bool setEventBackgroundColour (uint32_t colour, bool refresh=true)
 Sets the background colour when a touch event is active. More...
 
uint32_t getEventBackgroundColour ()
 Sets the background colour when a touch event is active. More...
 
bool setColour (char *type, uint32_t colour, bool refresh)
 Sets a colour by its property name. More...
 
uint32_t getColour (char *type)
 Gets a colour by its property name. More...
 
bool afterSet (bool result, bool refresh)
 Handles refreshing the page after a colour has been changed. More...
 
- Public Member Functions inherited from INextionWidget
 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...
 

Additional Inherited Members

- Protected Member Functions inherited from INextionWidget
bool sendCommand (char *commandStr, bool checkComplete=true)
 
- Protected Attributes inherited from INextionWidget
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

Interface for widgets that can be coloured.

Constructor & Destructor Documentation

INextionColourable::INextionColourable ( 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

bool INextionColourable::afterSet ( bool  result,
bool  refresh 
)

Handles refreshing the page after a colour has been changed.

Parameters
resultSuccess of colour set
refreshIf the widget should be refreshed
Returns
True if successful
See Also
INextionColourable::getColour
uint32_t INextionColourable::getBackgroundColour ( )

Gets the normal background colour.

Returns
Colour (may also return 0 in case of error)
See Also
INextionColourable::setBackgroundColour
uint32_t INextionColourable::getColour ( char *  type)

Gets a colour by its property name.

Parameters
typeProperty name
Returns
Colour (may also return 0 in case of error)
See Also
INextionColourable::setColour
uint32_t INextionColourable::getEventBackgroundColour ( )

Sets the background colour when a touch event is active.

Returns
Colour (may also return 0 in case of error)
See Also
INextionColourable::setEventBackgroundColour
uint32_t INextionColourable::getEventForegroundColour ( )

Gets the foreground colour when a touch event is active.

Returns
Colour (may also return 0 in case of error)
See Also
INextionColourable::setEventForegroundColour
uint32_t INextionColourable::getForegroundColour ( )

Gets the normal foreground colour.

Returns
Colour (may also return 0 in case of error)
See Also
INextionColourable::setForegroundColour
bool INextionColourable::setBackgroundColour ( uint32_t  colour,
bool  refresh = true 
)

Sets the normal background colour.

Parameters
colourColour
refreshIf the widget should be refreshed
Returns
True if successful
See Also
INextionColourable::getBackgroundColour
bool INextionColourable::setColour ( char *  type,
uint32_t  colour,
bool  refresh 
)

Sets a colour by its property name.

Parameters
typeProperty name
colourColour
refreshIf the widget should be refreshed
Returns
True if successful
bool INextionColourable::setEventBackgroundColour ( uint32_t  colour,
bool  refresh = true 
)

Sets the background colour when a touch event is active.

Parameters
colourColour
refreshIf the widget should be refreshed
Returns
True if successful
See Also
INextionColourable::getEventBackgroundColour
bool INextionColourable::setEventForegroundColour ( uint32_t  colour,
bool  refresh = true 
)

Sets the foreground colour when a touch event is active.

Parameters
colourColour
refreshIf the widget should be refreshed
Returns
True if successful
See Also
INextionColourable::getEventForegroundColour
bool INextionColourable::setForegroundColour ( uint32_t  colour,
bool  refresh = true 
)

Sets the normal foreground colour.

Parameters
colourColour
refreshIf the widget should be refreshed
Returns
True if successful
See Also
INextionColourable::getForegroundColour

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