2025-06-27 00:32:57 +08:00
|
|
|
|
#include "mywin_inc.h"
|
|
|
|
|
#include "ff.h"
|
2025-06-28 18:16:25 +08:00
|
|
|
|
// #include "nes_main.h"
|
2025-06-27 00:32:57 +08:00
|
|
|
|
#include "gif.h"
|
|
|
|
|
#include "system_updata.h"
|
|
|
|
|
#include "avi.h"
|
|
|
|
|
#include "mywin_user_photo.h"
|
|
|
|
|
#include "mywin_user_animation.h"
|
|
|
|
|
#include "mywin_music.h"
|
|
|
|
|
#include "mywin_user_filder.h"
|
|
|
|
|
#include "elf.h"
|
|
|
|
|
#include "lcd_rgb.h"
|
|
|
|
|
#include "tools.h"
|
|
|
|
|
#include "nrf.h"
|
|
|
|
|
#include "mywin_user_debug.h"
|
|
|
|
|
|
|
|
|
|
//文件管理器
|
|
|
|
|
|
|
|
|
|
#define WIN_FILDER_TYPE "WIN_FilderStruct"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static const char *g_popup_itmes[]=
|
|
|
|
|
{
|
|
|
|
|
"打开",
|
|
|
|
|
"重命名",
|
|
|
|
|
"复制到系统文件",
|
|
|
|
|
"文件信息",
|
|
|
|
|
"删除文件",
|
|
|
|
|
"发送",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void FILDER_Delete (WIN_FilderStruct *up);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WIN_FilderStruct *WIN_CreatFilder (WIN_WindowStruct *base,
|
|
|
|
|
void (*msgLoop)(struct _WIN_WindowStruct *win,WIN_MsgStruct *msg),
|
|
|
|
|
int x,int y,int x_size,int y_size)
|
|
|
|
|
{
|
|
|
|
|
//重设消息循环
|
|
|
|
|
if (msgLoop==0)
|
|
|
|
|
{
|
|
|
|
|
msgLoop=(void (*)(struct _WIN_WindowStruct *win,WIN_MsgStruct *msg))FILDER_defaultMsgLoop;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WIN_FilderStruct *ret=mymalloc_exm (sizeof ( WIN_FilderStruct));
|
|
|
|
|
//调用父类的构造函数
|
|
|
|
|
if (ret)
|
|
|
|
|
{
|
|
|
|
|
mymemset (ret,0,sizeof ( WIN_FilderStruct));
|
|
|
|
|
// 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))
|
|
|
|
|
{
|
|
|
|
|
//创建失败
|
|
|
|
|
myfree (ret);
|
|
|
|
|
ret=0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//构造
|
|
|
|
|
((WIN_WindowStruct *)ret)->winType=WIN_FILDER_TYPE;
|
|
|
|
|
((WIN_WindowStruct *)ret)->deleteWindow=(void (*)(struct _WIN_WindowStruct *win))FILDER_Delete;
|
|
|
|
|
((WIN_WindowStruct *)ret)->bkcolor=0x808080;
|
|
|
|
|
((WIN_WindowStruct *)ret)->color=0xffffff;
|
|
|
|
|
((WIN_WindowStruct *)ret)->intercept=1;//不发送按键消息到父窗口
|
|
|
|
|
ret->titleHight=30;
|
|
|
|
|
ret->itemHight=30;
|
|
|
|
|
ret->itemIndent=35;
|
|
|
|
|
ret->scrollbar_xsize=10;
|
|
|
|
|
ret->itemNumOnePage=(((WIN_WindowStruct *)ret)->y_size-ret->titleHight)/ret->itemHight;
|
|
|
|
|
ret->itemHight=(((WIN_WindowStruct *)ret)->y_size-ret->titleHight)/ret->itemNumOnePage;
|
|
|
|
|
ret->imgDir=0;
|
|
|
|
|
ret->imgFile=0;
|
|
|
|
|
|
|
|
|
|
tools_updata_on();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void FILDER_Delete (WIN_FilderStruct *up)
|
|
|
|
|
{
|
|
|
|
|
tools_updata_off();
|
|
|
|
|
|
|
|
|
|
//调用父类的销毁函数
|
|
|
|
|
WIN_DeleteWindow ( (WIN_WindowStruct *)up);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//设置文件索引
|
|
|
|
|
int FILDER_SetIndex(WIN_FilderStruct *filder,int index);
|
|
|
|
|
|
|
|
|
|
//设置文件路径,同时扫描路径下的文件
|
|
|
|
|
void FILDER_SetFileDir (WIN_FilderStruct *filder,char *dir)
|
|
|
|
|
{
|
|
|
|
|
mymemcpy (filder->dirName,dir,strlen(dir));
|
|
|
|
|
FILDER_ClearItem(filder);
|
|
|
|
|
FILDER_ScanFile (filder);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//清空条目
|
|
|
|
|
void FILDER_ClearItem (WIN_FilderStruct *filder)
|
|
|
|
|
{
|
|
|
|
|
filder->fileNum=0;
|
|
|
|
|
filder->firstItemOnPage=0;
|
|
|
|
|
filder->dirNum=0;
|
|
|
|
|
filder->file[0].name[0]=0;
|
|
|
|
|
FILDER_SetIndex(filder,0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//添加一个文件条目
|
|
|
|
|
void FILDER_AddItem (WIN_FilderStruct *filder,Filder_FildInfo *file)
|
|
|
|
|
{
|
|
|
|
|
if (filder->fileNum<FILDER_FILE_MAXNUM)
|
|
|
|
|
{
|
|
|
|
|
mymemcpy (&filder->file[filder->fileNum],file,sizeof (Filder_FildInfo));
|
|
|
|
|
filder->fileNum++;
|
|
|
|
|
|
|
|
|
|
//如果是文件夹,文件夹数目加1
|
|
|
|
|
if (file->type==FILDER_DIR_TYPE)
|
|
|
|
|
{ filder->dirNum++; }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//在指定位置插入一个条目
|
|
|
|
|
void FILDER_InsertItem (WIN_FilderStruct *filder,Filder_FildInfo *file,int index)
|
|
|
|
|
{
|
|
|
|
|
if (index<0) return;
|
|
|
|
|
if (filder->fileNum<FILDER_FILE_MAXNUM)
|
|
|
|
|
{
|
|
|
|
|
//在列表中间插入条目
|
|
|
|
|
if (index<filder->fileNum)
|
|
|
|
|
{
|
|
|
|
|
//先向后移动,留出位置
|
|
|
|
|
for (int i=filder->fileNum-1;i>=index;i--)
|
|
|
|
|
{
|
|
|
|
|
mymemcpy (&filder->file[i+1],&filder->file[i],sizeof (Filder_FildInfo));
|
|
|
|
|
}
|
|
|
|
|
//插入条目
|
|
|
|
|
mymemcpy (&filder->file[index],file,sizeof (Filder_FildInfo));
|
|
|
|
|
filder->fileNum++;
|
|
|
|
|
|
|
|
|
|
//如果是文件夹,文件夹数目加1
|
|
|
|
|
if (file->type==FILDER_DIR_TYPE)
|
|
|
|
|
{ filder->dirNum++; }
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
FILDER_AddItem (filder,file);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//入栈
|
|
|
|
|
int FILDER_PathPush (WIN_FilderStruct *filder)
|
|
|
|
|
{
|
|
|
|
|
if (filder->path.fileNum<FILDER_DIR_DEPTH)
|
|
|
|
|
{
|
|
|
|
|
for (int i=filder->path.fileNum;i>0;i--)
|
|
|
|
|
{
|
|
|
|
|
filder->path.first[i]=filder->path.first[i-1];
|
|
|
|
|
filder->path.index[i]=filder->path.index[i-1];
|
|
|
|
|
}
|
|
|
|
|
filder->path.first[0]=filder->firstItemOnPage;
|
|
|
|
|
filder->path.index[0]=filder->index;
|
|
|
|
|
filder->path.fileNum++;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//出栈
|
|
|
|
|
int FILDER_PathPull (WIN_FilderStruct *filder)
|
|
|
|
|
{
|
|
|
|
|
if (filder->path.fileNum)
|
|
|
|
|
{
|
|
|
|
|
filder->firstItemOnPage=filder->path.first[0];
|
|
|
|
|
filder->index=filder->path.index[0];
|
|
|
|
|
filder->path.fileNum--;
|
|
|
|
|
for (int i=0;i<filder->path.fileNum;i++)
|
|
|
|
|
{
|
|
|
|
|
filder->path.first[i]=filder->path.first[i+1];
|
|
|
|
|
filder->path.index[i]=filder->path.index[i+1];
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//把文件名追加到目录,同时扫描路径下的文件,目标不是目录时返回-1
|
|
|
|
|
int FILDER_DirAppend (WIN_FilderStruct *filder,Filder_FildInfo *file)
|
|
|
|
|
{
|
|
|
|
|
int dir_len=strlen(filder->dirName);
|
|
|
|
|
|
|
|
|
|
if (file->type==FILDER_DIR_TYPE)
|
|
|
|
|
{
|
|
|
|
|
filder->dirName[dir_len]='/';
|
|
|
|
|
dir_len++;
|
|
|
|
|
mymemcpy (&filder->dirName[dir_len],file->name,strlen(file->name)+1);
|
|
|
|
|
FILDER_PathPush (filder);
|
|
|
|
|
FILDER_ClearItem(filder);
|
|
|
|
|
FILDER_ScanFile (filder);
|
|
|
|
|
FILDER_SetIndex(filder,0);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//剪短一层目录,同时扫描目录下的文件,不能简短时返回-1
|
|
|
|
|
int FILDER_DirCut (WIN_FilderStruct *filder)
|
|
|
|
|
{
|
|
|
|
|
int dir_len=strlen(filder->dirName);
|
|
|
|
|
if (dir_len==0) return -1;
|
|
|
|
|
char *ptr_name=&filder->dirName[dir_len-1];
|
|
|
|
|
while (*ptr_name&&(*ptr_name!='/')&&(*ptr_name!=':')) {*ptr_name=0;ptr_name--;}
|
|
|
|
|
if (*ptr_name=='/')
|
|
|
|
|
{
|
|
|
|
|
*ptr_name=0;
|
|
|
|
|
FILDER_ClearItem(filder);
|
|
|
|
|
FILDER_PathPull(filder);
|
|
|
|
|
FILDER_ScanFile (filder);
|
|
|
|
|
FILDER_SetIndex(filder,filder->index);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//生成文件路径
|
|
|
|
|
void FILDER_GetFileRoute (WIN_FilderStruct *filder)
|
|
|
|
|
{
|
|
|
|
|
int dir_len=strlen(filder->dirName);
|
|
|
|
|
mymemcpy (filder->fileName,filder->dirName,dir_len+1);
|
|
|
|
|
filder->fileName[dir_len]='/';
|
|
|
|
|
dir_len++;
|
|
|
|
|
mymemcpy (&filder->fileName[dir_len],filder->file[filder->index].name,strlen(filder->file[filder->index].name)+1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//扫描文件
|
|
|
|
|
void FILDER_ScanFile (WIN_FilderStruct *filder)
|
|
|
|
|
{
|
|
|
|
|
FRESULT ret=FR_OK;
|
|
|
|
|
DIR dir={0};
|
|
|
|
|
FILINFO *file_info=0;
|
|
|
|
|
Filder_FildInfo *file_info_x=0;
|
|
|
|
|
file_info=mymalloc (sizeof(FILINFO));
|
|
|
|
|
file_info_x=mymalloc (sizeof (Filder_FildInfo));
|
|
|
|
|
ret=f_findfirst(&dir,file_info,filder->dirName,"*");
|
|
|
|
|
while ((ret==FR_OK)&&(file_info->fname[0]!=0))
|
|
|
|
|
{
|
|
|
|
|
mymemcpy (file_info_x->name,file_info->fname,strlen(file_info->fname)+1);
|
|
|
|
|
file_info_x->size=file_info->fsize;
|
|
|
|
|
if (AM_DIR&file_info->fattrib)
|
|
|
|
|
{file_info_x->type=FILDER_DIR_TYPE;}
|
|
|
|
|
else {file_info_x->type=FILDER_FILE_TYPE;}
|
|
|
|
|
if (filder->fileNum<FILDER_FILE_MAXNUM)
|
|
|
|
|
{
|
|
|
|
|
if (file_info_x->type==FILDER_DIR_TYPE)
|
|
|
|
|
{
|
|
|
|
|
FILDER_InsertItem (filder,file_info_x,filder->dirNum);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
FILDER_AddItem (filder,file_info_x);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
ret=f_findnext(&dir,file_info);
|
|
|
|
|
}
|
|
|
|
|
myfree(file_info);
|
|
|
|
|
myfree(file_info_x);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//打开文件
|
|
|
|
|
void FILDER_OpenFile (WIN_FilderStruct *filder)
|
|
|
|
|
{
|
|
|
|
|
int str_len=strlen(filder->file[filder->index].name);
|
|
|
|
|
char *p_str=&filder->file[filder->index].name[str_len-4];
|
|
|
|
|
if (strcmp (p_str,".jpg")==0)
|
|
|
|
|
{
|
|
|
|
|
FILDER_GetFileRoute(filder);
|
|
|
|
|
PHOTO_ShowPhoto ((WIN_WindowStruct *)filder,filder->fileName);
|
|
|
|
|
}
|
|
|
|
|
else if (strcmp (p_str,".bmp")==0)
|
|
|
|
|
{
|
|
|
|
|
FILDER_GetFileRoute(filder);
|
|
|
|
|
PHOTO_ShowPhoto ((WIN_WindowStruct *)filder,filder->fileName);
|
|
|
|
|
}
|
|
|
|
|
else if (strcmp (p_str,".png")==0)
|
|
|
|
|
{
|
|
|
|
|
FILDER_GetFileRoute(filder);
|
|
|
|
|
PHOTO_ShowPhoto ((WIN_WindowStruct *)filder,filder->fileName);
|
|
|
|
|
}
|
|
|
|
|
else if (strcmp (p_str,".pic")==0)
|
|
|
|
|
{
|
|
|
|
|
FILDER_GetFileRoute(filder);
|
|
|
|
|
WIN_PicStruct pic={0};
|
|
|
|
|
u32 file_size=0;
|
|
|
|
|
u8 *data=0;
|
|
|
|
|
FIL *file=mymalloc (sizeof(FIL));
|
|
|
|
|
FILINFO *file_info=mymalloc(sizeof(FILINFO));
|
|
|
|
|
UINT br;
|
|
|
|
|
u8 res=0;
|
|
|
|
|
f_stat((char*)filder->fileName,file_info);
|
|
|
|
|
data=mymalloc (file_info->fsize);
|
|
|
|
|
f_open(file,(char*)filder->fileName,FA_READ);
|
|
|
|
|
f_read(file,data,file_info->fsize,&br);
|
|
|
|
|
f_close(file);
|
|
|
|
|
res=WIN_GetImageSize ((u8*)data,&pic.xsize,&pic.ysize);
|
|
|
|
|
if (res==0){pic.data=(u16*)(data+8);}
|
|
|
|
|
PHOTO_ShowPic ((WIN_WindowStruct *)filder,&pic);
|
|
|
|
|
myfree(data);
|
|
|
|
|
myfree(file);
|
|
|
|
|
myfree(file_info);
|
|
|
|
|
}
|
|
|
|
|
else if (strcmp (p_str,".gif")==0)
|
|
|
|
|
{
|
|
|
|
|
FILDER_GetFileRoute(filder);
|
|
|
|
|
ANIMATION_ShowGif ((WIN_WindowStruct *)filder,(char*)filder->fileName);
|
|
|
|
|
}
|
|
|
|
|
else if ((strcmp (p_str,".nes")==0)||(strcmp (p_str,".NES")==0))
|
|
|
|
|
{
|
|
|
|
|
FILDER_GetFileRoute(filder);
|
|
|
|
|
WIN_KeyShieldOn();
|
|
|
|
|
nes_load ((u8*)filder->fileName,LCD_GetShowAddr(),LCD_GetLcdSizeX()/2-128,LCD_GetLcdSizeY()/2-120);
|
|
|
|
|
WIN_KeyShieldOff();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (strcmp (p_str,".avi")==0)
|
|
|
|
|
{
|
|
|
|
|
FILDER_GetFileRoute(filder);
|
|
|
|
|
WIN_KeyShieldOn();
|
|
|
|
|
int ret=video_play (filder->fileName,0);
|
|
|
|
|
WIN_KeyShieldOff();
|
|
|
|
|
}
|
|
|
|
|
else if (strcmp (p_str,".mp3")==0)
|
|
|
|
|
{
|
|
|
|
|
FILDER_GetFileRoute(filder);
|
|
|
|
|
MUSIC_PlaySong((WIN_WindowStruct *)filder,filder->fileName);
|
|
|
|
|
}
|
|
|
|
|
else if (strcmp (p_str,".axf")==0)
|
|
|
|
|
{
|
|
|
|
|
//执行程序文件
|
|
|
|
|
FILDER_GetFileRoute(filder);
|
|
|
|
|
app_run_path(filder->fileName);
|
|
|
|
|
}
|
|
|
|
|
else if (strcmp (p_str,".lua")==0)
|
|
|
|
|
{
|
|
|
|
|
// 执行lua脚本
|
|
|
|
|
FILDER_GetFileRoute(filder);
|
|
|
|
|
DEBUG_EnterPrintCmd(filder->fileName);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
MSGBOX_TipsTime ((WIN_WindowStruct *)filder,"提示","不支持的文件","确定",5000);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void FILDER_PaintItem(WIN_FilderStruct *filder,int index)
|
|
|
|
|
{
|
|
|
|
|
if(index<0||index>=filder->fileNum) return ;
|
|
|
|
|
|
|
|
|
|
int x=0;
|
|
|
|
|
int y=filder->titleHight+filder->y_off+(index-filder->firstItemOnPage)*filder->itemHight;
|
|
|
|
|
int x_size=((WIN_WindowStruct *)filder)->x_size;
|
|
|
|
|
int y_size=filder->itemHight;
|
|
|
|
|
Filder_FildInfo *file=&filder->file[index];
|
|
|
|
|
//显示图标
|
|
|
|
|
int img_xsize=0;
|
|
|
|
|
int img_ysize=0;
|
|
|
|
|
char *img=0;
|
|
|
|
|
if (file->type==FILDER_DIR_TYPE)
|
|
|
|
|
{img=filder->imgDir;} else {img=filder->imgFile;}
|
|
|
|
|
if (img)
|
|
|
|
|
{
|
|
|
|
|
WIN_PicStruct *pic=WIN_GetPic(img);
|
|
|
|
|
if(pic)
|
|
|
|
|
{
|
|
|
|
|
WIN_DrawPic(pic,x+(filder->itemIndent-pic->xsize)/2,y+(y_size-img_ysize)/2,
|
|
|
|
|
pic->xsize,pic->ysize);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//显示文件名
|
|
|
|
|
// RECT_Struct rs={0};//用于裁剪绘图区的矩形
|
|
|
|
|
// rs.x=x+filder->itemIndent;rs.y=y;
|
|
|
|
|
// rs.x_size=x_size-filder->scrollbar_xsize-filder->itemIndent-1;
|
|
|
|
|
// rs.y_size=y_size;
|
|
|
|
|
// WIN_SetWinInvalidRect (((WIN_WindowStruct *)filder),&rs);
|
|
|
|
|
if(index==filder->index)
|
|
|
|
|
WIN_DrawTxtAt (file->name,x+filder->itemIndent+filder->scroll_x,y+y_size/2-WIN_GetFontHight()/2);
|
|
|
|
|
else
|
|
|
|
|
WIN_DrawTxtAt (file->name,x+filder->itemIndent,y+y_size/2-WIN_GetFontHight()/2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//绘制函数
|
|
|
|
|
void FILDER_DefaultPaint (WIN_FilderStruct *filder)
|
|
|
|
|
{
|
|
|
|
|
//使用双缓冲,防止闪烁
|
|
|
|
|
// LCD_LayerBufferOn();
|
|
|
|
|
|
|
|
|
|
int x=0;
|
|
|
|
|
int y=0;
|
|
|
|
|
int x_size=((WIN_WindowStruct *)filder)->x_size;
|
|
|
|
|
int y_size=((WIN_WindowStruct *)filder)->y_size;
|
|
|
|
|
char txt_buff[20]={0};
|
|
|
|
|
WIN_PaintBackGround ((WIN_WindowStruct *)filder);
|
|
|
|
|
|
|
|
|
|
//绘制滚动条
|
|
|
|
|
int scrollbar_x=x_size-filder->scrollbar_xsize;
|
|
|
|
|
int scrollbar_y=y+filder->titleHight;
|
|
|
|
|
int scrollbar_xsize=filder->scrollbar_xsize;
|
|
|
|
|
int scrollbar_ysize=y_size-scrollbar_y;
|
|
|
|
|
int scrollbar_tstart=filder->firstItemOnPage*scrollbar_ysize/filder->fileNum;
|
|
|
|
|
int scrollbar_tsize=filder->itemNumOnePage*scrollbar_ysize/filder->fileNum;
|
|
|
|
|
WIN_SetLcdColor (((WIN_WindowStruct *)filder)->color);
|
|
|
|
|
WIN_DrawHLine (scrollbar_x,scrollbar_y,scrollbar_x+scrollbar_xsize-1);
|
|
|
|
|
WIN_DrawHLine (scrollbar_x,scrollbar_y+scrollbar_ysize-1,scrollbar_x+scrollbar_xsize-1);
|
|
|
|
|
WIN_DrawVLine (scrollbar_x,scrollbar_y,scrollbar_y+scrollbar_ysize-1);
|
|
|
|
|
WIN_DrawVLine (scrollbar_x+scrollbar_xsize-1,scrollbar_y,scrollbar_y+scrollbar_ysize-1);
|
|
|
|
|
WIN_FillRectByColor (scrollbar_x,scrollbar_y+scrollbar_tstart,scrollbar_xsize,scrollbar_tsize);
|
|
|
|
|
|
|
|
|
|
//显示标题
|
|
|
|
|
WIN_SetFontMode (WIN_DRAWMODE_ALONE);
|
|
|
|
|
WIN_DrawTxtHCenterAt ("文件管理器",x_size/2,filder->titleHight/2-WIN_GetFontHight()/2);
|
|
|
|
|
|
|
|
|
|
//显示文件信息
|
|
|
|
|
sprintf (txt_buff,"%d/%d",filder->index+1,filder->fileNum);
|
|
|
|
|
WIN_DrawTxtAt (txt_buff,x_size-WIN_GetFontWidth()*strlen(txt_buff)/2-1,filder->titleHight/2-WIN_GetFontHight()/2);
|
|
|
|
|
|
|
|
|
|
//显示选中框
|
|
|
|
|
int selete_x=x;
|
|
|
|
|
int selete_y=y+filder->titleHight;
|
|
|
|
|
int selete_xsize=x_size-scrollbar_xsize-1;
|
|
|
|
|
int selete_ysize=filder->itemHight;
|
|
|
|
|
WIN_SetLcdColor (0x00ffff);
|
|
|
|
|
selete_y+=filder->itemHight*(filder->index-filder->firstItemOnPage);
|
|
|
|
|
WIN_FillRectByColorAlpha (selete_x,selete_y,selete_xsize,selete_ysize,16);
|
|
|
|
|
|
|
|
|
|
//显示文件
|
|
|
|
|
RECT_Struct rs={0};//用于裁剪绘图区的矩形
|
|
|
|
|
rs.x=x;rs.y=y+filder->titleHight;
|
|
|
|
|
rs.x_size=x_size-scrollbar_xsize-1;
|
|
|
|
|
rs.y_size=y_size-rs.y;
|
|
|
|
|
WIN_SetLcdColor (((WIN_WindowStruct *)filder)->color);
|
|
|
|
|
WIN_SetWinInvalidRect (((WIN_WindowStruct *)filder),&rs);
|
|
|
|
|
for (int i=0;i<filder->itemNumOnePage+2;i++)
|
|
|
|
|
{
|
|
|
|
|
FILDER_PaintItem(filder,i+filder->firstItemOnPage-1);
|
|
|
|
|
}
|
|
|
|
|
WIN_SetWinInvalidRect (((WIN_WindowStruct *)filder),0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
char *name;
|
|
|
|
|
char *path;
|
|
|
|
|
}sysfile_updata_struct;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int sysfile_updata (void *ptr)
|
|
|
|
|
{
|
|
|
|
|
sysfile_updata_struct *t=ptr;
|
|
|
|
|
SysFile_Updata (t->name,t->path);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void FILDER_Down (WIN_FilderStruct *filder)
|
|
|
|
|
{
|
|
|
|
|
if ( filder->index<filder->fileNum-1)
|
|
|
|
|
{
|
|
|
|
|
FILDER_SetIndex(filder,filder->index+1);
|
|
|
|
|
if (filder->index>=filder->firstItemOnPage+filder->itemNumOnePage)
|
|
|
|
|
{
|
|
|
|
|
filder->firstItemOnPage++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
FILDER_SetIndex(filder,0);
|
|
|
|
|
filder->firstItemOnPage=0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void FILDER_Up (WIN_FilderStruct *filder)
|
|
|
|
|
{
|
|
|
|
|
if ( filder->index>0)
|
|
|
|
|
{
|
|
|
|
|
FILDER_SetIndex(filder,filder->index-1);
|
|
|
|
|
if (filder->index<filder->firstItemOnPage)
|
|
|
|
|
{
|
|
|
|
|
filder->firstItemOnPage--;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
FILDER_SetIndex(filder,filder->fileNum-1);
|
|
|
|
|
if (filder->fileNum>filder->itemNumOnePage)
|
|
|
|
|
filder->firstItemOnPage=filder->fileNum-filder->itemNumOnePage;
|
|
|
|
|
else filder->firstItemOnPage=0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int g_send_file(void *t);
|
|
|
|
|
static int set_progress(int now,int all);
|
|
|
|
|
static void get_progress(int *now,int *all);
|
|
|
|
|
static int g_send(void *data,int size);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void FILDER_Enter (WIN_FilderStruct *filder,int x,int y)
|
|
|
|
|
{
|
|
|
|
|
//打开
|
|
|
|
|
if (FILDER_DirAppend (filder,&filder->file[filder->index])==-1)
|
|
|
|
|
{
|
|
|
|
|
//是文件,在此做文件的处理
|
|
|
|
|
int index=POPUP_SelectItem ((WIN_WindowStruct *)filder,(char **)g_popup_itmes,6,x,y);
|
|
|
|
|
if (index==0)
|
|
|
|
|
{
|
|
|
|
|
FILDER_OpenFile(filder);
|
|
|
|
|
}
|
|
|
|
|
else if (index==1)
|
|
|
|
|
{
|
|
|
|
|
//重命名
|
|
|
|
|
char *txt_buff=mymalloc (256);
|
|
|
|
|
mymemcpy (txt_buff,filder->file[filder->index].name,strlen(filder->file[filder->index].name)+1);
|
|
|
|
|
if (INPUT_KeyBoard ((WIN_WindowStruct *)filder,txt_buff,256)==1)
|
|
|
|
|
{
|
|
|
|
|
char *txt_path_old=mymalloc (256);
|
|
|
|
|
FILDER_GetFileRoute (filder);
|
|
|
|
|
mymemcpy (txt_path_old,filder->fileName,strlen(filder->fileName)+1);//原始路径
|
|
|
|
|
mymemcpy (filder->file[filder->index].name,txt_buff,strlen(txt_buff)+1);//新文件名
|
|
|
|
|
FILDER_GetFileRoute (filder);//新路径
|
|
|
|
|
if (f_rename (txt_path_old,filder->fileName)==FR_OK)
|
|
|
|
|
{
|
|
|
|
|
MSGBOX_TipsTime ((WIN_WindowStruct *)filder,"提示","文件名修改成功","确定",5000);
|
|
|
|
|
}else
|
|
|
|
|
{
|
|
|
|
|
MSGBOX_TipsTime ((WIN_WindowStruct *)filder,"提示","文件名修改失败","确定",5000);
|
|
|
|
|
}
|
|
|
|
|
myfree (txt_path_old);
|
|
|
|
|
}
|
|
|
|
|
myfree(txt_buff);
|
|
|
|
|
}
|
|
|
|
|
else if (index==2)
|
|
|
|
|
{
|
|
|
|
|
//复制到系统文件
|
|
|
|
|
FILDER_GetFileRoute(filder);
|
|
|
|
|
//SysFile_Updata (filder->file[filder->index].name,filder->fileName);
|
|
|
|
|
sysfile_updata_struct upd={0};
|
|
|
|
|
upd.name=filder->file[filder->index].name;
|
|
|
|
|
upd.path=filder->fileName;
|
|
|
|
|
WORKING_DoWork ((WIN_WindowStruct *)filder,"正在复制文件到系统。。。",sysfile_updata,&upd);
|
|
|
|
|
|
|
|
|
|
MSGBOX_TipsTime ((WIN_WindowStruct *)filder,"提示","已复制到系统文件","确定",5000);
|
|
|
|
|
}
|
|
|
|
|
else if (index==3)
|
|
|
|
|
{
|
|
|
|
|
//文件信息
|
|
|
|
|
char *txt_buff=mymalloc (512);
|
|
|
|
|
FILDER_GetFileRoute(filder);
|
|
|
|
|
sprintf (txt_buff,"路径:%s\n大小:%lld Byte",filder->fileName,filder->file[filder->index].size);
|
|
|
|
|
MSGBOX_Tips((WIN_WindowStruct *)filder,"文件信息",txt_buff,"确定");
|
|
|
|
|
myfree(txt_buff);
|
|
|
|
|
}
|
|
|
|
|
else if (index==4)
|
|
|
|
|
{
|
|
|
|
|
//删除
|
|
|
|
|
if (MSGBOX_Inquiry((WIN_WindowStruct *)filder,"警告","确定删除这个文件吗?","确定","取消")==0)
|
|
|
|
|
{
|
|
|
|
|
FILDER_GetFileRoute(filder);
|
|
|
|
|
if (f_unlink(filder->fileName)==FR_OK)
|
|
|
|
|
{
|
|
|
|
|
MSGBOX_TipsTime ((WIN_WindowStruct *)filder,"提示","文件已删除","确定",5000);
|
|
|
|
|
FILDER_ClearItem(filder);
|
|
|
|
|
FILDER_ScanFile (filder);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
MSGBOX_TipsTime ((WIN_WindowStruct *)filder,"提示","删除文件失败","确定",5000);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if(index==5)
|
|
|
|
|
{
|
|
|
|
|
// 发送
|
|
|
|
|
FILDER_GetFileRoute(filder);
|
|
|
|
|
SysFile_SendStruct send;
|
|
|
|
|
SysFile_SendFileInit(&send,filder->file[filder->index].name,filder->fileName,
|
|
|
|
|
g_send,set_progress);
|
|
|
|
|
int ret=WORKING_DoWorkPro((WIN_WindowStruct *)filder,"正在发送文件",g_send_file,&send,
|
|
|
|
|
0,0,get_progress,25);
|
|
|
|
|
if(ret==0)
|
|
|
|
|
MSGBOX_TipsTime ((WIN_WindowStruct *)filder,"提示","文件发送成功","确定",5000);
|
|
|
|
|
else
|
|
|
|
|
MSGBOX_TipsTime ((WIN_WindowStruct *)filder,"提示","文件发送失败","确定",5000);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}//if (FILDER_DirAppend (filder,&filder->file[filder->index])==-1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int g_send_now;
|
|
|
|
|
static int g_send_all;
|
|
|
|
|
static int set_progress(int now,int all)
|
|
|
|
|
{
|
|
|
|
|
g_send_now=now;
|
|
|
|
|
g_send_all=all;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
static void get_progress(int *now,int *all)
|
|
|
|
|
{
|
|
|
|
|
*now=g_send_now;
|
|
|
|
|
*all=g_send_all;
|
|
|
|
|
}
|
|
|
|
|
static int g_send(void *data,int size)
|
|
|
|
|
{
|
|
|
|
|
if(nrf_send(data,size,0)==NRF_OK)
|
|
|
|
|
return 0;
|
|
|
|
|
else return -1;
|
|
|
|
|
}
|
|
|
|
|
static int g_send_file(void *t)
|
|
|
|
|
{
|
|
|
|
|
g_send_now=0;
|
|
|
|
|
g_send_all=0;
|
|
|
|
|
SysFile_SendStruct *send=t;
|
|
|
|
|
int ret=0;
|
|
|
|
|
ret=SysFile_SendFileName(send);
|
|
|
|
|
if(ret!=0) return ret;
|
|
|
|
|
|
|
|
|
|
ret=SysFile_SendFileInfo(send);
|
|
|
|
|
if(ret!=0) return ret;
|
|
|
|
|
|
|
|
|
|
ret=SysFile_SendFileData(send);
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void FILDER_Home (WIN_FilderStruct *filder)
|
|
|
|
|
{
|
|
|
|
|
//后退
|
|
|
|
|
if (FILDER_DirCut (filder)==-1)
|
|
|
|
|
{
|
|
|
|
|
//是根目录了,退出文件管理器
|
|
|
|
|
((WIN_WindowStruct *)filder)->deleteWindow((WIN_WindowStruct *)filder);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int FILDER_GetTouchIndex(WIN_FilderStruct *filder,int x,int y)
|
|
|
|
|
{
|
|
|
|
|
if(y<filder->titleHight) return -1;
|
|
|
|
|
return (y-filder->titleHight)/filder->itemHight+filder->firstItemOnPage;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int FILDER_SetIndex(WIN_FilderStruct *filder,int index)
|
|
|
|
|
{
|
|
|
|
|
int x_size=((WIN_WindowStruct *)filder)->x_size-filder->itemIndent;
|
|
|
|
|
Filder_FildInfo *file=&filder->file[index];
|
|
|
|
|
filder->scroll_xsize=(strlen(file->name)+4)*WIN_GetFontWidth()/2;
|
|
|
|
|
if(filder->scroll_xsize>x_size)
|
|
|
|
|
{
|
|
|
|
|
if(filder->scroll_timer==0)
|
|
|
|
|
filder->scroll_timer=WIN_CreatTimer((WIN_WindowStruct *)filder,50);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if(filder->scroll_timer)
|
|
|
|
|
WIN_DeleteTimer(filder->scroll_timer);
|
|
|
|
|
filder->scroll_timer=0;
|
|
|
|
|
}
|
|
|
|
|
filder->index=index;
|
|
|
|
|
filder->scroll_x=0;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FILDER_ScrollTimer(WIN_FilderStruct *filder)
|
|
|
|
|
{
|
|
|
|
|
int x_size=((WIN_WindowStruct *)filder)->x_size-filder->itemIndent;
|
|
|
|
|
int y=(filder->index-filder->firstItemOnPage)*filder->itemHight+filder->titleHight;
|
|
|
|
|
if(filder->scroll_x+filder->scroll_xsize>x_size)
|
|
|
|
|
{
|
|
|
|
|
filder->scroll_x-=3;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
filder->scroll_x=4*WIN_GetFontWidth()/2;
|
|
|
|
|
}
|
|
|
|
|
WIN_SetInvalidRectWhenTop ((WIN_WindowStruct *)filder,filder->itemIndent,y,x_size,filder->itemHight);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define FIRST_ADD() {if (filder->firstItemOnPage<filder->fileNum-filder->itemNumOnePage) {filder->firstItemOnPage++;\
|
|
|
|
|
if(filder->index<filder->firstItemOnPage) FILDER_SetIndex(filder,filder->firstItemOnPage);\
|
|
|
|
|
filder->y_off+=filder->itemHight;}else filder->y_off=0;}
|
|
|
|
|
#define FIRST_SUB() {if (filder->firstItemOnPage>0) {filder->firstItemOnPage--;\
|
|
|
|
|
if(filder->index>filder->firstItemOnPage+filder->itemNumOnePage-1)\
|
|
|
|
|
FILDER_SetIndex(filder,filder->firstItemOnPage+filder->itemNumOnePage-1);\
|
|
|
|
|
filder->y_off-=filder->itemHight;}else filder->y_off=0;}
|
|
|
|
|
|
|
|
|
|
#define IS_MIDDLE() (filder->firstItemOnPage>0||m->y_move<0)&&(filder->firstItemOnPage<filder->fileNum-filder->itemNumOnePage||m->y_move>0)
|
|
|
|
|
|
|
|
|
|
//消息处理函数
|
|
|
|
|
void FILDER_defaultMsgLoop (WIN_FilderStruct *filder,WIN_MsgStruct *msg)
|
|
|
|
|
{
|
|
|
|
|
WIN_MoveStruct *m=0;
|
|
|
|
|
WIN_KeyStruct *k=0;
|
|
|
|
|
switch (msg->msg)
|
|
|
|
|
{
|
|
|
|
|
case WIN_MSG_PAINT:
|
|
|
|
|
FILDER_DefaultPaint(filder);
|
|
|
|
|
break;
|
|
|
|
|
case WIN_MSG_TIMER:
|
|
|
|
|
if (msg->data.v==filder->scroll_timer)
|
|
|
|
|
{
|
|
|
|
|
FILDER_ScrollTimer(filder);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case WIN_MSG_KEY:
|
|
|
|
|
k=msg->data.p;
|
|
|
|
|
//收到确定或返回键
|
|
|
|
|
if (k->shortPress& KEY_VALUE_DOWN)
|
|
|
|
|
{
|
|
|
|
|
FILDER_Down(filder);
|
|
|
|
|
}//if (k->shortPress&KEY_VALUE_DOWN)
|
|
|
|
|
else if (k->shortPress&KEY_VALUE_UP)
|
|
|
|
|
{
|
|
|
|
|
FILDER_Up(filder);
|
|
|
|
|
}//else if (k->shortPress&KEY_VALUE_UP)
|
|
|
|
|
else if (k->shortPress&KEY_VALUE_ENTER)
|
|
|
|
|
{
|
|
|
|
|
FILDER_Enter(filder,100,100);
|
|
|
|
|
}
|
|
|
|
|
else if (k->shortPress&KEY_VALUE_HOME)
|
|
|
|
|
{
|
|
|
|
|
FILDER_Home(filder);
|
|
|
|
|
}
|
|
|
|
|
if (k->shortPress)
|
|
|
|
|
{
|
|
|
|
|
WIN_SetInvalid((WIN_WindowStruct *)filder);
|
|
|
|
|
}
|
|
|
|
|
break;//case WIN_MSG_KEY:
|
|
|
|
|
case WIN_MSG_MOVE:
|
|
|
|
|
m=msg->data.p;
|
|
|
|
|
switch (m->moveType)
|
|
|
|
|
{
|
|
|
|
|
case MOVE_DATA_SHORT:
|
|
|
|
|
{
|
|
|
|
|
int index=FILDER_GetTouchIndex(filder,m->x_move,m->y_move);
|
|
|
|
|
if(index==filder->index)
|
|
|
|
|
{
|
|
|
|
|
FILDER_Enter(filder,m->x_move,m->y_move);
|
|
|
|
|
}
|
|
|
|
|
else if(index!=-1)
|
|
|
|
|
{
|
|
|
|
|
FILDER_SetIndex(filder,index);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
FILDER_Home(filder);
|
|
|
|
|
}
|
|
|
|
|
WIN_SetInvalid((WIN_WindowStruct *)filder);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case MOVE_DATA_MOVED:
|
|
|
|
|
if(IS_MIDDLE())
|
|
|
|
|
{
|
|
|
|
|
filder->y_off+=m->y_move;
|
|
|
|
|
if(filder->y_off>=filder->itemHight)
|
|
|
|
|
{
|
|
|
|
|
FIRST_SUB();
|
|
|
|
|
}
|
|
|
|
|
else if(filder->y_off<=-filder->itemHight)
|
|
|
|
|
{
|
|
|
|
|
FIRST_ADD();
|
|
|
|
|
}
|
|
|
|
|
if(m->y_move==0&&m->x_move==0)
|
|
|
|
|
{
|
|
|
|
|
filder->y_off=0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
filder->y_off=0;
|
|
|
|
|
}
|
|
|
|
|
WIN_SetInvalidWhenTop ((WIN_WindowStruct *)filder);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
WIN_DefaultMsgLoop ((WIN_WindowStruct *)filder,msg);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case WIN_MSG_CHID:
|
|
|
|
|
switch (msg->data.v)
|
|
|
|
|
{
|
|
|
|
|
case CHID_DELETE:
|
|
|
|
|
break;
|
|
|
|
|
case CHID_USER:
|
|
|
|
|
{
|
|
|
|
|
if (msg->data2.v==BUTTON_PRESSED)
|
|
|
|
|
{
|
|
|
|
|
// if (msg->srcWin==filder->key_back)
|
|
|
|
|
// {
|
|
|
|
|
// //返回
|
|
|
|
|
// FILDER_Home(filder);
|
|
|
|
|
// }
|
|
|
|
|
// else if (msg->srcWin==filder->key_up)
|
|
|
|
|
// {
|
|
|
|
|
// FILDER_Up(filder);
|
|
|
|
|
// }
|
|
|
|
|
// else if (msg->srcWin==filder->key_down)
|
|
|
|
|
// {
|
|
|
|
|
// FILDER_Down(filder);
|
|
|
|
|
// }
|
|
|
|
|
// else if (msg->srcWin==filder->key_enter)
|
|
|
|
|
// {
|
|
|
|
|
// FILDER_Enter(filder);
|
|
|
|
|
// }
|
|
|
|
|
// WIN_SetInvalid((WIN_WindowStruct *)filder);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
WIN_DefaultMsgLoop((WIN_WindowStruct *)filder,msg);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//选则文件
|
|
|
|
|
int FILDER_ChooseFile (WIN_WindowStruct *win,char *dir)
|
|
|
|
|
{
|
|
|
|
|
WIN_FilderStruct *filder=0;
|
|
|
|
|
if (win)
|
|
|
|
|
{
|
|
|
|
|
filder=WIN_CreatFilder (win,0,0,0,win->x_size,win->y_size);
|
|
|
|
|
}
|
|
|
|
|
else filder=WIN_CreatFilder (0,0,0,0,WIN_GetWinStruct()->lcd->getLcdSizeX(),WIN_GetWinStruct()->lcd->getLcdSizeY());
|
|
|
|
|
WIN_SetBackPicPath ((WIN_WindowStruct *)filder,win->pic_path);
|
|
|
|
|
FILDER_SetFileDir (filder,dir);
|
|
|
|
|
WIN_ShowWindow((WIN_WindowStruct *)filder);
|
|
|
|
|
//return WIN_RunBlock ((WIN_WindowStruct *)filder);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|