Eolite: fixed bags.

git-svn-id: svn://kolibrios.org@5591 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
pavelyakov 2015-07-21 01:10:37 +00:00
parent 951d3fdb52
commit 1d9f0687b9
8 changed files with 525 additions and 481 deletions

View File

@ -156,6 +156,7 @@ int j, i;
int action_buf; int action_buf;
int rand_n; int rand_n;
int selected_count; int selected_count;
byte CMD_REFRESH;
mouse gestures; mouse gestures;
signed x_old, y_old, dif_x, dif_y, adif_x, adif_y; signed x_old, y_old, dif_x, dif_y, adif_x, adif_y;
@ -183,6 +184,9 @@ void main()
{ {
word key, id, can_show, can_select, m_selected; word key, id, can_show, can_select, m_selected;
dword selected_offset; dword selected_offset;
dword IPC_LEN,IPC_ID;
char IPC_BUF[10];
dword tmp;
rand_n = random(40); rand_n = random(40);
gestures.get(); gestures.get();
mem_Init(); mem_Init();
@ -194,365 +198,383 @@ void main()
SetAppColors(); SetAppColors();
if (param) if (param)
{ {
strcpy(#path, #param); tmp = strlen(#path);
if (path[strlen(#path)-1]!='/') chrcat(#path, '/'); //add "/" to the end of the string strncpy(#path, #param, tmp);
$dec tmp
if (path[tmp]!='/') DSBYTE[#path+tmp] = '/'; //add "/" to the end of the string
} }
else else
{ {
strcpy(#path, "/rd/1/"); strncpy(#path, "/rd/1/", 6);
} }
Open_Dir(#path,ONLY_OPEN); Open_Dir(#path,ONLY_OPEN);
SetEventMask(0x27); SetEventMask(0x27);
loop(){ switch(WaitEvent()) loop(){
{ switch(WaitEvent())
case evMouse: {
if (del_active) || (!CheckActiveProcess(Form.ID)) || (Form.status_window>2) break; case evMouse:
if (new_element_active) || (!CheckActiveProcess(Form.ID)) || (Form.status_window>2) if (del_active) || (!CheckActiveProcess(Form.ID)) || (Form.status_window>2) break;
{ if (new_element_active) || (!CheckActiveProcess(Form.ID)) || (Form.status_window>2)
edit_box_mouse stdcall(#new_file_ed);
break;
}
m.get();
gestures.get();
if (!gestures.mkm) && (stats>0) stats = 0;
if (gestures.mkm) && (stats==0)
{
x_old = gestures.x;
y_old = gestures.y;
stats = 1;
}
if (gestures.mkm) && (stats==1)
{
dif_x = gestures.x-x_old;
dif_y = gestures.y-y_old;
adif_x = fabs(dif_x);
adif_y = fabs(dif_y);
if (adif_x>adif_y)
{ {
if (dif_x > 150) edit_box_mouse stdcall(#new_file_ed);
{
if (HistoryPath(GO_FORWARD))
{
files.first=files.current=NULL;
Open_Dir(#path,WITH_REDRAW);
}
stats = 0;
}
if (dif_x < -150)
{
GoBack();
stats = 0;
}
}
else
{
if (dif_y < -100)
{
Dir_Up();
stats = 0;
}
}
}
if (files.MouseOver(m.x, m.y))&&((m.up)||(m.down)||(m.dblclick))
{
//select/open file {
if (m.key&MOUSE_LEFT)&&((m.down)||(m.dblclick))
{
if (m.y>=files.y)//&&(m.click)
{
id = m.y - files.y / files.line_h;
if (files.current!=id)
{
m.clearTime();
if (id<files.visible) List_Current(id-files.current);
}
else if(m.dblclick)Open(0);
}
}
// } select/open file
else
//file menu {
if (m.key&MOUSE_RIGHT)&&(m.up)
{
menu_call_mouse = 1;
if (m.y>=files.y)//&&(m.click)
{
id = m.y - files.y / files.line_h;
if (files.current!=id) List_Current(id-files.current);
//SwitchToAnotherThread();
menu_stak = malloc(4096);
CreateThread(#FileMenu,menu_stak+4092);
}
break; break;
} }
// } file menu
} m.get();
if (m.vert)
{ gestures.get();
if (files.MouseScroll(m.vert)) List_ReDraw(); if (!gestures.mkm) && (stats>0) stats = 0;
break; if (gestures.mkm) && (stats==0)
}
if (m.x>=Form.width-26) && (m.x<=Form.width-6) && (m.y>40) && (m.y<files.y)
{
IF (m.lkm==1) DrawRectangle3D(Form.cwidth - 17,41,14,14,0xC7C7C7,0xFFFFFF);
WHILE (m.lkm==1) && (files.first>0)
{ {
pause(8); x_old = gestures.x;
files.first--; y_old = gestures.y;
List_ReDraw(); stats = 1;
m.get();
} }
DrawRectangle3D(Form.cwidth - 17,41,14,14,0xFFFFFF,0xC7C7C7); if (gestures.mkm) && (stats==1)
}
if (m.x>=Form.width-26) && (m.x<=Form.width-6) && (m.y>onTop(22,0)+1) && (m.y<onTop(22,0)+16)
{
IF (m.lkm==1) DrawRectangle3D(Form.cwidth - 17,onTop(21,0),14,14,0xC7C7C7,0xFFFFFF);
while (m.lkm==1) && (files.first<files.count-files.visible)
{ {
pause(8); dif_x = gestures.x-x_old;
files.first++; dif_y = gestures.y-y_old;
List_ReDraw(); adif_x = fabs(dif_x);
m.get(); adif_y = fabs(dif_y);
}
DrawRectangle3D(Form.cwidth - 17,onTop(21,0),14,14,0xFFFFFF,0xC7C7C7); if (adif_x>adif_y)
} {
if (dif_x > 150)
//Scrooll
if (!m.lkm) && (scroll_used) { scroll_used=NULL; Scroll(); }
if (m.x>=Form.width-26) && (m.x<=Form.width-6) && (m.y>56) && (m.y<Form.height) && (m.lkm) && (!scroll_used) {scroll_used=1;Scroll();}
if (scroll_used)
{
IF (sc_slider_h/2+files.y>m.y) || (m.y<0) || (m.y>4000) m.y=sc_slider_h/2+files.y; //anee eo?ni? iaa ieiii
id=files.first;
j= sc_slider_h/2;
files.first = m.y -j -files.y * files.count;
files.first /= onTop(22,files.y);
IF (files.visible+files.first>files.count) files.first=files.count-files.visible;
IF (id!=files.first) List_ReDraw();
}
break;
//Button pressed-----------------------------------------------------------------------------
case evButton:
id=GetButtonID();
if (id==1)
{
KillProcess(about_window);
ExitProcess();
}
if (del_active)
{
IF (id==301) || (id==302) Del_File(302-id);
break;
}
if (new_element_active)
{
IF (id==301) || (id==302) NewElement(302-id);
break;
}
switch(id)
{
case 21: //Back
GoBack();
break;
case 22: //Forward
if (HistoryPath(GO_FORWARD))
{ {
files.first=files.current=NULL; //aaa?o nienea if (HistoryPath(GO_FORWARD))
Open_Dir(#path,WITH_REDRAW); {
files.first=files.current=NULL;
Open_Dir(#path,WITH_REDRAW);
}
stats = 0;
} }
break; if (dif_x < -150)
case 23: //up! {
Dir_Up(); GoBack();
break; stats = 0;
case 24: //cut }
Copy(#file_path, CUT); }
break; else
case 25: //copy {
Copy(#file_path, NOCUT); if (dif_y < -100)
break; {
case 26: //paste
copy_stak = malloc(4096);
CreateThread(#Paste,copy_stak+4092);
break;
case 31...33: //sort
IF(sort_num==1) DrawFilledBar(sorting_arrow_x,42,6,10);
IF(sort_num==2) DrawFilledBar(sorting_arrow_x,42,6,10);
IF(sort_num==3) DrawFilledBar(sorting_arrow_x,42,6,10);
sort_num=id-30;
Open_Dir(#path,WITH_REDRAW);
break;
case 50...60: //Actions
FnProcess(id-50);
break;
case 100...120:
DEVICE_MARK:
DrawRectangle(17,id-100*16+74,159,16, 0); //auaaeaiea
strcpy(#path, #disk_list[id-100].Item);
files.first=files.current=0;
Open_Dir(#path,WITH_REDRAW);
pause(5);
DrawRectangle(17,id-100*16+74,159,16, 0xFFFFFF);
break;
}
break;
//Key pressed-----------------------------------------------------------------------------
case evKey:
key = GetKey();
if (Form.status_window>2) break;
IF (del_active)
{
IF (key==013) Del_File(true);
IF (key==027) Del_File(false);
break;
}
IF (new_element_active)
{
IF (key==027) NewElement(0);
IF (key==013) NewElement(1);
EAX=key<<8;
edit_box_key stdcall (#new_file_ed);
break;
}
IF (edit2.flags!=64) && (key!=13) && (key!=27)
{
EAX=key<<8;
edit_box_key stdcall (#edit2);
break;
}
switch (key)
{
case 209...217:
id=key-110;
IF (id-100>=disc_num) break;
GOTO DEVICE_MARK;
case ASCII_KEY_BS:
//GoBack();
Dir_Up(); Dir_Up();
break; stats = 0;
case 004: //Ctrl+D set as bg }
strcpy(#temp, "\\S__"); }
strcat(#temp, #file_path); }
RunProgram("/sys/media/kiv", #temp); if (files.MouseOver(m.x, m.y))&&((m.up)||(m.down)||(m.dblclick))
break; {
case 014: //Ctrl+N new window //select/open file {
IF (Form.left==98) MoveSize(Form.left-20,Form.top-20,OLD,OLD); if (m.key&MOUSE_LEFT)&&((m.down)||(m.dblclick))
RunProgram("/sys/File Managers/Eolite", #path); {
break; if (m.y>=files.y)//&&(m.click)
case 024: //Ctrl+X {
Copy(#file_path, CUT); id = m.y - files.y / files.line_h;
break; if (files.current!=id)
case 003: //Ctrl+C
Copy(#file_path, NOCUT);
break;
case 022: //Ctrl+V
copy_stak = malloc(4096);
CreateThread(#Paste,copy_stak+4092);
break;
case 001: //Ctrl+A
debugln("press Ctrl+A");
for (i=0; i<files.count; i++)
{ {
selected_offset = file_mas[i]*304 + buf+32 + 7; m.clearTime();
ESBYTE[selected_offset] = 1; if (id<files.visible) List_Current(id-files.current);
selected_count++;
} }
List_ReDraw(); else if(m.dblclick)Open(0);
break; }
case 021: //Ctrl+U }
debugln("press Ctrl+A"); // } select/open file
for (i=0; i<files.count; i++) else
{ //file menu {
selected_offset = file_mas[i]*304 + buf+32 + 7; if (m.key&MOUSE_RIGHT)&&(m.up)
ESBYTE[selected_offset] = 0; {
} menu_call_mouse = 1;
selected_count = 0; if (m.y>=files.y)//&&(m.click)
List_ReDraw(); {
break; id = m.y - files.y / files.line_h;
case ASCII_KEY_ESC: if (files.current!=id) List_Current(id-files.current);
break;
case ASCII_KEY_ENTER:
Open(0);
break;
case 074: //menu
menu_call_mouse=0;
//SwitchToAnotherThread(); //SwitchToAnotherThread();
menu_stak = malloc(4096); menu_stak = malloc(4096);
CreateThread(#FileMenu,menu_stak+4092); CreateThread(#FileMenu,menu_stak+4092);
}
break;
}
// } file menu
}
if (m.vert)
{
if (files.MouseScroll(m.vert)) List_ReDraw();
break;
}
if (m.x>=Form.width-26) && (m.x<=Form.width-6) && (m.y>40) && (m.y<files.y)
{
if (m.lkm==1) DrawRectangle3D(Form.cwidth - 17,41,14,14,0xC7C7C7,0xFFFFFF);
WHILE (m.lkm==1) && (files.first>0)
{
pause(8);
files.first--;
List_ReDraw();
m.get();
}
DrawRectangle3D(Form.cwidth - 17,41,14,14,0xFFFFFF,0xC7C7C7);
}
if (m.x>=Form.width-26) && (m.x<=Form.width-6) && (m.y>onTop(22,0)+1) && (m.y<onTop(22,0)+16)
{
if (m.lkm==1) DrawRectangle3D(Form.cwidth - 17,onTop(21,0),14,14,0xC7C7C7,0xFFFFFF);
while (m.lkm==1) && (files.first<files.count-files.visible)
{
pause(8);
files.first++;
List_ReDraw();
m.get();
}
DrawRectangle3D(Form.cwidth - 17,onTop(21,0),14,14,0xFFFFFF,0xC7C7C7);
}
//Scrooll
if (!m.lkm) && (scroll_used) { scroll_used=NULL; Scroll(); }
if (m.x>=Form.width-26) && (m.x<=Form.width-6) && (m.y>56) && (m.y<Form.height) && (m.lkm) && (!scroll_used) {scroll_used=1;Scroll();}
if (scroll_used)
{
if (sc_slider_h/2+files.y>m.y) || (m.y<0) || (m.y>4000) m.y=sc_slider_h/2+files.y; //anee eo?ni? iaa ieiii
id=files.first;
j= sc_slider_h/2;
files.first = m.y -j -files.y * files.count;
files.first /= onTop(22,files.y);
if (files.visible+files.first>files.count) files.first=files.count-files.visible;
if (id!=files.first) List_ReDraw();
}
break;
//Button pressed-----------------------------------------------------------------------------
case evButton:
id=GetButtonID();
if (id==1)
{
KillProcess(about_window);
ExitProcess();
}
if (del_active)
{
if (id==301) || (id==302) Del_File(302-id);
break;
}
if (new_element_active)
{
if (id==301) || (id==302) NewElement(302-id);
break;
}
switch(id)
{
case 21: //Back
GoBack();
break; break;
case 173: //Ctrl+Enter case 22: //Forward
if (!itdir) ShowOpenWithDialog(); if (HistoryPath(GO_FORWARD))
else Open(1);
break;
case ASCII_KEY_UP:
List_Current(-1);
break;
case ASCII_KEY_DOWN:
List_Current(1);
break;
case ASCII_KEY_HOME:
if (files.KeyHome()) List_ReDraw();
break;
case ASCII_KEY_END:
if (files.KeyEnd()) List_ReDraw();
break;
case ASCII_KEY_PGDN:
List_Current(files.visible-1);
break;
case ASCII_KEY_PGUP:
List_Current(-files.visible+1);
break;
case ASCII_KEY_DEL:
Del_Form();
break;
case ASCII_KEY_INS:
selected_offset = file_mas[files.current+files.first]*304 + buf+32 + 7;
if (ESBYTE[selected_offset])
{ {
ESBYTE[selected_offset]=0; files.first=files.current=NULL; //aaa?o nienea
selected_count--; Open_Dir(#path,WITH_REDRAW);
} }
else
{
ESBYTE[selected_offset] = 1;
selected_count++;
}
List_Current(1);
break; break;
case 048...059: //F1-F10 case 23: //up!
FnProcess(key-49); Dir_Up();
break; break;
default: case 24: //cut
for (i=files.current+files.first+1; i<files.count; i++) Copy(#file_path, CUT);
{ break;
strcpy(#temp, file_mas[i]*304+buf+72); case 25: //copy
IF (temp[0]==key) || (temp[0]==key-32) Copy(#file_path, NOCUT);
break;
case 26: //paste
copy_stak = malloc(4096);
CreateThread(#Paste,copy_stak+4092);
break;
case 31...33: //sort
if(sort_num==1) DrawFilledBar(sorting_arrow_x,42,6,10);
if(sort_num==2) DrawFilledBar(sorting_arrow_x,42,6,10);
if(sort_num==3) DrawFilledBar(sorting_arrow_x,42,6,10);
sort_num=id-30;
Open_Dir(#path,WITH_REDRAW);
break;
case 50...60: //Actions
FnProcess(id-50);
break;
case 100...120:
DEVICE_MARK:
DrawRectangle(17,id-100*16+74,159,16, 0); //auaaeaiea
strcpy(#path, #disk_list[id-100].Item);
files.first=files.current=0;
Open_Dir(#path,WITH_REDRAW);
pause(5);
DrawRectangle(17,id-100*16+74,159,16, 0xFFFFFF);
break;
}
break;
//Key pressed-----------------------------------------------------------------------------
case evKey:
key = GetKey();
if (Form.status_window>2) break;
if (del_active)
{
if (key==013) Del_File(true);
if (key==027) Del_File(false);
break;
}
if (new_element_active)
{
if (key==027) NewElement(0);
if (key==013) NewElement(1);
EAX=key<<8;
edit_box_key stdcall (#new_file_ed);
break;
}
if (edit2.flags!=64) && (key!=13) && (key!=27)
{
EAX=key<<8;
edit_box_key stdcall (#edit2);
break;
}
switch (key)
{
case 209...217:
id=key-110;
if (id-100>=disc_num) break;
GOTO DEVICE_MARK;
case ASCII_KEY_BS:
//GoBack();
Dir_Up();
break;
case 004: //Ctrl+D set as bg
strncpy(#temp, "\\S__",4);
strcat(#temp, #file_path);
RunProgram("/sys/media/kiv", #temp);
break;
case 014: //Ctrl+N new window
if (Form.left==98) MoveSize(Form.left-20,Form.top-20,OLD,OLD);
RunProgram("/sys/File Managers/Eolite", #path);
break;
case 024: //Ctrl+X
Copy(#file_path, CUT);
break;
case 003: //Ctrl+C
Copy(#file_path, NOCUT);
break;
case 022: //Ctrl+V
copy_stak = malloc(4096);
CreateThread(#Paste,copy_stak+4092);
break;
case 001: //Ctrl+A
debugln("press Ctrl+A");
for (i=0; i<files.count; i++)
{ {
List_Current(i-files.current-files.first); selected_offset = file_mas[i]*304 + buf+32 + 7;
break; ESBYTE[selected_offset] = 1;
selected_count++;
} }
} List_ReDraw();
} break;
case 021: //Ctrl+U
debugln("press Ctrl+A");
for (i=0; i<files.count; i++)
{
selected_offset = file_mas[i]*304 + buf+32 + 7;
ESBYTE[selected_offset] = 0;
}
selected_count = 0;
List_ReDraw();
break;
case ASCII_KEY_ESC:
break;
case ASCII_KEY_ENTER:
Open(0);
break;
case 074: //menu
menu_call_mouse=0;
//SwitchToAnotherThread();
menu_stak = malloc(4096);
CreateThread(#FileMenu,menu_stak+4092);
break;
case 173: //Ctrl+Enter
if (!itdir) ShowOpenWithDialog();
else Open(1);
break;
case ASCII_KEY_UP:
List_Current(-1);
break;
case ASCII_KEY_DOWN:
List_Current(1);
break;
case ASCII_KEY_HOME:
if (files.KeyHome()) List_ReDraw();
break;
case ASCII_KEY_END:
if (files.KeyEnd()) List_ReDraw();
break;
case ASCII_KEY_PGDN:
List_Current(files.visible-1);
break;
case ASCII_KEY_PGUP:
List_Current(-files.visible+1);
break;
case ASCII_KEY_DEL:
Del_Form();
break;
case ASCII_KEY_INS:
selected_offset = file_mas[files.current+files.first]*304 + buf+32 + 7;
if (ESBYTE[selected_offset])
{
ESBYTE[selected_offset]=0;
selected_count--;
}
else
{
ESBYTE[selected_offset] = 1;
selected_count++;
}
List_Current(1);
break;
case 048...059: //F1-F10
FnProcess(key-49);
break;
default:
for (i=files.current+files.first+1; i<files.count; i++)
{
strcpy(#temp, file_mas[i]*304+buf+72);
if (temp[0]==key) || (temp[0]==key-32)
{
List_Current(i-files.current-files.first);
break;
}
}
}
break; break;
case evReDraw: case evReDraw:
draw_window(); DRAW_WINDOW:
if (action_buf) { menu_action(action_buf); action_buf=0;} draw_window();
} if (action_buf)
if(cmd_free){ {
menu_action(action_buf);
action_buf=0;
}
break;
/*default:
if(CMD_REFRESH)
{
CMD_REFRESH = false;
goto DRAW_WINDOW;
}
*/
}
if(cmd_free)
{
if(cmd_free==1) free(menu_stak); if(cmd_free==1) free(menu_stak);
else if(cmd_free==2)free(about_stak); else if(cmd_free==2)free(about_stak);
else if(cmd_free==3)free(properties_stak); else if(cmd_free==3)free(properties_stak);
else if(cmd_free==4)free(settings_stak); else if(cmd_free==4)free(settings_stak);
else if(cmd_free==5)free(copy_stak); else if(cmd_free==5)free(copy_stak);
cmd_free = 0; cmd_free = false;
} }
} }
} }
@ -561,10 +583,10 @@ void main()
inline fastcall signed int _strrchr( ESI,BL) inline fastcall signed int _strrchr( ESI,BL)
{ {
int jj=0, last=strlen(ESI); int jj=0, last=strlen(ESI);
do{ do {
jj++; jj++;
$lodsb $lodsb
IF(AL==BL) last=jj; if(AL==BL) last=jj;
} while(AL!=0); } while(AL!=0);
return last; return last;
} }
@ -583,12 +605,20 @@ void menu_action(dword id)
if (id==203) FnProcess(4); //F4 if (id==203) FnProcess(4); //F4
if (id==104) Copy(#file_path, NOCUT); if (id==104) Copy(#file_path, NOCUT);
if (id==105) Copy(#file_path, CUT); if (id==105) Copy(#file_path, CUT);
if (id==106) { copy_stak = malloc(4096); CreateThread(#Paste,copy_stak+4092);} if (id==106)
{
copy_stak = malloc(4096);
CreateThread(#Paste,copy_stak+4092);
}
if (id==207) FnProcess(2); if (id==207) FnProcess(2);
if (id==108) Del_Form(); if (id==108) Del_Form();
if (id==109) FnProcess(5); if (id==109) FnProcess(5);
if (id==110) FnProcess(8); if (id==110) FnProcess(8);
if (id==300) { FnProcess(5); List_ReDraw(); } if (id==300)
{
FnProcess(5);
List_ReDraw();
}
} }
@ -643,30 +673,8 @@ void List_Current(signed int cur)
{ {
if (cur<=0) //up if (cur<=0) //up
{ {
IF (files.first==0) && (files.current<=0) return; if (files.first==0) && (files.current<=0) return;
IF (-cur-1<files.current) if (-cur-1<files.current)
{
Line_ReDraw(0xFFFFFF, files.current);
files.current+=cur;
Line_ReDraw(col_selec, files.current);
return;
}
ELSE
{
IF (-cur<files.first) files.first+=cur; ELSE files.first=0;
files.current=0;
List_ReDraw();
return;
}
}
else //down
{
IF (files.first==files.count-files.visible) && (files.current==files.visible-1)
{
Line_ReDraw(col_selec, files.current);
return;
}
IF (files.visible-files.current>cur)
{ {
Line_ReDraw(0xFFFFFF, files.current); Line_ReDraw(0xFFFFFF, files.current);
files.current+=cur; files.current+=cur;
@ -675,18 +683,40 @@ void List_Current(signed int cur)
} }
else else
{ {
IF(files.first+files.current+cur>=files.count) if (-cur<files.first) files.first+=cur; else files.first=0;
files.current=0;
List_ReDraw();
return;
}
}
else //down
{
if (files.first==files.count-files.visible) && (files.current==files.visible-1)
{
Line_ReDraw(col_selec, files.current);
return;
}
if (files.visible-files.current>cur)
{
Line_ReDraw(0xFFFFFF, files.current);
files.current+=cur;
Line_ReDraw(col_selec, files.current);
return;
}
else
{
if(files.first+files.current+cur>=files.count)
{ {
files.first=files.count-files.visible; files.first=files.count-files.visible;
files.current=cur-files.first+files.current; files.current=cur-files.first+files.current;
} }
ELSE else
{ {
files.first+=cur+files.current-files.visible+1; files.first+=cur+files.current-files.visible+1;
files.current=files.visible-1; files.current=files.visible-1;
} }
IF (files.current<0) || (files.current>files.visible) if (files.current<0) || (files.current>files.visible)
{ {
files.current=files.visible-1; files.current=files.visible-1;
} }
@ -793,15 +823,15 @@ void Open_Dir(dword dir_path, redraw){
KEdit(); KEdit();
HistoryPath(ADD_NEW_PATH); HistoryPath(ADD_NEW_PATH);
files.visible = files.h / files.line_h; files.visible = files.h / files.line_h;
IF (files.count < files.visible) files.visible = files.count; if (files.count < files.visible) files.visible = files.count;
IF (sort_num==1) sorting_arrow_x = Form.width+60/2; if (sort_num==1) sorting_arrow_x = Form.width+60/2;
IF (sort_num==2) sorting_arrow_x = Form.width-115; if (sort_num==2) sorting_arrow_x = Form.width-115;
IF (sort_num==3) sorting_arrow_x = strlen(T_SIZE)*3-30+files.x+files.w; if (sort_num==3) sorting_arrow_x = strlen(T_SIZE)*3-30+files.x+files.w;
WriteText(sorting_arrow_x,45,0x80,sc.work_graph,"\x19"); WriteText(sorting_arrow_x,45,0x80,sc.work_graph,"\x19");
IF (redraw!=ONLY_SHOW) Sorting(); if (redraw!=ONLY_SHOW) Sorting();
IF (redraw!=ONLY_OPEN) List_ReDraw(); if (redraw!=ONLY_OPEN) List_ReDraw();
} }
IF (files.count==-1) && (redraw!=ONLY_OPEN) {files.visible=files.count=0; List_ReDraw();} if (files.count==-1) && (redraw!=ONLY_OPEN) {files.visible=files.count=0; List_ReDraw();}
} }
@ -812,10 +842,10 @@ inline Sorting()
int i; int i;
if (!strcmp(#path,"/")) //do not sort if (!strcmp(#path,"/")) //do not sort
{ {
FOR(k=1;k<files.count;k++;) file_mas[k]=k; for(k=1;k<files.count;k++;) file_mas[k]=k;
return; return;
} }
FOR (j=files.count-1, file_off=files.count-1*304+buf+32; j>=0; j--, file_off-=304;) //files | folders for (j=files.count-1, file_off=files.count-1*304+buf+32; j>=0; j--, file_off-=304;) //files | folders
{ {
if (!real_files_names_case) strttl(file_off+40); if (!real_files_names_case) strttl(file_off+40);
if (TestBit(ESDWORD[file_off],4)) //directory? if (TestBit(ESDWORD[file_off],4)) //directory?
@ -831,12 +861,12 @@ inline Sorting()
} }
//sorting: files first, then folders //sorting: files first, then folders
Sort_by_Name(0,k-1); Sort_by_Name(0,k-1);
IF (sort_num==1) Sort_by_Name(k,files.count-1); if (sort_num==1) Sort_by_Name(k,files.count-1);
IF (sort_num==2) Sort_by_Type(k,files.count-1); if (sort_num==2) Sort_by_Type(k,files.count-1);
IF (sort_num==3) Sort_by_Size(k,files.count-1); if (sort_num==3) Sort_by_Size(k,files.count-1);
//make ".." first item in list //make ".." first item in list
IF (k>0) && (strcmp(file_mas[0]*304+buf+72,"..")!=0) if (k>0) && (strcmp(file_mas[0]*304+buf+72,"..")!=0)
FOR(k--; k>0; k--;) IF (!strcmp(file_mas[k]*304+buf+72,"..")) {file_mas[k]><file_mas[0]; break;} for(k--; k>0; k--;) if (!strcmp(file_mas[k]*304+buf+72,"..")) {file_mas[k]><file_mas[0]; break;}
} }
@ -846,7 +876,7 @@ void Del_Form()
int cont = 0; int cont = 0;
byte f_count[128]; byte f_count[128];
int dform_x = files.w - 220 / 2 + files.x; int dform_x = files.w - 220 / 2 + files.x;
if (strcmp(#file_name,".")==0) || (strcmp(#file_name,"..")==0) return; if (!strncmp(#file_name,".",1)) || (!strncmp(#file_name,"..",2)) return;
if (del_active==2) if (del_active==2)
{ {
if (itdir) ShowMessage(WAIT_DELETING_FOLDER, 0); if (itdir) ShowMessage(WAIT_DELETING_FOLDER, 0);
@ -868,7 +898,7 @@ void Del_Form()
} }
else else
{ {
IF (strlen(#file_name)<28) if (strlen(#file_name)<28)
{ {
WriteText(strlen(#file_name)*3+110+dform_x+2,190,0x80,sc.work_text,"?"); WriteText(strlen(#file_name)*3+110+dform_x+2,190,0x80,sc.work_text,"?");
WriteText(-strlen(#file_name)*3+110+dform_x,190,0x80,sc.work_text,#file_name); WriteText(-strlen(#file_name)*3+110+dform_x,190,0x80,sc.work_text,#file_name);
@ -899,9 +929,10 @@ int Del_File2(dword way)
{ {
if (CheckEvent()==evReDraw) draw_window(); if (CheckEvent()==evReDraw) draw_window();
filename = i*304+dirbuf+72; filename = i*304+dirbuf+72;
strcpy(#del_from, way); /*strcpy(#del_from, way);
chrcat(#del_from, '/'); chrcat(#del_from, '/');
strcat(#del_from, filename); strcat(#del_from, filename);*/
sprintf(#del_from,"%s/%s",way,filename);
if ( TestBit(ESDWORD[filename-40], 4) ) if ( TestBit(ESDWORD[filename-40], 4) )
{ {
Del_File2(#del_from); Del_File2(#del_from);
@ -934,8 +965,9 @@ void Del_File(byte dodel)
{ {
selected_offset2 = file_mas[i]*304 + buf+32 + 7; selected_offset2 = file_mas[i]*304 + buf+32 + 7;
if (ESBYTE[selected_offset2]) { if (ESBYTE[selected_offset2]) {
strcpy(#del_from, #path); /*strcpy(#del_from, #path);
strcat(#del_from, file_mas[i]*304+buf+72); strcat(#del_from, file_mas[i]*304+buf+72);*/
sprintf(#del_from,"%s%s",#path,file_mas[i]*304+buf+72);
Del_File2(#del_from); Del_File2(#del_from);
} }
} }
@ -983,7 +1015,7 @@ void Open(byte rez)
selected_count = 0; selected_count = 0;
if (rez) if (rez)
{ {
if (!strcmp(#file_name,"..")) return; if (!strncmp(#file_name,"..",2)) return;
strcpy(#temp, #file_path); strcpy(#temp, #file_path);
if (path[strlen(#temp)-1]!='/') chrcat(#temp, '/'); //need "/" in the end if (path[strlen(#temp)-1]!='/') chrcat(#temp, '/'); //need "/" in the end
RunProgram("/sys/File Managers/Eolite", #temp); RunProgram("/sys/File Managers/Eolite", #temp);
@ -996,7 +1028,7 @@ void Open(byte rez)
} }
else else
{ {
if (!strcmp(#file_name,"..")) { Dir_Up(); return; } if (!strncmp(#file_name,"..",2)) { Dir_Up(); return; }
strcpy(#path, #file_path); strcpy(#path, #file_path);
if (path[strlen(#path)-1]!='/') chrcat(#path, '/'); //need "/" in the end if (path[strlen(#path)-1]!='/') chrcat(#path, '/'); //need "/" in the end
files.first=files.current=0; files.first=files.current=0;
@ -1015,9 +1047,10 @@ inline fastcall void GoBack()
void ShowOpenWithDialog() void ShowOpenWithDialog()
{ {
byte param[4097]; byte param[4097];
param[0] = '~'; /*param[0] = '~';
param[1] = '\0'; param[1] = '\0';
strcat(#param, #file_path); strcat(#param, #file_path);*/
sprintf(#param,"~%s",#file_path);
RunProgram("/sys/@open", #param); RunProgram("/sys/@open", #param);
} }
@ -1027,8 +1060,9 @@ void NewElement(byte newf)
byte del_rezult, copy_rezult, info_result; byte del_rezult, copy_rezult, info_result;
if (newf) if (newf)
{ {
strcpy(#temp, #path); /*strcpy(#temp, #path);
strcat(#temp, new_file_ed.text); strcat(#temp, new_file_ed.text);*/
sprintf(#temp,"%s%s",#path,new_file_ed.text);
info_result = GetFileInfo(#temp, #element_info); info_result = GetFileInfo(#temp, #element_info);
switch(new_element_active) switch(new_element_active)
{ {
@ -1117,8 +1151,8 @@ void NewElement_Form(byte crt, dword strng)
edit_box_draw stdcall (#new_file_ed); edit_box_draw stdcall (#new_file_ed);
DrawRectangle(new_file_ed.left-1, new_file_ed.top-1, new_file_ed.width+2, 16, 0xFFFfff); DrawRectangle(new_file_ed.left-1, new_file_ed.top-1, new_file_ed.width+2, 16, 0xFFFfff);
DrawRectangle(new_file_ed.left-2, new_file_ed.top-2, new_file_ed.width+4, 18, sc.work_graph); DrawRectangle(new_file_ed.left-2, new_file_ed.top-2, new_file_ed.width+4, 18, sc.work_graph);
IF (new_element_active==3) DrawFlatButton(dform_x+22,208,85,22,301,0xFFB6B5,T_RENAME); if (new_element_active==3) DrawFlatButton(dform_x+22,208,85,22,301,0xFFB6B5,T_RENAME);
ELSE DrawFlatButton(dform_x+27,208,70,22,301,0xFFB6B5,T_CREATE); else DrawFlatButton(dform_x+27,208,70,22,301,0xFFB6B5,T_CREATE);
DrawFlatButton(dform_x+120,208,70,22,302,0xC6DFC6,T_CANCEL); DrawFlatButton(dform_x+120,208,70,22,302,0xC6DFC6,T_CANCEL);
} }
@ -1144,10 +1178,10 @@ void FnProcess(byte N)
NewElement_Form(RENAME_ITEM, #file_name); NewElement_Form(RENAME_ITEM, #file_name);
break; break;
case 3: case 3:
IF (!itdir) RunProgram("/sys/tinypad", #file_path); if (!itdir) RunProgram("/sys/tinypad", #file_path);
break; break;
case 4: case 4:
IF (!itdir) RunProgram("/sys/develop/heed", #file_path); if (!itdir) RunProgram("/sys/develop/heed", #file_path);
break; break;
case 5: //refresh cur dir & devs case 5: //refresh cur dir & devs
Tip(56, T_DEVICES, 55, "-"); Tip(56, T_DEVICES, 55, "-");

View File

@ -75,7 +75,7 @@ void FileMenu()
mm.get(); mm.get();
if (!CheckActiveProcess(MenuForm.ID)){ cmd_free=1; ExitProcess();} if (!CheckActiveProcess(MenuForm.ID)){ cmd_free=1; ExitProcess();}
else if (mm.move)&&(menu.ProcessMouse(mm.x, mm.y)) MenuListRedraw(); else if (mm.move)&&(menu.ProcessMouse(mm.x, mm.y)) MenuListRedraw();
else if (mm.key&MOUSE_LEFT)&&(mm.down) {action_buf = cur_action_buf; pause(5); cmd_free=1; ExitProcess(); } else if (mm.key&MOUSE_LEFT)&&(mm.up) {action_buf = cur_action_buf; cmd_free=1; ExitProcess(); }
break; break;
case evKey: case evKey:

View File

@ -14,6 +14,7 @@
?define PR_T_HIDDEN "‘ªàëâë©" ?define PR_T_HIDDEN "‘ªàëâë©"
?define PR_T_SYSTEM "‘¨á⥬­ë©" ?define PR_T_SYSTEM "‘¨á⥬­ë©"
?define PR_T_ONLY_READ "’®«ìª® ç⥭¨¥" ?define PR_T_ONLY_READ "’®«ìª® ç⥭¨¥"
?define SET_BYTE_LANG "¡ ©â"
#else #else
?define WINDOW_TITLE_PROPERTIES "Properties" ?define WINDOW_TITLE_PROPERTIES "Properties"
?define BTN_CLOSE "Close" ?define BTN_CLOSE "Close"
@ -30,6 +31,7 @@
?define PR_T_HIDDEN "Hidden" ?define PR_T_HIDDEN "Hidden"
?define PR_T_SYSTEM "System" ?define PR_T_SYSTEM "System"
?define PR_T_ONLY_READ "Read-only" ?define PR_T_ONLY_READ "Read-only"
?define SET_BYTE_LANG "byte"
#endif #endif
dword mouse_ddd2; dword mouse_ddd2;
@ -49,9 +51,9 @@ void SetProperties(byte id)
if (selected_count) return; if (selected_count) return;
else else
{ {
if (id==20) file_info_general.readonly ^= 1; if (id==20) file_info_general.readonly ^= true;
if (id==21) file_info_general.hidden ^= 1; if (id==21) file_info_general.hidden ^= true;
if (id==22) file_info_general.system ^= 1; if (id==22) file_info_general.system ^= true;
SetFileInfo(#file_path, #file_info_general); SetFileInfo(#file_path, #file_info_general);
} }
} }
@ -59,26 +61,30 @@ void SetProperties(byte id)
void GetSizeDir(dword way) void GetSizeDir(dword way)
{ {
dword dirbuf, fcount, i, filename; dword dirbuf, fcount, i, filename;
char cur_file[4096]; dword cur_file;
if (isdir(way)) if (isdir(way))
{ {
cur_file = malloc(4096);
// In the process of recursive descent, memory must be allocated dynamically, because the static memory -> was a bug !!! But unfortunately pass away to sacrifice speed.
GetDir(#dirbuf, #fcount, way, DIRS_ONLYREAL); GetDir(#dirbuf, #fcount, way, DIRS_ONLYREAL);
for (i=0; i<fcount; i++) for (i=0; i<fcount; i++)
{ {
filename = i*304+dirbuf+72; filename = i*304+dirbuf+72;
sprintf(#cur_file,"%s/%s",way,filename); sprintf(cur_file,"%s/%s",way,filename);
if ( TestBit(ESDWORD[filename-40], 4) )
if (TestBit(ESDWORD[filename-40], 4) )
{ {
dir_count++; dir_count++;
GetSizeDir(#cur_file); GetSizeDir(cur_file);
} }
else else
{ {
GetFileInfo(#cur_file, #file_info_dirsize); GetFileInfo(cur_file, #file_info_dirsize);
size_dir = size_dir + file_info_dirsize.sizelo; size_dir += file_info_dirsize.sizelo;
file_count++; file_count++;
} }
} }
free(cur_file);
} }
} }
@ -96,7 +102,7 @@ void GetSizeMoreFiles(dword way)
{ {
selected_offset2 = file_mas[i]*304 + buf+32 + 7; selected_offset2 = file_mas[i]*304 + buf+32 + 7;
if (ESBYTE[selected_offset2]) { if (ESBYTE[selected_offset2]) {
sprintf(#cur_file,way,file_mas[i]*304+buf+72); sprintf(#cur_file,"%s/%s",way,file_mas[i]*304+buf+72);
GetFileInfo(#cur_file, #file_info_general); GetFileInfo(#cur_file, #file_info_general);
if ( file_info_general.isfolder ) if ( file_info_general.isfolder )
@ -138,8 +144,8 @@ void properties_dialog()
{ {
GetFileInfo(#file_path, #file_info_general); GetFileInfo(#file_path, #file_info_general);
strcpy(#file_name2, #file_name); strcpy(#file_name2, #file_name);
file_name_ed.size = strlen(#file_name2); file_name_ed.size = strlen(#file_name2);
if (itdir) GetSizeDir(#file_path); if(itdir) GetSizeDir(#file_path);
} }
strcpy(#path_to_file, #path); strcpy(#path_to_file, #path);
path_to_file_ed.size = strlen(#path_to_file); path_to_file_ed.size = strlen(#path_to_file);
@ -149,7 +155,11 @@ void properties_dialog()
{ {
case evButton: case evButton:
id=GetButtonID(); id=GetButtonID();
IF (id==1) || (id==10){cmd_free=3;ExitProcess();} if (id==1) || (id==10)
{
cmd_free=3;
ExitProcess();
}
if (id==20) SetProperties(id); if (id==20) SetProperties(id);
if (id==21) SetProperties(id); if (id==21) SetProperties(id);
if (id==22) SetProperties(id); if (id==22) SetProperties(id);
@ -163,7 +173,11 @@ void properties_dialog()
case evKey: case evKey:
key = GetKey(); key = GetKey();
IF (key==27){cmd_free=3;ExitProcess();} if (key==27)
{
cmd_free=3;
ExitProcess();
}
EAX=key<<8; EAX=key<<8;
edit_box_key stdcall(#file_name_ed); edit_box_key stdcall(#file_name_ed);
edit_box_key stdcall(#path_to_file_ed); edit_box_key stdcall(#path_to_file_ed);
@ -185,60 +199,43 @@ void properties_dialog()
Put_icon('', 18, 19, 0xFFFfff, 0); Put_icon('', 18, 19, 0xFFFfff, 0);
sprintf(#folder_info,"%s%d%s%d",SET_6,file_count,SET_7,dir_count); sprintf(#folder_info,"%s%d%s%d",SET_6,file_count,SET_7,dir_count);
WriteText(50, 23, 0x80, 0x000000, #folder_info); WriteText(50, 23, 0x80, 0x000000, #folder_info);
EAX = ConvertSize(size_dir); sprintf(#element_size_label,"%s (%d %s)",ConvertSize(size_dir),size_dir,SET_BYTE_LANG);
strcpy(#element_size_label, EAX);
strcat(#element_size_label, " (");
strcat(#element_size_label, itoa(size_dir));
strcat(#element_size_label, " b)");
//tmp = ConvertSize(size_dir);
//sprintf(#element_size_label," ( byte)");
WriteText(100, 65, 0x80, 0x000000, #element_size_label); WriteText(100, 65, 0x80, 0x000000, #element_size_label);
} }
else else
{ {
if ( file_info_general.isfolder ) if ( file_info_general.isfolder )
Put_icon("<DIR>", 18, 19, 0xFFFfff, 0); Put_icon("<DIR>", 18, 19, 0xFFFfff, 0);
else else
Put_icon(#file_name2+strrchr(#file_name2,'.'), 18, 19, 0xFFFfff, 0); Put_icon(#file_name2+strrchr(#file_name2,'.'), 18, 19, 0xFFFfff, 0);
WriteText(50, 13, 0x80, 0x000000, PR_T_NAME); WriteText(50, 13, 0x80, 0x000000, PR_T_NAME);
edit_box_draw stdcall (#file_name_ed); edit_box_draw stdcall (#file_name_ed);
if (!itdir) if (!itdir) element_size = file_info_general.sizelo;
{
element_size = file_info_general.sizelo;
}
else else
{ {
WriteText(10, 80, 0x80, 0x000000, PR_T_CONTAINS); WriteText(10, 80, 0x80, 0x000000, PR_T_CONTAINS);
sprintf(#folder_info,"%s%d%s%d",SET_6,file_count,SET_7,dir_count); sprintf(#folder_info,"%s%d%s%d",SET_6,file_count,SET_7,dir_count);
WriteText(100, 80, 0x80, 0x000000, #folder_info); WriteText(100, 80, 0x80, 0x000000, #folder_info);
element_size = size_dir; element_size = size_dir;
} }
WriteText(10, 95, 0x80, 0x000000, SET_3); WriteText(10, 95, 0x80, 0x000000, SET_3);
WriteText(10, 110, 0x80, 0x000000, SET_4); WriteText(10, 110, 0x80, 0x000000, SET_4);
WriteText(10, 125, 0x80, 0x000000, SET_5); WriteText(10, 125, 0x80, 0x000000, SET_5);
DrawDate(100, 95, 0, #file_info_general.datecreate); DrawDate(100, 95, 0, #file_info_general.datecreate);
DrawDate(100, 110, 0, #file_info_general.datelastaccess); DrawDate(100, 110, 0, #file_info_general.datelastaccess);
DrawDate(100, 125, 0, #file_info_general.datelastedit); DrawDate(100, 125, 0, #file_info_general.datelastedit);
EAX = ConvertSize(element_size); sprintf(#element_size_label,"%s (%d %s)",ConvertSize(element_size),element_size,SET_BYTE_LANG);
strcpy(#element_size_label, EAX);
strcat(#element_size_label, " (");
strcat(#element_size_label, itoa(element_size));
strcat(#element_size_label, " b)");
//sprintf(#element_size_label,"%s (%d byte)","",element_size);
//tmp = ConvertSize(element_size);
//sprintf(#element_size_label,"%s (%d byte)",tmp,element_size);
WriteText(100, 65, 0x80, 0x000000, #element_size_label); WriteText(100, 65, 0x80, 0x000000, #element_size_label);
flags_frame.size_x = - flags_frame.start_x * 2 + settings_form.cwidth - 2; flags_frame.size_x = - flags_frame.start_x * 2 + settings_form.cwidth - 2;
flags_frame.font_color = sc.work_text; flags_frame.font_color = sc.work_text;
flags_frame.font_backgr_color = sc.work; flags_frame.font_backgr_color = sc.work;
flags_frame.ext_col = sc.work_graph; flags_frame.ext_col = sc.work_graph;
frame_draw stdcall (#flags_frame); frame_draw stdcall (#flags_frame);
DrawPropertiesCheckBoxes(); DrawPropertiesCheckBoxes();
} }
} }

View File

@ -57,15 +57,10 @@ void settings_dialog()
save_files_h = files.line_h; save_files_h = files.line_h;
save_DBLTime = MOUSE_TIME; save_DBLTime = MOUSE_TIME;
//SetEventMask(0x27);
loop(){ loop(){
switch(WaitEvent()) switch(WaitEvent())
{ {
/*case evMouse: case evButton:
break;*/
case evButton:
id=GetButtonID(); id=GetButtonID();
if (id==10) if (id==10)
{ {
@ -75,29 +70,31 @@ void settings_dialog()
cmd_free = 4; cmd_free = 4;
ExitProcess(); ExitProcess();
} }
if (id==1) || (id==11) else if (id==1) || (id==11)
{ {
active_settings=0; active_settings=0;
goto EXIT_SETTING; goto EXIT_SETTING;
} }
if (id==5) else if (id==5)
{ {
RunProgram("tinypad", "/sys/settings/assoc.ini"); RunProgram("tinypad", "/sys/settings/assoc.ini");
break; break;
} }
if (id==20) show_dev_name ^= 1; else if (id==20) show_dev_name ^= 1;
if (id==21) real_files_names_case ^= 1; else if (id==21) real_files_names_case ^= 1;
if (id==22) info_after_copy ^= 1; else if (id==22) info_after_copy ^= 1;
if (id==23) use_big_fonts ^= 1; else if (id==23) use_big_fonts ^= 1;
if (id==25) files.line_h++; else if (id==25) files.line_h++;
if (id==26) && (files.line_h>8) files.line_h--; else if (id==26) && (files.line_h>14) files.line_h--;
if (id==27) MOUSE_TIME++; else if (id==27) MOUSE_TIME++;
if (id==28) && (MOUSE_TIME>30) MOUSE_TIME--; else if (id==28) && (MOUSE_TIME>29) MOUSE_TIME--;
RefreshWindow(Form.ID,settings_form.ID); //CMD_REFRESH = true;
MoveSize(-1,-1,-1,settings_form.height+1);
MoveSize(-1,-1,-1,settings_form.height);
DrawSettingsCheckBoxes(); DrawSettingsCheckBoxes();
break; break;
case evKey: case evKey:
key = GetKey(); key = GetKey();
if (key==27) if (key==27)
{ {
@ -106,15 +103,15 @@ void settings_dialog()
goto EXIT_SETTING; goto EXIT_SETTING;
} }
break; break;
case evReDraw: case evReDraw:
DefineAndDrawWindow(Form.left + Form.width/2, Form.top + Form.height/2 - 75, 300, 234+GetSkinHeight(),0x34,sc.work,TITLE_SETT); DefineAndDrawWindow(Form.left + Form.width/2, Form.top + Form.height/2 - 75, 300, 234+GetSkinHeight(),0x34,sc.work,TITLE_SETT);
GetProcessInfo(#settings_form, SelfInfo); GetProcessInfo(#settings_form, SelfInfo);
DrawSettingsCheckBoxes(); DrawSettingsCheckBoxes();
DrawFlatButton(9, 166, strlen(EDIT_FILE_ASSOCIATIONS)+4*6, 22, 5, 0xE4DFE1, EDIT_FILE_ASSOCIATIONS); DrawFlatButton(9, 166, strlen(EDIT_FILE_ASSOCIATIONS)+4*6, 22, 5, 0xE4DFE1, EDIT_FILE_ASSOCIATIONS);
DrawFlatButton(128, settings_form.cheight - 30, 70, 22, 10, 0xE4DFE1, APPLY_T); DrawFlatButton(128, settings_form.cheight - 30, 70, 22, 10, 0xE4DFE1, APPLY_T);
DrawFlatButton(208, settings_form.cheight - 30, 70, 22, 11, 0xE4DFE1, CANCEL_T); DrawFlatButton(208, settings_form.cheight - 30, 70, 22, 11, 0xE4DFE1, CANCEL_T);
} }
} }
} }

View File

@ -33,8 +33,8 @@
:void DrawDate(dword x, y, color, in_date) :void DrawDate(dword x, y, color, in_date)
{ {
char text[15]; //char text[15];
/*EDI = in_date; EDI = in_date;
EAX = 47; EAX = 47;
EBX = 2<<16; EBX = 2<<16;
EDX = x<<16+y; EDX = x<<16+y;
@ -47,10 +47,11 @@
EDX += 18<<16; EDX += 18<<16;
EBX = 4<<16; EBX = 4<<16;
ECX = EDI.date.year; ECX = EDI.date.year;
$int 0x40;*/ $int 0x40;
PutPixel(x+14,y+6,color);
//sprintf(#text,"%s","ddf"); PutPixel(x+32,y+6,color);
WriteText(x, y, 0x80, color, "adas\0"); //sprintf(#text,"%d",EDI.date.year);
//WriteText(x, y, 0x80, 0x000000, #text);
} }
@ -301,18 +302,17 @@ enum
return #absolute_path; return #absolute_path;
} }
:byte ConvertSize_size_prefix[8];
:dword ConvertSize(dword bytes) :dword ConvertSize(dword bytes)
{ {
byte size_prefix[8], size_nm[4]; byte size_nm[4];
if (bytes>=1073741824) strcpy(#size_nm, "Gb"); if (bytes>=1073741824) strncpy(#size_nm, "Gb",2);
else if (bytes>=1048576) strcpy(#size_nm, "Mb"); else if (bytes>=1048576) strncpy(#size_nm, "Mb",2);
else if (bytes>=1024) strcpy(#size_nm, "Kb"); else if (bytes>=1024) strncpy(#size_nm, "Kb",2);
else strcpy(#size_nm, "b"); else strncpy(#size_nm, "b ",2);
while (bytes>1023) bytes/=1024; while (bytes>1023) bytes/=1024;
itoa_(#size_prefix, bytes); sprintf(#ConvertSize_size_prefix,"%d %s",bytes,#size_nm);
strcat(#size_prefix, #size_nm); return #ConvertSize_size_prefix;
//sprintf(#size_prefix,"%s","123");
return #size_prefix;
} }
:dword ConvertSizeToKb(unsigned int bytes) :dword ConvertSizeToKb(unsigned int bytes)

View File

@ -302,6 +302,8 @@ inline fastcall dword WaitEvent()
$mov eax,10 $mov eax,10
$int 0x40 $int 0x40
wait_event_code = EAX; wait_event_code = EAX;
//if(wait_event_code==evMouse) MOUSE.get();
//return wait_event_code;
} }
inline fastcall dword CheckEvent() inline fastcall dword CheckEvent()
@ -786,6 +788,20 @@ inline RefreshWindow(dword ID_REFRESH,ID_ACTIVE)
$int 0x40 $int 0x40
} }
inline getIPC(ECX,EDX)
{
$mov EAX,60
$mov EBX,2
$int 0x40
}
inline sendIPC(ECX,EDX,ESI)
{
$mov EAX,60
$mov EBX,1
$int 0x40
}
void UnsafeDefineButton(dword x,y,w,h,EDX,ESI) void UnsafeDefineButton(dword x,y,w,h,EDX,ESI)
{ {
EAX = 8; EAX = 8;
@ -818,6 +834,7 @@ inline fastcall dword GetStartTime()
DefineAndDrawWindow(215,100,250,200,0x34,0xFFFFFF,"Alert"); DefineAndDrawWindow(215,100,250,200,0x34,0xFFFFFF,"Alert");
WriteTextB(5,5,0x90,0x0,ALERT_TEXT); WriteTextB(5,5,0x90,0x0,ALERT_TEXT);
break; break;
case evKey:
case evButton: case evButton:
id=GetButtonID(); id=GetButtonID();
if (id==1) ExitProcess(); if (id==1) ExitProcess();

View File

@ -618,16 +618,15 @@ F3:
return #buffer; return #buffer;
} }
*/ */
:unsigned char BUF_ITOA[11];
inline dword itoa(signed long number) inline dword itoa(signed long number)
{ {
unsigned char buf[11];
dword ret,p; dword ret,p;
byte cmd; byte cmd;
long mask,tmp; long mask,tmp;
mask = 1000000000; mask = 1000000000;
cmd = true; cmd = true;
p = #buf; p = #BUF_ITOA;
if(!number){ if(!number){
ESBYTE[p] = '0'; ESBYTE[p] = '0';
ESBYTE[p+1] = 0; ESBYTE[p+1] = 0;

View File

@ -55,7 +55,7 @@ include '../../../develop/libraries/box_lib/load_lib.mac'
START: START:
mcall 68,11 mcall 68,11
mcall 40,0x27 mcall 40,0x80000027
load_libraries l_libs_start,load_lib_end load_libraries l_libs_start,load_lib_end
cmp eax,-1 cmp eax,-1