2025-06-27 00:32:57 +08:00
|
|
|
|
#include "mywin_inc.h"
|
|
|
|
|
|
#include "timer.h"
|
|
|
|
|
|
#include "mywin_user_timeout.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define WIN_TIMEOUT_TYPE "WIN_TimeOutStruct"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F>Ѻ<EFBFBD><D1BA><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>Ϊʱ<CEAA><CAB1><EFBFBD><EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
static void msToHour (u32 msint,int *hour,int *min,int *sec,int *ms)
|
|
|
|
|
|
{
|
|
|
|
|
|
*ms=msint%100;
|
|
|
|
|
|
*sec=msint/100%60;
|
|
|
|
|
|
*min=msint/60/100%60;
|
|
|
|
|
|
*hour=msint/60/60/100%24;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static u32 hourToms (int hour,int min,int sec,int ms)
|
|
|
|
|
|
{
|
|
|
|
|
|
return hour*60*60*100+min*60*100+sec*100+ms;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static u32 g_ms;
|
|
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
static u32 timer_getMs (void)
|
|
|
|
|
|
{
|
|
|
|
|
|
return g_ms;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//1ms<6D><73>ʱ<EFBFBD>ж<EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
static void timer_irq (void)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (g_ms)
|
|
|
|
|
|
g_ms--;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void timer_init (u32 time)
|
|
|
|
|
|
{
|
|
|
|
|
|
g_ms=time;
|
|
|
|
|
|
TIMER_InitStruct timer_init={0};
|
2025-07-05 19:47:28 +08:00
|
|
|
|
timer_init.Cycle=10000; //10<31><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
timer_init.Tim=TIM3;
|
|
|
|
|
|
timer_init.UpdataCall=timer_irq;
|
|
|
|
|
|
TIMER_InitNormal(&timer_init);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void timer_deInit (void)
|
|
|
|
|
|
{
|
|
|
|
|
|
TIMER_DeInit (TIM3);
|
|
|
|
|
|
g_ms=0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void timer_spend (void)
|
|
|
|
|
|
{
|
|
|
|
|
|
TIM_Cmd(TIM3,DISABLE);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void timer_continue (void)
|
|
|
|
|
|
{
|
|
|
|
|
|
TIM_Cmd(TIM3,ENABLE);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WIN_TimeOutStruct *WIN_CreatTimeOut (WIN_WindowStruct *base,
|
|
|
|
|
|
void (*msgLoop)(struct _WIN_WindowStruct *win,WIN_MsgStruct *msg),
|
|
|
|
|
|
int x,int y,int x_size,int y_size)
|
|
|
|
|
|
{
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣѭ<CFA2><D1AD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
if (msgLoop==0)
|
|
|
|
|
|
{
|
|
|
|
|
|
msgLoop=(void (*)(struct _WIN_WindowStruct *win,WIN_MsgStruct *msg))TIMEOUT_defaultMsgLoop;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
WIN_TimeOutStruct *ret=mymalloc (sizeof ( WIN_TimeOutStruct));
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><><EFBFBD>ø<EFBFBD><C3B8><EFBFBD><EFBFBD>Ĺ<EFBFBD><C4B9>캯<EFBFBD><ECBAAF>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
if (ret)
|
|
|
|
|
|
{
|
|
|
|
|
|
mymemset (ret,0,sizeof ( WIN_TimeOutStruct));
|
|
|
|
|
|
// if (0==WIN_CreatWindowExt((WIN_WindowStruct *)ret,base,msgLoop,x,y,x_size,y_size))
|
|
|
|
|
|
if (0==WIN_CreatTouchEx((WIN_TouchWinStruct *)ret,base,msgLoop,x,y,x_size,y_size))
|
|
|
|
|
|
{
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
myfree (ret);
|
|
|
|
|
|
ret=0;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
((WIN_WindowStruct *)ret)->winType=WIN_TIMEOUT_TYPE;
|
|
|
|
|
|
((WIN_WindowStruct *)ret)->intercept=1;
|
|
|
|
|
|
((WIN_WindowStruct *)ret)->deleteWindow=(void (*)(struct _WIN_WindowStruct *win))WIN_DeleteTimeOut;
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>
|
|
|
|
|
|
ret->title="<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ";
|
2025-06-27 00:32:57 +08:00
|
|
|
|
ret->rectColor=0x221f18;
|
|
|
|
|
|
ret->txtColor=0x342e27;
|
|
|
|
|
|
ret->selectRectColor=0x342f2a;
|
|
|
|
|
|
ret->selectTxtColor=0xc2ae9b;
|
|
|
|
|
|
ret->timerId=WIN_CreatTimer ((WIN_WindowStruct *)ret,70);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void WIN_DeleteTimeOut (WIN_TimeOutStruct *timeout )
|
|
|
|
|
|
{
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><><EFBFBD>ն<EFBFBD>ʱ<EFBFBD><CAB1>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
if (timeout->power)
|
|
|
|
|
|
{
|
|
|
|
|
|
timer_deInit ();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><><EFBFBD>ø<EFBFBD><C3B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٺ<EFBFBD><D9BA><EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
WIN_DeleteWindow ( (WIN_WindowStruct *)timeout);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void TIMEOUT_KeyEnter (WIN_TimeOutStruct *timeout)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (timeout->power==0)
|
|
|
|
|
|
{
|
|
|
|
|
|
timeout->index++;
|
|
|
|
|
|
if (timeout->index>=3)
|
|
|
|
|
|
{
|
|
|
|
|
|
timeout->power=1;
|
|
|
|
|
|
timeout->fresh=0;
|
|
|
|
|
|
timer_init(hourToms (timeout->hour,timeout->min,timeout->sec,0));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (timer_getMs())
|
|
|
|
|
|
{
|
|
|
|
|
|
if (timeout->spend==0)
|
|
|
|
|
|
{
|
|
|
|
|
|
timeout->spend=1;
|
|
|
|
|
|
timer_spend();
|
|
|
|
|
|
}else
|
|
|
|
|
|
{
|
|
|
|
|
|
timeout->spend=0;
|
|
|
|
|
|
timer_continue();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD><C3B5><EFBFBD>ʱ
|
2025-06-27 00:32:57 +08:00
|
|
|
|
timeout->power=0;
|
|
|
|
|
|
timer_deInit ();
|
|
|
|
|
|
timeout->index=0;
|
|
|
|
|
|
timeout->spend=0;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void TIMEOUT_KeyBack (WIN_TimeOutStruct *timeout)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (timeout->power)
|
|
|
|
|
|
{
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD><C3B5><EFBFBD>ʱ
|
2025-06-27 00:32:57 +08:00
|
|
|
|
timeout->power=0;
|
|
|
|
|
|
timer_deInit ();
|
|
|
|
|
|
timeout->index=0;
|
|
|
|
|
|
timeout->spend=0;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
((WIN_WindowStruct *)timeout)->deleteWindow((WIN_WindowStruct *)timeout);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void TIMEOUT_KeyUp (WIN_TimeOutStruct *timeout)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (timeout->power==0)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (timeout->index==0)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (timeout->hour<23)
|
|
|
|
|
|
timeout->hour++;
|
|
|
|
|
|
else timeout->hour=0;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (timeout->index==1)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (timeout->min<59)
|
|
|
|
|
|
timeout->min++;
|
|
|
|
|
|
else timeout->min=0;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (timeout->index==2)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (timeout->sec<59)
|
|
|
|
|
|
timeout->sec++;
|
|
|
|
|
|
else timeout->sec=0;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TIMEOUT_KeyDown (WIN_TimeOutStruct *timeout)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (timeout->power==0)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (timeout->index==0)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (timeout->hour>0)
|
|
|
|
|
|
timeout->hour--;
|
|
|
|
|
|
else timeout->hour=23;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (timeout->index==1)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (timeout->min>0)
|
|
|
|
|
|
timeout->min--;
|
|
|
|
|
|
else timeout->min=59;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (timeout->index==2)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (timeout->sec>0)
|
|
|
|
|
|
timeout->sec--;
|
|
|
|
|
|
else timeout->sec=59;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><>Ϣ<EFBFBD><CFA2><EFBFBD>Ļ<EFBFBD><C4BB>ƺ<EFBFBD><C6BA><EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
void TIMEOUT_DefaultPaint (WIN_TimeOutStruct *timeout)
|
|
|
|
|
|
{
|
|
|
|
|
|
int x=0;
|
|
|
|
|
|
int y=0;
|
|
|
|
|
|
int x_size=((WIN_WindowStruct *)timeout)->x_size;
|
|
|
|
|
|
int y_size=((WIN_WindowStruct *)timeout)->y_size;
|
|
|
|
|
|
char txt_buff[20]={0};
|
|
|
|
|
|
|
|
|
|
|
|
WIN_PaintBackGround ((WIN_WindowStruct *)timeout);
|
|
|
|
|
|
u32 font_type=WIN_SetFontType(24);
|
|
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
int img_x=x+25;
|
|
|
|
|
|
int img_y=y;
|
|
|
|
|
|
int img_xsize=0;
|
|
|
|
|
|
int img_ysize=0;
|
|
|
|
|
|
int head_ysize=45;
|
|
|
|
|
|
WIN_SetLcdColor (((WIN_WindowStruct *)timeout)->color);
|
|
|
|
|
|
if (timeout->icon)
|
|
|
|
|
|
{
|
|
|
|
|
|
WIN_GetImageSize (timeout->icon,&img_xsize,&img_ysize);
|
|
|
|
|
|
if (img_ysize>head_ysize) img_ysize=head_ysize;
|
|
|
|
|
|
WIN_DrawImagByAlpha (img_x,img_y+head_ysize/2-img_ysize/2, img_xsize,img_ysize,timeout->icon,WIN_GetLcdColor16());
|
|
|
|
|
|
img_xsize+=10;
|
|
|
|
|
|
}
|
|
|
|
|
|
WIN_DrawTxtAt (timeout->title,img_x+img_xsize,y+head_ysize/2-WIN_GetFontHight()/2);
|
|
|
|
|
|
x+=25;x_size-=25*2;
|
|
|
|
|
|
y+=45;y_size-=45*2;
|
|
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><><EFBFBD>ƾ<EFBFBD><C6BE><EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
int x_step=x_size/2;
|
|
|
|
|
|
int y_step=y_size/3;
|
|
|
|
|
|
x+=(x_size-x_step*2)/2;
|
|
|
|
|
|
y+=(y_size-y_step*3)/2;
|
|
|
|
|
|
x_size=x_step*2;
|
|
|
|
|
|
y_size=y_step*3;
|
|
|
|
|
|
WIN_SetLcdColor (timeout->rectColor);
|
|
|
|
|
|
WIN_FillRectByColorAlpha (x,y,x_size-1,y_step*2-1,16);
|
|
|
|
|
|
WIN_SetLcdColor (timeout->selectRectColor);
|
|
|
|
|
|
WIN_FillRectByColorAlpha (x,y+y_step*2,x_step-1,y_step-1,16);
|
|
|
|
|
|
WIN_FillRectByColorAlpha (x+x_step,y+y_step*2,x_step-1,y_step-1,16);
|
|
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><><EFBFBD>水ťλ<C5A5><CEBB>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
timeout->rect_ok.x=x,timeout->rect_ok.y=y+y_step*2,
|
|
|
|
|
|
timeout->rect_ok.x_size=x_step,timeout->rect_ok.y_size=y_step;
|
|
|
|
|
|
timeout->rect_back.x=x+x_step,timeout->rect_back.y=y+y_step*2,
|
|
|
|
|
|
timeout->rect_back.x_size=x_step,timeout->rect_back.y_size=y_step;
|
|
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><>ʾ<EFBFBD><CABE>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
int hour,min,sec,ms;
|
|
|
|
|
|
msToHour (timer_getMs(),&hour,&min,&sec,&ms);
|
|
|
|
|
|
sprintf (txt_buff,"%02d:%02d:%02d:%02d",hour,min,sec,ms);
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><>ʾѡ<CABE>п<EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
int num_type=30;
|
|
|
|
|
|
WIN_SetFontType(num_type);
|
|
|
|
|
|
int num_x=x+x_size/2-strlen(txt_buff)*WIN_GetFontWidth()/2/2;
|
|
|
|
|
|
int num_y=y+y_step-20;
|
|
|
|
|
|
int num_xsize=strlen(txt_buff)*WIN_GetFontWidth()/2;
|
|
|
|
|
|
int num_ysize=WIN_GetFontHight();
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>λ<EFBFBD>ã<EFBFBD><C3A3>Զ<EFBFBD>ˢ<EFBFBD>µ<EFBFBD>ʱ<EFBFBD><CAB1>Ҫ<EFBFBD><D2AA>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
timeout->num_x=num_x;
|
|
|
|
|
|
timeout->num_y=num_y;
|
|
|
|
|
|
timeout->num_xsize=num_xsize;
|
|
|
|
|
|
timeout->num_ysize=num_ysize;
|
|
|
|
|
|
if (timeout->power==0)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (timeout->index==0)
|
|
|
|
|
|
{
|
|
|
|
|
|
WIN_SetLcdColor (timeout->selectRectColor);
|
|
|
|
|
|
WIN_FillRectByColorAlpha (num_x,num_y,num_type+4,35,16);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (timeout->index==1)
|
|
|
|
|
|
{
|
|
|
|
|
|
WIN_SetLcdColor (timeout->selectRectColor);
|
|
|
|
|
|
WIN_FillRectByColorAlpha (num_x+num_type*3/2+1,num_y,num_type+4,35,16);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (timeout->index==2)
|
|
|
|
|
|
{
|
|
|
|
|
|
WIN_SetLcdColor (timeout->selectRectColor);
|
|
|
|
|
|
WIN_FillRectByColorAlpha (num_x+num_type*6/2+3,num_y,num_type+4,35,16);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (timeout->index==3)
|
|
|
|
|
|
{
|
|
|
|
|
|
WIN_SetLcdColor (timeout->selectRectColor);
|
|
|
|
|
|
WIN_FillRectByColorAlpha (num_x+num_type*5/2,num_y,num_type+4,35,16);
|
|
|
|
|
|
}
|
|
|
|
|
|
WIN_SetLcdColor (timeout->selectTxtColor);
|
|
|
|
|
|
sprintf (txt_buff,"%02d:%02d:%02d:%02d",timeout->hour,timeout->min,timeout->sec,0);
|
|
|
|
|
|
WIN_DrawTxtAt(txt_buff,num_x,num_y);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (timer_getMs())
|
|
|
|
|
|
{
|
|
|
|
|
|
WIN_SetLcdColor (timeout->selectTxtColor);
|
|
|
|
|
|
WIN_DrawTxtAt(txt_buff,num_x,num_y);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
WIN_SetLcdColor (timeout->selectTxtColor);
|
|
|
|
|
|
int x_off=strlen(txt_buff)*WIN_GetFontWidth()/2/2;
|
2025-07-05 19:47:28 +08:00
|
|
|
|
WIN_DrawTxtHCenterAt ("<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>",num_x+x_off,num_y);
|
2025-06-27 00:32:57 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><>ʾ<EFBFBD><CABE>ť
|
2025-06-27 00:32:57 +08:00
|
|
|
|
WIN_SetFontType(24);
|
|
|
|
|
|
WIN_SetLcdColor (timeout->selectTxtColor);
|
|
|
|
|
|
if (timeout->power==0)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (timeout->index<2)
|
2025-07-05 19:47:28 +08:00
|
|
|
|
WIN_DrawTxtCenterAtRect ("<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>",x,y+y_step*2,x_step-1,y_step-1);
|
2025-06-27 00:32:57 +08:00
|
|
|
|
else
|
2025-07-05 19:47:28 +08:00
|
|
|
|
WIN_DrawTxtCenterAtRect ("<EFBFBD><EFBFBD>ʼ",x,y+y_step*2,x_step-1,y_step-1);
|
|
|
|
|
|
WIN_DrawTxtCenterAtRect ("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>",x+x_step,y+y_step*2,x_step-1,y_step-1);
|
2025-06-27 00:32:57 +08:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (timeout->spend==0)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (timer_getMs())
|
|
|
|
|
|
{
|
2025-07-05 19:47:28 +08:00
|
|
|
|
WIN_DrawTxtCenterAtRect ("<EFBFBD><EFBFBD>ͣ",x,y+y_step*2,x_step-1,y_step-1);
|
2025-06-27 00:32:57 +08:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2025-07-05 19:47:28 +08:00
|
|
|
|
WIN_DrawTxtCenterAtRect ("<EFBFBD>ٴ<EFBFBD>",x,y+y_step*2,x_step-1,y_step-1);
|
2025-06-27 00:32:57 +08:00
|
|
|
|
}
|
2025-07-05 19:47:28 +08:00
|
|
|
|
WIN_DrawTxtCenterAtRect ("ֹͣ",x+x_step,y+y_step*2,x_step-1,y_step-1);
|
2025-06-27 00:32:57 +08:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2025-07-05 19:47:28 +08:00
|
|
|
|
WIN_DrawTxtCenterAtRect ("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>",x,y+y_step*2,x_step-1,y_step-1);
|
|
|
|
|
|
WIN_DrawTxtCenterAtRect ("ֹͣ",x+x_step,y+y_step*2,x_step-1,y_step-1);
|
2025-06-27 00:32:57 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
WIN_SetFontType(font_type);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
void TIMEOUT_defaultMsgLoop (WIN_TimeOutStruct *timeout,WIN_MsgStruct *msg)
|
|
|
|
|
|
{
|
|
|
|
|
|
WIN_KeyStruct *k=0;
|
|
|
|
|
|
WIN_MoveStruct *m=0;
|
|
|
|
|
|
switch (msg->msg)
|
|
|
|
|
|
{
|
|
|
|
|
|
case WIN_MSG_PAINT:
|
|
|
|
|
|
TIMEOUT_DefaultPaint(timeout);
|
|
|
|
|
|
break;
|
|
|
|
|
|
case WIN_MSG_TIMER:
|
|
|
|
|
|
if (msg->data.v==timeout->timerId)
|
|
|
|
|
|
{
|
|
|
|
|
|
WIN_SetInvalidRectWhenTop ((WIN_WindowStruct *)timeout,timeout->num_x,timeout->num_y,timeout->num_xsize,timeout->num_ysize);
|
|
|
|
|
|
if ((timer_getMs()==0)&&(timeout->power==1)&&(timeout->fresh==0))
|
|
|
|
|
|
{
|
|
|
|
|
|
timeout->fresh=1;
|
|
|
|
|
|
WIN_SetInvalid ((WIN_WindowStruct *)timeout);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case WIN_MSG_KEY:
|
|
|
|
|
|
k=msg->data.p;
|
2025-07-05 19:47:28 +08:00
|
|
|
|
if (k->shortPress&KEY_VALUE_UP)//<2F>̰<EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
{
|
|
|
|
|
|
TIMEOUT_KeyUp (timeout);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (k->shortPress&KEY_VALUE_DOWN)
|
|
|
|
|
|
{
|
|
|
|
|
|
TIMEOUT_KeyDown (timeout);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (k->shortPress&KEY_VALUE_HOME)
|
|
|
|
|
|
{
|
|
|
|
|
|
TIMEOUT_KeyBack(timeout);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (k->shortPress&KEY_VALUE_ENTER)
|
|
|
|
|
|
{
|
|
|
|
|
|
TIMEOUT_KeyEnter(timeout);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (k->shortPress)
|
|
|
|
|
|
{
|
|
|
|
|
|
WIN_SetInvalid ((WIN_WindowStruct *)timeout);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;//case WIN_MSG_KEY:
|
|
|
|
|
|
case WIN_MSG_MOVE:
|
|
|
|
|
|
m=msg->data.p;
|
|
|
|
|
|
switch (m->moveType)
|
|
|
|
|
|
{
|
|
|
|
|
|
case MOVE_DATA_SHORT:
|
|
|
|
|
|
{
|
|
|
|
|
|
if (POS_InRect(timeout->rect_ok.x,timeout->rect_ok.y,
|
|
|
|
|
|
timeout->rect_ok.x_size,timeout->rect_ok.y_size,m->x_move,m->y_move))
|
|
|
|
|
|
{
|
|
|
|
|
|
TIMEOUT_KeyEnter(timeout);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (POS_InRect(timeout->rect_back.x,timeout->rect_back.y,
|
|
|
|
|
|
timeout->rect_back.x_size,timeout->rect_back.y_size,m->x_move,m->y_move))
|
|
|
|
|
|
{
|
|
|
|
|
|
TIMEOUT_KeyBack(timeout);
|
|
|
|
|
|
}
|
|
|
|
|
|
WIN_SetInvalid ((WIN_WindowStruct *)timeout);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
|
|
|
WIN_DefaultMsgLoop((WIN_WindowStruct *)timeout,msg);
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WIN_TimeOutStruct *TIMEOUT_SaveTime (WIN_WindowStruct *base)
|
|
|
|
|
|
{
|
|
|
|
|
|
WIN_TimeOutStruct *ret=0;
|
|
|
|
|
|
if (base)
|
|
|
|
|
|
{
|
|
|
|
|
|
ret=WIN_CreatTimeOut (base,0,0,0,base->x_size,base->y_size);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
ret=WIN_CreatTimeOut (0,0,0,0,WIN_GetBaseWindow()->x_size,WIN_GetBaseWindow()->y_size);
|
|
|
|
|
|
}
|
|
|
|
|
|
WIN_SetBackPic ((WIN_WindowStruct *)ret,&base->pic);
|
|
|
|
|
|
WIN_ShowWindow((WIN_WindowStruct*)ret);
|
|
|
|
|
|
return ret;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|