Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
NexButton Class Reference

#include <NexButton.h>

Inheritance diagram for NexButton:
NexTouch NexObject

Public Member Functions

 NexButton (uint8_t pid, uint8_t cid, const char *name)
 
uint16_t getText (char *buffer, uint16_t len)
 
bool setText (const char *buffer)
 
uint32_t Get_background_color_bco (uint32_t *number)
 
bool Set_background_color_bco (uint32_t number)
 
uint32_t Get_press_background_color_bco2 (uint32_t *number)
 
bool Set_press_background_color_bco2 (uint32_t number)
 
uint32_t Get_font_color_pco (uint32_t *number)
 
bool Set_font_color_pco (uint32_t number)
 
uint32_t Get_press_font_color_pco2 (uint32_t *number)
 
bool Set_press_font_color_pco2 (uint32_t number)
 
uint32_t Get_place_xcen (uint32_t *number)
 
bool Set_place_xcen (uint32_t number)
 
uint32_t Get_place_ycen (uint32_t *number)
 
bool Set_place_ycen (uint32_t number)
 
uint32_t getFont (uint32_t *number)
 
bool setFont (uint32_t number)
 
uint32_t Get_background_cropi_picc (uint32_t *number)
 
bool Set_background_crop_picc (uint32_t number)
 
uint32_t Get_press_background_crop_picc2 (uint32_t *number)
 
bool Set_press_background_crop_picc2 (uint32_t number)
 
uint32_t Get_background_image_pic (uint32_t *number)
 
bool Set_background_image_pic (uint32_t number)
 
uint32_t Get_press_background_image_pic2 (uint32_t *number)
 
bool Set_press_background_image_pic2 (uint32_t number)
 
void attachPush (NexTouchEventCb push, void *ptr=NULL)
 
void detachPush (void)
 
void attachPop (NexTouchEventCb pop, void *ptr=NULL)
 
void detachPop (void)
 
void printObjInfo (void)
 

Static Public Member Functions

static void iterate (NexTouch **list, uint8_t pid, uint8_t cid, int32_t event)
 

Protected Member Functions

uint8_t getObjPid (void)
 
uint8_t getObjCid (void)
 
const char * getObjName (void)
 

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.

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.

Member Function Documentation

void NexTouch::attachPop ( NexTouchEventCb  pop,
void *  ptr = NULL 
)
inherited

Attach an callback function of pop touch event.

Parameters
pop- callback called with ptr when a pop touch event occurs.
ptr- parameter passed into pop[default:NULL].
Returns
none.
Note
If calling this method multiply, the last call is valid.
void NexTouch::attachPush ( NexTouchEventCb  push,
void *  ptr = NULL 
)
inherited

Attach an callback function of push touch event.

Parameters
push- callback called with ptr when a push touch event occurs.
ptr- parameter passed into push[default:NULL].
Returns
none.
Note
If calling this method multiply, the last call is valid.
void NexTouch::detachPop ( void  )
inherited

Detach an callback function.

Returns
none.
void NexTouch::detachPush ( void  )
inherited

Detach an callback function.

Returns
none.
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
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
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
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
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
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
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
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
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
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
uint32_t NexButton::getFont ( uint32_t *  number)

Get font attribute of component

Parameters
number- buffer storing data return
Returns
the length of the data
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.
void NexObject::printObjInfo ( void  )
inherited

Print current object'address, page id, component id and name.

Warning
this method does nothing, unless debug message enabled.
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
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
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
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
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
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
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
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
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
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
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
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.