Nextion User Manual
For Arduino developers
NexButton Class Reference

NexButton component. More...

#include <NexButton.h>

Inheritance diagram for NexButton:
Collaboration diagram for NexButton:

Public Member Functions

 NexButton (uint8_t pid, uint8_t cid, const char *name)
 Constructor. More...
 
uint16_t getText (char *buffer, uint16_t len)
 Get text attribute of component. More...
 
bool setText (const char *buffer)
 Set text attribute of component. More...
 
- Public Member Functions inherited from NexTouch
 NexTouch (uint8_t pid, uint8_t cid, const char *name)
 Constructor. More...
 
void attachPush (NexTouchEventCb push, void *ptr=NULL)
 Attach an callback function of push touch event. More...
 
void detachPush (void)
 Detach an callback function. More...
 
void attachPop (NexTouchEventCb pop, void *ptr=NULL)
 Attach an callback function of pop touch event. More...
 
void detachPop (void)
 Detach an callback function. More...
 
- Public Member Functions inherited from NexObject
 NexObject (uint8_t pid, uint8_t cid, const char *name)
 Constructor. More...
 
void printObjInfo (void)
 Print current object'address, page id, component id and name. More...
 

Detailed Description

NexButton component.

Commonly, you want to do something after push and pop it. It is recommanded that only call NexTouch::attachPop to satisfy your purpose.

Warning
Please do not call NexTouch::attachPush on this component, even though you can.
Examples:
CompButton.ino, CompGauge.ino, CompProgressBar.ino, and CompText.ino.

Definition at line 35 of file NexButton.h.

Constructor & Destructor Documentation

NexButton::NexButton ( uint8_t  pid,
uint8_t  cid,
const char *  name 
)

Constructor.

Parameters
pid- page id.
cid- component id.
name- pointer to an unique name in range of all components.

Definition at line 18 of file NexButton.cpp.

Member Function Documentation

uint16_t NexButton::getText ( char *  buffer,
uint16_t  len 
)

Get text attribute of component.

Parameters
buffer- buffer storing text returned.
len- length of buffer.
Returns
The real length of text returned.
Examples:
CompButton.ino.

Definition at line 23 of file NexButton.cpp.

bool NexButton::setText ( const char *  buffer)

Set text attribute of component.

Parameters
buffer- text buffer terminated with '\0'.
Returns
true if success, false for failure.
Examples:
CompButton.ino.

Definition at line 33 of file NexButton.cpp.


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