Add functions for new items based on the IDE.

This commit is contained in:
huangxiaoming
2016-09-27 16:04:39 +08:00
parent d6c42dbf62
commit f104dd861b
31 changed files with 3345 additions and 33 deletions

192
NexText.cpp Normal file → Executable file
View File

@@ -40,3 +40,195 @@ bool NexText::setText(const char *buffer)
return recvRetCommandFinished();
}
uint32_t NexText::Get_background_color_bco(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".bco";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexText::Set_background_color_bco(uint32_t number)
{
char buf[10] = {0};
String cmd;
utoa(number, buf, 10);
cmd += getObjName();
cmd += ".bco=";
cmd += buf;
sendCommand(cmd.c_str());
cmd="";
cmd += "ref ";
cmd += getObjName();
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
uint32_t NexText::Get_font_color_pco(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".pco";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexText::Set_font_color_pco(uint32_t number)
{
char buf[10] = {0};
String cmd;
utoa(number, buf, 10);
cmd += getObjName();
cmd += ".pco=";
cmd += buf;
sendCommand(cmd.c_str());
cmd = "";
cmd += "ref ";
cmd += getObjName();
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
uint32_t NexText::Get_place_xcen(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".xcen";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexText::Set_place_xcen(uint32_t number)
{
char buf[10] = {0};
String cmd;
utoa(number, buf, 10);
cmd += getObjName();
cmd += ".xcen=";
cmd += buf;
sendCommand(cmd.c_str());
cmd = "";
cmd += "ref ";
cmd += getObjName();
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
uint32_t NexText::Get_place_ycen(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".ycen";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexText::Set_place_ycen(uint32_t number)
{
char buf[10] = {0};
String cmd;
utoa(number, buf, 10);
cmd += getObjName();
cmd += ".ycen=";
cmd += buf;
sendCommand(cmd.c_str());
cmd = "";
cmd += "ref ";
cmd += getObjName();
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
uint32_t NexText::getFont(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".font";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexText::setFont(uint32_t number)
{
char buf[10] = {0};
String cmd;
utoa(number, buf, 10);
cmd += getObjName();
cmd += ".font=";
cmd += buf;
sendCommand(cmd.c_str());
cmd = "";
cmd += "ref ";
cmd += getObjName();
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
uint32_t NexText::Get_background_crop_picc(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".picc";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexText::Set_background_crop_picc(uint32_t number)
{
char buf[10] = {0};
String cmd;
utoa(number, buf, 10);
cmd += getObjName();
cmd += ".picc=";
cmd += buf;
sendCommand(cmd.c_str());
cmd = "";
cmd += "ref ";
cmd += getObjName();
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
uint32_t NexText::Get_background_image_pic(uint32_t *number)
{
String cmd = String("get ");
cmd += getObjName();
cmd += ".pic";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexText::Set_background_image_pic(uint32_t number)
{
char buf[10] = {0};
String cmd;
utoa(number, buf, 10);
cmd += getObjName();
cmd += ".pic=";
cmd += buf;
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}