forked from KolibriOS/kolibrios
Eolite 0.98.2
git-svn-id: svn://kolibrios.org@975 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
5f10b7db0c
commit
104d540920
@ -1,5 +1,12 @@
|
||||
//Leency & Veliant -=- KolibriOS Team -=- 2008
|
||||
|
||||
//ñòðîêà 258, êåéàï!
|
||||
//âîçìîæíî, áàã â KEdit
|
||||
//find_symbol íàäî ÷èòàòü ñ êîíöà
|
||||
//335 ñòðîêà
|
||||
//PathHistory áëÿ íàäî API äëÿ ðàáîòû ñ èñòîðèåé, â ò.÷. ïðîâåðÿòü íå ðàâíà ëè íîâàÿ ïàïêà ïðåäûäóùåé
|
||||
//DrawBar(sort_num[1],45,6,9,0xE4DFE1);
|
||||
|
||||
#codesize
|
||||
#include "lib\kolibri.h--"
|
||||
#include "lib\memory.h--"
|
||||
@ -9,77 +16,103 @@
|
||||
#include "imgs\left_p.txt"
|
||||
|
||||
//ëîêàëèçàöèÿ è íàñòðîéêè
|
||||
#define header "Eolite File Manager v0.97.2"
|
||||
#define header "Eolite File Manager v0.98.2"
|
||||
#define videlenie 0x94AECE //0x94AECE,0xFEA4B7,0x8BCDFF,0xB8C9B8}; //öâåò âûäåëåííîãî ýëåìåíòà èç ñïèñêà ôàéëîâ
|
||||
byte toolbar_buttons_x[6]={14,51,90,139,172,208};
|
||||
byte toolbar_buttons_x[6]={9,46,85,134,167,203};
|
||||
//
|
||||
dword but_num, kolichestvo, za_kadrom, curbtn, razm_scrl;
|
||||
byte cut_active, rename_active, del_active;
|
||||
byte show_actions=1, show_preview=0, sort_num=1, isdir;
|
||||
char path[256]="/rd/1/", edit_path[256], PathHistory[2560], temp[256]; //äëÿ ïóòåé
|
||||
char file_path[256], file_name[256]; //äëÿ ôàéëîâ
|
||||
char copyfile[256],copy_name[256]; //êîïèðîâàíèå
|
||||
dword file_mas[6898]; //ñïèñîê ôàéëîâ
|
||||
dword but_num,
|
||||
kolichestvo,
|
||||
za_kadrom,
|
||||
curbtn,
|
||||
razm_scrl;
|
||||
byte cut_active,
|
||||
rename_active,
|
||||
del_active;
|
||||
byte show_actions=1,
|
||||
show_preview=0,
|
||||
sort_num=2,
|
||||
isdir;
|
||||
char path[256]="/rd/1/",
|
||||
edit_path[256],
|
||||
file_path[256],
|
||||
file_name[256],
|
||||
copy_file[256],
|
||||
temp[256];
|
||||
char PathHistory[2560];
|
||||
|
||||
dword file_mas[6898];
|
||||
int temp_int, j, i;
|
||||
|
||||
dword stak[100]=0; //îêíî 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};
|
||||
edit_box edit1= {250,247,17,0xffffff,0x94AECE,0xD3DDEB,0xffffff,0,248,#edit_path,64,6,6};
|
||||
edit_box edit2= {250,213,80,0xFFFFCC,0x94AECE,0xFFFFCC,0xffffff,0,248,#file_name,64,6,6};
|
||||
|
||||
proc_info Form;
|
||||
proc_info Form;
|
||||
dword buf=0, off; //äëÿ òåêñòà è áóôåðà
|
||||
dword devbuf=0, dev_num;
|
||||
#include "include\LVabout.c--"
|
||||
#include "include\LVabout.h--"
|
||||
#include "include\sorting.h--"
|
||||
#include "include\icons_f.h--"
|
||||
|
||||
|
||||
|
||||
//IPC
|
||||
#include "lib\Nable_lib.h--"
|
||||
#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
|
||||
}
|
||||
|
||||
|
||||
void main()
|
||||
byte pressed, key, id;
|
||||
void main()
|
||||
byte key, id;
|
||||
mouse m;
|
||||
int pressed_y;
|
||||
{
|
||||
load_editbox_lib();
|
||||
devbuf= malloc(3112); //áóôåð ãäå-òî íà 10 äåâàéñîâ â ëåâîé ïàíåëè
|
||||
ReadDir(10, devbuf, "/");
|
||||
dev_num=EBX;
|
||||
load_dll(); //ïîäãðóæàåò ëèáó ñ åäèò_áîêñîì
|
||||
IF (param[0]<>'') {copystr(#param,#edit_path); Goto_edit_path();}
|
||||
Open_Dir(#path,2);
|
||||
IF (param[0]<>'') {copystr(#param,#edit_path); Goto_edit_path();} ELSE Open_Dir(#path,2); //áûë ëè çàïóñê ñ ïàðàìåòðîì
|
||||
loop()
|
||||
{
|
||||
switch(WaitEvent())
|
||||
{
|
||||
CASE evMouse:
|
||||
id = 0;
|
||||
IF (del_active==1) break;
|
||||
m.get();
|
||||
//
|
||||
|
||||
if (m.x>=Form.width-21) && (m.x<=Form.width-6) && (m.y>40) && (m.y<57)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
if (m.x>=Form.width-21) && (m.x<=Form.width-6) && (m.y>onTop(22,0)+1) && (m.y<onTop(22,0)+16)
|
||||
{
|
||||
IF (m.lkm==1) DrawRegion_3D(onLeft(26,0),onTop(21,0),14,14,0xC7C7C7,0xFFFFFF);
|
||||
while (m.lkm==1) && (za_kadrom<kolichestvo-but_num)
|
||||
{
|
||||
Pause(10);
|
||||
za_kadrom++;
|
||||
List_ReDraw();
|
||||
m.get();
|
||||
}
|
||||
DrawRegion_3D(onLeft(26,0),onTop(21,0),14,14,0xFFFFFF,0xC7C7C7);
|
||||
}
|
||||
|
||||
//êîë¸ñèêî ìûøè
|
||||
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);
|
||||
//ñêðîëë
|
||||
IF (razm_scrl/2+57>m.y) || (m.y<0) || (m.y>4000) m.y=razm_scrl/2+57; //åñëè êóðñîð íàä îêíîì
|
||||
IF (m.lkm==0) pressed=0; ELSE
|
||||
IF (m.x>=Form.width-21) && (m.x<=Form.width-6) pressed=1;
|
||||
IF (pressed==1)
|
||||
if (m.x>=Form.width-21) && (m.x<=Form.width-6) while (m.lkm)
|
||||
{
|
||||
IF (razm_scrl/2+57>m.y) || (m.y<0) || (m.y>4000) m.y=razm_scrl/2+57; //åñëè êóðñîð íàä îêíîì
|
||||
temp_int=za_kadrom; //ñîõðàíÿåì ñòàðîå êîëè÷åñòâî
|
||||
j= razm_scrl/2;
|
||||
za_kadrom = m.y -j -57 * kolichestvo / onTop(22,57);
|
||||
IF (but_num+za_kadrom>kolichestvo) za_kadrom=kolichestvo-but_num;
|
||||
IF (temp_int<>za_kadrom) List_ReDraw(); //÷òîá ëèøíèé ðàç íå ïåðåðèñîâûâàòü
|
||||
m.get();
|
||||
}
|
||||
break;
|
||||
//Button pressed-----------------------------------------------------------------------------
|
||||
@ -98,22 +131,14 @@ int pressed_y;
|
||||
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);
|
||||
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);
|
||||
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: //ñòðåëêà ââåðõ íà ñêðîëå
|
||||
FileList_ReDraw(-1);
|
||||
break;
|
||||
case 51: //ñòðåëêà âíèç íà ñêðîëå
|
||||
FileList_ReDraw(1);
|
||||
CreateThread(#authors,#stak);
|
||||
break;
|
||||
case 78: //preview
|
||||
IF (show_preview==1) show_preview=0; ELSE show_preview=1;
|
||||
@ -136,31 +161,29 @@ int pressed_y;
|
||||
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;}
|
||||
IF (strcmp("New folder",file_mas[i]*304+buf+72)==0) {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;
|
||||
ELSE {
|
||||
copystr("/", #file_path);
|
||||
copystr(#path, #file_path+strlen(#file_path));
|
||||
}
|
||||
GOTO OPEN_DEV;
|
||||
default:
|
||||
if (id<200) break; //êíîïêè èç ñïèñêà ôàéëîâ
|
||||
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
|
||||
if (strcmp(#file_name,"..")==0) Dir_Up(); else
|
||||
{ OPEN_DEV:
|
||||
copystr(#file_path, #path);
|
||||
copystr("/", #path+strlen(#path));
|
||||
DrawBar(197,curbtn*18+57,onLeft(22,197),18,0xFFFFFF); //çàêðàøèâàåì ñòàðîå âûäåëåíèå
|
||||
za_kadrom=curbtn=0;
|
||||
Open_Dir(#path,1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
//Key pressed-----------------------------------------------------------------------------
|
||||
@ -176,7 +199,7 @@ int pressed_y;
|
||||
IF (edit2.flags<>64) && (key<>13) && (key<>27) {EAX=key<<8; edit_box_key stdcall (#edit2); break;}
|
||||
switch (key)
|
||||
{
|
||||
case 209...217: id=key-109; IF(dev_num>id-100)GOTO DEVICE_MARK; break;
|
||||
case 209...217: id=key-109; GOTO DEVICE_MARK;
|
||||
case 8: GoBack(); break; //Íàçàä
|
||||
case 014: MoveSize(80,80,OLD,OLD); RunProgram("/sys/File Managers/Eolite", #path); break; //íîâîå îêíî
|
||||
case 024: //Ctrl+X cut
|
||||
@ -184,15 +207,14 @@ int pressed_y;
|
||||
case 003: //Ctrl+C copy
|
||||
CTRLC_MARK:
|
||||
IF (isdir) break; //ïàïêè ïîêà ÷òî êîïèðîâàòü íå óìååì
|
||||
copystr(#file_name,#copy_name);
|
||||
copystr(#file_path,#copyfile); //âû÷èñëÿåì êàêîé ôàéë êîïèðîâàòü
|
||||
copystr(#file_path,#copy_file); //âû÷èñëÿåì êàêîé ôàéë êîïèðîâàòü
|
||||
IF (key==24) cut_active=1; ELSE cut_active=0;
|
||||
break;
|
||||
case 022: Paste(); break;//Ctrl+V paste
|
||||
case 027: //Esc
|
||||
IF (rename_active==1) {Line_ReDraw(videlenie, 100);}
|
||||
break;
|
||||
case 013: //Enter
|
||||
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;
|
||||
@ -210,7 +232,7 @@ int pressed_y;
|
||||
FileList_ReDraw(-za_kadrom-curbtn);
|
||||
break;
|
||||
case 181: //end
|
||||
FileList_ReDraw(kolichestvo-za_kadrom-curbtn+but_num);
|
||||
FileList_ReDraw(kolichestvo-za_kadrom-curbtn+but_num-1);
|
||||
break;
|
||||
case 183: //Page Down
|
||||
FileList_ReDraw(but_num-1);
|
||||
@ -220,32 +242,35 @@ int pressed_y;
|
||||
break;
|
||||
case 051: //Íàæàòà F2
|
||||
REN_MARK:
|
||||
//IF (isdir==1) break; //ïàïêè ïîêà ÷òî êîïèðîâàòü íå óìååì
|
||||
edit2.flags=66; //äåëàåì êîìïîíåíò àêòèâíûì
|
||||
DeleteButton(curbtn+201); //ýòî ÷òîá ìîæíî áûëî âûäåëÿòü ìûøüþ
|
||||
edit2.flags=66; //äåëàåì êîìïîíåíò àêòèâíûì
|
||||
edit2.width=onLeft(24,217);
|
||||
edit2.top=curbtn*18+59+skin_width;
|
||||
edit2.size=strlen(#file_name); edit2.pos=strlen(#file_name);
|
||||
edit2.top=curbtn*18+59;
|
||||
edit2.size=edit2.pos=strlen(#file_name);
|
||||
edit_box_draw stdcall (#edit2);
|
||||
DrawBar(218,curbtn*18+58,edit2.width+1,1,0xFFFFCC); //ïîëîñà æåëòàÿ ñâåðõó äëÿ îäèíàêîâîñòè
|
||||
DrawBar(213,curbtn*18+58,edit2.width+1,1,0xFFFFCC); //ïîëîñà æåëòàÿ ñâåðõó äëÿ îäèíàêîâîñòè
|
||||
rename_active=1;
|
||||
break;
|
||||
case 052: //Íàæàòà F3
|
||||
IF (isdir==false) RunProgram("/sys/tinypad", #file_path); break;
|
||||
case 054: Open_Dir(#path,1); break; //ïåðåðèñîâàòü îêíî F5
|
||||
case 182: Del_Form(); break; //delete file
|
||||
IF (isdir==false) RunProgram("/sys/tinypad", #file_path);
|
||||
break;
|
||||
case 054: //F5
|
||||
Open_Dir(#path,1);
|
||||
break;
|
||||
case 182: //delete file
|
||||
Del_Form();
|
||||
break;
|
||||
default:
|
||||
IF (strcmp("..",buf+72+304)<>0) temp_int=0; ELSE temp_int=1;
|
||||
for (i=curbtn+za_kadrom+1; i<kolichestvo; i++)
|
||||
FOR (i=curbtn+za_kadrom+1; i<kolichestvo; i++)
|
||||
{
|
||||
copystr(file_mas[i+temp_int]*304+buf+72,#temp);
|
||||
copystr(file_mas[i]*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;}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case evReDraw: draw_window(); BREAK;
|
||||
BREAK;
|
||||
case evReDraw: draw_window();
|
||||
}
|
||||
IF (rename_active==0) edit_box_mouse stdcall(#edit1); ELSE edit_box_mouse stdcall(#edit2);
|
||||
}
|
||||
@ -256,47 +281,38 @@ inline fastcall void draw_window()
|
||||
{
|
||||
WindowRedrawStatus(1);
|
||||
skin_width = GetSkinWidth();
|
||||
DefineAndDrawWindow(100,100,600,410,0x43,0x10E4DFE1,0,0,header);
|
||||
DefineAndDrawWindow(100,100,600,410,0x73,0x10E4DFE1,0,0,header);
|
||||
Form.GetInfo(SelfInfo);
|
||||
IF (Form.height==skin_width+3) {WindowRedrawStatus(2); return;} //ýòî çà÷¸ò!
|
||||
IF (Form.height==skin_width+3) {WindowRedrawStatus(2); return;} //íè÷åãî íå äåëàòü åñëè îêíî ñõëîïíóòî â çàãîëîâîê
|
||||
IF (Form.height<280) MoveSize(OLD,OLD,OLD,280);
|
||||
IF (Form.width<480) MoveSize(OLD,OLD,480,OLD);
|
||||
//toolbar buttons
|
||||
PutPaletteImage(#toolbar,246,39,5,0,#toolbar_pal);
|
||||
PutPaletteImage(#toolbar,246,39,0,0,#toolbar_pal);
|
||||
FOR (j=0; j<6; j++) DefineButton(toolbar_buttons_x[j],5,31,29,21+j+BT_HIDE,0xE4DFE1);
|
||||
//ïîëîñà àäðåñà
|
||||
DrawBar(251,0,onLeft(251,60),12,0xE4DFE1); //ôîí íàä ïîëîñîé àäðåñà
|
||||
DrawBar(246,0,onLeft(246,60),12,0xE4DFE1); //ôîí íàä ïîëîñîé àäðåñà
|
||||
edit1.width=Form.width-314;
|
||||
edit1.top=13+skin_width;
|
||||
edit1.top=13;
|
||||
KEdit();
|
||||
DrawRegion(251,12,onLeft(61,251),16,0x94AECE); //îáîäîê
|
||||
DrawBar(251,29,onLeft(251,60),10,0xE4DFE1); //ôîí ïîä ïîëîñîé àäðåñà
|
||||
DrawRegion_3D(246,12,onLeft(66,246),16,0x94AECE,0x94AECE); //îáîäîê
|
||||
DrawBar(246,29,onLeft(246,60),10,0xE4DFE1); //ôîí ïîä ïîëîñîé àäðåñà
|
||||
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); //êíîïêà ïåðåõîäà
|
||||
PutPaletteImage(#goto_about,56,40,Form.width-60,0,#goto_about_pal);
|
||||
PutPaletteImage(#goto_about,56,40,Form.width-65,0,#goto_about_pal);
|
||||
//ïðÿìîóãîëüíèêè âíóòðè
|
||||
DrawRegion(6,40,Form.width-12,Form.height-skin_width-46,0x94AECE); //ñèíèé îáîäîê
|
||||
DrawRegion(5,39,Form.width-10,Form.height-skin_width-44,0xE4DFE1); //ôîí
|
||||
DrawRegion_3D(1,40,Form.width-12,Form.height-skin_width-46,0x94AECE,0x94AECE); //ñèíèé îáîäîê
|
||||
DrawRegion_3D(0,39,Form.width-10,Form.height-skin_width-44,0xE4DFE1,0xE4DFE1); //ôîí
|
||||
Devices(); //ïàíåëü ñëåâà íà ñèíåì ôîíå
|
||||
//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);
|
||||
//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");
|
||||
//ïðîêðóòêà
|
||||
DrawFlatButton(onLeft(22,0),40,16,16,50,0xE4DFE1,"\x18"); //ïðîêðóòêà ââåðõ
|
||||
DrawFlatButton(onLeft(22,0),onTop(22,0),16,16,51,0xE4DFE1,"\x19");//ïðîêðóòêà âíèç
|
||||
DrawBar(onLeft(27,0),57,1,onTop(22,57),0x94AECE); //ëèíèÿ ñëåâà îò ïðîêðóòêè
|
||||
DrawFlatButton(onLeft(27,0),40,16,16,0,0xE4DFE1,"\x18"); //ïðîêðóòêà ââåðõ
|
||||
DrawFlatButton(onLeft(27,0),onTop(22,0),16,16,0,0xE4DFE1,"\x19");//ïðîêðóòêà âíèç
|
||||
//
|
||||
//DrawBar(197,57,onLeft(22,197),onTop(57,6),0xFFFFFF); //çàëèâêà áåëûì
|
||||
//
|
||||
DrawBar(onLeft(22,0),57,1,onTop(22,57),0x94AECE); //ëèíèÿ ñëåâà îò ïðîêðóòêè
|
||||
but_num=onTop(6,57)/18;
|
||||
IF (but_num>100) but_num=1; ELSE 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); //íîâûå êíîïêè
|
||||
List_ReDraw();
|
||||
IF (del_active==1) Del_Form();
|
||||
Open_Dir(#path,3);
|
||||
//
|
||||
WindowRedrawStatus(2);
|
||||
}
|
||||
@ -311,14 +327,14 @@ void KEdit()
|
||||
|
||||
inline fastcall void TVScroll() { //Ïðîêðóòêà
|
||||
dword on_y;
|
||||
IF (kolichestvo<=0) {DrawFlatButton(onLeft(22,0),57,16,onTop(22,58),0,0xE4DFE1,""); return;}
|
||||
IF (kolichestvo<=0) {DrawFlatButton(onLeft(27,0),57,16,onTop(22,58),0,0xE4DFE1,""); return;}
|
||||
on_y = za_kadrom * onTop(22,57) / kolichestvo +57;
|
||||
razm_scrl=onTop(22,57) * but_num - but_num / kolichestvo;
|
||||
razm_scrl=onTop(22,57) * but_num - but_num / kolichestvo;
|
||||
IF (razm_scrl<20) razm_scrl = 20; //óñòàíàâëèâàåì ìèíèìàëüíûé ðàçìåð ñêðîëëà
|
||||
IF (razm_scrl>onTop(22,57)-on_y+56) || (za_kadrom+but_num>=kolichestvo) on_y=onTop(23+razm_scrl,0); //äëÿ áîëüøîãî ñïèñêà
|
||||
DrawFlatButton(onLeft(22,0),on_y,16,razm_scrl,0,0xE4DFE1,"");//ïîëçóíîê
|
||||
DrawBar(onLeft(21,0),57,15,on_y-57,0xCED0D0);//ïîëå äî ïîëçóíêà
|
||||
DrawBar(onLeft(21,0),on_y+razm_scrl+1,15,onTop(22,57)-razm_scrl-on_y+56,0xCED0D0); //ïîëå ïîñëå ïîëçóíêà
|
||||
DrawFlatButton(onLeft(27,0),on_y,16,razm_scrl,0,0xE4DFE1,"");//ïîëçóíîê
|
||||
DrawBar(onLeft(26,0),57,15,on_y-57,0xCED0D0);//ïîëå äî ïîëçóíêà
|
||||
DrawBar(onLeft(26,0),on_y+razm_scrl+1,15,onTop(22,57)-razm_scrl-on_y+56,0xCED0D0); //ïîëå ïîñëå ïîëçóíêà
|
||||
}
|
||||
|
||||
|
||||
@ -355,7 +371,7 @@ void FileList_ReDraw(int curbtn_)
|
||||
ELSE
|
||||
{
|
||||
IF(but_num+za_kadrom+curbtn_>=kolichestvo) za_kadrom=kolichestvo-but_num; ELSE za_kadrom+=curbtn_+curbtn-but_num+1;
|
||||
curbtn=but_num;
|
||||
curbtn=but_num-1;
|
||||
List_ReDraw();
|
||||
}
|
||||
}
|
||||
@ -364,15 +380,14 @@ void FileList_ReDraw(int curbtn_)
|
||||
|
||||
void List_ReDraw()
|
||||
{
|
||||
IF (kolichestvo-za_kadrom<but_num) //åñëè ìû â êîíöå ñïèñêà ôàéëîâ ðàçâåðí¸ì îêíî ïîÿâÿòüñÿ ïóñòÿå áåëûå êíîïêè
|
||||
{ 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; //ýòî åñëè âûäåëåíèå ïîñëå ñõëîïûâàíèÿ îêíà çà êàäðîì
|
||||
IF (kolichestvo-za_kadrom<but_num) || (curbtn>but_num-1) //åñëè ìû â êîíöå ñïèñêà ôàéëîâ ðàçâåðí¸ì îêíî ïîÿâÿòüñÿ ïóñòÿå áåëûå êíîïêè
|
||||
{ za_kadrom=kolichestvo-but_num; curbtn=but_num-1; } //ýòî åñëè âûäåëåíèå ïîñëå ñõëîïûâàíèÿ îêíà çà êàäðîì
|
||||
//
|
||||
FOR (j=0; j<but_num; j++) IF (curbtn<>j) Line_ReDraw(0xFFFFFF, j); ELSE Line_ReDraw(videlenie, curbtn);
|
||||
temp_int=but_num*18+57;
|
||||
DrawBar(197,temp_int,onLeft(22,197),onTop(temp_int,6),0xFFFFFF); //çàëèâêà áåëûì äîêîíöà
|
||||
DrawBar(onLeft(163,0),temp_int,1,onTop(temp_int,6),0xE4DFE1); //ïîëîñà ñåðàÿ âåðòèêàëüíàÿ 1
|
||||
DrawBar(onLeft(90,0),temp_int,1,onTop(temp_int,6),0xE4DFE1); //ïîëîñà ñåðàÿ âåðòèêàëüíàÿ 2
|
||||
DrawBar(192,temp_int,onLeft(27,192),onTop(temp_int,6),0xFFFFFF); //çàëèâêà áåëûì äîêîíöà
|
||||
DrawBar(onLeft(168,0),temp_int,1,onTop(temp_int,6),0xE4DFE1); //ïîëîñà ñåðàÿ âåðòèêàëüíàÿ 1
|
||||
DrawBar(onLeft(95,0),temp_int,1,onTop(temp_int,6),0xE4DFE1); //ïîëîñà ñåðàÿ âåðòèêàëüíàÿ 2
|
||||
TVScroll();
|
||||
}
|
||||
|
||||
@ -383,7 +398,7 @@ void Line_ReDraw(dword color, filenum){
|
||||
{
|
||||
rename_active=0;
|
||||
edit2.flags=64;
|
||||
DefineButton(197,curbtn*18+57,onLeft(22,197),18,curbtn+201+BT_HIDE+BT_NOFRAME,0xFFFFFF);
|
||||
DefineButton(192,curbtn*18+57,onLeft(27,192),18,curbtn+201+BT_HIDE+BT_NOFRAME,0xFFFFFF);
|
||||
IF (filenum==100) filenum=curbtn; else
|
||||
{
|
||||
copystr(#path,#temp);
|
||||
@ -393,7 +408,7 @@ void Line_ReDraw(dword color, filenum){
|
||||
{
|
||||
//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);}
|
||||
IF (EAX) {DrawFlatButton(Form.width-200+192/2,160,200,80,0,0xFFB6B5, "Error. Folder isn't empty."); Pause(200);}
|
||||
ELSE CreateFolder(#temp);
|
||||
Open_Dir(#path,1);
|
||||
}
|
||||
@ -402,12 +417,10 @@ void Line_ReDraw(dword color, filenum){
|
||||
}
|
||||
y=filenum*18+57;
|
||||
//äà, ÿ íå ñïîðþ ÷òî èçâðàò, íî ïåðåðèñîâêà çàòî ìàëåíüêàÿ
|
||||
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);
|
||||
DrawBar(192,y,3,18,color); DrawBar(195,y,16,2,color);
|
||||
DrawBar(192+19,y,onLeft(46,192),18,color); DrawBar(195,y+17,16,1,color);
|
||||
//
|
||||
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;
|
||||
off=file_mas[filenum+za_kadrom]*304 + buf+72;
|
||||
EAX=ESDWORD[off-40];
|
||||
$shr eax,4
|
||||
$and eax,1
|
||||
@ -415,14 +428,14 @@ void Line_ReDraw(dword color, filenum){
|
||||
if (!EAX)
|
||||
{
|
||||
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
|
||||
WriteText(7-strlen(ConvertSize(ESDWORD[off-8]))*6+onLeft(70,0),y+6,0x80,0,ConvertSize(ESDWORD[off-8]),0); //size
|
||||
} ELSE IF (!strcmp("..",off)) temp_int=Put_icon("..", y+2); ELSE temp_int=Put_icon("<DIR>", y+2);
|
||||
if (color==videlenie)
|
||||
{
|
||||
IconFairing(temp_int, y+2); //çàêðàøèâàåì èêîíêó
|
||||
copystr(#path,#file_path);
|
||||
copystr(off,#file_name);
|
||||
copystr(off,#file_path+strlen(#file_path)); //èòàê, file_path=ôàéëó, ò.ê. ïî-óìîë÷àíèþ ýòî ïðîãà
|
||||
copystr(#path,#file_path);
|
||||
copystr(#file_name,#file_path+strlen(#file_path)); //ïîëíûé ïóòü ê ôàéëó
|
||||
/*IF (show_preview) && (!isdir)
|
||||
{
|
||||
GetImage(#file_path);
|
||||
@ -431,107 +444,97 @@ void Line_ReDraw(dword color, filenum){
|
||||
IF (pLoadedImage<>0) DrawImage(#CurrentImage, 22*65536+j+skin_width+18);
|
||||
}*/
|
||||
}
|
||||
temp_int = onLeft(220,160)/6;
|
||||
temp_int = onLeft(215,160)/6;
|
||||
IF (strlen(off)<temp_int) temp_int = strlen(off); //äëèííà íàçâàíèÿ ôàéëà
|
||||
WriteText(220,y+6,0,0,off,temp_int); //èìÿ ôàéëà
|
||||
DrawBar(onLeft(163,0),y,1,18,0xE4DFE1); //ïîëîñà ñåðàÿ âåðòèêàëüíàÿ 1
|
||||
DrawBar(onLeft(90,0),y,1,18,0xE4DFE1); //ïîëîñà ñåðàÿ âåðòèêàëüíàÿ 2
|
||||
WriteText(215,y+6,0,0,off,temp_int); //èìÿ ôàéëà
|
||||
DrawBar(onLeft(168,0),y,1,18,0xE4DFE1); //ïîëîñà ñåðàÿ âåðòèêàëüíàÿ 1
|
||||
DrawBar(onLeft(95,0),y,1,18,0xE4DFE1); //ïîëîñà ñåðàÿ âåðòèêàëüíàÿ 2
|
||||
}
|
||||
|
||||
|
||||
void Open_Dir(dword path_,redraw){
|
||||
IF (buf) free(buf);
|
||||
//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_);
|
||||
//
|
||||
kolichestvo=EBX;
|
||||
//
|
||||
void Open_Dir(dword temp_, redraw){
|
||||
byte path_[256], somelen=strlen(temp_)-1;
|
||||
if (redraw<>3)
|
||||
{
|
||||
copystr(temp_, #path_);
|
||||
IF (somelen) path_[somelen]=0x00;
|
||||
//
|
||||
IF (buf) free(buf);
|
||||
buf = malloc(32);
|
||||
ReadDir(0, buf, #path_);
|
||||
kolichestvo = ESDWORD[buf+8];
|
||||
buf = realloc(kolichestvo * 304 + 32, buf);
|
||||
ReadDir(kolichestvo, buf, #path_);
|
||||
IF (EBX>6898) && (EBX<>-1) EBX=6898;
|
||||
kolichestvo=EBX;
|
||||
}
|
||||
if (kolichestvo<>-1) && (redraw>0)
|
||||
{
|
||||
FOR (j=0;j<kolichestvo;j++) {off=j*304+buf+72; IF(strcmp(path_,"/")<>0) ChangeCase(off);} //ðåãèñòð
|
||||
IF (!strcmp(".",buf+72)) {memmov(buf,buf+304,kolichestvo-1*304); kolichestvo--; } //ôèëüòðóåì ýëåìåíò "."
|
||||
FOR (j=0;j<but_num;j++) DeleteButton(201+j); //óäàëÿåì ñòàðûå
|
||||
but_num=onTop(6,57)/18;
|
||||
IF (strcmp(".",buf+72)==0) kolichestvo--; //ôèëüòðóåì ýëåìåíò "."
|
||||
//IF (strcmp(".",buf+72)==0) copystr(304+buf+72,buf);
|
||||
IF (but_num>100) but_num=1; ELSE//ýòà ñòðàííàÿ ñòðî÷êà äëÿ òîãî åñëè ðàçìåðû îêíà ñëèøêîì ìàëåíüêèå
|
||||
but_num=onTop(6,57)/18;
|
||||
IF (but_num>100) but_num=1; ELSE //ýòà ñòðàííàÿ ñòðî÷êà äëÿ òîãî åñëè ðàçìåðû îêíà ñëèøêîì ìàëåíüêèå
|
||||
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); //íîâûå êíîïû
|
||||
FoldesGoUp();
|
||||
IF (redraw==1) List_ReDraw();
|
||||
copystr(path_,#edit_path);
|
||||
FOR (j=0;j<but_num;j++) DefineButton(192,j*18+57,onLeft(27,192),18,201+j+BT_HIDE+BT_NOFRAME,0xFFFFFF); //íîâûå êíîïû
|
||||
IF (redraw<>3) Sorting();
|
||||
IF (redraw==1) || (redraw==3) List_ReDraw();
|
||||
copystr(temp_,#edit_path);
|
||||
KEdit();
|
||||
copystr("|",#PathHistory+strlen(#PathHistory));
|
||||
copystr(#path,#PathHistory+strlen(#PathHistory));
|
||||
//ñòðåëî÷êà ñîðòèðîâêè
|
||||
IF (sort_num==1) WriteText(onLeft(192,168)/2+210,45,0x80,0x4E78AC,"\x19",0);
|
||||
IF (sort_num==2) WriteText(onLeft(115,0),45,0x80,0x4E78AC,"\x19",0);
|
||||
IF (sort_num==3) WriteText(onLeft(44,0),45,0x80,0x4E78AC,"\x19",0);
|
||||
}
|
||||
IF (kolichestvo==-1) {but_num=kolichestvo=0; List_ReDraw();}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void FoldesGoUp()
|
||||
inline Sorting()
|
||||
{
|
||||
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--; //ôàê! ýòî áðåä! õç êàê îíî ðàáîòàåò
|
||||
FOR (j=0;j<=kolichestvo;j++) //à ïàïêè ââåðõ, ôàéëû âíèç
|
||||
dword k=0, l=1;
|
||||
IF (!strcmp(#path,"/")) {FOR(k=1;k<kolichestvo;k++;)file_mas[k]=k; return;} //íå ñîðòèðîâàòü ïàïêè è íå ìåíÿòü ðåãèñòð â "/"
|
||||
FOR (j=kolichestvo-1, off=kolichestvo-1*304+buf+32; j>=0; j--, off-=304;) //ïàïêè ââåðõ, ôàéëû âíèç
|
||||
{
|
||||
EAX=ESDWORD[off-40];
|
||||
ChangeCase(off+40);
|
||||
EAX=ESDWORD[off];
|
||||
$shr eax,4
|
||||
$and eax,1
|
||||
IF (EAX) {file_mas[k]=j; k++;}
|
||||
ELSE {file_mas[kolichestvo-l]=j; l++;}
|
||||
off += 304;
|
||||
IF (EAX) {file_mas[k]=j; k++;} ELSE
|
||||
{file_mas[kolichestvo-l]=j; l++;}
|
||||
}
|
||||
switch(sort_num)
|
||||
{
|
||||
CASE 1: //óïîðÿäî÷èâàåì ôàéëû ïî èìåíè
|
||||
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: //óïîðÿäî÷èâàåì ôàéëû ïî òèïó
|
||||
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); //èíîãäà èìÿ ïàïêè íà÷èíàåòñÿ ñ !,&...
|
||||
IF (strcmp(".",buf+72)<>0) && (strlen(#path)>6) kolichestvo++;
|
||||
//Ñîáñòâåííî ñîðòèðîâêà
|
||||
Sort_by_Name(0,k-1);
|
||||
IF (sort_num==1) Sort_by_Name(k,kolichestvo-1);
|
||||
IF (sort_num==2) Sort_by_Type(k, kolichestvo-1);
|
||||
IF (sort_num==3) Sort_by_Size(k,kolichestvo-1);
|
||||
//åñëè ïàïêà ".." íå ïåðâàÿ, ñòàâèì å¸ òóäà
|
||||
IF (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];
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
int dform_x=Form.width/2-13;
|
||||
//òèïà îêíî
|
||||
FOR (i=5;i<11;i++) DeleteButton(201+i); //óäàëÿåì êíîïêè ïîä ôîðìîé
|
||||
DrawFlatButton(temp_int,160,200,80,0,0xE4DFE1, ""); //ôîðìà
|
||||
WriteText(temp_int+19,175,0x80,0,"Do you really want to delete",0);
|
||||
DrawFlatButton(dform_x,160,200,80,0,0xE4DFE1, ""); //ôîðìà
|
||||
WriteText(dform_x+19,175,0x80,0,"Do you really want to delete",0);
|
||||
IF (strlen(#file_name)<28)
|
||||
{
|
||||
WriteText(strlen(#file_name)*6+temp_int+20,190,0x80,0,"?",0);
|
||||
WriteText(temp_int+20,190,0x80,0,#file_name,0); //ïèøåì èìÿ
|
||||
WriteText(strlen(#file_name)*6+dform_x+20,190,0x80,0,"?",0);
|
||||
WriteText(dform_x+20,190,0x80,0,#file_name,0); //ïèøåì èìÿ
|
||||
}
|
||||
ELSE
|
||||
{
|
||||
WriteText(164+temp_int,190,0x80,0,"...?",0);
|
||||
WriteText(temp_int+20,190,0,0,#file_name,24); //ïèøåì èìÿ
|
||||
WriteText(164+dform_x,190,0x80,0,"...?",0);
|
||||
WriteText(dform_x+20,190,0,0,#file_name,24); //ïèøåì èìÿ
|
||||
}
|
||||
//êíîïî÷êè
|
||||
DrawFlatButton(temp_int+20,208,70,20,301,0xFFB6B5,"Yes");
|
||||
DrawFlatButton(temp_int+111,208,70,20,302,0xC6DFC6,"No");
|
||||
DrawFlatButton(dform_x+20,208,70,20,301,0xFFB6B5,"Yes");
|
||||
DrawFlatButton(dform_x+111,208,70,20,302,0xC6DFC6,"No");
|
||||
del_active=1;
|
||||
}
|
||||
|
||||
@ -541,7 +544,7 @@ void Del_File(byte dodel)
|
||||
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);}
|
||||
IF (EAX<>0) && (isdir==true) {DrawFlatButton(Form.width/2-13,160,200,80,0,0xFFB6B5, "Error. Folder isn't empty."); Pause(200);}
|
||||
}
|
||||
del_active=0;
|
||||
DeleteButton(301); DeleteButton(302); //óäàëÿåì êíîïî÷êè Yes/No
|
||||
@ -551,21 +554,21 @@ void Del_File(byte dodel)
|
||||
|
||||
void Paste()
|
||||
{
|
||||
IF (strcmp(#copyfile,"")==0) return; //îòìåíà, åøè åù¸ íè÷¸ íå ñêîïèðîâàëè
|
||||
IF (!copy_file) return; //îòìåíà, åøè åù¸ íè÷¸ íå ñêîïèðîâàëè
|
||||
copystr(#path,#temp);
|
||||
copystr(#copy_name,#temp+strlen(#temp));
|
||||
if (strcmp(#copyfile,#temp)==0) //åñëè ìû êîïèðóåì è âñòàâëÿåì â îäíîé è òîé æå ïàïêå
|
||||
copystr(#copy_file+find_symbol(#copy_file,'/'),#temp+strlen(#temp));
|
||||
if (strcmp(#copy_file,#temp)==0) //åñëè ìû êîïèðóåì è âñòàâëÿåì â îäíîé è òîé æå ïàïêå
|
||||
{
|
||||
copystr(#path,#temp);
|
||||
copystr("new_",#temp+strlen(#temp));
|
||||
copystr(#copy_name,#temp+strlen(#temp));
|
||||
copystr(#copy_file+find_symbol(#copy_file,'/'),#temp+strlen(#temp));
|
||||
}
|
||||
CopyFile(#copyfile,#temp);
|
||||
CopyFile(#copy_file,#temp);
|
||||
IF (cut_active==1) //åñëè ìû âûáðàëè âûðåçàòü
|
||||
{
|
||||
copystr(#copyfile,#file_path);
|
||||
copystr(#copy_file,#file_path);
|
||||
Del_File(true);
|
||||
copyfile='';
|
||||
copy_file='';
|
||||
cut_active=0;
|
||||
}
|
||||
Open_Dir(#path,1);
|
||||
@ -574,26 +577,26 @@ void Paste()
|
||||
|
||||
void Tip(int y, dword caption, id, arrow)
|
||||
{
|
||||
DrawBar(22,y,160,17,0xE4DFE1); //ñåðîå ñâåðõó
|
||||
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); //êíîïà äëÿ ñòðåëêè
|
||||
WriteText(170,y+5,0x80,0,arrow,0); //ñòðåëêà âíèç
|
||||
DrawBar(22,y+17,160,1,0x94AECE); //ïîä÷¸ðêèâàíèå
|
||||
DrawBar(17,y,160,17,0xE4DFE1); //ñåðîå ñâåðõó
|
||||
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); //êíîïà äëÿ ñòðåëêè
|
||||
WriteText(165,y+5,0x80,0,arrow,0); //ñòðåëêà âíèç
|
||||
DrawBar(17,y+17,160,1,0x94AECE); //ïîä÷¸ðêèâàíèå
|
||||
}
|
||||
|
||||
|
||||
void Devices()
|
||||
{
|
||||
byte dev_icon; dword drive_name[30]; char dev_name[4];
|
||||
DrawBar(7,41,190,15,0x00699C); //ñèíèé ïðÿìîóãîëüíèê - ñâåðõó
|
||||
DrawBar(7,56,15,onTop(21,41),0x00699C); //ñèíèé ïðÿìîóãîëüíèê - ñëåâà
|
||||
DrawBar(182,56,15,onTop(21,41),0x00699C); //ñèíèé ïðÿìîóãîëüíèê - ñïðàâà
|
||||
DrawBar(2,41,190,15,0x00699C); //ñèíèé ïðÿìîóãîëüíèê - ñâåðõó
|
||||
DrawBar(2,56,15,onTop(21,41),0x00699C); //ñèíèé ïðÿìîóãîëüíèê - ñëåâà
|
||||
DrawBar(177,56,15,onTop(21,41),0x00699C); //ñèíèé ïðÿìîóãîëüíèê - ñïðàâà
|
||||
//ñïèñîê äèñêîâ
|
||||
Tip(56, "Goto:", 0, "");
|
||||
DrawBar(22,74,160,dev_num*16+1,0xFFFFFF); //áåëîå
|
||||
DrawBar(17,74,160,dev_num*16+1,0xFFFFFF); //áåëîå
|
||||
for (i=0;i<dev_num;i++)
|
||||
{
|
||||
DefineButton(22,i*16+74,159,16,100+i+BT_HIDE,0xE4DFE1); //ñîçäà¸ì êíîïêè, à ïîòîì âûâîäèì íàçâàíèÿ äèñêîâ
|
||||
DefineButton(17,i*16+74,159,16,100+i+BT_HIDE,0xE4DFE1); //ñîçäà¸ì êíîïêè, à ïîòîì âûâîäèì íàçâàíèÿ äèñêîâ
|
||||
copystr("Unknown drive",#drive_name); //èçíà÷àëüíî íåèçâåñíûé íîñèòåëü
|
||||
dev_icon=3; //ïî-óìîë÷àíèþ óñòðîéñòâî âûãëÿäèò êàê æåñòÿê
|
||||
copystr(i*304+ devbuf+72, #dev_name);
|
||||
@ -605,7 +608,7 @@ void Devices()
|
||||
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);
|
||||
PutImage(dev_icon*14*13*3+#devices,14,13,21,i*16+76);
|
||||
}
|
||||
Actions(); //ôóíêöèè ôàéëîâ è ïàïîê
|
||||
Preview();
|
||||
@ -614,35 +617,35 @@ void Devices()
|
||||
|
||||
void Actions()
|
||||
{
|
||||
DrawBar(22,dev_num*16+75,160,15,0x00699C); //ñèíèé ïðÿìîóãîëüíèê - ïîä äåâàéñàìè
|
||||
DrawBar(17,dev_num*16+75,160,15,0x00699C); //ñèíèé ïðÿìîóãîëüíèê - ïîä äåâàéñàìè
|
||||
if (show_actions==1)
|
||||
{
|
||||
Tip(dev_num*16+90, "Actions", 77, "\x19");
|
||||
DrawBar(22,dev_num*16+108,160,51,0xFFFFFF); //áåëîå
|
||||
PutImage(#factions,16,44,26,dev_num*16+113); //ïèêòîãðàìêè
|
||||
DrawBar(17,dev_num*16+108,160,51,0xFFFFFF); //áåëîå
|
||||
PutImage(#factions,16,44,21,dev_num*16+113); //ïèêòîãðàìêè
|
||||
//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);
|
||||
WriteText(42,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);
|
||||
DefineButton(17,dev_num*16+125,159,16,81+BT_HIDE,0xE4DFE1);
|
||||
WriteText(42,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); //ñèíåå ïîñëå Actions
|
||||
DefineButton(17,dev_num*16+142,159,16,82+BT_HIDE,0xE4DFE1);
|
||||
WriteText(42,dev_num*16+147,0x80,0,"Create folder <F6>",0);
|
||||
DrawBar(17,dev_num*16+159,160,15,0x00699C); //ñèíåå ïîñëå 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); //ñèíåå
|
||||
DrawBar(17,dev_num*16+108,160,51,0x00699C); //ñèíåå
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Dir_Up()
|
||||
{
|
||||
byte temp_[256];
|
||||
char temp_[256];
|
||||
i=strlen(#path)-1;
|
||||
path[i]=0x00;
|
||||
do i--; while (path[i]<>'/'); copystr(#path+i+1,#temp_);
|
||||
@ -650,14 +653,14 @@ void Dir_Up()
|
||||
ChangeCase(#temp_);
|
||||
za_kadrom=curbtn=0; //ââåðõ ñïèñêà
|
||||
Open_Dir(#path,2);
|
||||
FOR (i=kolichestvo; i>0; i--;) IF(strcmp(file_mas[i]*304+buf+72,#temp_)==0) BREAK;
|
||||
FOR (i=kolichestvo-1; 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;
|
||||
curbtn=i-kolichestvo+but_num;
|
||||
}
|
||||
ELSE IF (strcmp(".",buf+72)<>0) FileList_ReDraw(i); ELSE FileList_ReDraw(i-1);
|
||||
ELSE FileList_ReDraw(i);
|
||||
List_ReDraw();
|
||||
}
|
||||
|
||||
@ -670,21 +673,21 @@ void Preview()
|
||||
if (show_preview==1)
|
||||
{
|
||||
Tip(top_pr,"Preview",78,"\x19");
|
||||
DrawBar(22,top_pr+18,160,100,0xFFFFFF); //áåëîå
|
||||
/*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);
|
||||
DrawBar(17,top_pr+18,160,100,0xFFFFFF); //áåëîå
|
||||
WriteText(25,top_pr+30,0x80,0,"Number of files:",0); WriteText(135,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); //ñèíåå
|
||||
DrawBar(17,top_pr+118,160,onTop(top_pr+118,6),0x00699C); //ñèíåå
|
||||
}
|
||||
ELSE
|
||||
{
|
||||
Tip(top_pr,"Preview",78,"\x18");
|
||||
DrawBar(22,top_pr+18,160,onTop(top_pr+18,6),0x00699C); //ñèíåå
|
||||
DrawBar(17,top_pr+18,160,onTop(top_pr+18,6),0x00699C); //ñèíåå
|
||||
}
|
||||
}
|
||||
|
||||
@ -700,6 +703,7 @@ void Goto_edit_path()
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline fastcall void GoBack() //âíà÷àëå óäàëÿåì òåêóùèé ïóòü, à ïîòîì êîïèðóåì òî, ÷òî îñòàëîñü
|
||||
{
|
||||
//char old_dir[256]='';
|
||||
|
78
programs/fs/Eolite/trunk/include/LVabout.h--
Normal file
78
programs/fs/Eolite/trunk/include/LVabout.h--
Normal file
@ -0,0 +1,78 @@
|
||||
#include "imgs\logo.txt"
|
||||
|
||||
/*
|
||||
//IPC
|
||||
#include "lib\Nable_lib.h--"
|
||||
#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
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
void authors()
|
||||
{
|
||||
mouse mm;
|
||||
byte letitclose=0;
|
||||
SetEventMask(100111b);
|
||||
loop() switch(WaitEvent())
|
||||
{
|
||||
case evMouse:
|
||||
mm.get();
|
||||
//êóëüíî
|
||||
IF (mm.x>85) && (mm.x<155) && (mm.y>190) && (mm.y<190+22)
|
||||
IF (mm.lkm) {DrawRegion_3D(86,191,68,20,0xC7C7C7,0xFFFFFF); letitclose=1;}
|
||||
ELSE {IF (letitclose) {DrawRegion_3D(86,191,68,20,0xFFFFFF,0xC7C7C7); Pause(7); ExitProcess();}}
|
||||
ELSE IF (letitclose) {letitclose=0; DrawRegion_3D(86,191,68,20,0xFFFFFF,0xC7C7C7);}
|
||||
break;
|
||||
case evButton: ExitProcess();
|
||||
case evKey: IF (GetKey()==27) ExitProcess(); break;
|
||||
case evReDraw:
|
||||
WindowRedrawStatus(1);
|
||||
DefineAndDrawWindow(500,200,181,256,0x34,0x10EFEBEF,0,0,"About Eolite");
|
||||
DrawBar(0,0,172,50,0x8494C4); //ãîëóáîå ñçàäè
|
||||
PutPaletteImage(#logo,85,85,48,7,#logo_pal);
|
||||
WriteText(33,100,0x80,0xBF40BF,"Eolite v0.98.2 RC1",0);
|
||||
WriteText(55,120,0x80,0,"Developers:",0);
|
||||
WriteText(39,130,0x80,0,"Leency & Veliant",0);
|
||||
WriteText(30,140,0x80,0,"Diamond, Lrz, Nable",0);
|
||||
WriteText(21,160,0x80,0,"Made using C-- in 2008",0);
|
||||
WriteText(18,170,0x80,0,"Visit www.kolibrios.org",0);
|
||||
DrawFlatButton(85,190,70,22,0,0xE4DFE1, "Close");
|
||||
WindowRedrawStatus(2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*òèïà àíèìàöèÿ
|
||||
WHILE (m.lkm==1)
|
||||
{
|
||||
Pause(10);
|
||||
PutPaletteImage(p*16*15+#ficons,16,15,100,350,#ficons_pal);
|
||||
IF (p>21) p=0; ELSE p++;
|
||||
m.get();
|
||||
}*/
|
||||
|
||||
|
||||
dword onLeft(dword right,left) {EAX=Form.width-right-left;}
|
||||
dword onTop(dword down,up) {EAX=Form.height-skin_width-down-up;}
|
||||
|
||||
|
||||
dword ConvertSize(dword bytes)
|
||||
{
|
||||
char size_prefix[7], temp[3];
|
||||
IF (bytes>=1073741824) copystr(" Gb",#temp);
|
||||
ELSE IF (bytes>=1048576) copystr(" Mb",#temp);
|
||||
ELSE IF (bytes>=1024) copystr(" Kb",#temp);
|
||||
ELSE copystr(" b ",#temp);
|
||||
WHILE (bytes>1023) bytes/=1024;
|
||||
copystr(IntToStr(bytes),#size_prefix);
|
||||
copystr(#temp,#size_prefix+strlen(#size_prefix));
|
||||
EAX=#size_prefix;
|
||||
}
|
@ -3,65 +3,65 @@ void IconFairing(int filenum, y)
|
||||
switch(filenum)
|
||||
{
|
||||
case 0...4: //ôàéëèê
|
||||
DrawBar(200,y,2,15,videlenie);
|
||||
DrawBar(214,y,2,15,videlenie);
|
||||
DrawBar(210,y,4,1,videlenie);
|
||||
DrawBar(211,y+1,3,1,videlenie);
|
||||
DrawBar(212,y+2,2,1,videlenie);
|
||||
PutPixel(213,y+3,videlenie);
|
||||
DrawBar(195,y,2,15,videlenie);
|
||||
DrawBar(209,y,2,15,videlenie);
|
||||
DrawBar(205,y,4,1,videlenie);
|
||||
DrawBar(206,y+1,3,1,videlenie);
|
||||
DrawBar(207,y+2,2,1,videlenie);
|
||||
PutPixel(208,y+3,videlenie);
|
||||
return;
|
||||
case 16...17: //ïàïêà
|
||||
DrawBar(200,y,1,15,videlenie);
|
||||
DrawBar(208,y,8,2,videlenie);
|
||||
IF (filenum==17) PutPixel(211,y+1,0x1A7B17); //çåë¸íàÿ òî÷êà ñòðåëêè
|
||||
DrawBar(201,y+13,15,2,videlenie);
|
||||
PutPixel(201,y,videlenie); //.òî÷êè
|
||||
PutPixel(207,y,videlenie);
|
||||
PutPixel(215,y+2,videlenie);
|
||||
PutPixel(201,y+12,videlenie);
|
||||
PutPixel(215,y+12,videlenie);
|
||||
DrawBar(195,y,1,15,videlenie);
|
||||
DrawBar(203,y,8,2,videlenie);
|
||||
IF (filenum==17) PutPixel(206,y+1,0x1A7B17); //çåë¸íàÿ òî÷êà ñòðåëêè
|
||||
DrawBar(196,y+13,15,2,videlenie);
|
||||
PutPixel(196,y,videlenie); //.òî÷êè
|
||||
PutPixel(202,y,videlenie);
|
||||
PutPixel(210,y+2,videlenie);
|
||||
PutPixel(196,y+12,videlenie);
|
||||
PutPixel(210,y+12,videlenie);
|
||||
return;
|
||||
case 13: //skin
|
||||
PutPixel(215,y,videlenie);
|
||||
PutPixel(210,y,videlenie);
|
||||
return;
|
||||
case 11: //asm
|
||||
DrawBar(201,y,1,15,videlenie);
|
||||
DrawBar(196,y,1,15,videlenie);
|
||||
case 14: //video
|
||||
DrawBar(200,y,1,15,videlenie);
|
||||
DrawBar(215,y,1,15,videlenie);
|
||||
DrawBar(195,y,1,15,videlenie);
|
||||
DrawBar(210,y,1,15,videlenie);
|
||||
return;
|
||||
case 15: //àðõèâ
|
||||
PutPixel(200,y,videlenie); //ñïðàâà ñïðàâà
|
||||
DrawBar(213,y,3,1,videlenie);
|
||||
DrawBar(214,y+1,2,1,videlenie);
|
||||
PutPixel(215,y+2,videlenie);
|
||||
PutPixel(200,y+11,videlenie);
|
||||
DrawBar(200,y+12,2,1,videlenie);
|
||||
DrawBar(200,y+13,3,1,videlenie);
|
||||
DrawBar(200,y+14,4,1,videlenie);
|
||||
PutPixel(195,y,videlenie); //ñïðàâà ñïðàâà
|
||||
DrawBar(208,y,3,1,videlenie);
|
||||
DrawBar(209,y+1,2,1,videlenie);
|
||||
PutPixel(210,y+2,videlenie);
|
||||
PutPixel(195,y+11,videlenie);
|
||||
DrawBar(195,y+12,2,1,videlenie);
|
||||
DrawBar(195,y+13,3,1,videlenie);
|
||||
DrawBar(195,y+14,4,1,videlenie);
|
||||
return;
|
||||
case 19: //èçîáðàæåíèå
|
||||
DrawBar(200,y+14,16,1,videlenie);
|
||||
DrawBar(195,y+14,16,1,videlenie);
|
||||
return;
|
||||
case 20: //êàðòðèäæ
|
||||
DrawBar(200,y,16,2,videlenie);
|
||||
DrawBar(200,y+11,1,2,videlenie);
|
||||
DrawBar(215,y+11,1,2,videlenie);
|
||||
DrawBar(200,y+13,16,2,videlenie);
|
||||
DrawBar(195,y,16,2,videlenie);
|
||||
DrawBar(195,y+11,1,2,videlenie);
|
||||
DrawBar(210,y+11,1,2,videlenie);
|
||||
DrawBar(195,y+13,16,2,videlenie);
|
||||
return;
|
||||
case 21: //äèñêåòà
|
||||
PutPixel(200,y,videlenie);
|
||||
PutPixel(215,y,videlenie);
|
||||
PutPixel(195,y,videlenie);
|
||||
PutPixel(210,y,videlenie);
|
||||
return;
|
||||
case 22: //áèáëèîòåêà
|
||||
DrawBar(200,y,16,1,videlenie); //ñâåðõó ñëåâà
|
||||
DrawBar(200,y+1,3,1,videlenie);
|
||||
DrawBar(200,y+2,2,1,videlenie);
|
||||
PutPixel(200,y+3,videlenie);
|
||||
PutPixel(215,y+11,videlenie); //ñïðàâà ñïðàâà
|
||||
DrawBar(214,y+12,2,1,videlenie);
|
||||
DrawBar(213,y+13,3,1,videlenie);
|
||||
DrawBar(212,y+14,4,1,videlenie);
|
||||
DrawBar(195,y,16,1,videlenie); //ñâåðõó ñëåâà
|
||||
DrawBar(195,y+1,3,1,videlenie);
|
||||
DrawBar(195,y+2,2,1,videlenie);
|
||||
PutPixel(195,y+3,videlenie);
|
||||
PutPixel(210,y+11,videlenie); //ñïðàâà ñïðàâà
|
||||
DrawBar(209,y+12,2,1,videlenie);
|
||||
DrawBar(208,y+13,3,1,videlenie);
|
||||
DrawBar(207,y+14,4,1,videlenie);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -73,23 +73,23 @@ dword Put_icon(dword extension, yy)
|
||||
dword ftype="", fnum=0; //åøè íåèçâåñíûé ôàéë
|
||||
IF (!strcmp(extension,".kex")) {fnum = 6; ftype="Program";}
|
||||
IF (!strcmp(extension,".cvs")) {fnum = 18; ftype="Graph";}
|
||||
IF (!strcmp(extension,".cmd")) || (!strcmp(extension,".bat")) {fnum = 5; ftype="CMD skript";}
|
||||
IF (!strcmp(extension,".cmd")) || (!strcmp(extension,".bat")) {fnum = 5; ftype="Script";}
|
||||
IF (!strcmp(extension,".skn")) {fnum = 13; ftype="Skin";}
|
||||
IF (!strcmp(extension,".chr"))|| (!strcmp(extension+1,".mt")) || (!strcmp(extension,".ttf")) || (!strcmp(extension,".fon")) {fnum = 10; ftype="Font";}
|
||||
IF (!strcmp(extension,".asm")) {fnum = 11; ftype="Source";}
|
||||
IF (!strcmp(extension,".inc")) fnum = 9;
|
||||
IF (!strcmp(extension,".exe")) || (!strcmp(extension,".msi")) {fnum = 7; ftype="Win32 Exec";}
|
||||
IF (!strcmp(extension,".com")) fnum = 5;
|
||||
IF (!strcmp(extension,".com")) {fnum = 5; ftype="DOS Exec";}
|
||||
IF (!strcmp(extension,".cpp")) {fnum = 3; ftype="C++ code";}
|
||||
IF (!strcmp(extension,".nes")) {fnum = 20; ftype="Cartridge";}
|
||||
IF (!strcmp(extension,".img")) || (!strcmp(extension,".ima")) {fnum = 21; ftype="Image";}
|
||||
IF (!strcmp(extension,".dll")) || (!strcmp(extension,".obj")) {fnum = 22; ftype="Library";}
|
||||
IF (!strcmp(extension,".sys")) || (!strcmp(extension,".ocx")) fnum = 8;
|
||||
IF (!strcmp(extension,".sys")) || (!strcmp(extension,".ocx")) || (!strcmp(extension,".drv")) fnum = 8;
|
||||
IF (!strcmp(extension,".ini")) || (!strcmp(extension,"conf")) {fnum = 4; ftype="Config";}
|
||||
IF (!strcmp(extension,".htm")) || (!strcmp(extension,"html")) {fnum = 2; ftype="Web-page";}
|
||||
//text
|
||||
IF (!strcmp(extension,".txt")) || (!strcmp(extension,".doc")) ||
|
||||
(!strcmp(extension,".rtf")) {fnum = 1; ftype="Text";}
|
||||
(!strcmp(extension,".rtf")) || (!strcmp(extension,".pdf")) {fnum = 1; ftype="Text";}
|
||||
//èçîáðàæåíèÿ
|
||||
IF (!strcmp(extension,".gif")) || (!strcmp(extension,".bmp")) ||
|
||||
(!strcmp(extension,".tga")) || (!strcmp(extension,".pcx")) ||
|
||||
@ -102,16 +102,17 @@ dword Put_icon(dword extension, yy)
|
||||
(!strcmp(extension+1,".7z")){fnum = 15; ftype="Archive";}
|
||||
//audio
|
||||
IF (!strcmp(extension,".mp3")) {fnum = 12; ftype="Music";}
|
||||
IF (!strcmp(extension,".wav")) || (strcmp(extension,".mid")==0) ||
|
||||
(!strcmp(extension,"midi")) || (strcmp(extension,".ogg")==0) {fnum = 12; ftype="Audio";}
|
||||
IF (!strcmp(extension,".wav")) || (!strcmp(extension,".mid")) ||
|
||||
(!strcmp(extension,"midi")) || (!strcmp(extension,".ogg")) ||
|
||||
(!strcmp(extension,".wma")) {fnum = 12; ftype="Audio";}
|
||||
//video
|
||||
IF (!strcmp(extension,".avi")) || (!strcmp(extension,".flv")) || (!strcmp(extension,".mpg")) ||
|
||||
(!strcmp(extension,".wmv")) {fnum = 14; ftype="Video";}
|
||||
(!strcmp(extension,".wmv")) || (!strcmp(extension,".mov")) {fnum = 14; ftype="Video";}
|
||||
//ïàïêè
|
||||
IF (!strcmp(extension,"<DIR>")) { fnum=16; WriteText(onLeft(140,0),yy+4,0x80,0,extension,0);}
|
||||
IF (!strcmp(extension,"<DIR>")) { fnum=16; WriteText(onLeft(145,0),yy+4,0x80,0,extension,0);}
|
||||
IF (!strcmp(extension,"..")) fnum=17;
|
||||
//
|
||||
PutPaletteImage(fnum*16*15+#ficons,16,15,200,yy,#ficons_pal);
|
||||
WriteText(onLeft(155,0),yy+4,0x80,0,ftype,0);
|
||||
PutPaletteImage(fnum*16*15+#ficons,16,15,195,yy,#ficons_pal);
|
||||
WriteText(onLeft(160,0),yy+4,0x80,0,ftype,0);
|
||||
return fnum;
|
||||
}
|
||||
|
@ -1,44 +1,4 @@
|
||||
#include "imgs\logo.txt"
|
||||
|
||||
void authors()
|
||||
{
|
||||
loop()
|
||||
{
|
||||
switch(WaitEvent())
|
||||
{
|
||||
CASE evButton: ExitProcess();
|
||||
CASE evKey: IF (GetKey()==27) ExitProcess(); break;
|
||||
CASE evReDraw:
|
||||
WindowRedrawStatus(1);
|
||||
DefineAndDrawWindow(500,200,181,256,0x04,0x10EFEBEF,0,0,"About Eolite");
|
||||
DrawBar(5,0,172,50,0x8494C4); //ãîëóáîå ñçàäè
|
||||
PutPaletteImage(#logo,85,85,48,7,#logo_pal);
|
||||
WriteText(32,100,0x80,0xBF40BF,"Eolite v0.97.2 beta7",0);
|
||||
WriteText(60,120,0x80,0,"Developers:",0);
|
||||
WriteText(44,130,0x80,0,"Leency & Veliant",0);
|
||||
WriteText(35,140,0x80,0,"Lrz, Diamond, Nable",0);
|
||||
WriteText(26,160,0x80,0,"Made using C-- in 2008",0);
|
||||
WriteText(23,170,0x80,0,"Visit www.kolibrios.org",0);
|
||||
DrawFlatButton(90,190,70,22,2,0xE4DFE1, "Close");
|
||||
WindowRedrawStatus(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
dword ConvertSize(dword bytes)
|
||||
{
|
||||
char size_prefix[7], temp[3];
|
||||
IF (bytes>=1073741824) copystr(" Gb",#temp);
|
||||
ELSE IF (bytes>=1048576) copystr(" Mb",#temp);
|
||||
ELSE IF (bytes>=1024) copystr(" Kb",#temp);
|
||||
ELSE copystr(" b ",#temp);
|
||||
WHILE (bytes>1023) bytes/=1024;
|
||||
copystr(IntToStr(bytes),#size_prefix);
|
||||
copystr(#temp,#size_prefix+strlen(#size_prefix));
|
||||
EAX=#size_prefix;
|
||||
}
|
||||
|
||||
//聋耱疣<E880B1> 耦痱桊钼赅. Leency 2008. GPL license.
|
||||
|
||||
void Sort_by_Size(int a, b) // для первого вызова: a = 0, b = <элементов в массиве> - 1
|
||||
{
|
@ -1,186 +0,0 @@
|
||||
//stuff for loading images via MeView via IPC by Nable. 2008
|
||||
//Last changed 13.11.2008
|
||||
|
||||
inline fastcall void registerIPCbuffer(dword ECX, dword EDX)
|
||||
//ecx - pointer to buffer, edx - buffer size
|
||||
{
|
||||
EAX=60;
|
||||
EBX=1;
|
||||
$int 0x40
|
||||
}
|
||||
|
||||
inline fastcall void build_param_string(dword ESI, dword EDI)
|
||||
//first parameter - pointer to filename string, second - pointer to
|
||||
//the output area for commandline for MeView
|
||||
proc_info _p_info;
|
||||
{
|
||||
_p_info.GetInfo(SelfInfo);
|
||||
EBX = _p_info.ID;
|
||||
EAX = 'NCPI'; //'IPCN' in reversed byte order
|
||||
$STOSD
|
||||
ECX = 8;
|
||||
|
||||
___NEW_SYMBOL_OF_PID:
|
||||
$ROL EBX,4
|
||||
|
||||
EAX = EBX;
|
||||
EAX &= 0xF;
|
||||
EAX += '0';
|
||||
|
||||
$CMP AL,'9'
|
||||
$JBE ___NEW_SYMBOL_OF_PID_PRINT
|
||||
$ADD AL,7 //('A'-'0'-10)
|
||||
___NEW_SYMBOL_OF_PID_PRINT:
|
||||
$STOSB
|
||||
$LOOP ___NEW_SYMBOL_OF_PID
|
||||
|
||||
___NEW_SYMBOL_OF_PATH_COPY:
|
||||
$LODSB
|
||||
$STOSB
|
||||
$OR AL,AL
|
||||
$JNE ___NEW_SYMBOL_OF_PATH_COPY
|
||||
}
|
||||
|
||||
char _Path2MeView[]="/sys/mv";
|
||||
|
||||
inline int RunMV(char* parameters)
|
||||
f70 _run_struct;
|
||||
{
|
||||
_run_struct.func = 7;
|
||||
_run_struct.param1 = 0;
|
||||
_run_struct.param2 = parameters;
|
||||
_run_struct.param3 =
|
||||
_run_struct.param4 =
|
||||
_run_struct.rezerv = 0;
|
||||
_run_struct.name = #_Path2MeView;
|
||||
|
||||
EAX=70;
|
||||
EBX=#_run_struct;
|
||||
$int 0x40
|
||||
//EAX (return code) will contain positive PID of new process or negative error code.
|
||||
}
|
||||
|
||||
|
||||
int loadimage_viaIPC(char* file_name_to_load, int initial_values)
|
||||
//really it must be IMAGE_INFO* initial_values, but compiler rejected
|
||||
//this, so I had to use 'int initial_values'
|
||||
char param_string[255];
|
||||
unsigned int _FrameCountTemp;
|
||||
int temp0; //scratch variable
|
||||
int came_size; //sizeof data that came. It's used to shrink unneeded IPC data
|
||||
//added by Nable 13.11.2008 3.36am (begin)
|
||||
int MVsPID; //no comments
|
||||
int MVsSlot; //no comments
|
||||
proc_info _p_info; //this structure will be used to test if MV is alive
|
||||
//added by Nable 13.11.2008 3.36am (end)
|
||||
{
|
||||
int pIPCbuffer = malloc(64); //IPC buffer for the first message can be
|
||||
//rather small but >= 8+8+24
|
||||
|
||||
/*Here you can add error checking code, i.e. if(!pIPCbuffer)
|
||||
{ ErrorExit("OUT OF MEMORY!"); }; */
|
||||
|
||||
registerIPCbuffer(pIPCbuffer,64);
|
||||
DSDWORD[pIPCbuffer+4]=8; //at +4 in IPC buffer is a relative pointer to free place
|
||||
|
||||
build_param_string(file_name_to_load, #param_string);
|
||||
|
||||
DSDWORD[pIPCbuffer]=0; //unlock the buffer
|
||||
|
||||
SetEventMask(01000000b); // 1 << (evIPC-1)
|
||||
//13.11.2008 3.45am Nable's fixes (begin1)
|
||||
MVsPID = RunMV(#param_string); //you can use here your function but don't forget
|
||||
//about parameters (param_string).
|
||||
MVsSlot = PIDtoSlot(MVsPID);
|
||||
|
||||
WHILE(!(WaitEventTimeout(100))){
|
||||
//we have only one event - evIPC so return value may be 0 or evIPC but if received 0 it can mean
|
||||
//either MV terminated silently or it just hasn't done the work and we should wait. Test for it
|
||||
_p_info.GetInfo(MVsSlot);
|
||||
IF((_p_info.status_slot > 2)||(_p_info.ID != MVsPID)) return 0;
|
||||
}
|
||||
//13.11.2008 4.26am Nable's fixes ( end1)
|
||||
|
||||
//else we got the message. Process it.
|
||||
DSDWORD[pIPCbuffer] |= -1; //lock the buffer
|
||||
|
||||
//the first dword of the message is frame count
|
||||
_FrameCountTemp = DSDWORD[pIPCbuffer+16]; //note that data of the first
|
||||
//message is located at offset 16 in IPC buffer;
|
||||
|
||||
IF(_FrameCountTemp <= 1) //see docs
|
||||
{
|
||||
ESI = pIPCbuffer+16+12;
|
||||
EDI = initial_values; //offset of CurrentImage structure
|
||||
|
||||
//Left and top corner's coords (not used in many cases but who knows?)
|
||||
$MOVSD
|
||||
//Width and height
|
||||
$MOVSD
|
||||
//bpp
|
||||
$LODSD
|
||||
$movzx eax,ax
|
||||
CurrentImage.BitsPerPixel = EAX;
|
||||
}
|
||||
//see docs
|
||||
came_size = DSDWORD[pIPCbuffer+24]; //amount of useful data
|
||||
temp0 = came_size + 4096; //+4096 - some reserve
|
||||
realloc(temp0+4096, pIPCbuffer); //+4096 - some reserve
|
||||
registerIPCbuffer(pIPCbuffer, temp0); //re-register IPC buffer with a new size
|
||||
|
||||
DSDWORD[pIPCbuffer+4]=8; //delete first message, at +4 in IPC buffer is a
|
||||
//relative pointer to free place
|
||||
|
||||
DSDWORD[pIPCbuffer]=0; //unlock the buffer to receive second msg
|
||||
|
||||
//13.11.2008 4.26am Nable's fixes ( begin2)
|
||||
WHILE(!(WaitEventTimeout(100))){
|
||||
//we have only one event - evIPC so return value may be 0 or evIPC but if received 0 it can mean
|
||||
//either MV terminated silently or it just hasn't done the work and we should wait. Test for it
|
||||
_p_info.GetInfo(MVsSlot);
|
||||
IF((_p_info.status_slot > 2)||(_p_info.ID != MVsPID)) return 0;
|
||||
}
|
||||
//13.11.2008 4.26am Nable's fixes ( end2)
|
||||
|
||||
//if we are here, then we received the second message. if FrameCount==1 then
|
||||
//it's a pure image data (if BitsPerPixel==15, 16, 24 or 32) or
|
||||
//(dword)sizeof(palette[]) then palette[] and then the image.
|
||||
//Parse it as you like, here's my way:
|
||||
|
||||
registerIPCbuffer(pIPCbuffer, 0); // there are no function 'unregister
|
||||
//IPC buffer' in Kolibri - so I have to use 'dark power'
|
||||
|
||||
//shrink unneeded IPC data
|
||||
ECX = came_size;
|
||||
$SHR ECX,2
|
||||
ECX++; //ECX = number of useful dwords
|
||||
EDI = pIPCbuffer;
|
||||
ESI = EDI + 16;
|
||||
$CLD
|
||||
$REP $MOVSD
|
||||
|
||||
//now we must interpret second message
|
||||
EDI = initial_values;
|
||||
IF(_FrameCountTemp <= 1)
|
||||
{
|
||||
IF(DSDWORD[EDI+24] > 8) //CurrentImage.BitsPerPixel
|
||||
{
|
||||
DSDWORD[EDI+20] = 0; //CurrentImage.pPalette=0
|
||||
DSDWORD[EDI+16] = pIPCbuffer; //CurrentImage.StartOfImage=pIPCbuffer
|
||||
}
|
||||
ELSE
|
||||
{
|
||||
EAX = pIPCbuffer + 4;
|
||||
DSDWORD[EDI+20] = EAX; //CurrentImage.pPalette=EAX
|
||||
EAX += DSDWORD[EAX-4];
|
||||
DSDWORD[EDI+16] = EAX; //CurrentImage.StartOfImage = EAX;
|
||||
};
|
||||
}
|
||||
ELSE
|
||||
{
|
||||
GetNthImageInfo(pIPCbuffer,EDI,0);
|
||||
};
|
||||
|
||||
EBX = _FrameCountTemp;
|
||||
return pIPCbuffer;
|
||||
}
|
@ -1,119 +0,0 @@
|
||||
/*-------------------------------------------------------------------------------
|
||||
C-- base library for Kolibri, Nable's variant.
|
||||
-------------------------------------------------------------------------------*/
|
||||
|
||||
inline fastcall dword WaitEventTimeout(dword EBX){
|
||||
EAX = 23; // wait here for event
|
||||
$int 0x40
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
struct IMAGE_INFO{
|
||||
word Left,Top,Width,Height; //+0, +2, +4, +6
|
||||
dword Delay,Displacement,StartOfImage; //+8, +12, +16
|
||||
dword pPalette,BitsPerPixel; //+20, +24
|
||||
};
|
||||
|
||||
IMAGE_INFO CurrentImage;
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
fastcall int GetNthImageInfo(dword ESI, EDI, ECX)
|
||||
//esi - pointer to structure with multiple images
|
||||
//edi - pointer to structure of type IMG_INFO
|
||||
//ecx - CurrentFrameNum
|
||||
//returns 0 if error
|
||||
int pCurrentImage;
|
||||
{
|
||||
pCurrentImage = EDI;
|
||||
EAX = 0;
|
||||
EBX = ESI;
|
||||
$jecxz _END_LOOP
|
||||
_1:
|
||||
$TEST ESI,ESI
|
||||
$JE __EXIT
|
||||
|
||||
//MOV ESI,[ESI] - c-- refused to compile it
|
||||
$DB 8Bh
|
||||
$DB 36h
|
||||
|
||||
$ADD ESI,EBX
|
||||
$loop _1
|
||||
_END_LOOP:
|
||||
$LODSD
|
||||
//left and top
|
||||
$MOVSD
|
||||
//width and height
|
||||
$MOVSD
|
||||
//delay
|
||||
$MOVSD
|
||||
//displacement
|
||||
$MOVSD
|
||||
|
||||
EDI = pCurrentImage;
|
||||
|
||||
$LODSD
|
||||
$TEST EAX,EAX
|
||||
$JS _NO_PALETTE
|
||||
$ADD EAX,EBX
|
||||
|
||||
//Stay calm, this pervertion is only because of uncomplete
|
||||
//pointers' support in C--
|
||||
|
||||
//CurrentImage.pPalette=ESI;
|
||||
DSDWORD[EDI+20] = ESI;
|
||||
|
||||
//CurrentImage.StartOfImage=EAX;
|
||||
DSDWORD[EDI+16] = EAX;
|
||||
|
||||
//CurrentImage.BitsPerPixel=8;
|
||||
DSDWORD[EDI+24] = 8;
|
||||
GOTO __EXIT;
|
||||
|
||||
_NO_PALETTE:
|
||||
$NEG EAX
|
||||
//CurrentImage.BitsPerPixel=EAX;
|
||||
DSDWORD[EDI+24] = EAX;
|
||||
|
||||
//CurrentImage.pPalette=0;
|
||||
DSDWORD[EDI+20] = 0;
|
||||
|
||||
//CurrentImage.StartOfImage=ESI;
|
||||
DSDWORD[EDI+16] = ESI;
|
||||
__EXIT:
|
||||
}
|
||||
|
||||
//As a parameter you should send PID of needed slot
|
||||
//return value will be 0 if not found
|
||||
inline fastcall int PIDtoSlot(dword EDX)
|
||||
{
|
||||
proc_info _p_info;
|
||||
EBX=#_p_info; //pointer to the structure
|
||||
ECX=2;//slot 1 is system
|
||||
WHILE(ECX<256){
|
||||
EAX=9;
|
||||
$INT 0x40
|
||||
IF(_p_info.ID == EDX) return ECX;
|
||||
ECX++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void fastcall DrawImage(dword EBX, EDX)
|
||||
{
|
||||
$PUSHAD
|
||||
EAX = 65;
|
||||
EBP = 0;
|
||||
EDI = DSDWORD[EBX+20];
|
||||
ESI = DSDWORD[EBX+24];
|
||||
$ROR EDX,16
|
||||
EDX += DSDWORD[EBX];
|
||||
$ROR EDX,16
|
||||
ECX = DSDWORD[EBX+4];
|
||||
$ROR ECX,16
|
||||
EBX = DSDWORD[EBX+16];
|
||||
$INT 0x40
|
||||
$POPAD
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ text_color, max, text, flags, size, pos, offset, cl_curs_x, cl_curs_y, shift, sh
|
||||
|
||||
|
||||
|
||||
int load_dll(EAX)
|
||||
int load_editbox_lib(EAX)
|
||||
{
|
||||
//set mask
|
||||
$mov eax,40
|
||||
|
@ -1,3 +1,18 @@
|
||||
#define ac97snd "AC97SND"
|
||||
#define desktop "desktop"
|
||||
#define fce "/sys/games/fce"
|
||||
#define graph "graph"
|
||||
#define htmlv "/sys/network/HTMLv"
|
||||
#define jpegview "JpegView"
|
||||
#define kvid "/sys/kvid"
|
||||
#define life2 "/sys/demos/life2"
|
||||
#define midamp "MIDAMP"
|
||||
#define mv "MV"
|
||||
#define pngview "pngview"
|
||||
#define rtfread "RtfRead"
|
||||
#define tinypad "TinyPad"
|
||||
#define view3ds "/sys/demos/3d/view3ds"
|
||||
|
||||
struct f70{
|
||||
dword func;
|
||||
dword param1;
|
||||
@ -8,6 +23,21 @@ struct f70{
|
||||
dword name;
|
||||
};
|
||||
|
||||
struct BDVK{
|
||||
dword attr;
|
||||
byte type_name;
|
||||
byte rez1, rez2, rez3;
|
||||
dword timecreate;
|
||||
dword datecreate;
|
||||
dword timelastaccess;
|
||||
dword datelastaccess;
|
||||
dword timelastedit;
|
||||
dword datelastedit;
|
||||
dword sizelo;
|
||||
dword sizehi;
|
||||
char name[518];
|
||||
};
|
||||
|
||||
////////////////////////////
|
||||
// Прочитать файл //
|
||||
////////////////////////////
|
||||
@ -139,67 +169,38 @@ inline fastcall dword CopyFile(dword EBX,ECX)
|
||||
|
||||
}
|
||||
|
||||
/*char *extension[25]={".skn",".avi",".htm","html",".3ds",".lif",".cvs",".mp3",
|
||||
".wav",".mid","midi",".rtf",".txt",".inc",".ini",".dat",".asm",".gif",".bmp",
|
||||
".tga",".pcx",".png",".jpg","jpeg", 0}; //ìàññèâ óêàçàòåëåé
|
||||
char *prog_path[25]={"desktop","/sys/kvid","/sys/network/HTMLv","/sys/network/HTMLv",
|
||||
"/sys/demos/3d/view3ds","/sys/demos/life2","graph","AC97SND","AC97SND","MIDAMP",
|
||||
"MIDAMP","RtfRead","TinyPad","TinyPad","TinyPad","TinyPad","TinyPad","MV","MV",
|
||||
"MV","MV","@rcher","JpegView","JpegView", 0};
|
||||
|
||||
|
||||
void Run_File(dword fpath)
|
||||
{
|
||||
byte i;
|
||||
dword file_ext[4]=fpath+strlen(fpath)-4;
|
||||
FOR(i=0; extension[i]!=0; i++) IF (strcmp(file_ext,extension[i])==0)
|
||||
{
|
||||
Run_Program(prog_path[i], fpath);
|
||||
return;
|
||||
}
|
||||
Run_Program(fpath, "");
|
||||
}*/
|
||||
|
||||
|
||||
void Run_File(dword fpath)
|
||||
{
|
||||
dword extension[4], fparam[256];
|
||||
dword extension[4], fparam[256]; byte needrun;
|
||||
needrun = 1; //åñëè 1 òî íóæíî çàïóñêàòü, åñëè 0 òî íå íàäî
|
||||
copystr(fpath,#fparam); //по-умолчанию прога и параметр равны, если окажется что это файл, парам - сбросим
|
||||
copystr(fpath+strlen(fpath)-4,#extension); //узнаём расширение файла с каким работаем
|
||||
//тут мы это расширение сравнимаем, и, если оно асоциируется с прогой, прога - это fpath
|
||||
IF (!strcmp(#extension,".skn")) copystr("desktop",fpath);
|
||||
IF (!strcmp(#extension,".avi")) copystr("/sys/kvid",fpath);
|
||||
IF (!strcmp(#extension,".mpg")) copystr("/sys/kvid",fpath);
|
||||
IF (!strcmp(#extension,".htm")) copystr("/sys/network/HTMLv",fpath);
|
||||
IF (!strcmp(#extension,"html")) copystr("/sys/network/HTMLv",fpath);
|
||||
//IF (strcmp(#extension,".htm")==0) || (strcmp(#extension,"html")==0) copystr("/hd0/2/Programs/QIP/Users/419114984/RcvdFiles/313257308_Veliant/browser/HTMLv",fpath);
|
||||
IF (!strcmp(#extension,".3ds")) copystr("/sys/demos/3d/view3ds",fpath);
|
||||
IF (!strcmp(#extension,".lif")) copystr("/sys/demos/life2",fpath);
|
||||
IF (!strcmp(#extension,".cvs")) copystr("graph",fpath);
|
||||
IF (!strcmp(#extension,".nes")) copystr("/sys/games/fce",fpath);
|
||||
//audio
|
||||
IF (!strcmp(#extension,".mp3")) copystr("AC97SND",fpath);
|
||||
IF (!strcmp(#extension,".wav")) copystr("AC97SND",fpath);
|
||||
IF (!strcmp(#extension,".mid")) copystr("MIDAMP",fpath);
|
||||
IF (!strcmp(#extension,"midi")) copystr("MIDAMP",fpath);
|
||||
//text
|
||||
IF (!strcmp(#extension,".rtf")) copystr("RtfRead",fpath);
|
||||
IF (!strcmp(#extension,".txt")) copystr("TinyPad",fpath);
|
||||
IF (!strcmp(#extension,".inc")) copystr("TinyPad",fpath);
|
||||
IF (!strcmp(#extension,".ini")) copystr("TinyPad",fpath);
|
||||
IF (!strcmp(#extension,".dat")) copystr("TinyPad",fpath);
|
||||
IF (!strcmp(#extension,".asm")) copystr("TinyPad",fpath);
|
||||
IF (!strcmp(#extension,".cpp")) copystr("TinyPad",fpath);
|
||||
//èçîáðàæåíèÿ
|
||||
IF (!strcmp(#extension,".gif")) copystr("MV",fpath); //GifView,MenuAnimage
|
||||
IF (!strcmp(#extension,".bmp")) copystr("MV",fpath); //BmpMenu1,MenuAnimage
|
||||
IF (!strcmp(#extension,".tga")) copystr("MV",fpath);
|
||||
IF (!strcmp(#extension,".pcx")) copystr("MV",fpath);
|
||||
IF (!strcmp(#extension,".cur")) copystr("MV",fpath);
|
||||
IF (!strcmp(#extension,".ico")) copystr("MV",fpath);
|
||||
IF (!strcmp(#extension,".png")) copystr("pngview",fpath);
|
||||
IF (!strcmp(#extension,".jpg")) copystr("JpegView",fpath);
|
||||
IF (!strcmp(#extension,"jpeg")) copystr("JpegView",fpath);
|
||||
IF (!strcmp(#extension,".skn")) copystr("desktop",fpath);
|
||||
IF (!strcmp(#extension,".avi")) || (!strcmp(#extension,".mpg")) copystr(kvid,fpath);
|
||||
IF (!strcmp(#extension,".htm")) || (!strcmp(#extension,"html")) copystr(htmlv,fpath);
|
||||
IF (!strcmp(#extension,".3ds")) copystr(view3ds,fpath);
|
||||
IF (!strcmp(#extension,".lif")) copystr(life2,fpath);
|
||||
IF (!strcmp(#extension,".cvs")) copystr(graph,fpath);
|
||||
IF (!strcmp(#extension,".nes")) copystr(fce,fpath);
|
||||
//audio
|
||||
IF (!strcmp(#extension,".mp3")) || (!strcmp(#extension,".wav")) copystr(ac97snd,fpath);
|
||||
IF (!strcmp(#extension,".mid")) || (!strcmp(#extension,"midi")) copystr(midamp,fpath);
|
||||
//text
|
||||
IF (!strcmp(#extension,".rtf")) copystr(rtfread,fpath);
|
||||
IF (!strcmp(#extension,".txt")) || (!strcmp(#extension,".inc")) ||
|
||||
(!strcmp(#extension,".ini")) || (!strcmp(#extension,".dat")) ||
|
||||
(!strcmp(#extension,".asm")) || (!strcmp(#extension,".cpp")) copystr(tinypad,fpath);
|
||||
//èçîáðàæåíèÿ
|
||||
IF (!strcmp(#extension,".gif")) || (!strcmp(#extension,".bmp")) ||
|
||||
(!strcmp(#extension,".tga")) || (!strcmp(#extension,".pcx")) ||
|
||||
(!strcmp(#extension,".cur")) || (!strcmp(#extension,".ico")) copystr(mv,fpath);
|
||||
IF (!strcmp(#extension,".png")) copystr(pngview,fpath);
|
||||
IF (!strcmp(#extension,".jpg")) || (!strcmp(#extension,"jpeg")) copystr(jpegview,fpath);
|
||||
|
||||
IF (!strcmp(#extension,".sys")) || (!strcmp(#extension,".drv")) ||
|
||||
(!strcmp(#extension,".obj")) needrun=0; // ýòè ôàéëû íå äëÿ çàïóñêà
|
||||
|
||||
IF (!strcmp(fpath,#fparam)) fparam=''; //если fpath не изменился, то это таки, наверное, прога, параметров нет.
|
||||
RunProgram(fpath, #fparam); //çàïóñê!
|
||||
IF (needrun == 1) RunProgram(fpath, #fparam); //çàïóñê!
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ void mouse::get()
|
||||
$shr eax, 16
|
||||
$and ebx,0x0000FFFF
|
||||
x = EAX;
|
||||
y = EBX-skin_width;
|
||||
y = EBX;
|
||||
EAX = 37;
|
||||
EBX = 2;
|
||||
$int 0x40
|
||||
@ -66,21 +66,6 @@ void mouse::get()
|
||||
vert = EBX;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
struct BDVK{
|
||||
dword attr;
|
||||
byte type_name;
|
||||
byte rez1, rez2, rez3;
|
||||
dword timecreate;
|
||||
dword datecreate;
|
||||
dword timelastaccess;
|
||||
dword datelastaccess;
|
||||
dword timelastedit;
|
||||
dword datelastedit;
|
||||
dword sizelo;
|
||||
dword sizehi;
|
||||
char name[518];
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
struct proc_info{
|
||||
dword use_cpu;
|
||||
@ -148,6 +133,13 @@ void DefineAndDrawWindow(dword x,y,sizeX,sizeY,byte mainAreaType,dword
|
||||
$int 0x40
|
||||
}
|
||||
|
||||
inline fastcall dword CreateThread(dword ECX,EDX)
|
||||
{
|
||||
EAX = 51;
|
||||
EBX = 1;
|
||||
$int 0x40
|
||||
}
|
||||
|
||||
inline fastcall void DrawTitle(dword ECX){
|
||||
EAX = 71;
|
||||
EBX = 1;
|
||||
@ -221,50 +213,88 @@ f3:
|
||||
}
|
||||
|
||||
|
||||
inline fastcall int strcmp(dword EAX,EBX)
|
||||
inline fastcall int strcmp(ESI, EDI)
|
||||
{
|
||||
#speed
|
||||
ESI=EAX;
|
||||
EBX--;
|
||||
TOP:
|
||||
EBX++;
|
||||
$LODSB
|
||||
$CMP AL,0
|
||||
$JE HERE
|
||||
$CMP DSBYTE[EBX],AL
|
||||
$JE TOP
|
||||
HERE:
|
||||
AL-=DSBYTE[EBX];
|
||||
return AL;
|
||||
#codesize
|
||||
loop()
|
||||
{
|
||||
IF (DSBYTE[ESI]<DSBYTE[EDI]) RETURN -1;
|
||||
IF (DSBYTE[ESI]>DSBYTE[EDI]) RETURN 1;
|
||||
IF (DSBYTE[ESI]=='\0') RETURN 0;
|
||||
ESI++;
|
||||
EDI++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inline fastcall unsigned int find_symbol(ESI,BL)
|
||||
{
|
||||
int jj=0, last=-1;
|
||||
do{
|
||||
jj++;
|
||||
$lodsb
|
||||
IF(AL==BL) last=jj;
|
||||
} while(AL!=0);
|
||||
return last;
|
||||
}
|
||||
|
||||
|
||||
inline fastcall memmov( EDI, ESI, ECX)
|
||||
{
|
||||
asm {
|
||||
MOV EAX, ECX
|
||||
CMP EDI, ESI
|
||||
JG L1
|
||||
JE L2
|
||||
SAR ECX, 2
|
||||
JS L2
|
||||
REP MOVSD
|
||||
MOV ECX, EAX
|
||||
AND ECX, 3
|
||||
REP MOVSB
|
||||
JMP SHORT L2
|
||||
L1: LEA ESI, DSDWORD[ ESI+ECX-4]
|
||||
LEA EDI, DSDWORD[ EDI+ECX-4]
|
||||
SAR ECX, 2
|
||||
JS L2
|
||||
STD
|
||||
REP MOVSD
|
||||
MOV ECX, EAX
|
||||
AND ECX, 3
|
||||
ADD ESI, 3
|
||||
ADD EDI, 3
|
||||
REP MOVSB
|
||||
CLD
|
||||
L2:
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inline fastcall dword ChangeCase(dword EDX)
|
||||
{
|
||||
#speed
|
||||
AL=DSBYTE[EDX];
|
||||
IF(AL>='a')&&(AL<='z')DSBYTE[EDX]=AL&0x5f;
|
||||
EDX++;
|
||||
IF (AL>=160) && (AL<=175) DSBYTE[EDX] = AL - 32; //à-ï
|
||||
IF (AL>=224) && (AL<=239) DSBYTE[EDX] = AL - 80; //à-ï
|
||||
do{
|
||||
AL=DSBYTE[EDX];
|
||||
IF(AL>='A')&&(AL<='Z')DSBYTE[EDX]=AL|0x20;
|
||||
EDX++;
|
||||
AL=DSBYTE[EDX];
|
||||
IF(AL>='A')&&(AL<='Z'){DSBYTE[EDX]=AL|0x20; continue;}
|
||||
IF(AL>='€')&&(AL<='<27>')DSBYTE[EDX]=AL|0x20; // -¯
|
||||
IF (AL>=144) && (AL<=159) DSBYTE[EDX] = AL + 80; //à-ï
|
||||
}while(AL!=0);
|
||||
#codesize
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
inline fastcall void PutPixel(dword EBX,ECX,EDX){
|
||||
EAX=1;
|
||||
ECX+=skin_width;
|
||||
$int 0x40
|
||||
}
|
||||
|
||||
void DefineButton(dword x,y,w,h,EDX,ESI){
|
||||
EAX = 8;
|
||||
EBX = x<<16+w;
|
||||
ECX = skin_width+y<<16+h;
|
||||
ECX = y<<16+h;
|
||||
$int 0x40
|
||||
}
|
||||
|
||||
@ -278,7 +308,7 @@ inline fastcall void DeleteButton(dword EDX)
|
||||
void WriteText(dword x,y,byte fontType, dword color, EDX, ESI)
|
||||
{
|
||||
EAX = 4;
|
||||
EBX = x<<16+skin_width+y;
|
||||
EBX = x<<16+y;
|
||||
ECX = fontType<<24+color;
|
||||
$int 0x40;
|
||||
}
|
||||
@ -288,26 +318,23 @@ void DrawBar(dword x,y,w,h,EDX)
|
||||
#speed
|
||||
EAX = 13;
|
||||
EBX = x<<16+w;
|
||||
ECX = skin_width+y<<16+h;
|
||||
ECX = y<<16+h;
|
||||
$int 0x40
|
||||
#codesize
|
||||
}
|
||||
|
||||
void DrawRegion(dword x,y,width,height,color1)
|
||||
void DrawRegion_3D(dword x,y,width,height,color1,color2)
|
||||
{
|
||||
DrawBar(x,y,width,1,color1); //¯®«®á £®à ᢥàåã
|
||||
DrawBar(x,y+height,width,1,color1); //¯®«®á £®à ᨧã
|
||||
DrawBar(x,y,1,height,color1); //¯®«®á ¢¥àåã á«¥¢
|
||||
DrawBar(x+width,y,1,height+1,color1); //¯®«®á ¢¥àåã á¯à ¢
|
||||
DrawBar(x,y,width+1,1,color1); //¯®«®á £®à ᢥàåã
|
||||
DrawBar(x,y+1,1,height-1,color1); //¯®«®á á«¥¢
|
||||
DrawBar(x+width,y+1,1,height,color2); //¯®«®á á¯à ¢
|
||||
DrawBar(x,y+height,width,1,color2); //¯®«®á £®à ᨧã
|
||||
}
|
||||
|
||||
void DrawFlatButton(dword x,y,width,height,id,color,text)
|
||||
{
|
||||
DrawRegion(x,y,width,height,0x94AECE);
|
||||
DrawBar(x+1,y+1,width-1,1,0xFFFFFF); //¯®«®á £®à ¡¥« ï
|
||||
DrawBar(x+1,y+height-1,width-2,1,0xC7C7C7); //¢¥¬ ¢¥à¢
|
||||
DrawBar(x+1,y+1,1,height-1,0xFFFFFF); //¯®«®á ¢¥à¢ ¡¥« ¯
|
||||
DrawBar(x+width-1,y+2,1,height-2,0xC7C7C7); //¢¥¬ ¢¥à¢
|
||||
DrawRegion_3D(x,y,width,height,0x94AECE,0x94AECE);
|
||||
DrawRegion_3D(x+1,y+1,width-2,height-2,0xFFFFFF,0xC7C7C7);
|
||||
DrawBar(x+2,y+2,width-3,height-3,color); //§ «¨¢ª
|
||||
IF (id<>0) DefineButton(x,y,width,height,id+BT_HIDE,0xEFEBEF); //ª®¯ª
|
||||
WriteText(-strlen(text)*6+width/2+x+1,height/2-3+y,0x80,0,text,0);
|
||||
@ -317,7 +344,7 @@ void PutImage(dword EBX,w,h,x,y)
|
||||
{
|
||||
EAX = 7;
|
||||
ECX = w<<16+h;
|
||||
EDX = x<<16+y+skin_width;
|
||||
EDX = x<<16+y;
|
||||
$int 0x40
|
||||
}
|
||||
|
||||
@ -325,7 +352,7 @@ void PutPaletteImage(dword EBX,w,h,x,y, EDI)
|
||||
{
|
||||
EAX = 65;
|
||||
ECX = w<<16+h;
|
||||
EDX = x<<16+y+skin_width;
|
||||
EDX = x<<16+y;
|
||||
ESI = 8;
|
||||
EBP = 0;
|
||||
$int 0x40
|
||||
|
Loading…
Reference in New Issue
Block a user