|
发表于 2023-3-3 11:21:36
|
显示全部楼层
//点击 先开启定时器
case GX_SIGNAL(time_id,GX_EVENT_CLICKED):
gx_system_timer_start((GX_WIDGET *)widget,GUI_ID_Timer1,1,1000);
break;
case GX_EVENT_TIMER:
if(event_ptr->gx_event_payload.gx_event_timer_id == GUI_ID_Timer1){
//因为开启定时器会马上执行一次 所以在这里做个判断 然后溢出在执行一次
if(timesta == 0){
timesta = 1;
}else if(timesta == 1){
timesta = 2;
gx_system_timer_stop((GX_WIDGET *)widget,GUI_ID_Timer1);
}
}
break;
case GX_EVENT_PEN_UP:
//短按
if(timesta == 1){
timesta = 0;
gx_system_timer_stop((GX_WIDGET *)widget,GUI_ID_Timer1);
//长按
}else if(timesta == 2){
timesta = 0;
//切换页面
gx_widget_attach(widget,pScreen7);
}
break;
|
|