2008-11-03 14:17:17 +01:00
//Leency & Veliant -=- KolibriOS Team -=- 2008
#codesize
#include "lib\kolibri.h--"
#include "lib\memory.h--"
#include "lib\edit_box_lib.h--"
2008-11-26 03:02:31 +01:00
#include "lib\file_system.h--"
2008-11-24 01:49:58 +01:00
#include "imgs\toolbar.txt"
2008-11-26 03:02:31 +01:00
#include "imgs\left_p.txt"
2008-11-03 14:17:17 +01:00
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-12-05 20:59:10 +01:00
#define header "Eolite File Manager v0.97.2"
#define videlenie 0x94AECE //0x94AECE,0xFEA4B7,0x8BCDFF,0xB8C9B8}; //<2F> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-11-24 01:49:58 +01:00
byte toolbar_buttons_x[6]={14,51,90,139,172,208};
2008-11-03 14:17:17 +01:00
//
2008-11-26 03:02:31 +01:00
dword but_num, kolichestvo, za_kadrom, curbtn, razm_scrl;
2008-11-03 14:17:17 +01:00
byte cut_active, rename_active, del_active;
byte show_actions=1, show_preview=0, sort_num=1, isdir;
2008-11-26 03:02:31 +01:00
char path[256]="/rd/1/", edit_path[256], PathHistory[2560], temp[256]; //<2F> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
char file_path[256], file_name[256]; //<2F> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
char copyfile[256],copy_name[256]; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-11-03 14:17:17 +01:00
dword file_mas[6898]; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-11-26 03:02:31 +01:00
int temp_int, j, i;
2008-11-03 14:17:17 +01:00
dword stak[100]=0; //<2F> <> <EFBFBD> <EFBFBD> About
edit_box edit1= {250,252,17,0xffffff,0x94AECE,0xD3DDEB,0xffffff,0,248,#edit_path,64,6,6};
edit_box edit2= {250,218,80,0xFFFFCC,0x94AECE,0xFFFFCC,0xffffff,0,248,#file_name,64,6,6};
proc_info Form;
dword buf=0, off; //<2F> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
dword devbuf=0, dev_num;
#include "include\LVabout.c--"
2008-11-24 01:49:58 +01:00
#include "include\icons_f.h--"
2008-11-03 14:17:17 +01:00
2008-11-26 03:02:31 +01:00
//IPC
2008-12-05 20:59:10 +01:00
#include "lib\Nable_lib.h--"
2008-11-26 03:02:31 +01:00
#include "lib\ipc.h--"
int pLoadedImage;
void GetImage(dword ipath)
{
IF (pLoadedImage) free(pLoadedImage);
pLoadedImage=loadimage_viaIPC(ipath, #CurrentImage);
SetEventMask(100111b); //restore normal event mask
2008-12-05 20:59:10 +01:00
}
2008-11-26 03:02:31 +01:00
2008-11-03 14:17:17 +01:00
void main()
byte pressed, key, id;
mouse m;
2008-11-26 03:02:31 +01:00
int pressed_y;
2008-11-03 14:17:17 +01:00
{
2008-12-05 20:59:10 +01:00
devbuf= malloc(3112); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> -<2D> <> <20> <> 10 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
ReadDir(10, devbuf, "/");
dev_num=EBX;
2008-11-03 14:17:17 +01:00
load_dll(); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> _<EFBFBD> <5F> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
IF (param[0]<>'') {copystr(#param,#edit_path); Goto_edit_path();}
Open_Dir(#path,2);
loop()
{
switch(WaitEvent())
{
CASE evMouse:
id = 0;
IF (del_active==1) break;
m.get();
//
IF (vert==65535) IF (curbtn==0) FileList_ReDraw(-3); ELSE FileList_ReDraw(-1);
IF (vert==1) IF (curbtn==but_num-1) FileList_ReDraw(3); ELSE FileList_ReDraw(1);
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-12-05 20:59:10 +01:00
IF (razm_scrl/2+57>m.y) || (m.y<0) || (m.y>4000) m.y=razm_scrl/2+57; //<2F> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
2008-11-03 14:17:17 +01:00
IF (m.lkm==0) pressed=0; ELSE
IF (m.x>=Form.width-21) && (m.x<=Form.width-6) pressed=1;
IF (pressed==1)
{
temp_int=za_kadrom; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-11-26 03:02:31 +01:00
j= razm_scrl/2;
za_kadrom = m.y -j -57 * kolichestvo / onTop(22,57);
2008-11-03 14:17:17 +01:00
IF (but_num+za_kadrom>kolichestvo) za_kadrom=kolichestvo-but_num;
IF (temp_int<>za_kadrom) List_ReDraw(); //<2F> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
}
break;
//Button pressed-----------------------------------------------------------------------------
case evButton:
IF (edit1.flags<>64) {edit1.flags=64; edit_box_draw stdcall(#edit1);} //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
id=GetButtonID();
2008-12-05 20:59:10 +01:00
IF (id==1) ExitProcess();
2008-11-03 14:17:17 +01:00
IF (del_active==1) {IF (id==301) || (id==302) Del_File(302-id); break;}
switch(id)
{
CASE 21: GoBack(); break;//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD>
CASE 23: IF (strcmp(#path,"/")<>0) Dir_Up(); break;//up!
CASE 24: key=24; //cut
CASE 25: goto CTRLC_MARK; //copy
CASE 26: Paste(); break;//paste
CASE 27: Goto_edit_path(); break; //goto edit_path
CASE 31...33: //sort
IF (sort_num==id-30) break;
IF(sort_num==1)DrawBar(onLeft(197,163)/2+215,45,6,9,0xE4DFE1);
IF(sort_num==2)DrawBar(onLeft(110,0),45,6,9,0xE4DFE1);
IF(sort_num==3)DrawBar(onLeft(39,0),45,6,9,0xE4DFE1);
sort_num=id-30;
Open_Dir(#path,1);
break;
case 30: //about
EAX = 51; EBX = 1;
ECX = #authors; EDX = #stak;
$int 40h;
break;
case 50: //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
FileList_ReDraw(-1);
2008-11-26 03:02:31 +01:00
break;
2008-11-03 14:17:17 +01:00
case 51: //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
FileList_ReDraw(1);
2008-11-26 03:02:31 +01:00
break;
2008-11-03 14:17:17 +01:00
case 78: //preview
IF (show_preview==1) show_preview=0; ELSE show_preview=1;
Preview();
2008-11-26 03:02:31 +01:00
break;
2008-11-03 14:17:17 +01:00
case 77: //actions
IF (show_actions==1) show_actions=0; ELSE show_actions=1;
Actions(); Preview();
2008-11-26 03:02:31 +01:00
break;
case 80: //rename
goto REN_MARK;
case 81: //Delete file
Del_Form();
break;
case 82: //create folder
NEW_FOLDER_MARK:
copystr(#path, #temp);
copystr("New folder", #temp+strlen(#temp));
CreateFolder(#temp);
za_kadrom=curbtn=0;
Open_Dir(#path,1);
FOR (i=0; i<kolichestvo; i++)
IF (strcmp("New folder",file_mas[i]*304+buf+72)==0) {IF(!strcmp("..",buf+72+304))i--; FileList_ReDraw(i); break;}
goto REN_MARK;
case 100...120:
DEVICE_MARK:
copystr(id-100*304+ devbuf+72, #path);
IF (path[0]=='r') copystr("/rd/1",#file_path);
ELSE {
copystr("/", #file_path);
copystr(#path, #file_path+strlen(#file_path));
}
goto OPEN_DEV;
default:
if (id<200) break; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
IF (curbtn!=id-201) {FileList_ReDraw(id-201-curbtn); break;}
else OPEN_MARK:
if (!isdir) Run_File(#file_path); else
if (strcmp(za_kadrom+curbtn+1*304 + buf+72,"..")==0) Dir_Up(); else
{ OPEN_DEV:
copystr(#file_path, #path);
copystr("/", #path+strlen(#path));
DrawBar(197,curbtn*18+57,onLeft(22,197),18,0xFFFFFF); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
za_kadrom=curbtn=0;
Open_Dir(#path,1);
2008-11-03 14:17:17 +01:00
}
2008-11-26 03:02:31 +01:00
break;
2008-11-03 14:17:17 +01:00
}
break;
//Key pressed-----------------------------------------------------------------------------
case evKey:
key = GetKey();
IF (del_active==1)
{
IF (key==013) Del_File(true);
IF (key==027) Del_File(false);
break;
}
2008-11-24 01:49:58 +01:00
IF (edit1.flags<>64) && (key<>13) {EAX=key<<8; edit_box_key stdcall (#edit1); break;}
IF (edit2.flags<>64) && (key<>13) && (key<>27) {EAX=key<<8; edit_box_key stdcall (#edit2); break;}
2008-11-03 14:17:17 +01:00
switch (key)
{
case 209...217: id=key-109; IF(dev_num>id-100)GOTO DEVICE_MARK; break;
case 8: GoBack(); break; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD>
2008-11-26 03:02:31 +01:00
case 014: MoveSize(80,80,OLD,OLD); RunProgram("/sys/File Managers/Eolite", #path); break; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
2008-11-03 14:17:17 +01:00
case 024: //Ctrl+X cut
case 089: //Ctrl+Ins copy
case 003: //Ctrl+C copy
CTRLC_MARK:
IF (isdir) break; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
copystr(#file_name,#copy_name);
copystr(#file_path,#copyfile); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
IF (key==24) cut_active=1; ELSE cut_active=0;
break;
case 022: Paste(); break;//Ctrl+V paste
case 027: //Esc
2008-11-26 03:02:31 +01:00
IF (rename_active==1) {Line_ReDraw(videlenie, 100);}
2008-11-03 14:17:17 +01:00
break;
case 013: //Enter
IF (rename_active==1) {Line_ReDraw(videlenie, curbtn); break;}
IF (strcmp(#path,#edit_path)<>0) Goto_edit_path();
ELSE GOTO OPEN_MARK;
break;
2008-11-26 03:02:31 +01:00
case 55: //F6 - new folder
goto NEW_FOLDER_MARK;
2008-11-03 14:17:17 +01:00
case 56: //IF (rename_active==1) break;//up
case 178: //up
FileList_ReDraw(-1);
break;
case 177: //down
FileList_ReDraw(1);
break;
case 180: //home
FileList_ReDraw(-za_kadrom-curbtn);
break;
case 181: //end
FileList_ReDraw(kolichestvo-za_kadrom-curbtn+but_num);
break;
case 183: //Page Down
FileList_ReDraw(but_num-1);
break;
case 184: //Page Up
FileList_ReDraw(-but_num+1);
break;
case 051: //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> F2
2008-11-26 03:02:31 +01:00
REN_MARK:
//IF (isdir==1) break; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
edit2.flags=66; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
DeleteButton(curbtn+201); //<2F> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
edit2.width=onLeft(24,217);
edit2.top=curbtn*18+59+skin_width;
edit2.size=strlen(#file_name); edit2.pos=strlen(#file_name);
edit_box_draw stdcall (#edit2);
DrawBar(218,curbtn*18+58,edit2.width+1,1,0xFFFFCC); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
rename_active=1;
break;
2008-11-03 14:17:17 +01:00
case 052: //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> F3
2008-11-26 03:02:31 +01:00
IF (isdir==false) RunProgram("/sys/tinypad", #file_path); break;
2008-11-24 01:49:58 +01:00
case 054: Open_Dir(#path,1); break; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> F5
case 182: Del_Form(); break; //delete file
default:
IF (strcmp("..",buf+72+304)<>0) temp_int=0; ELSE temp_int=1;
for (i=curbtn+za_kadrom+1; i<kolichestvo; i++)
{
copystr(file_mas[i+temp_int]*304+buf+72,#temp);
AL=DSBYTE[#temp];
IF(AL>='A')&&(AL<='Z')DSBYTE[#temp]=AL|0x20;
IF (temp[0]==key) {FileList_ReDraw(i-curbtn-za_kadrom); break;}
}
2008-11-03 14:17:17 +01:00
}
break;
case evReDraw: draw_window(); BREAK;
}
IF (rename_active==0) edit_box_mouse stdcall(#edit1); ELSE edit_box_mouse stdcall(#edit2);
}
}
inline fastcall void draw_window()
{
WindowRedrawStatus(1);
skin_width = GetSkinWidth();
2008-11-26 03:02:31 +01:00
DefineAndDrawWindow(100,100,600,410,0x43,0x10E4DFE1,0,0,header);
Form.GetInfo(SelfInfo);
2008-11-03 14:17:17 +01:00
IF (Form.height==skin_width+3) {WindowRedrawStatus(2); return;} //<2F> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> !
IF (Form.height<280) MoveSize(OLD,OLD,OLD,280);
IF (Form.width<480) MoveSize(OLD,OLD,480,OLD);
//toolbar buttons
2008-11-24 01:49:58 +01:00
PutPaletteImage(#toolbar,246,39,5,0,#toolbar_pal);
2008-11-03 14:17:17 +01:00
FOR (j=0; j<6; j++) DefineButton(toolbar_buttons_x[j],5,31,29,21+j+BT_HIDE,0xE4DFE1);
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
DrawBar(251,0,onLeft(251,60),12,0xE4DFE1); //<2F> <> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
edit1.width=Form.width-314;
edit1.top=13+skin_width;
KEdit();
DrawRegion(251,12,onLeft(61,251),16,0x94AECE); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
DrawBar(251,29,onLeft(251,60),10,0xE4DFE1); //<2F> <> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
DefineButton(onLeft(34,0),6,27,28,30+BT_HIDE+BT_NOFRAME,0xE4DFE1); //about
DefineButton(onLeft(61,0),12,18,16,27+BT_HIDE,0xE4DFE1); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-11-26 03:02:31 +01:00
PutPaletteImage(#goto_about,56,40,Form.width-60,0,#goto_about_pal);
2008-11-03 14:17:17 +01:00
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
DrawRegion(6,40,Form.width-12,Form.height-skin_width-46,0x94AECE); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
DrawRegion(5,39,Form.width-10,Form.height-skin_width-44,0xE4DFE1); //<2F> <> <EFBFBD>
Devices(); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
//Buttons
DrawFlatButton(197,40,onLeft(197,163),16,31,0xE4DFE1,"File");
DrawFlatButton(onLeft(163,0),40,73,16,32,0xE4DFE1,"Type");
DrawFlatButton(onLeft(90,0),40,68,16,33,0xE4DFE1,"Size");
IF (sort_num==1) WriteText(onLeft(197,163)/2+197+18,45,0x80,0x4E78AC,"\x19",0);
ELSE IF (sort_num==2) WriteText(onLeft(110,0),45,0x80,0x4E78AC,"\x19",0);
ELSE WriteText(onLeft(39,0),45,0x80,0x4E78AC,"\x19",0);
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
DrawFlatButton(onLeft(22,0),40,16,16,50,0xE4DFE1,"\x18"); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
DrawFlatButton(onLeft(22,0),onTop(22,0),16,16,51,0xE4DFE1,"\x19");//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
2008-11-24 01:49:58 +01:00
//
//DrawBar(197,57,onLeft(22,197),onTop(57,6),0xFFFFFF); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
//
2008-11-03 14:17:17 +01:00
DrawBar(onLeft(22,0),57,1,onTop(22,57),0x94AECE); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
but_num=onTop(6,57)/18;
IF (but_num>100) but_num=1; ELSE IF (kolichestvo<but_num) but_num=kolichestvo;
2008-11-24 01:49:58 +01:00
FOR (j=0;j<but_num;j++) DefineButton(197,j*18+57,onLeft(22,197),18,201+j+BT_HIDE+BT_NOFRAME,0xFFFFFF); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-11-03 14:17:17 +01:00
List_ReDraw();
IF (del_active==1) Del_Form();
2008-12-05 20:59:10 +01:00
//
2008-11-03 14:17:17 +01:00
WindowRedrawStatus(2);
}
void KEdit()
{
edit1.size=strlen(#edit_path); edit1.pos=strlen(#edit_path);
edit_box_draw stdcall (#edit1);
}
inline fastcall void TVScroll() { //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-12-05 20:59:10 +01:00
dword on_y;
IF (kolichestvo<=0) {DrawFlatButton(onLeft(22,0),57,16,onTop(22,58),0,0xE4DFE1,""); return;}
on_y = za_kadrom * onTop(22,57) / kolichestvo +57;
2008-11-03 14:17:17 +01:00
razm_scrl=onTop(22,57) * but_num - but_num / kolichestvo;
IF (razm_scrl<20) razm_scrl = 20; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
IF (razm_scrl>onTop(22,57)-on_y+56) || (za_kadrom+but_num>=kolichestvo) on_y=onTop(23+razm_scrl,0); //<2F> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
DrawFlatButton(onLeft(22,0),on_y,16,razm_scrl,0,0xE4DFE1,"");//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
DrawBar(onLeft(21,0),57,15,on_y-57,0xCED0D0);//<2F> <> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
DrawBar(onLeft(21,0),on_y+razm_scrl+1,15,onTop(22,57)-razm_scrl-on_y+56,0xCED0D0); //<2F> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
}
void FileList_ReDraw(int curbtn_)
{
if (curbtn_<=0) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD>
{
IF (za_kadrom==0) && (curbtn==0) return;
IF (-curbtn_-1<curbtn)
{
Line_ReDraw(0xFFFFFF, curbtn); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
curbtn+=curbtn_;
Line_ReDraw(videlenie, curbtn); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
return;
}
ELSE
{
IF (-curbtn_<za_kadrom) za_kadrom+=curbtn_; ELSE za_kadrom=0;
curbtn=0;
List_ReDraw();
return;
}
}
else //<2F> <> <EFBFBD> <EFBFBD>
{
IF (za_kadrom==kolichestvo-but_num) && (curbtn==but_num-1) return;
IF (but_num-curbtn>curbtn_)
{
Line_ReDraw(0xFFFFFF, curbtn); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
curbtn+=curbtn_;
Line_ReDraw(videlenie, curbtn); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
return;
}
ELSE
{
IF(but_num+za_kadrom+curbtn_>=kolichestvo) za_kadrom=kolichestvo-but_num; ELSE za_kadrom+=curbtn_+curbtn-but_num+1;
curbtn=but_num;
List_ReDraw();
}
}
}
void List_ReDraw()
{
IF (kolichestvo-za_kadrom<but_num) //<2F> <> <EFBFBD> <EFBFBD> <20> <> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{ za_kadrom=kolichestvo-but_num; DrawBar(197,curbtn*18+57,onLeft(22,197),18,0xFFFFFF); curbtn=but_num-1; }
ELSE IF (curbtn>but_num-1) curbtn=but_num-1; //<2F> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
//
FOR (j=0; j<but_num; j++) IF (curbtn<>j) Line_ReDraw(0xFFFFFF, j); ELSE Line_ReDraw(videlenie, curbtn);
2008-11-24 01:49:58 +01:00
temp_int=but_num*18+57;
2008-11-03 14:17:17 +01:00
DrawBar(197,temp_int,onLeft(22,197),onTop(temp_int,6),0xFFFFFF); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
DrawBar(onLeft(163,0),temp_int,1,onTop(temp_int,6),0xE4DFE1); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 1
DrawBar(onLeft(90,0),temp_int,1,onTop(temp_int,6),0xE4DFE1); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 2
TVScroll();
}
void Line_ReDraw(dword color, filenum){
2008-11-26 03:02:31 +01:00
dword y;//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> Y;
2008-11-03 14:17:17 +01:00
if (rename_active==1)
{
rename_active=0;
edit2.flags=64;
2008-11-24 01:49:58 +01:00
DefineButton(197,curbtn*18+57,onLeft(22,197),18,curbtn+201+BT_HIDE+BT_NOFRAME,0xFFFFFF);
2008-11-26 03:02:31 +01:00
IF (filenum==100) filenum=curbtn; else
2008-11-03 14:17:17 +01:00
{
copystr(#path,#temp);
copystr(#file_name,#temp+strlen(#temp));
2008-11-26 03:02:31 +01:00
if (strcmp(#file_path,#temp)<>0) && (strlen(#file_name)>0)
IF (isdir)
{
//Del_File(true);
DeleleFile(#file_path);
IF (EAX<>0) {DrawFlatButton(Form.width-200+197/2,160,200,80,0,0xFFB6B5, "Error. Folder isn't empty."); Pause(200);}
ELSE CreateFolder(#temp);
Open_Dir(#path,1);
}
ELSE { CopyFile(#file_path,#temp); Del_File(true); }
2008-11-03 14:17:17 +01:00
}
}
2008-11-26 03:02:31 +01:00
y=filenum*18+57;
2008-11-24 01:49:58 +01:00
//<2F> <> , <20> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
DrawBar(197,y,3,18,color);
DrawBar(200,y,16,2,color);
DrawBar(197+19,y,onLeft(22+19,197),18,color);
DrawBar(200,y+17,16,1,color);
2008-11-03 14:17:17 +01:00
//
IF (strcmp(".",buf+72)<>0) off=file_mas[filenum+za_kadrom]*304 + buf+72; ELSE off=file_mas[filenum+za_kadrom+1]*304 + buf+72;
EAX=ESDWORD[off-40];
$shr eax,4
$and eax,1
2008-11-26 03:02:31 +01:00
IF (color==videlenie) isdir=EAX;
2008-11-24 01:49:58 +01:00
if (!EAX)
2008-11-03 14:17:17 +01:00
{
2008-11-24 01:49:58 +01:00
temp_int = Put_icon(off+strlen(off)-4, y+2);
WriteText(7-strlen(ConvertSize(ESDWORD[off-8]))*6+onLeft(75,0),y+6,0x80,0,ConvertSize(ESDWORD[off-8]),0); //size
2008-11-26 03:02:31 +01:00
} ELSE IF (!strcmp("..",off)) temp_int=Put_icon("..", y+2); ELSE temp_int=Put_icon("<DIR>", y+2);
2008-12-05 20:59:10 +01:00
if (color==videlenie)
2008-11-03 14:17:17 +01:00
{
2008-11-26 03:02:31 +01:00
IconFairing(temp_int, y+2); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-11-03 14:17:17 +01:00
copystr(#path,#file_path);
copystr(off,#file_name);
copystr(off,#file_path+strlen(#file_path)); //<2F> <> <EFBFBD> <EFBFBD> , file_path=<3D> <> <EFBFBD> <EFBFBD> <EFBFBD> , <20> .<2E> . <20> <> -<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
2008-12-05 20:59:10 +01:00
/*IF (show_preview) && (!isdir)
{
GetImage(#file_path);
j=dev_num*16+123;
j+=show_actions*51;
IF (pLoadedImage<>0) DrawImage(#CurrentImage, 22*65536+j+skin_width+18);
}*/
2008-11-03 14:17:17 +01:00
}
2008-11-24 01:49:58 +01:00
temp_int = onLeft(220,160)/6;
IF (strlen(off)<temp_int) temp_int = strlen(off); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
WriteText(220,y+6,0,0,off,temp_int); //<2F> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
DrawBar(onLeft(163,0),y,1,18,0xE4DFE1); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 1
DrawBar(onLeft(90,0),y,1,18,0xE4DFE1); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 2
2008-11-03 14:17:17 +01:00
}
void Open_Dir(dword path_,redraw){
IF (buf) free(buf);
2008-12-05 20:59:10 +01:00
//buf = malloc(2097152);
//ReadDir(6898, buf, path_);
buf = malloc(32);
ReadDir(0, buf, path_);
EAX = buf + 8;
kolichestvo = ESDWORD[EAX];
buf = realloc(kolichestvo * 304 + 32, buf);
ReadDir(kolichestvo, buf, path_);
//
2008-11-03 14:17:17 +01:00
kolichestvo=EBX;
//
if (kolichestvo<>-1) && (redraw>0)
{
FOR (j=0;j<kolichestvo;j++) {off=j*304+buf+72; IF(strcmp(path_,"/")<>0) ChangeCase(off);} //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
FOR (j=0;j<but_num;j++) DeleteButton(201+j); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
but_num=onTop(6,57)/18;
IF (strcmp(".",buf+72)==0) kolichestvo--; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> "."
//IF (strcmp(".",buf+72)==0) copystr(304+buf+72,buf);
IF (but_num>100) but_num=1; ELSE//<2F> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
IF (kolichestvo<but_num) but_num=kolichestvo;
FOR (j=0;j<but_num;j++) DefineButton(197,j*18+57,onLeft(22,197),18,201+j+BT_HIDE+BT_NOFRAME,0xFFFFFF); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
FoldesGoUp();
IF (redraw==1) List_ReDraw();
copystr(path_,#edit_path);
KEdit();
copystr("|",#PathHistory+strlen(#PathHistory));
copystr(#path,#PathHistory+strlen(#PathHistory));
}
}
void FoldesGoUp()
{
dword k=0, l=0; off=buf+72;
IF (strcmp(#path,"/rd/1/")==0) || (strcmp(#path,"/fd/1/")==0) kolichestvo--;
IF (strcmp(".",buf+72)<>0) && (strlen(#path)>6) kolichestvo--; //<2F> <> <EFBFBD> ! <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> ! <20> <> <20> <> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-11-24 01:49:58 +01:00
FOR (j=0;j<=kolichestvo;j++) //<2F> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
2008-11-03 14:17:17 +01:00
{
EAX=ESDWORD[off-40];
$shr eax,4
$and eax,1
2008-11-24 01:49:58 +01:00
IF (EAX) {file_mas[k]=j; k++;}
ELSE {file_mas[kolichestvo-l]=j; l++;}
2008-11-03 14:17:17 +01:00
off += 304;
}
switch(sort_num)
{
CASE 1: //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
WriteText(onLeft(197,163)/2+215,45,0x80,0x4E78AC,"\x19",0);
IF (strcmp(#path,"/")==0) break;
IF (strcmp("..",buf+72+304)<>0) Sort_by_Name(k,kolichestvo-1); ELSE Sort_by_Name(k,kolichestvo);
break;
case 2: //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD>
WriteText(onLeft(110,0),45,0x80,0x4E78AC,"\x19",0);
IF (strcmp("..",buf+72+304)<>0) Sort_by_Type(k, kolichestvo-1); ELSE Sort_by_Type(k, kolichestvo);
break;
case 3:
WriteText(onLeft(39,0),45,0x80,0x4E78AC,"\x19",0);
IF (strcmp("..",buf+72+304)<>0) Sort_by_Size(k,kolichestvo-1); ELSE Sort_by_Size(k,kolichestvo);
BREAK;
}
IF (strcmp(#path,"/")<>0) IF (strcmp("..",304+buf+72)<>0) Sort_by_Name(0,k-1); ELSE Sort_by_Name(2,k-1); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> !,&...
IF (strcmp(".",buf+72)<>0) && (strlen(#path)>6) kolichestvo++;
}
dword onLeft(dword right,left) {return Form.width-right-left;}
dword onTop(dword down,up) {return Form.height-skin_width-down-up;}
void Del_Form()
{
temp_int=Form.width-200+197/2;
//<2F> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
FOR (i=5;i<11;i++) DeleteButton(201+i); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
DrawFlatButton(temp_int,160,200,80,0,0xE4DFE1, ""); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD>
2008-11-26 03:02:31 +01:00
WriteText(temp_int+19,175,0x80,0,"Do you really want to delete",0);
2008-11-03 14:17:17 +01:00
IF (strlen(#file_name)<28)
{
2008-11-26 03:02:31 +01:00
WriteText(strlen(#file_name)*6+temp_int+20,190,0x80,0,"?",0);
WriteText(temp_int+20,190,0x80,0,#file_name,0); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD>
2008-11-03 14:17:17 +01:00
}
ELSE
{
2008-11-26 03:02:31 +01:00
WriteText(164+temp_int,190,0x80,0,"...?",0);
2008-11-03 14:17:17 +01:00
WriteText(temp_int+20,190,0,0,#file_name,24); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD>
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
DrawFlatButton(temp_int+20,208,70,20,301,0xFFB6B5,"Yes");
DrawFlatButton(temp_int+111,208,70,20,302,0xC6DFC6,"No");
del_active=1;
}
2008-11-24 01:49:58 +01:00
2008-12-05 20:59:10 +01:00
2008-11-03 14:17:17 +01:00
void Del_File(byte dodel)
2008-11-24 01:49:58 +01:00
{
2008-11-26 03:02:31 +01:00
IF (dodel==true)
{
DeleleFile(#file_path);
IF (EAX<>0) && (isdir==true) {DrawFlatButton(temp_int,160,200,80,0,0xFFB6B5, "Error. Folder isn't empty."); Pause(200);}
}
del_active=0;
DeleteButton(301); DeleteButton(302); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Yes/No
Open_Dir(#path,1);
}
2008-11-03 14:17:17 +01:00
void Paste()
{
IF (strcmp(#copyfile,"")==0) return; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
copystr(#path,#temp);
copystr(#copy_name,#temp+strlen(#temp));
if (strcmp(#copyfile,#temp)==0) //<2F> <> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
{
copystr(#path,#temp);
copystr("new_",#temp+strlen(#temp));
copystr(#copy_name,#temp+strlen(#temp));
}
CopyFile(#copyfile,#temp);
IF (cut_active==1) //<2F> <> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
copystr(#copyfile,#file_path);
Del_File(true);
copyfile='';
cut_active=0;
}
Open_Dir(#path,1);
}
void Tip(int y, dword caption, id, arrow)
{
DrawBar(22,y,160,17,0xE4DFE1); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
WriteText(30,y+5,0x80,0,caption,0); //text Goto:
IF (id<>0) DefineButton(164,y+1,16,16,id+BT_HIDE+BT_NOFRAME,0xE4DFE1); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
WriteText(170,y+5,0x80,0,arrow,0); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
DrawBar(22,y+17,160,1,0x94AECE); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
}
void Devices()
{
byte dev_icon; dword drive_name[30]; char dev_name[4];
DrawBar(7,41,190,15,0x00699C); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> - <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
DrawBar(7,56,15,onTop(21,41),0x00699C); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> - <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
DrawBar(182,56,15,onTop(21,41),0x00699C); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> - <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
Tip(56, "Goto:", 0, "");
DrawBar(22,74,160,dev_num*16+1,0xFFFFFF); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD>
for (i=0;i<dev_num;i++)
{
DefineButton(22,i*16+74,159,16,100+i+BT_HIDE,0xE4DFE1); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
copystr("Unknown drive",#drive_name); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
dev_icon=3; //<2F> <> -<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
copystr(i*304+ devbuf+72, #dev_name);
IF (dev_name[0]=='f') { copystr("Floppy disk /",#drive_name); dev_icon=2; }
2008-12-05 20:59:10 +01:00
IF (dev_name[0]=='h') copystr("Hard disk drive /",#drive_name);
IF (dev_name[0]=='b') copystr("SATA disk drive /",#drive_name);
2008-11-03 14:17:17 +01:00
IF (dev_name[0]=='c') {copystr("CD-drive /",#drive_name); dev_icon=1;}
copystr(#dev_name,#drive_name+strlen(#drive_name));
copystr("/",#drive_name+strlen(#drive_name));
IF (dev_name[0]=='r') { copystr("RAM-disk /rd/1/",#drive_name); dev_icon=0; }
WriteText(45,i*16+79,0x80,0,#drive_name,0);
PutImage(dev_icon*14*13*3+#devices,14,13,26,i*16+76);
2008-11-24 01:49:58 +01:00
}
2008-11-03 14:17:17 +01:00
Actions(); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
Preview();
}
2008-11-24 01:49:58 +01:00
2008-11-03 14:17:17 +01:00
void Actions()
{
DrawBar(22,dev_num*16+75,160,15,0x00699C); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> - <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if (show_actions==1)
{
Tip(dev_num*16+90, "Actions", 77, "\x19");
DrawBar(22,dev_num*16+108,160,51,0xFFFFFF); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD>
PutImage(#factions,16,44,26,dev_num*16+113); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
//rename file
DefineButton(22,dev_num*16+108,159,16,80+BT_HIDE,0xE4DFE1);
WriteText(47,dev_num*16+113,0x80,0,"Rename file <F2>",0);
//delete file
DefineButton(22,dev_num*16+125,159,16,81+BT_HIDE,0xE4DFE1);
WriteText(47,dev_num*16+130,0x80,0,"Delete file <Del>",0);
//create folder
DefineButton(22,dev_num*16+142,159,16,82+BT_HIDE,0xE4DFE1);
WriteText(47,dev_num*16+147,0x80,0,"Create folder <F6>",0);
DrawBar(22,dev_num*16+159,160,15,0x00699C); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> Actions
}
ELSE
{
DeleteButton(80); DeleteButton(81); DeleteButton(82);
Tip(dev_num*16+90, "Actions", 77, "\x18");
DrawBar(22,dev_num*16+108,160,51,0x00699C); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD>
}
}
void Dir_Up()
{
byte temp_[256];
i=strlen(#path)-1;
path[i]=0x00;
do i--; while (path[i]<>'/'); copystr(#path+i+1,#temp_);
path[i+1]=0x00;
ChangeCase(#temp_);
za_kadrom=curbtn=0; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
Open_Dir(#path,2);
FOR (i=kolichestvo; i>0; i--;) IF(strcmp(file_mas[i]*304+buf+72,#temp_)==0) BREAK;
//
if (i>kolichestvo-but_num)
{
za_kadrom=kolichestvo-but_num;
IF (strcmp(".",buf+72)<>0) curbtn=i-kolichestvo+but_num; ELSE curbtn=i-kolichestvo+but_num-1;
}
ELSE IF (strcmp(".",buf+72)<>0) FileList_ReDraw(i); ELSE FileList_ReDraw(i-1);
List_ReDraw();
}
void Preview()
2008-12-05 20:59:10 +01:00
{
2008-11-03 14:17:17 +01:00
dword top_pr=dev_num*16+123;
2008-11-24 01:49:58 +01:00
top_pr+=show_actions*51; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-11-03 14:17:17 +01:00
DeleteButton(78);
if (show_preview==1)
{
Tip(top_pr,"Preview",78,"\x19");
DrawBar(22,top_pr+18,160,100,0xFFFFFF); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD>
2008-12-05 20:59:10 +01:00
/*WriteText(30,top_pr+30,0x80,0,"kolichestvo:",0); WriteText(105,top_pr+30,0x80,0,IntToStr(kolichestvo),0);
WriteText(30,top_pr+40,0x80,0,"but_num:",0); WriteText(105,top_pr+40,0x80,0,IntToStr(but_num),0);
WriteText(30,top_pr+50,0x80,0,"curbtn",0); WriteText(105,top_pr+50,0x80,0,IntToStr(curbtn),0);
WriteText(30,top_pr+60,0x80,0,"ra_kadrom:",0); WriteText(105,top_pr+60,0x80,0,IntToStr(za_kadrom),0);
WriteText(30,top_pr+70,0x80,0,#file_path,0);
WriteText(30,top_pr+80,0x80,0,#file_name,0);*/
//WriteText(30,top_pr+60,0x80,0,"Not realized... I think",0);
//WriteText(30,top_pr+70,0x80,0,"it will be realired soon.",0);
DrawBar(22,top_pr+118,160,onTop(top_pr+118,6),0x00699C); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD>
2008-11-03 14:17:17 +01:00
}
2008-12-05 20:59:10 +01:00
ELSE
{
2008-11-03 14:17:17 +01:00
Tip(top_pr,"Preview",78,"\x18");
DrawBar(22,top_pr+18,160,onTop(top_pr+18,6),0x00699C); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD>
2008-12-05 20:59:10 +01:00
}
2008-11-03 14:17:17 +01:00
}
void Goto_edit_path()
{
IF (strcmp(#path,#edit_path)==0) return; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <20> <> <EFBFBD> <EFBFBD> <20> <> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
IF (strcmp(#edit_path+strlen(#edit_path)-1,"/")<>0) copystr("/",#edit_path+strlen(#edit_path)); //<2F> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> , + "/"
Open_Dir(#edit_path,0); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD>
IF (kolichestvo==-1) KEdit(); ELSE //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{za_kadrom=curbtn=0; copystr(#edit_path,#path);}//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
Open_Dir(#path,1);
}
inline fastcall void GoBack() //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> , <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> , <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
//char old_dir[256]='';
i=strlen(#PathHistory)-2;
//
//WHILE (PathHistory[i]<>'/') { copystr(#PathHistory[i],#old_dir); i--; };
//old_dir[strlen(#old_dir)-1]=0x00;
//DrawTitle(#old_dir);
//
WHILE (PathHistory[i]<>'|') { i--; };
IF (i>0) PathHistory[i]=0x00;
WHILE (PathHistory[i]<>'|') { copystr(#PathHistory[i],#path); i--; }
IF (i>0) PathHistory[i]=0x00;
za_kadrom=curbtn=0; Open_Dir(#path,1);
//FOR (i=0; i<kolichestvo; i++;) IF (strcmp(file_mas[i]*304+buf+72,#old_dir)==0) {curbtn=3; za_kadrom=i-3; Open_Dir(#path,1); return;}
}
stop: