diff --git a/programs/cmm/eolite/Eolite.c b/programs/cmm/eolite/Eolite.c index 8c692c8651..050dbd7a9e 100644 --- a/programs/cmm/eolite/Eolite.c +++ b/programs/cmm/eolite/Eolite.c @@ -122,7 +122,7 @@ byte active_about=0; word about_window; byte active_settings=0; word settings_window; - +dword _not_draw = false; byte menu_call_mouse=0; llist files; @@ -208,7 +208,7 @@ void main() strncpy(#path, "/rd/1/", 6); } Open_Dir(#path,ONLY_OPEN); - SetEventMask(0x27); + SetEventMask(1100111b); loop(){ switch(WaitEvent()) { @@ -558,13 +558,9 @@ void main() action_buf=0; } break; - /*default: - if(CMD_REFRESH) - { - CMD_REFRESH = false; - goto DRAW_WINDOW; - } - */ + case evIPC: + goto DRAW_WINDOW; + break; } if(cmd_free) @@ -769,7 +765,7 @@ void Line_ReDraw(dword color, filenum){ } else { - if (strcmp("..",file_name_off)==0) ext1=".."; else ext1=""; + if (!strncmp(file_name_off,"..",3)) ext1=".."; else ext1=""; Put_icon(ext1, files.x+3, files.line_h/2-7+y, color, 0); } @@ -778,8 +774,7 @@ void Line_ReDraw(dword color, filenum){ { itdir = TestBit(attr, 4); strcpy(#file_name, file_name_off); - strcpy(#file_path, #path); - strcat(#file_path, #file_name); + sprintf(#file_path,"%s%s",#path,file_name_off); if (text_col==0xA6A6B7) text_col=0xFFFFFF; } if (file.selected) text_col=0xFF0000; @@ -820,7 +815,7 @@ void Open_Dir(dword dir_path, redraw){ } if (files.count!=-1) { - KEdit(); + if(!_not_draw)KEdit(); HistoryPath(ADD_NEW_PATH); files.visible = files.h / files.line_h; if (files.count < files.visible) files.visible = files.count; @@ -829,9 +824,9 @@ void Open_Dir(dword dir_path, redraw){ 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"); if (redraw!=ONLY_SHOW) Sorting(); - if (redraw!=ONLY_OPEN) List_ReDraw(); + if (redraw!=ONLY_OPEN)&&(!_not_draw) 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; if(!_not_draw)List_ReDraw();} } @@ -840,7 +835,7 @@ inline Sorting() dword k=0, l=1; dword file_off; int i; - if (!strcmp(#path,"/")) //do not sort + if (!strncmp(#path,"/",2)) //do not sort { for(k=1;k0) && (strcmp(file_mas[0]*304+buf+72,"..")!=0) - for(k--; k>0; k--;) if (!strcmp(file_mas[k]*304+buf+72,"..")) {file_mas[k]>0) && (!strncmp(file_mas[0]*304+buf+72,"..",3)) + for(k--; k>0; k--;) if (!strncmp(file_mas[k]*304+buf+72,"..",3)) {file_mas[k]>14) files.line_h--; else if (id==27) MOUSE_TIME++; else if (id==28) && (MOUSE_TIME>29) MOUSE_TIME--; - //CMD_REFRESH = true; - MoveSize(-1,-1,-1,settings_form.height+1); - MoveSize(-1,-1,-1,settings_form.height); + EventRedrawWindow(Form.left,Form.top); DrawSettingsCheckBoxes(); break; diff --git a/programs/cmm/eolite/include/sorting.h b/programs/cmm/eolite/include/sorting.h index bd05b11dea..e5b5bb3b2c 100644 --- a/programs/cmm/eolite/include/sorting.h +++ b/programs/cmm/eolite/include/sorting.h @@ -3,9 +3,9 @@ void Sort_by_Size(int a, b) // для первого вызова: a = 0, b = <элементов в массиве> - 1 { int iss = a; - IF (a >= b) return; - FOR (j = a; j <= b; j++) - IF (ESDWORD[file_mas[j]*304 + buf+64] <= ESDWORD[file_mas[b]*304 + buf+64]) { file_mas[iss] >< file_mas[j]; iss++;} + if (a >= b) return; + for (j = a; j <= b; j++) + if (ESDWORD[file_mas[j]*304 + buf+64] <= ESDWORD[file_mas[b]*304 + buf+64]) { file_mas[iss] >< file_mas[j]; iss++;} Sort_by_Size (a, iss-2); Sort_by_Size (iss, b); } @@ -14,9 +14,9 @@ void Sort_by_Size(int a, b) // void Sort_by_Name(int a, b) // для первого вызова: a = 0, b = <элементов в массиве> - 1 { int isn = a; - IF (a >= b) return; - FOR (j = a; j <= b; j++) - IF (strcmp(file_mas[j]*304 + buf+72, file_mas[b]*304 + buf+72)<=0) { file_mas[isn] >< file_mas[j]; isn++;} + if (a >= b) return; + for (j = a; j <= b; j++) + if (strcmp(file_mas[j]*304 + buf+72, file_mas[b]*304 + buf+72)<=0) { file_mas[isn] >< file_mas[j]; isn++;} Sort_by_Name(a, isn-2); Sort_by_Name(isn, b); } @@ -26,7 +26,7 @@ void Sort_by_Type(int a, b) // { dword filename1, filename2, ext1, ext2; int n, isn = a; - IF (a >= b) return; + if (a >= b) return; for (j = a; j <= b; j++) { filename1 = file_mas[j]*304 + buf+72; @@ -34,14 +34,14 @@ void Sort_by_Type(int a, b) // n=strlen(filename1)-1; WHILE (n>0) && (ESBYTE[filename1+n]<>'.') n--; - IF (n) ext1 = filename1+n+1; else ext1=0; + if (n) ext1 = filename1+n+1; else ext1=0; n=strlen(filename2)-1; WHILE (n>0) && (ESBYTE[filename2+n]<>'.') n--; - IF (n) ext2 = filename2+n+1; else ext2=0; + if (n) ext2 = filename2+n+1; else ext2=0; n=strcmp(ext1, ext2); - IF (n<0) { file_mas[isn] >< file_mas[j]; isn++;} - IF (n==0) && (strcmp(filename1, filename2)<=0) { file_mas[isn] >< file_mas[j]; isn++;} + if (n<0) { file_mas[isn] >< file_mas[j]; isn++;} + if (n==0) && (strcmp(filename1, filename2)<=0) { file_mas[isn] >< file_mas[j]; isn++;} } Sort_by_Type(a, isn-2); Sort_by_Type(isn, b); diff --git a/programs/cmm/lib/kolibri.h b/programs/cmm/lib/kolibri.h index 8acf02c190..c20f84c231 100644 --- a/programs/cmm/lib/kolibri.h +++ b/programs/cmm/lib/kolibri.h @@ -251,6 +251,8 @@ char program_path[4096]; vert = EBX; } + + :void mouse::slider() { signed _x,_y; @@ -824,6 +826,27 @@ inline fastcall dword GetStartTime() $int 0x40 } + +:dword X_EventRedrawWindow,Y_EventRedrawWindow; +:void _EventRedrawWindow() +{ + loop()switch(WaitEvent()) + { + case evReDraw: + DefineAndDrawWindow(X_EventRedrawWindow,Y_EventRedrawWindow,100,1,1,0x34,0xFFFFFF,""); + pause(10); + ExitProcess(); + break; + } +} +:void EventRedrawWindow(dword x,y) +{ + dword mem = malloc(4096); + X_EventRedrawWindow = x; + Y_EventRedrawWindow = y; + CreateThread(#_EventRedrawWindow,mem+4092); +} + :dword ALERT_TEXT; :void dialog_alert() { @@ -841,7 +864,6 @@ inline fastcall dword GetStartTime() break; } } - :dword alert(dword text) { dword mem = malloc(4096); diff --git a/programs/cmm/lib/mem.h b/programs/cmm/lib/mem.h index 4b44b7e1a6..19d307a223 100644 --- a/programs/cmm/lib/mem.h +++ b/programs/cmm/lib/mem.h @@ -1,6 +1,10 @@ #ifndef INCLUDE_MEM_H #define INCLUDE_MEM_H +#ifndef INCLUDE_KOLIBRI_H +#include "../lib/kolibri.h" +#endif + dword mem_init() { $push ebx diff --git a/programs/cmm/lib/strings.h b/programs/cmm/lib/strings.h index b5b34379bd..84bb0b3cb1 100644 --- a/programs/cmm/lib/strings.h +++ b/programs/cmm/lib/strings.h @@ -116,7 +116,18 @@ L1: } } - +/* +inline signed int strncmp(dword text1,text2,len) +{ + + loop() + { + if(DSBYTE[text1]!=DSBYTE[text2])return text1-text2; + $dec len + if(!len)return 0; + } +} +*/ inline fastcall unsigned int strlen( EDI) { $xor eax, eax