Example #1
0
//u16 itot,u16 ipg,
void test_scb(u16 x, u16 y, u16 width, u16 height, u8 type, u16 icur, u16 inbkcolor, u16 btncolor, u16 rimcolor)
{
    _scrollbar_obj *tscb;
    tscb = scrollbar_creat(y, x, width, height, type); //创建滚动条
    if(tscb == NULL) {
        return;    //创建失败.
    }

    tscb->totalitems = 50;
    tscb->itemsperpage = 8;
    tscb->topitem = icur;

    tscb->inbkcolor = inbkcolor;
    tscb->btncolor = btncolor;
    tscb->rimcolor = rimcolor;

    scrollbar_draw_scrollbar(tscb);//画按钮
    scrollbar_delete(tscb);//删除按钮
}
//画listbox
//listbox:listbox指针
void listbox_draw_listbox(_listbox_obj *listbox)
{															  
	if(listbox==NULL)return;//无效,直接退出
	if(listbox->scbv->totalitems>listbox->scbv->itemsperpage)scrollbar_draw_scrollbar(listbox->scbv);//必要时,画滚动条
    listbox_draw_list(listbox);//画list
}