2012-03-22 14:33:15 +01:00
//Leency & Veliant -=- KolibriOS Team -=- 2012
2010-02-15 02:23:03 +01:00
//GNU GPL licence.
2008-12-19 03:44:13 +01:00
2012-04-08 00:07:32 +02:00
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
2012-04-08 00:22:19 +02:00
//IF (strcmp(#path+strlen(#path)-1,"/")<>0) copystr("/",#path+strlen(#path)); //<2F> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> , + "/" <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2012-05-13 13:42:55 +02:00
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
2012-04-08 00:07:32 +02:00
2012-04-05 00:18:49 +02:00
#include "lib\kolibri.h"
#include "lib\memory.h"
#include "lib\edit_box_lib.h"
#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
2012-03-30 12:00:24 +02:00
int BUTTON_HEIGHT=18;
2011-08-27 23:37:45 +02:00
//for OpenDir
#define ONLY_SHOW 0
#define WITH_REDRAW 1
#define ONLY_OPEN 2
2011-07-30 16:59:48 +02:00
2008-12-29 02:49:26 +01:00
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2012-05-13 13:42:55 +02:00
#define title "Eolite File Manager v1.22"
2012-04-05 00:18:49 +02:00
dword videlenie=0x94AECE; //<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-03 14:17:17 +01:00
//
2008-12-29 02:49:26 +01:00
int but_num,
2008-12-20 04:38:10 +01:00
count,
2008-12-19 03:44:13 +01:00
za_kadrom,
curbtn,
2012-05-13 13:42:55 +02:00
disc_num,
2008-12-20 04:38:10 +01:00
scroll_size;
2008-12-19 03:44:13 +01:00
byte cut_active,
rename_active,
del_active;
byte show_actions=1,
2012-05-13 13:42:55 +02:00
show_dev_name=1,
2008-12-19 03:44:13 +01:00
sort_num=2,
isdir;
2012-04-05 00:18:49 +02:00
char path[4096],
2010-02-15 02:23:03 +01:00
edit_path[4096],
file_path[4096],
file_name[4096],
copy_file[4096],
temp[4096];
2012-05-13 13:42:55 +02:00
2008-12-19 03:44:13 +01:00
2012-04-05 00:18:49 +02:00
int toolbar_buttons_x[6]={9,46,85,134,167,203};
2008-12-19 03:44:13 +01:00
dword file_mas[6898];
2009-10-17 06:13:20 +02:00
int j, i, mouse_dd;
2008-12-19 03:44:13 +01:00
2012-04-08 00:07:32 +02:00
struct path_string {
char Item[4096];
};
2012-05-13 13:42:55 +02:00
path_string disk_list[20];
2011-10-05 11:50:43 +02:00
dword stak[100]; //<2F> <> <EFBFBD> <EFBFBD> About
2008-11-03 14:17:17 +01:00
2012-04-05 00:18:49 +02:00
edit_box edit1= {250,247,13,0xffffff,0x94AECE,0xD3DDEB,0xffffff,0,248,#edit_path,#mouse_dd,64,6,6};
edit_box edit2= {250,213,80,0xFFFFCC,0x94AECE,0xFFFFCC,0xffffff,0,248,#file_name,#mouse_dd,64,6,6};
2008-11-03 14:17:17 +01:00
2008-12-19 03:44:13 +01:00
proc_info Form;
2008-12-29 02:49:26 +01:00
dword buf, off; //<2F> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-11-03 14:17:17 +01:00
2012-04-05 00:18:49 +02:00
#include "include\about_dialog.h"
#include "include\some_code.h"
#include "include\sorting.h"
#include "include\icons_f.h"
#include "include\ini.h"
#include "include\devices.h"
2012-04-08 00:07:32 +02:00
#include "include\history.h"
2008-11-26 03:02:31 +01:00
2008-12-19 03:44:13 +01:00
void main()
2008-12-29 02:49:26 +01:00
word key, id;
2008-11-03 14:17:17 +01:00
mouse m;
2008-11-26 03:02:31 +01:00
int pressed_y;
2008-11-03 14:17:17 +01:00
{
2011-08-18 15:32:06 +02:00
//
2008-12-19 03:44:13 +01:00
load_editbox_lib();
2012-04-05 00:18:49 +02:00
GetSystemDiscs();
GetIni(1);
edit1.shift_color=videlenie;
edit2.shift_color=videlenie;
2011-08-27 23:37:45 +02:00
HistoryPath(add_new_path);
IF (param[0]<>'') //<2F> <> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2011-07-30 16:59:48 +02:00
{
2011-08-27 23:37:45 +02:00
copystr(#param, #path);
IF (strcmp(#path+strlen(#path)-1,"/")<>0) copystr("/",#path+strlen(#path)); //<2F> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> , + "/"
}
2012-04-05 00:18:49 +02:00
else copystr("/rd/1/", #path);
2011-08-27 23:37:45 +02:00
Open_Dir(#path,ONLY_OPEN);
2008-11-03 14:17:17 +01:00
loop()
{
switch(WaitEvent())
{
2012-04-08 00:07:32 +02:00
case evMouse:
2008-11-03 14:17:17 +01:00
IF (del_active==1) break;
2011-08-27 23:37:45 +02:00
id=GetSlot(Form.ID);
IF (id<>ActiveProcess()) break; //<2F> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-11-03 14:17:17 +01:00
m.get();
2008-12-19 03:44:13 +01:00
2011-08-27 23:37:45 +02:00
if (m.x>=Form.width-26) && (m.x<=Form.width-6) && (m.y>40) && (m.y<57)
2008-12-19 03:44:13 +01:00
{
IF (m.lkm==1) DrawRegion_3D(onLeft(26,0),41,14,14,0xC7C7C7,0xFFFFFF);
WHILE (m.lkm==1) && (za_kadrom>0)
{
Pause(10);
za_kadrom--;
List_ReDraw();
m.get();
}
DrawRegion_3D(onLeft(26,0),41,14,14,0xFFFFFF,0xC7C7C7);
}
2011-08-27 23:37:45 +02:00
if (m.x>=Form.width-26) && (m.x<=Form.width-6) && (m.y>onTop(22,0)+1) && (m.y<onTop(22,0)+16)
2008-12-19 03:44:13 +01:00
{
IF (m.lkm==1) DrawRegion_3D(onLeft(26,0),onTop(21,0),14,14,0xC7C7C7,0xFFFFFF);
2008-12-20 04:38:10 +01:00
while (m.lkm==1) && (za_kadrom<count-but_num)
2008-12-19 03:44:13 +01:00
{
Pause(10);
za_kadrom++;
List_ReDraw();
m.get();
}
DrawRegion_3D(onLeft(26,0),onTop(21,0),14,14,0xFFFFFF,0xC7C7C7);
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
2012-03-25 23:57:03 +02:00
IF (m.vert==65535) IF (curbtn>0) FileList_ReDraw(-1); ELSE
{
FileList_ReDraw(-1);
FileList_ReDraw(-1);
FileList_ReDraw(-1);
}
IF (m.vert==1) IF (curbtn<but_num-1) FileList_ReDraw(1); ELSE
{
FileList_ReDraw(1);
FileList_ReDraw(1);
FileList_ReDraw(1);
}
2008-11-03 14:17:17 +01:00
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2011-08-27 23:37:45 +02:00
if (m.x>=Form.width-26) && (m.x<=Form.width-6) && (m.y>56) while (m.lkm)
2008-11-03 14:17:17 +01:00
{
2008-12-20 04:38:10 +01:00
IF (scroll_size/2+57>m.y) || (m.y<0) || (m.y>4000) m.y=scroll_size/2+57; //<2F> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
2008-12-29 02:49:26 +01:00
id=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-12-20 04:38:10 +01:00
j= scroll_size/2;
2012-04-05 00:18:49 +02:00
za_kadrom = m.y -j -57 * count;
za_kadrom /= onTop(22,57);
2008-12-20 04:38:10 +01:00
IF (but_num+za_kadrom>count) za_kadrom=count-but_num;
2008-12-29 02:49:26 +01:00
IF (id<>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>
2008-12-19 03:44:13 +01:00
m.get();
2008-11-03 14:17:17 +01:00
}
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)
{
2012-04-08 00:07:32 +02:00
case 21: //Back
2011-08-22 02:17:55 +02:00
GoBack();
break;
2012-04-09 00:01:35 +02:00
case 22: //Forward
HistoryPath(go_forward);
2012-04-08 00:07:32 +02:00
break;
case 23: //up!
2011-08-22 02:17:55 +02:00
IF (strcmp(#path,"/")<>0) Dir_Up();
break;
2012-04-08 00:07:32 +02:00
case 24: //cut
2011-08-22 02:17:55 +02:00
key=24;
2012-04-08 00:07:32 +02:00
case 25: //copy
2011-08-22 02:17:55 +02:00
goto CTRLC_MARK;
2012-04-08 00:07:32 +02:00
case 26: //paste
2011-08-22 02:17:55 +02:00
Paste();
break;
2012-04-08 00:07:32 +02:00
case 27: //goto edit_path
2011-08-22 02:17:55 +02:00
Goto_edit_path();
break;
2012-04-08 00:07:32 +02:00
case 31...33: //sort
2011-08-27 23:37:45 +02:00
IF(sort_num==1) DrawBar(onLeft(192,168)/2+210,45,6,9,0xE4DFE1);
IF(sort_num==2) DrawBar(onLeft(115,0),45,6,9,0xE4DFE1);
IF(sort_num==3) DrawBar(onLeft(44,0),45,6,9,0xE4DFE1);
2008-11-03 14:17:17 +01:00
sort_num=id-30;
Open_Dir(#path,1);
break;
case 30: //about
2012-05-13 13:42:55 +02:00
CreateThread(#about_dialog,#stak);
2011-08-22 02:17:55 +02:00
break;
2012-05-13 13:42:55 +02:00
case 77:
2011-08-22 02:17:55 +02:00
IF (show_actions==1) show_actions=0; ELSE show_actions=1;
Actions();
break;
2012-05-13 13:42:55 +02:00
case 78:
IF (show_dev_name==1) show_dev_name=0; ELSE show_dev_name=1;
DrawSystemDiscs();
break;
2008-11-26 03:02:31 +01:00
case 80: //rename
2011-08-22 02:17:55 +02:00
goto REN_MARK;
2008-11-26 03:02:31 +01:00
case 81: //Delete file
2011-08-22 02:17:55 +02:00
Del_Form();
break;
2008-11-26 03:02:31 +01:00
case 82: //create folder
2011-08-22 02:17:55 +02:00
NEW_FOLDER_MARK:
copystr(#path, #temp);
copystr("New folder", #temp+strlen(#temp));
CreateFolder(#temp);
IF (EAX==0){
SelectFile("New folder");
goto REN_MARK;
}
ELSE ShowMessage("Folder can not be created.");
break;
2008-11-26 03:02:31 +01:00
case 100...120:
2011-08-22 02:17:55 +02:00
DEVICE_MARK:
2012-04-05 10:00:32 +02:00
DrawRegion_3D(17,id-100*16+74,159,16, 0, 0); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2012-04-05 00:18:49 +02:00
copystr(#disk_list[id-100].Item, #path);
za_kadrom=curbtn=0;
Open_Dir(#path,1);
2012-04-05 10:00:32 +02:00
DrawRegion_3D(17,id-100*16+74,159,16, 0xFFFFFF, 0xFFFFFF);
2012-04-05 00:18:49 +02:00
break;
2008-11-26 03:02:31 +01:00
default:
2011-08-22 02:17:55 +02:00
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:
2012-04-05 00:18:49 +02:00
if (!isdir) GetIni(0); else
if (strcmp(#file_name,"..")==0) Dir_Up(); else
2011-08-22 02:17:55 +02:00
{ OPEN_DEV:
copystr(#file_path, #path);
2012-04-05 00:18:49 +02:00
IF (strcmp(#path+strlen(#path)-1,"/")<>0) copystr("/",#path+strlen(#path)); //<2F> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> , + "/"
2011-08-22 02:17:55 +02:00
za_kadrom=curbtn=0;
Open_Dir(#path,1);
}
2008-11-03 14:17:17 +01:00
}
break;
//Key pressed-----------------------------------------------------------------------------
case evKey:
key = GetKey();
IF (del_active==1)
2011-08-27 23:37:45 +02:00
{
2008-11-03 14:17:17 +01:00
IF (key==013) Del_File(true);
IF (key==027) Del_File(false);
break;
2011-08-27 23:37:45 +02:00
}
IF (edit1.flags<>64) && (edit1.flags<>0) && (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)
{
2010-02-15 02:23:03 +01:00
case 209...217:
id=key-110;
2012-04-05 00:18:49 +02:00
IF (id-100>=disc_num) break;
2010-02-15 02:23:03 +01:00
GOTO DEVICE_MARK;
2011-08-22 02:17:55 +02:00
case 8: //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD>
GoBack();
break;
case 004: //Ctrl+D <20> <> <EFBFBD> <20> <> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
copystr("\\S__", #temp);
copystr(#file_path, #temp+strlen(#temp));
RunProgram("/sys/media/kiv", #temp);
break;
case 014: //Ctrl+N <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
IF (Form.left==98) MoveSize(Form.left-20,Form.top-20,OLD,OLD);
RunProgram("/sys/File Managers/Eolite", #path);
break;
2008-12-29 02:49:26 +01:00
case 024: //Ctrl+X cut
2008-11-03 14:17:17 +01:00
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>
2008-12-19 03:44:13 +01:00
copystr(#file_path,#copy_file); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-11-03 14:17:17 +01:00
IF (key==24) cut_active=1; ELSE cut_active=0;
break;
case 022: Paste(); break;//Ctrl+V paste
case 027: //Esc
2008-12-29 02:49:26 +01:00
IF (rename_active==1) ReName(false);
2008-11-03 14:17:17 +01:00
break;
2008-12-19 03:44:13 +01:00
case 013: //Enter
2008-12-29 02:49:26 +01:00
IF (rename_active==1) {ReName(true); break;}
2008-11-03 14:17:17 +01:00
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
2011-08-18 15:32:06 +02:00
za_kadrom=0;
curbtn=0;
List_ReDraw();
2008-11-03 14:17:17 +01:00
break;
case 181: //end
2011-08-18 15:32:06 +02:00
za_kadrom=count-but_num;
curbtn=but_num-1;
List_ReDraw();
2008-11-03 14:17:17 +01:00
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:
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>
2008-12-19 03:44:13 +01:00
edit2.flags=66; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-11-26 03:02:31 +01:00
edit2.width=onLeft(24,217);
2012-03-30 12:00:24 +02:00
edit2.top=curbtn*BUTTON_HEIGHT+59;
2008-12-19 03:44:13 +01:00
edit2.size=edit2.pos=strlen(#file_name);
2008-11-26 03:02:31 +01:00
edit_box_draw stdcall (#edit2);
2012-03-30 12:00:24 +02:00
DrawBar(213,curbtn*BUTTON_HEIGHT+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>
2008-11-26 03:02:31 +01:00
rename_active=1;
break;
2008-11-03 14:17:17 +01:00
case 052: //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> F3
2008-12-19 03:44:13 +01:00
IF (isdir==false) RunProgram("/sys/tinypad", #file_path);
break;
2011-07-30 16:59:48 +02:00
case 053: //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> F4
IF (isdir==false) RunProgram("/sys/develop/heed", #file_path);
break;
2008-12-19 03:44:13 +01:00
case 054: //F5
Open_Dir(#path,1);
break;
case 182: //delete file
Del_Form();
break;
2008-11-24 01:49:58 +01:00
default:
2011-07-30 16:59:48 +02:00
for (i=curbtn+za_kadrom+1; i<count; i++)
2008-11-24 01:49:58 +01:00
{
2008-12-19 03:44:13 +01:00
copystr(file_mas[i]*304+buf+72,#temp);
2008-11-24 01:49:58 +01:00
AL=DSBYTE[#temp];
IF(AL>='A')&&(AL<='Z')DSBYTE[#temp]=AL|0x20;
2011-08-18 15:32:06 +02:00
IF (temp[0]==key)
{
FileList_ReDraw(i-curbtn-za_kadrom);
break;
}
2008-11-24 01:49:58 +01:00
}
2008-11-03 14:17:17 +01:00
}
2008-12-19 03:44:13 +01:00
BREAK;
case evReDraw: draw_window();
2008-11-03 14:17:17 +01:00
}
IF (rename_active==0) edit_box_mouse stdcall(#edit1); ELSE edit_box_mouse stdcall(#edit2);
}
}
inline fastcall void draw_window()
2012-04-05 00:18:49 +02:00
{
2012-05-13 02:30:49 +02:00
if (GetScreenHeight()<480) DefineAndDrawWindow(20,0,582,GetScreenHeight()-30,0x73,0x10E4DFE1,0,0,title); else
DefineAndDrawWindow(98,90,582,482,0x73,0x10E4DFE1,0,0,title);
2011-08-27 23:37:45 +02:00
Form.GetInfo(#Form, SelfInfo);
2012-03-22 14:33:15 +01:00
IF (Form.status_window==4) return; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-11-03 14:17:17 +01:00
IF (Form.height<280) MoveSize(OLD,OLD,OLD,280);
IF (Form.width<480) MoveSize(OLD,OLD,480,OLD);
//toolbar buttons
2008-12-19 03:44:13 +01:00
PutPaletteImage(#toolbar,246,39,0,0,#toolbar_pal);
2011-08-22 02:17:55 +02:00
FOR (j=0; j<3; j++) DefineButton(toolbar_buttons_x[j]+2,5+2,31-5,29-5,21+j+BT_HIDE,0xE4DFE1);
FOR (j=3; j<6; j++) DefineButton(toolbar_buttons_x[j],5,31,29,21+j+BT_HIDE,0xE4DFE1);
2008-11-03 14:17:17 +01:00
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
edit1.width=Form.width-314;
2008-12-29 02:49:26 +01:00
DrawBar(246,0,onLeft(246,60),12,0xE4DFE1); //<2F> <> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-12-19 03:44:13 +01:00
DrawBar(246,29,onLeft(246,60),10,0xE4DFE1); //<2F> <> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-12-29 02:49:26 +01:00
DrawRegion_3D(246,12,onLeft(66,246),16,0x94AECE,0x94AECE); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-11-03 14:17:17 +01:00
DefineButton(onLeft(34,0),6,27,28,30+BT_HIDE+BT_NOFRAME,0xE4DFE1); //about
2008-12-20 04:38:10 +01:00
DefineButton(onLeft(66,0),12,18,16,27+BT_HIDE,0xE4DFE1); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-12-19 03:44:13 +01:00
PutPaletteImage(#goto_about,56,40,Form.width-65,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>
2008-12-29 02:49:26 +01:00
DrawRegion_3D(1,40,Form.width-12,onTop(46,0),0x94AECE,0x94AECE); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
DrawRegion_3D(0,39,Form.width-10,onTop(44,0),0xE4DFE1,0xE4DFE1); //<2F> <> <EFBFBD>
2012-04-05 00:18:49 +02:00
DrawSystemDiscs();
Actions();
2008-12-19 03:44:13 +01:00
//SortButtons
DrawFlatButton(192,40,onLeft(192,168),16,31,0xE4DFE1,"File");
DrawFlatButton(onLeft(168,0),40,73,16,32,0xE4DFE1,"Type");
DrawFlatButton(onLeft(95,0),40,68,16,33,0xE4DFE1,"Size");
2008-12-29 02:49:26 +01:00
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
Open_Dir(#path,ONLY_SHOW);
2012-05-13 13:42:55 +02:00
//List_ReDraw();
//KEdit();
2008-11-03 14:17:17 +01:00
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-12-19 03:44:13 +01:00
DrawBar(onLeft(27,0),57,1,onTop(22,57),0x94AECE); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
DrawFlatButton(onLeft(27,0),40,16,16,0,0xE4DFE1,"\x18"); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
DrawFlatButton(onLeft(27,0),onTop(22,0),16,16,0,0xE4DFE1,"\x19");//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
2012-04-05 00:18:49 +02:00
if (del_active==1) Del_Form();
2008-11-03 14:17:17 +01:00
}
void KEdit()
{
2008-12-20 04:38:10 +01:00
edit1.size=edit1.pos=strlen(#edit_path);
2008-11-03 14:17:17 +01:00
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;
2008-12-20 04:38:10 +01:00
IF (count<=0) {DrawFlatButton(onLeft(27,0),57,16,onTop(22,58),0,0xE4DFE1,""); return;}
on_y = za_kadrom * onTop(22,57) / count +57;
scroll_size=onTop(22,57) * but_num - but_num / count;
IF (scroll_size<20) scroll_size = 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 (scroll_size>onTop(22,57)-on_y+56) || (za_kadrom+but_num>=count) on_y=onTop(23+scroll_size,0); //<2F> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
DrawFlatButton(onLeft(27,0),on_y,16,scroll_size,0,0xE4DFE1,"");//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-12-19 03:44:13 +01:00
DrawBar(onLeft(26,0),57,15,on_y-57,0xCED0D0);//<2F> <> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-12-20 04:38:10 +01:00
DrawBar(onLeft(26,0),on_y+scroll_size+1,15,onTop(22,57)-scroll_size-on_y+56,0xCED0D0); //<2F> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-11-03 14:17:17 +01:00
}
void FileList_ReDraw(int curbtn_)
{
if (curbtn_<=0) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD>
{
2008-12-29 02:49:26 +01:00
IF (za_kadrom==0) && (curbtn<=0) return;
2008-11-03 14:17:17 +01:00
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>
{
2008-12-20 04:38:10 +01:00
IF (za_kadrom==count-but_num) && (curbtn==but_num-1) return;
2012-03-25 23:57:03 +02:00
IF (but_num-curbtn>curbtn_)
2008-11-03 14:17:17 +01:00
{
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;
}
2011-08-18 15:32:06 +02:00
else
2008-11-03 14:17:17 +01:00
{
2012-03-25 23:57:03 +02:00
IF(za_kadrom+curbtn+curbtn_>=count)
2011-07-30 16:59:48 +02:00
{
2011-08-18 15:32:06 +02:00
za_kadrom=count-but_num;
curbtn=curbtn_-za_kadrom+curbtn;
2011-07-30 16:59:48 +02:00
}
ELSE
{
za_kadrom+=curbtn_+curbtn-but_num+1;
2011-08-18 15:32:06 +02:00
curbtn=but_num-1;
}
2012-03-25 23:57:03 +02:00
2011-08-18 15:32:06 +02:00
IF (curbtn<0) || (curbtn>but_num)
{
curbtn=but_num-1;
2011-07-30 16:59:48 +02:00
}
2008-11-03 14:17:17 +01:00
List_ReDraw();
2011-08-18 15:32:06 +02:00
2012-03-30 12:00:24 +02:00
//WriteFullDebug("");
2008-11-03 14:17:17 +01:00
}
}
}
2011-08-27 23:37:45 +02:00
2008-11-03 14:17:17 +01:00
void List_ReDraw()
{
2012-03-30 12:00:24 +02:00
int paint_x=but_num*BUTTON_HEIGHT+57;
2008-12-20 04:38:10 +01:00
IF (count-za_kadrom<but_num) || (curbtn>but_num-1) //<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=count-but_num; 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>
2008-11-03 14:17:17 +01:00
//
FOR (j=0; j<but_num; j++) IF (curbtn<>j) Line_ReDraw(0xFFFFFF, j); ELSE Line_ReDraw(videlenie, curbtn);
2008-12-29 02:49:26 +01:00
DrawBar(192,paint_x,onLeft(27,192),onTop(paint_x,6),0xFFFFFF); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
DrawBar(onLeft(168,0),paint_x,1,onTop(paint_x,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(95,0),paint_x,1,onTop(paint_x,6),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
TVScroll();
}
2008-12-29 02:49:26 +01:00
//puticon+icon_fairing!!!
2008-11-03 14:17:17 +01:00
void Line_ReDraw(dword color, filenum){
2008-12-29 02:49:26 +01:00
dword text_col=0, temp_int,
2012-04-05 00:18:49 +02:00
/* //<2F> <> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2012-03-30 12:00:24 +02:00
dword text_col=0, temp_int, x,
max_x=onLeft(28,192)/BUTTON_HEIGHT,
y=filenum/max_x*BUTTON_HEIGHT+57; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> Y
temp_int=filenum/max_x;
temp_int=temp_int*max_x;
x=filenum-temp_int*BUTTON_HEIGHT+192;
*/
y=filenum*BUTTON_HEIGHT+57; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> Y
2008-12-29 02:49:26 +01:00
IF (rename_active==1) ReName(false);
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>
2012-03-30 12:00:24 +02:00
DefineButton(192,y,onLeft(28,192),BUTTON_HEIGHT,201+filenum+BT_HIDE+BT_NOFRAME,color); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD>
2012-04-05 00:18:49 +02:00
DrawBar(192,y,3,BUTTON_HEIGHT,color);
2012-03-30 12:00:24 +02:00
DrawBar(192+19,y,onLeft(46,192),BUTTON_HEIGHT,color); DrawBar(195,y+17,16,1,color);
if (BUTTON_HEIGHT>18) DrawBar(195,y+18,16,BUTTON_HEIGHT-18,color);
2012-04-05 00:18:49 +02:00
if (BUTTON_HEIGHT>15) DrawBar(195,y,16,BUTTON_HEIGHT-15,color);
2008-12-20 07:22:01 +01:00
//
2008-12-29 02:49:26 +01:00
off=file_mas[filenum+za_kadrom]*304 + buf+72;
2011-07-30 16:59:48 +02:00
if (TestBit(ESDWORD[off-40],1)) || (TestBit(ESDWORD[off-40],2)) text_col=0xA6A6B7;
2011-08-27 23:37:45 +02:00
if (!TestBit(ESDWORD[off-40],4))
{
copystr(off,#temp);
2012-04-05 00:18:49 +02:00
temp_int = Put_icon(#temp+find_symbol(#temp,'.'), BUTTON_HEIGHT/2-7+y);
2012-03-30 12:00:24 +02:00
WriteText(7-strlen(ConvertSize(ESDWORD[off-8]))*6+onLeft(75,0),BUTTON_HEIGHT-6/2+y,0x80,0,ConvertSize(ESDWORD[off-8]),0); //size
2011-08-27 23:37:45 +02:00
}
ELSE
2012-04-05 00:18:49 +02:00
IF (!strcmp("..",off)) temp_int=Put_icon("..", BUTTON_HEIGHT/2-7+y);
2011-08-27 23:37:45 +02:00
ELSE
2012-04-05 00:18:49 +02:00
temp_int=Put_icon("<DIR>", BUTTON_HEIGHT/2-7+y);
2008-12-05 20:59:10 +01:00
if (color==videlenie)
2008-11-03 14:17:17 +01:00
{
2008-12-29 02:49:26 +01:00
isdir=TestBit(ESDWORD[off-40], 4);
2012-04-05 00:18:49 +02:00
IconFairing(temp_int, BUTTON_HEIGHT/2-7+y); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-11-03 14:17:17 +01:00
copystr(off,#file_name);
2008-12-19 03:44:13 +01:00
copystr(#path,#file_path);
copystr(#file_name,#file_path+strlen(#file_path)); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
2008-12-20 07:22:01 +01:00
IF (text_col==0xA6A6B7) text_col=0xFFFFFF;
2008-11-03 14:17:17 +01:00
}
2008-12-20 07:22:01 +01:00
temp_int = onLeft(215,165)/6;
2008-11-24 01:49:58 +01:00
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>
2012-03-30 12:00:24 +02:00
WriteText(215,BUTTON_HEIGHT-6/2+y,0,text_col,off,temp_int); //<2F> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
DrawBar(onLeft(168,0),y,1,BUTTON_HEIGHT,0xE4DFE1); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 1
DrawBar(onLeft(95,0),y,1,BUTTON_HEIGHT,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
}
2011-07-30 16:59:48 +02:00
2008-12-19 03:44:13 +01:00
void Open_Dir(dword temp_, redraw){
2011-07-30 16:59:48 +02:00
int errornum;
2011-08-27 23:37:45 +02:00
byte path_[4096],
2011-07-30 16:59:48 +02:00
somelen=strlen(temp_)-1;
2008-12-29 02:49:26 +01:00
if (redraw<>ONLY_SHOW)
2008-12-19 03:44:13 +01:00
{
copystr(temp_, #path_);
IF (somelen) path_[somelen]=0x00;
2011-08-27 23:37:45 +02:00
2008-12-19 03:44:13 +01:00
IF (buf) free(buf);
2011-08-27 23:37:45 +02:00
buf = malloc(32);
2011-07-30 16:59:48 +02:00
errornum=ReadDir(0, buf, #path_);
if (errornum<>0) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
{
Write_Debug_Error(errornum);
HistoryPath(add_new_path);
GoBack();
return;
2010-02-15 02:23:03 +01:00
}
count = ESDWORD[buf+8];
buf = realloc(count * 304 + 32, buf);
2008-12-20 04:38:10 +01:00
ReadDir(count, buf, #path_);
IF (EBX>6897) && (EBX<>-1) EBX=6897; //1 <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ;)
count=EBX;
2011-08-27 23:37:45 +02:00
}
2008-12-29 02:49:26 +01:00
if (count<>-1)
2008-11-03 14:17:17 +01:00
{
2011-07-30 16:59:48 +02:00
copystr(temp_,#edit_path);
KEdit();
HistoryPath(add_new_path);
2008-12-29 02:49:26 +01:00
IF (!strcmp(".",buf+72)) {memmov(buf,buf+304,count-1*304); count--;} //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> "."
2008-11-03 14:17:17 +01:00
FOR (j=0;j<but_num;j++) DeleteButton(201+j); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2012-03-30 12:00:24 +02:00
but_num=onTop(6,57)/BUTTON_HEIGHT;
2008-12-20 04:38:10 +01:00
IF (count<but_num) but_num=count;
2008-12-29 02:49:26 +01:00
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
IF (sort_num==1) WriteText(Form.width+60/2,45,0x80,0x4E78AC,"\x19",0);
IF (sort_num==2) WriteText(Form.width-115,45,0x80,0x4E78AC,"\x19",0);
IF (sort_num==3) WriteText(Form.width-44,45,0x80,0x4E78AC,"\x19",0);
IF (redraw<>ONLY_SHOW) Sorting(); //<2F> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
IF (redraw<>ONLY_OPEN) List_ReDraw();
2008-11-03 14:17:17 +01:00
}
2008-12-29 02:49:26 +01:00
IF (count==-1) && (redraw<>ONLY_OPEN) {but_num=count=0; List_ReDraw();}
2008-11-03 14:17:17 +01:00
}
2008-12-19 03:44:13 +01:00
inline Sorting()
2008-11-03 14:17:17 +01:00
{
2008-12-19 03:44:13 +01:00
dword k=0, l=1;
2012-04-05 00:18:49 +02:00
if (!strcmp(#path,"/")) //<2F> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> "/"
{
FOR(k=1;k<count;k++;) file_mas[k]=k;
return;
}
2008-12-20 04:38:10 +01:00
FOR (j=count-1, off=count-1*304+buf+32; j>=0; j--, off-=304;) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
2008-11-03 14:17:17 +01:00
{
2008-12-19 03:44:13 +01:00
ChangeCase(off+40);
2012-04-05 00:18:49 +02:00
if (TestBit(ESDWORD[off],4)) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ?
{
file_mas[k]=j;
k++;
}
else
{
file_mas[count-l]=j;
l++;
}
2008-11-03 14:17:17 +01:00
}
2008-12-29 02:49:26 +01:00
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> : <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
Sort_by_Name(0,k-1);
2008-12-20 04:38:10 +01:00
IF (sort_num==1) Sort_by_Name(k,count-1);
2011-10-05 11:50:43 +02:00
IF (sort_num==2) Sort_by_Type(k,count-1);
2008-12-20 04:38:10 +01:00
IF (sort_num==3) Sort_by_Size(k,count-1);
2008-12-19 03:44:13 +01:00
//<2F> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ".." <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD>
2008-12-29 02:49:26 +01:00
IF (k>0) && (strcmp(file_mas[0]*304+buf+72,"..")<>0) FOR(k=k-1; k>0; k--;) IF (!strcmp(file_mas[k]*304+buf+72,"..")) file_mas[k]><file_mas[0];
2008-11-03 14:17:17 +01:00
}
void Del_Form()
{
2008-12-19 03:44:13 +01:00
int dform_x=Form.width/2-13;
2008-11-03 14:17:17 +01:00
//<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>
2008-12-19 03:44:13 +01:00
DrawFlatButton(dform_x,160,200,80,0,0xE4DFE1, ""); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD>
WriteText(dform_x+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-12-19 03:44:13 +01:00
WriteText(strlen(#file_name)*6+dform_x+20,190,0x80,0,"?",0);
WriteText(dform_x+20,190,0x80,0,#file_name,0); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD>
2008-11-03 14:17:17 +01:00
}
ELSE
{
2008-12-19 03:44:13 +01:00
WriteText(164+dform_x,190,0x80,0,"...?",0);
WriteText(dform_x+20,190,0,0,#file_name,24); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD>
2008-11-03 14:17:17 +01:00
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-12-19 03:44:13 +01:00
DrawFlatButton(dform_x+20,208,70,20,301,0xFFB6B5,"Yes");
DrawFlatButton(dform_x+111,208,70,20,302,0xC6DFC6,"No");
2008-11-03 14:17:17 +01:00
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
{
2011-07-30 16:59:48 +02:00
int del_file_rez;
2008-11-26 03:02:31 +01:00
IF (dodel==true)
{
2011-07-30 16:59:48 +02:00
del_file_rez=DeleleFile(#file_path);
IF (del_file_rez<>0)
{
Write_Debug_Error(del_file_rez);
2011-08-27 23:37:45 +02:00
IF (isdir==true) ShowMessage("Error. Folder isn't empty.");
2011-07-30 16:59:48 +02:00
IF (isdir==false) ShowMessage("Error. Filesystem read-only.");
}
2008-11-26 03:02:31 +01:00
}
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()
{
2011-08-27 23:37:45 +02:00
char new_copy_path[4096]='';
int copy_rezult;
2008-12-19 03:44:13 +01:00
IF (!copy_file) return; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2011-08-27 23:37:45 +02:00
copystr(#path,#new_copy_path);
copystr(#copy_file+find_symbol(#copy_file,'/'),#new_copy_path+strlen(#new_copy_path));
if (strcmp(#copy_file,#new_copy_path)==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>
2008-11-03 14:17:17 +01:00
{
2011-08-27 23:37:45 +02:00
copystr(#path,#new_copy_path);
copystr("new_",#new_copy_path+strlen(#new_copy_path));
copystr(#copy_file+find_symbol(#copy_file,'/'),#new_copy_path+strlen(#new_copy_path));
2008-11-03 14:17:17 +01:00
}
2011-08-27 23:37:45 +02:00
copy_rezult=CopyFile(#copy_file,#new_copy_path);
IF (copy_rezult<>0) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2011-07-30 16:59:48 +02:00
{
2011-08-27 23:37:45 +02:00
Write_Debug_Error(copy_rezult);
2011-07-30 16:59:48 +02:00
DrawFlatButton(Form.width/2-13,160,200,80,0,0xFFB6B5, "Error. You can't paste here.");
Pause(150);
}
2008-11-03 14:17:17 +01:00
IF (cut_active==1) //<2F> <> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
2008-12-19 03:44:13 +01:00
copystr(#copy_file,#file_path);
2008-11-03 14:17:17 +01:00
Del_File(true);
2008-12-19 03:44:13 +01:00
copy_file='';
2008-11-03 14:17:17 +01:00
cut_active=0;
}
2011-08-27 23:37:45 +02:00
SelectFile(#new_copy_path+find_symbol(#new_copy_path,'/'));
2008-11-03 14:17:17 +01:00
}
void Tip(int y, dword caption, id, arrow)
{
2008-12-19 03:44:13 +01:00
DrawBar(17,y,160,17,0xE4DFE1); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
WriteText(25,y+5,0x80,0,caption,0); //text Goto:
IF (id<>0) DefineButton(159,y+1,16,16,id+BT_HIDE+BT_NOFRAME,0xE4DFE1); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
WriteText(165,y+5,0x80,0,arrow,0); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
DrawBar(17,y+17,160,1,0x94AECE); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-11-03 14:17:17 +01:00
}
2011-08-27 23:37:45 +02:00
2008-12-29 02:49:26 +01:00
void ReName(byte rename)
{
2011-08-27 23:37:45 +02:00
int del_file_rez;
char edit_name[256]='';
2008-12-29 02:49:26 +01:00
rename_active=0;
edit2.flags=64;
2012-03-30 12:00:24 +02:00
DefineButton(192,curbtn*BUTTON_HEIGHT+57,onLeft(27,192),BUTTON_HEIGHT,curbtn+201+BT_HIDE+BT_NOFRAME,0xFFFFFF);
2008-12-29 02:49:26 +01:00
if (rename==true)
{
copystr(#path,#temp);
2011-08-27 23:37:45 +02:00
copystr(#file_name,#edit_name); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-12-29 02:49:26 +01:00
copystr(#file_name,#temp+strlen(#temp));
if (strcmp(#file_path,#temp)<>0) && (file_name)
IF (isdir)
{
2011-08-27 23:37:45 +02:00
del_file_rez=DeleleFile(#file_path);
IF (del_file_rez<>0)
{
Write_Debug_Error(del_file_rez);
ShowMessage("Error. Folder isn't empty.");
return;
}
2008-12-29 02:49:26 +01:00
ELSE CreateFolder(#temp);
Open_Dir(#path,1);
}
ELSE
{
CopyFile(#file_path,#temp);
Del_File(true);
}
2011-08-27 23:37:45 +02:00
SelectFile(#edit_name);
2008-12-29 02:49:26 +01:00
}
Line_ReDraw(videlenie,curbtn);
}
2008-11-03 14:17:17 +01:00
void Actions()
{
2012-04-05 00:18:49 +02:00
int actions_y=disc_num*16;
2011-07-30 16:59:48 +02:00
DrawBar(17,actions_y+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>
2012-04-05 00:18:49 +02:00
DrawBar(17,show_actions*51+actions_y+108,160,onTop(show_actions*51+actions_y+108,6),0x00699C); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
2008-11-03 14:17:17 +01:00
if (show_actions==1)
{
2012-04-05 00:18:49 +02:00
Tip(actions_y+90, "Actions", 77, "\x19"); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2011-07-30 16:59:48 +02:00
DrawBar(17,actions_y+108,160,51,0xFFFFFF); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD>
2012-04-05 00:18:49 +02:00
PutImage(#factions,16,44,21,actions_y+113); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-11-03 14:17:17 +01:00
//rename file
2012-04-05 00:18:49 +02:00
DefineButton(17,actions_y+108,159,16,80+BT_HIDE,0xE4DFE1);
2011-07-30 16:59:48 +02:00
WriteText(42,actions_y+113,0x80,0,"Rename file <F2>",0);
2008-11-03 14:17:17 +01:00
//delete file
2011-07-30 16:59:48 +02:00
DefineButton(17,actions_y+125,159,16,81+BT_HIDE,0xE4DFE1);
WriteText(42,actions_y+130,0x80,0,"Delete file <Del>",0);
2008-11-03 14:17:17 +01:00
//create folder
2011-07-30 16:59:48 +02:00
DefineButton(17,actions_y+142,159,16,82+BT_HIDE,0xE4DFE1);
WriteText(42,actions_y+147,0x80,0,"Create folder <F6>",0);
2008-11-03 14:17:17 +01:00
}
2012-04-05 00:18:49 +02:00
else
2008-11-03 14:17:17 +01:00
{
2012-04-05 00:18:49 +02:00
DeleteButton(80);
DeleteButton(81);
DeleteButton(82);
2011-07-30 16:59:48 +02:00
Tip(actions_y+90, "Actions", 77, "\x18");
2008-11-03 14:17:17 +01:00
}
}
2011-07-30 16:59:48 +02: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> , + "/"
2012-05-13 13:42:55 +02:00
Open_Dir(#edit_path,ONLY_OPEN); //<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>
2008-12-20 04:38:10 +01:00
IF (count<1) KEdit(); ELSE //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2008-11-03 14:17:17 +01:00
{za_kadrom=curbtn=0; copystr(#edit_path,#path);}//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
Open_Dir(#path,1);
}
2008-12-20 04:38:10 +01:00
void SelectFile(dword that_file)
{
za_kadrom=curbtn=0; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2011-08-27 23:37:45 +02:00
Open_Dir(#path,ONLY_OPEN);
2008-12-20 04:38:10 +01:00
ChangeCase(that_file);
2012-04-05 00:18:49 +02:00
for (i=count-1; i>=0; i--;)
if (strcmp(file_mas[i]*304+buf+72,that_file)==0) break;
2011-08-27 23:37:45 +02:00
FileList_ReDraw(i);
2008-12-20 04:38:10 +01:00
List_ReDraw();
}
void Dir_Up()
{
2012-04-09 00:01:35 +02:00
char cur_folder[4096];
2008-12-20 04:38:10 +01:00
i=strlen(#path)-1;
path[i]=0x00;
2012-04-09 00:01:35 +02:00
do i--; while (path[i]<>'/'); copystr(#path+i+1,#cur_folder);
2008-12-20 04:38:10 +01:00
path[i+1]=0x00;
2012-04-09 00:01:35 +02:00
SelectFile(#cur_folder);
2008-12-20 04:38:10 +01:00
}
2008-11-03 14:17:17 +01:00
2008-12-19 03:44:13 +01:00
2008-12-20 07:22:01 +01:00
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>
{
2012-04-08 00:07:32 +02:00
char cur_folder[4096];
copystr(GetCurrentFolder(), #cur_folder);
2008-12-20 07:22:01 +01:00
HistoryPath(go_back);
2012-04-08 00:07:32 +02:00
SelectFile(#cur_folder);
2008-11-03 14:17:17 +01:00
}
stop: