2025-06-27 00:32:57 +08:00
|
|
|
|
#include "mywin_inc.h"
|
|
|
|
|
#include "mywin_user_status_bar.h"
|
|
|
|
|
#include "date.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD>̳<EFBFBD><CCB3><EFBFBD>MYWIN<49><4E><EFBFBD><EFBFBD>
|
|
|
|
|
//<2F>û<EFBFBD><C3BB><EFBFBD><EFBFBD>棬<EFBFBD><E6A3AC><EFBFBD>ݾ<EFBFBD><DDBE><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>;<EFBFBD><CDBE>д<EFBFBD><D0B4>û<EFBFBD><C3BB>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
#define WIN_STATUSBAR_TYPE "WIN_StatusBarStruct"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WIN_StatusBarStruct *WIN_CreatStatusBar (WIN_WindowStruct *base,
|
|
|
|
|
void (*msgLoop)(struct _WIN_WindowStruct *win,WIN_MsgStruct *msg),
|
|
|
|
|
int x,int y,int x_size,int y_size)
|
2025-07-06 15:22:15 +08:00
|
|
|
|
{
|
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)
|
|
|
|
|
{
|
2025-07-06 15:22:15 +08:00
|
|
|
|
msgLoop=(void (*)(struct _WIN_WindowStruct *win,WIN_MsgStruct *msg))STATUSBAR_DefaultMsgLoop;
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-27 00:32:57 +08:00
|
|
|
|
WIN_StatusBarStruct *ret=mymalloc (sizeof ( WIN_StatusBarStruct));
|
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_StatusBarStruct));
|
|
|
|
|
if (0==WIN_CreatWindowExt((WIN_WindowStruct *)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_STATUSBAR_TYPE;
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//((WIN_WindowStruct *)ret)->keyShield=1;//<2F><><EFBFBD>ΰ<EFBFBD><CEB0><EFBFBD><EFBFBD>ʹ<EFBFBD><CDB4><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
ret->img_xsize=40;
|
|
|
|
|
ret->backColor=0;
|
|
|
|
|
ret->color=0xffffffff;
|
2025-07-05 19:47:28 +08:00
|
|
|
|
mymemcpy (ret->stat.time,"ʾ<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD> 00:00",15);
|
|
|
|
|
mymemcpy (ret->stat.mode,"ʾ<EFBFBD><EFBFBD>ģʽ",9);
|
2025-06-27 00:32:57 +08:00
|
|
|
|
ret->timerIdGet=WIN_CreatTimer ((WIN_WindowStruct *)ret,100);
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//WIN_SetAsTopWin ((WIN_WindowStruct *)ret);//<2F><><EFBFBD><EFBFBD><EFBFBD>ö<EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
ret->y_size_def=y_size;
|
|
|
|
|
ret->app_y_step=30;
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-07-06 15:22:15 +08:00
|
|
|
|
|
|
|
|
|
|
2025-06-27 00:32:57 +08:00
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//״̬<D7B4><CCAC>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
void STATUSBAR_StateUpdata (WIN_StatusBarStruct *statusbar,STATUSBAR_DataStruct *s)
|
|
|
|
|
{
|
|
|
|
|
int temp=statusbar->stat.mode_x;
|
2025-07-06 15:22:15 +08:00
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//ʹ<><CAB9><EFBFBD>ڴ渴<DAB4>Ƶķ<C6B5><C4B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƽṹ<C6BD><E1B9B9>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
mymemcpy (& statusbar->stat,s,sizeof (STATUSBAR_DataStruct));
|
|
|
|
|
if (strlen(statusbar->stat.mode)>8)
|
|
|
|
|
{
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱʹ<CAB1>ù<EFBFBD><C3B9><EFBFBD><EFBFBD><EFBFBD>ʾ
|
2025-06-27 00:32:57 +08:00
|
|
|
|
if (statusbar->timerId==0)
|
|
|
|
|
{
|
|
|
|
|
statusbar->timerId=WIN_CreatTimer ((WIN_WindowStruct *)statusbar,100);
|
|
|
|
|
statusbar->stat.mode_x=WIN_GetFontWidth()*4/2;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
statusbar->stat.mode_x=temp;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (statusbar->timerId)
|
|
|
|
|
{
|
|
|
|
|
WIN_DeleteTimer(statusbar->timerId);
|
|
|
|
|
statusbar->timerId=0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD>ļ<EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
void STATUSBAR_SetRes (WIN_StatusBarStruct *statusbar,STATUSBAR_ResStruct *r)
|
|
|
|
|
{
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//ʹ<><CAB9><EFBFBD>ڴ渴<DAB4>Ƶķ<C6B5><C4B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƽṹ<C6BD><E1B9B9>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
mymemcpy (& statusbar->res,r,sizeof (STATUSBAR_ResStruct));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><><EFBFBD>ñ<EFBFBD><C3B1><EFBFBD>ͼƬ
|
2025-06-27 00:32:57 +08:00
|
|
|
|
void STATUSBAR_SetBackPic (WIN_StatusBarStruct *statusbar,WIN_PicStruct *pic)
|
|
|
|
|
{
|
|
|
|
|
if (pic)
|
|
|
|
|
{
|
|
|
|
|
mymemcpy(&statusbar->pic,pic,sizeof(WIN_PicStruct));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
mymemset(&statusbar->pic,0,sizeof(WIN_PicStruct));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void STATUSBAR_ScanApp(WIN_StatusBarStruct *bar)
|
|
|
|
|
{
|
|
|
|
|
for(int i=0;i<APPM_LIST_MAXLEN;i++)
|
|
|
|
|
{
|
|
|
|
|
app_struct *app=appm_get(i);
|
|
|
|
|
if(app)
|
2025-07-06 15:22:15 +08:00
|
|
|
|
{
|
2025-06-27 00:32:57 +08:00
|
|
|
|
bar->app_item[bar->app_num].app=app;
|
|
|
|
|
bar->app_num++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void STATUSBAR_ClearApp(WIN_StatusBarStruct *bar)
|
|
|
|
|
{
|
|
|
|
|
bar->app_num=0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//Ĭ<>ϻ<EFBFBD><CFBB>ƺ<EFBFBD><C6BA><EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
void STATUSBAR_DefaultPaint (WIN_StatusBarStruct *statusbar)
|
|
|
|
|
{
|
2025-07-06 15:22:15 +08:00
|
|
|
|
|
2025-06-27 00:32:57 +08:00
|
|
|
|
int x=0;
|
|
|
|
|
int y=0;
|
|
|
|
|
int x_size=((WIN_WindowStruct *)statusbar)->x_size;
|
|
|
|
|
// int y_size=((WIN_WindowStruct *)statusbar)->y_size;
|
|
|
|
|
int y_size=20;
|
2025-07-05 19:47:28 +08:00
|
|
|
|
int tag_xsize=0;//<2F><><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD>
|
2025-07-06 15:22:15 +08:00
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
WIN_SetLcdBkColor (statusbar->backColor);
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼƬ<CDBC><C6AC><EFBFBD><EFBFBD>ʾͼƬ
|
2025-06-27 00:32:57 +08:00
|
|
|
|
if (statusbar->pic.data)
|
|
|
|
|
{
|
|
|
|
|
WIN_FillRect (0,0,((WIN_WindowStruct *)statusbar)->x_size,((WIN_WindowStruct *)statusbar)->y_size,
|
|
|
|
|
statusbar->pic.data,((WIN_WindowStruct *)statusbar)->x,((WIN_WindowStruct *)statusbar)->y,statusbar->pic.xsize,statusbar->pic.ysize);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
WIN_Clear();
|
|
|
|
|
}
|
2025-07-06 15:22:15 +08:00
|
|
|
|
|
2025-06-27 00:32:57 +08:00
|
|
|
|
u32 font_type =WIN_SetFontSize (16);
|
2025-07-06 15:22:15 +08:00
|
|
|
|
|
2025-06-27 00:32:57 +08:00
|
|
|
|
WIN_SetLcdColor (statusbar->color);
|
2025-07-06 15:22:15 +08:00
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><>ʾʱ<CABE><CAB1>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
WIN_SetFontMode (WIN_DRAWMODE_ALONE);
|
|
|
|
|
WIN_SetLcdBkColor (statusbar->color);
|
|
|
|
|
if (statusbar->stat.time[0])
|
|
|
|
|
{
|
2025-07-06 15:22:15 +08:00
|
|
|
|
WIN_DrawTxtAt (statusbar->stat.time,x,y_size/2-WIN_GetFontHight()/2);
|
2025-06-27 00:32:57 +08:00
|
|
|
|
}
|
2025-07-06 15:22:15 +08:00
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><>ʾģʽ
|
2025-06-27 00:32:57 +08:00
|
|
|
|
if (statusbar->stat.mode[0])
|
|
|
|
|
{
|
2025-07-06 15:22:15 +08:00
|
|
|
|
WIN_DrawTxtHCenterAt (statusbar->stat.mode,x_size/2,y_size/2-WIN_GetFontHight()/2);
|
2025-06-27 00:32:57 +08:00
|
|
|
|
}
|
2025-07-06 15:22:15 +08:00
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><>ʾ<EFBFBD><CABE><EFBFBD>ذٷֱ<D9B7>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
if (statusbar->stat.betty[0])
|
|
|
|
|
{
|
|
|
|
|
tag_xsize=strlen(statusbar->stat.betty)*WIN_GetFontWidth()/2;
|
|
|
|
|
WIN_DrawTxtAt (statusbar->stat.betty,x_size-tag_xsize-1,y_size/2-WIN_GetFontHight()/2);
|
|
|
|
|
x_size-=tag_xsize;
|
|
|
|
|
}
|
2025-07-06 15:22:15 +08:00
|
|
|
|
|
|
|
|
|
|
2025-06-27 00:32:57 +08:00
|
|
|
|
int y_step=statusbar->app_y_step;
|
|
|
|
|
x=15;
|
|
|
|
|
y=statusbar->y_size_def+10;
|
|
|
|
|
x_size=((WIN_WindowStruct *)statusbar)->x_size;
|
|
|
|
|
char txt[20]={0};
|
|
|
|
|
for(int i=0;i<statusbar->app_num;i++)
|
|
|
|
|
{
|
|
|
|
|
int txt_y=y+(y_step-WIN_GetFontHight())/2;
|
|
|
|
|
STATUSBAR_AppStruct *app_item=&statusbar->app_item[i];
|
|
|
|
|
RECT_Struct *rect=0;
|
|
|
|
|
WIN_DrawTxtAt(app_item->app->app_info->name,x,txt_y);
|
|
|
|
|
if(app_item->app->run_state)
|
2025-07-05 19:47:28 +08:00
|
|
|
|
WIN_DrawTxtAt("<EFBFBD><EFBFBD><EFBFBD>",x+x_size*1/4,txt_y);
|
2025-06-27 00:32:57 +08:00
|
|
|
|
rect=&app_item->enter;
|
|
|
|
|
rect->x_size=x_size/4;
|
|
|
|
|
rect->y_size=y_step;
|
|
|
|
|
rect->x=x+x_size*2/4;rect->y=y;
|
2025-07-05 19:47:28 +08:00
|
|
|
|
WIN_DrawTxtAt("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>",rect->x,txt_y);
|
2025-06-27 00:32:57 +08:00
|
|
|
|
rect=&app_item->exit;
|
|
|
|
|
rect->x=x+x_size*3/4;rect->y=y;
|
|
|
|
|
rect->x_size=x_size/4;
|
|
|
|
|
rect->y_size=y_step;
|
2025-07-05 19:47:28 +08:00
|
|
|
|
WIN_DrawTxtAt("ɾ<EFBFBD><EFBFBD>",rect->x,txt_y);
|
2025-07-06 15:22:15 +08:00
|
|
|
|
|
2025-06-27 00:32:57 +08:00
|
|
|
|
y+=y_step;
|
|
|
|
|
WIN_DrawHLine(10,y,x_size-1-10);
|
|
|
|
|
}
|
2025-07-06 15:22:15 +08:00
|
|
|
|
|
2025-06-27 00:32:57 +08:00
|
|
|
|
WIN_SetFontSize (font_type);
|
|
|
|
|
}
|
2025-07-06 15:22:15 +08:00
|
|
|
|
|
2025-06-27 00:32:57 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int STATUSBAR_AppButton(WIN_StatusBarStruct *bar,WIN_MoveStruct *m)
|
|
|
|
|
{
|
|
|
|
|
WIN_WindowStruct *win=(WIN_WindowStruct *)bar;
|
|
|
|
|
for(int i=0;i<bar->app_num;i++)
|
|
|
|
|
{
|
|
|
|
|
STATUSBAR_AppStruct *app_item=&bar->app_item[i];
|
|
|
|
|
RECT_Struct *rect=0;
|
|
|
|
|
rect=&app_item->enter;
|
|
|
|
|
if(POS_InRect(rect->x,rect->y,rect->x_size,rect->y_size,m->x_move,m->y_move))
|
|
|
|
|
{
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><EFBFBD><F2BFAAB1><EFBFBD>Ϊi<CEAA><69>app
|
2025-06-27 00:32:57 +08:00
|
|
|
|
WIN_SetSize (win,win->x_size,bar->y_size_def);
|
|
|
|
|
bar->dis=0;
|
|
|
|
|
app_run(app_item->app);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
rect=&app_item->exit;
|
|
|
|
|
if(POS_InRect(rect->x,rect->y,rect->x_size,rect->y_size,m->x_move,m->y_move))
|
|
|
|
|
{
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD>Ϊi<CEAA><69>app
|
2025-06-27 00:32:57 +08:00
|
|
|
|
if(app_exit(app_item->app) !=0)
|
|
|
|
|
{
|
2025-07-05 19:47:28 +08:00
|
|
|
|
MSGBOX_TipsTime ((WIN_WindowStruct *)bar,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>","ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>","ȷ<EFBFBD><EFBFBD>",5*1000);
|
2025-06-27 00:32:57 +08:00
|
|
|
|
}
|
|
|
|
|
WIN_SetSize (win,win->x_size,bar->y_size_def);
|
|
|
|
|
bar->dis=0;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int STATUSBAR_TouchMove(WIN_StatusBarStruct *statusbar,WIN_MoveStruct *m)
|
|
|
|
|
{
|
|
|
|
|
WIN_WindowStruct *win=(WIN_WindowStruct *)statusbar;
|
|
|
|
|
int y_max=WIN_GetWinStruct()->lcd->getLcdSizeY();
|
|
|
|
|
switch(m->moveType)
|
|
|
|
|
{
|
|
|
|
|
case MOVE_DATA_SHORT:
|
|
|
|
|
STATUSBAR_AppButton(statusbar,m);
|
|
|
|
|
break;
|
|
|
|
|
case MOVE_DATA_MOVED:
|
|
|
|
|
if(statusbar->mov_start)
|
|
|
|
|
{
|
|
|
|
|
int y_temp=win->y_size+m->y_move;
|
|
|
|
|
if(y_temp<statusbar->y_size_def) y_temp=statusbar->y_size_def;
|
|
|
|
|
WIN_SetSize (win,win->x_size,y_temp);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case MOVE_DATA_TOUCHIN:
|
|
|
|
|
if(statusbar->mov_start==0)
|
|
|
|
|
{
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD>Ļ<EFBFBD><C4BB>Ե<EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڸı䴰<C4B1>ڴ<EFBFBD>С
|
2025-06-27 00:32:57 +08:00
|
|
|
|
//if(m->y_move<20||m->y_move>y_max-20)
|
|
|
|
|
{
|
|
|
|
|
statusbar->mov_start=1;
|
|
|
|
|
if (statusbar->dis==0)
|
|
|
|
|
{
|
|
|
|
|
statusbar->dis=1;
|
|
|
|
|
WIN_SetSize (win,win->x_size,100);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
statusbar->dis=0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case MOVE_DATA_TOUCHOUT:
|
|
|
|
|
case MOVE_DATA_MOVEOUT:
|
|
|
|
|
if(statusbar->mov_start)
|
|
|
|
|
{
|
|
|
|
|
if(statusbar->dis==1)
|
|
|
|
|
{
|
|
|
|
|
if(win->y_size>200)
|
|
|
|
|
{
|
|
|
|
|
WIN_SetSize (win,win->x_size,y_max);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
WIN_SetSize (win,win->x_size,statusbar->y_size_def);
|
|
|
|
|
statusbar->dis=0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if(win->y_size<y_max-100)
|
|
|
|
|
{
|
|
|
|
|
WIN_SetSize (win,win->x_size,statusbar->y_size_def);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
WIN_SetSize (win,win->x_size,y_max);
|
|
|
|
|
statusbar->dis=1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
statusbar->mov_start=0;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-06 15:22:15 +08:00
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//Ĭ<><C4AC><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
void STATUSBAR_DefaultMsgLoop (WIN_StatusBarStruct *statusbar,WIN_MsgStruct *msg)
|
|
|
|
|
{
|
|
|
|
|
WIN_MoveStruct *m=0;
|
|
|
|
|
WIN_TouchStruct *t=0;
|
|
|
|
|
STATUSBAR_DataStruct *s=0;
|
|
|
|
|
switch (msg->msg)
|
2025-07-06 15:22:15 +08:00
|
|
|
|
{
|
2025-06-27 00:32:57 +08:00
|
|
|
|
case WIN_MSG_PAINT:
|
|
|
|
|
STATUSBAR_DefaultPaint(statusbar);
|
|
|
|
|
break;
|
|
|
|
|
case WIN_MSG_KEY:
|
|
|
|
|
break;
|
|
|
|
|
case WIN_MSG_MOVE:
|
|
|
|
|
m=msg->data.p;
|
|
|
|
|
STATUSBAR_TouchMove(statusbar,m);
|
|
|
|
|
break;
|
|
|
|
|
case WIN_MSG_TIMER:
|
|
|
|
|
if (msg->data.v==statusbar->timerId)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
else if (msg->data.v==statusbar->timerIdGet)
|
|
|
|
|
{
|
|
|
|
|
int Hours=0;int Minutes=0;int Seconds;
|
|
|
|
|
STATUSBAR_DataStruct *statu=mymalloc (sizeof (STATUSBAR_DataStruct));
|
|
|
|
|
mymemset (statu,0,sizeof (STATUSBAR_DataStruct));
|
|
|
|
|
date_rtc_get_time (&Hours,&Minutes,&Seconds);
|
|
|
|
|
if (statusbar->sec!=Seconds)
|
|
|
|
|
{
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD>״̬<D7B4><CCAC>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
statusbar->sec=Seconds;
|
2025-07-06 15:22:15 +08:00
|
|
|
|
int a=mem_perused(),b=exmem_perused();
|
2025-06-27 00:32:57 +08:00
|
|
|
|
sprintf (statu->time,"%02d:%02d:%02d", Hours,Minutes,Seconds);
|
2025-07-06 15:22:15 +08:00
|
|
|
|
sprintf (statu->mode,"mem:%02d.%02d,exm:%02d.%02d",a/100,a%100,
|
|
|
|
|
b/100,b%100);
|
2025-07-05 19:47:28 +08:00
|
|
|
|
sprintf (statu->betty,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:100%%");
|
2025-06-27 00:32:57 +08:00
|
|
|
|
STATUSBAR_StateUpdata (statusbar,statu);
|
2025-07-06 15:22:15 +08:00
|
|
|
|
|
2025-06-27 00:32:57 +08:00
|
|
|
|
STATUSBAR_ClearApp(statusbar);
|
|
|
|
|
STATUSBAR_ScanApp(statusbar);
|
2025-07-06 15:22:15 +08:00
|
|
|
|
|
2025-06-27 00:32:57 +08:00
|
|
|
|
WIN_SetInvalidWhenTop ((WIN_WindowStruct *)statusbar);
|
|
|
|
|
}
|
|
|
|
|
myfree(statu);
|
|
|
|
|
}
|
|
|
|
|
break;
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD><D5B5>ⲿ<EFBFBD><E2B2BF>Ϣ<EFBFBD><CFA2>Ϊ STATUSBAR_Struct <20><><EFBFBD>͵Ľṹ<C4BD><E1B9B9>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
case WIN_MSG_EXTMSG:
|
|
|
|
|
s=msg->data.p;
|
|
|
|
|
STATUSBAR_StateUpdata (statusbar,s);
|
|
|
|
|
WIN_SetInvalid ((WIN_WindowStruct *)statusbar);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
WIN_DefaultMsgLoop((WIN_WindowStruct *)statusbar,msg);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|