我先上代码
[mw_shl_code=c,true]void UpdateListView(void)
{
unsigned char i;
unsigned char str_date[10];
unsigned char str_time[10];
unsigned char str_num[10];
char Record[3][10];
/********* date translate to string type (example : 2014-06-06) **************/
str_date[0] = Clock.Year/1000+0x30; //year first bit
str_date[1] = (Clock.Year/100)%10+0x30; //year second bit
str_date[2] = (Clock.Year%100)/10+0x30; //year third bit
str_date[3] = Clock.Year%10+0x30; //year fouth bit
str_date[4] = '-';
str_date[5] = Clock.Month/10+0x30; //month first bit
str_date[6] = Clock.Month%10+0x30; //month second bit
str_date[7] = '-';
str_date[8] = Clock.Day/10+0x30; //day fisrt bit
str_date[9] = Clock.Day%10+0x30; //day second bit
/*********** time translte to string type (example: 12:12:00) **************/
str_time[0] = Clock.Hour/10+0x30; //hour fisrt bit
str_time[1] = Clock.Hour%10+0x30; //hour second bit
str_time[2] = '-';
str_time[3] = Clock.Min/10+0x30; //minute 1 bit
str_time[4] = Clock.Min%10+0x30; //minute 2 bit
str_time[5] = '-';
str_time[6] = Clock.Sec/10+0x30; //second 1 bit
str_time[7] = Clock.Sec%10+0x30; //second 2 bit
/*********** number of student or teacher translate to string ***************/
str_num[0] = card_num;
for(i=0;i<10;i++)
{
Record[0] = str_date;
Record[1] = str_time;
Record[2] = str_num;
}
/************* translate to Record to display in listview *******************/
for (i = 0; i < GUI_COUNTOF(Record); i++)
{
LISTVIEW_AddRow(listview, ( GUI_ConstString *)Record);
}
}[/mw_shl_code]
如上,我想实现一个LISTVIEW 数据更显的操作,可是我看了uCGUI 3.90就爱 LISTVIEW_AddRow();可以添加,而且这个函数添加行的数据时 const GUI_ConstString*
类型的,还有一个函数,
void LISTVIEW_SetItemText (LISTVIEW_Handle hObj, unsigned Column, unsigned Row, const char * s);
这个函数怎么添加呢?如上怎么实现我的功能呢?我的功能是 LISTVIEW有三列 ,然后每次添加一行。 |