NexButton Class Reference
Nextion Component

NexButton component. More...

`#include <NexButton.h>`

Inherits NexTouch.

## 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...
uint32_t | Get_background_color_bco (uint32_t *number)
| Get bco attribute of component. More...
bool | Set_background_color_bco (uint32_t number)
| Set bco attribute of component. More...
uint32_t | Get_press_background_color_bco2 (uint32_t *number)
| Get bco2 attribute of component. More...
bool | Set_press_background_color_bco2 (uint32_t number)
| Set bco2 attribute of component. More...
uint32_t | Get_font_color_pco (uint32_t *number)
| Get pco attribute of component. More...
bool | Set_font_color_pco (uint32_t number)
| Set pco attribute of component. More...
uint32_t | Get_press_font_color_pco2 (uint32_t *number)
| Get pco2 attribute of component. More...
bool | Set_press_font_color_pco2 (uint32_t number)
| Set pco2 attribute of component. More...
uint32_t | Get_place_xcen (uint32_t *number)
| Get xcen attribute of component. More...
bool | Set_place_xcen (uint32_t number)
| Set xcen attribute of component. More...
uint32_t | Get_place_ycen (uint32_t *number)
| Get ycen attribute of component. More...
bool | Set_place_ycen (uint32_t number)
| Set ycen attribute of component. More...
uint32_t | getFont (uint32_t *number)
| Get font attribute of component. More...
bool | setFont (uint32_t number)
| Set font attribute of component. More...
uint32_t | Get_background_cropi_picc (uint32_t *number)
| Get picc attribute of component. More...
bool | Set_background_crop_picc (uint32_t number)
| Set picc attribute of component. More...
uint32_t | Get_press_background_crop_picc2 (uint32_t *number)
| Get picc2 attribute of component. More...
bool | Set_press_background_crop_picc2 (uint32_t number)
| Set picc2 attribute of component. More...
uint32_t | Get_background_image_pic (uint32_t *number)
| Get pic attribute of component. More...
bool | Set_background_image_pic (uint32_t number)
| Set pic attribute of component. More...
uint32_t | Get_press_background_image_pic2 (uint32_t *number)
| Get pic2 attribute of component. More...
bool | Set_press_background_image_pic2 (uint32_t number)
| Set pic2 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.

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

uint32_t NexButton::Get_background_color_bco | ( | uint32_t * | number | ) |

Get bco attribute of component.

Parameters

  number | - buffer storing data return

Returns
  the length of the data

Definition at line 45 of file NexButton.cpp.

uint32_t NexButton::Get_background_cropi_picc | ( | uint32_t * | number | ) |

Get picc attribute of component.

Parameters

  number | - buffer storing data return

Returns
  the length of the data

Definition at line 241 of file NexButton.cpp.

uint32_t NexButton::Get_background_image_pic | ( | uint32_t * | number | ) |

Get pic attribute of component.

Parameters

  number | - buffer storing data return

Returns
  the length of the data

Definition at line 297 of file NexButton.cpp.

uint32_t NexButton::Get_font_color_pco | ( | uint32_t * | number | ) |

Get pco attribute of component.

Parameters

  number | - buffer storing data return

Returns
  the length of the data

Definition at line 101 of file NexButton.cpp.

uint32_t NexButton::Get_place_xcen | ( | uint32_t * | number | ) |

Get xcen attribute of component.

Parameters

  number | - buffer storing data return

Returns
  the length of the data

Definition at line 157 of file NexButton.cpp.

uint32_t NexButton::Get_place_ycen | ( | uint32_t * | number | ) |

Get ycen attribute of component.

Parameters

  number | - buffer storing data return

Returns
  the length of the data

Definition at line 185 of file NexButton.cpp.

uint32_t NexButton::Get_press_background_color_bco2 | ( | uint32_t * | number | ) |

Get bco2 attribute of component.

Parameters

  number | - buffer storing data return

Returns
  the length of the data

Definition at line 73 of file NexButton.cpp.

uint32_t NexButton::Get_press_background_crop_picc2 | ( | uint32_t * | number | ) |

Get picc2 attribute of component.

Parameters

  number | - buffer storing data return

Returns
  the length of the data

Definition at line 269 of file NexButton.cpp.

uint32_t NexButton::Get_press_background_image_pic2 | ( | uint32_t * | number | ) |

Get pic2 attribute of component.

Parameters

  number | - buffer storing data return

Returns
  the length of the data

Definition at line 325 of file NexButton.cpp.

uint32_t NexButton::Get_press_font_color_pco2 | ( | uint32_t * | number | ) |

Get pco2 attribute of component.

Parameters

  number | - buffer storing data return

Returns
  the length of the data

Definition at line 129 of file NexButton.cpp.

uint32_t NexButton::getFont | ( | uint32_t * | number | ) |

Get font attribute of component.

Parameters

  number | - buffer storing data return

Returns
  the length of the data

Definition at line 213 of file NexButton.cpp.

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.

Definition at line 23 of file NexButton.cpp.

bool NexButton::Set_background_color_bco | ( | uint32_t | number | ) |

Set bco attribute of component.

Parameters

  number | - To set up the data

Returns
  true if success, false for failure

Definition at line 55 of file NexButton.cpp.

bool NexButton::Set_background_crop_picc | ( | uint32_t | number | ) |

Set picc attribute of component.

Parameters

  number | - To set up the data

Returns
  true if success, false for failure

Definition at line 251 of file NexButton.cpp.

bool NexButton::Set_background_image_pic | ( | uint32_t | number | ) |

Set pic attribute of component.

Parameters

  number | - To set up the data

Returns
  true if success, false for failure

Definition at line 307 of file NexButton.cpp.

bool NexButton::Set_font_color_pco | ( | uint32_t | number | ) |

Set pco attribute of component.

Parameters

  number | - To set up the data

Returns
  true if success, false for failure

Definition at line 111 of file NexButton.cpp.

bool NexButton::Set_place_xcen | ( | uint32_t | number | ) |

Set xcen attribute of component.

Parameters

  number | - To set up the data

Returns
  true if success, false for failure

Definition at line 167 of file NexButton.cpp.

bool NexButton::Set_place_ycen | ( | uint32_t | number | ) |

Set ycen attribute of component.

Parameters

  number | - To set up the data

Returns
  true if success, false for failure

Definition at line 195 of file NexButton.cpp.

bool NexButton::Set_press_background_color_bco2 | ( | uint32_t | number | ) |

Set bco2 attribute of component.

Parameters

  number | - To set up the data

Returns
  true if success, false for failure

Definition at line 83 of file NexButton.cpp.

bool NexButton::Set_press_background_crop_picc2 | ( | uint32_t | number | ) |

Set picc2 attribute of component.

Parameters

  number | - To set up the data

Returns
  true if success, false for failure

Definition at line 279 of file NexButton.cpp.

bool NexButton::Set_press_background_image_pic2 | ( | uint32_t | number | ) |

Set pic2 attribute of component.

Parameters

  number | - To set up the data

Returns
  true if success, false for failure

Definition at line 335 of file NexButton.cpp.

bool NexButton::Set_press_font_color_pco2 | ( | uint32_t | number | ) |

Set pco2 attribute of component.

Parameters

  number | - To set up the data

Returns
  true if success, false for failure

Definition at line 139 of file NexButton.cpp.

bool NexButton::setFont | ( | uint32_t | number | ) |

Set font attribute of component.

Parameters

  number | - To set up the data

Returns
  true if success, false for failure

Definition at line 223 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.

Definition at line 33 of file NexButton.cpp.

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

- NexButton.h
- NexButton.cpp