From ce5a4a5f1ac36d103274e2c389f6891ebedfe411 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Sun, 31 Mar 2013 20:25:54 +0000 Subject: [PATCH] Eolite 1.77: RMB menu, list_box element used, fixed crash when changing size (reported by 0CodErr), a lot of other improvements git-svn-id: svn://kolibrios.org@3434 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/eolite/Eolite.c | 615 +++++++++--------- programs/cmm/eolite/imgs/actions.raw | Bin 2112 -> 1638 bytes programs/cmm/eolite/imgs/left_p.txt | 2 +- programs/cmm/eolite/imgs/png/actions.png | Bin 0 -> 1165 bytes programs/cmm/eolite/imgs/png/file_actions.png | Bin 694 -> 0 bytes programs/cmm/eolite/imgs/png/icons.png | Bin 5347 -> 6134 bytes programs/cmm/eolite/include/about_dialog.h | 3 - programs/cmm/eolite/include/file_menu.h | 66 ++ programs/cmm/eolite/include/ini.h | 36 +- programs/cmm/eolite/include/left_panel.h | 105 +-- programs/cmm/eolite/include/some_code.h | 23 +- programs/cmm/eolite/txt/History.txt | 8 + programs/cmm/installer/installation.c | 8 + programs/cmm/installer/main.c | 2 +- .../cmm/{installer/copyf.c => lib/copyf.h} | 25 +- programs/cmm/lib/figures.h | 3 +- programs/cmm/lib/file_system.h | 1 + programs/cmm/lib/kolibri.h | 1 + programs/cmm/rb/rb.c | 6 +- 19 files changed, 463 insertions(+), 441 deletions(-) create mode 100644 programs/cmm/eolite/imgs/png/actions.png delete mode 100644 programs/cmm/eolite/imgs/png/file_actions.png create mode 100644 programs/cmm/eolite/include/file_menu.h rename programs/cmm/{installer/copyf.c => lib/copyf.h} (81%) diff --git a/programs/cmm/eolite/Eolite.c b/programs/cmm/eolite/Eolite.c index 9ad2cf9ac4..88da320462 100644 --- a/programs/cmm/eolite/Eolite.c +++ b/programs/cmm/eolite/Eolite.c @@ -2,7 +2,6 @@ //GNU GPL licence. //копировать через поток -//иконка действительно нужна другая для неизвесных устройств и папок в будующем. //libraries #define MEMSIZE 0xA0000 @@ -14,79 +13,57 @@ #include "..\lib\file_system.h" #include "..\lib\figures.h" #include "..\lib\encoding.h" +#include "..\lib\list_box.h" +#include "..\lib\copyf.h" //images #include "imgs\toolbar.txt" #include "imgs\left_p.txt" -int BUTTON_HEIGHT=18; - //for OpenDir #define ONLY_SHOW 0 #define WITH_REDRAW 1 #define ONLY_OPEN 2 -//переменные -#define TITLE "Eolite File Manager v1.65" -#define ABOUT_TITLE "Eolite v1.65" +#define TITLE "Eolite File Manager v1.77" +#define ABOUT_TITLE "Eolite v1.77" dword col_work = 0xE4DFE1; dword col_border = 0x819FC5; dword col_padding = 0xC8C9C9; dword col_selec = 0x94AECE; dword col_lpanel = 0x00699C; +int toolbar_buttons_x[7]={9,46,85,134,167,203}; +char tmp_disk_del_param[3]="d0"; +struct path_string { char Item[4096]; }; -int f_visible, - count, - za_kadrom, - curbtn; - - -byte cut_active, - rename_active, - del_active; -byte show_actions=1, - show_dev_name=1, - sort_num=2, - isdir; -unsigned char +llist files; + +byte path[4096], - edit_path[4096], file_path[4096], file_name[256], copy_file[4096], - temp[4096]; -int scroll_size; - -struct path_string { -char Item[4096]; -}; - -int toolbar_buttons_x[7]={9,46,85,134,167,203}; -char tmp_disk_del_param[3]="d0"; - -dword file_mas[6898]; -int j, i, mouse_dd; -int scroll_used; + temp[4096]; +byte + cut_active, + rename_active, + del_active; +byte + show_dev_name=1, + sort_num=2, + isdir; proc_info Form; mouse m; -dword buf, off; //для текста и буфера +int mouse_dd, scroll_used, scroll_size; +dword buf, off; +dword file_mas[6898]; +int j, i; edit_box edit2= {250,213,80,0xFFFFCC,0x94AECE,0xFFFFCC,0xffffff,0,248,#file_name,#mouse_dd,64,6,6}; -PathShow_data PathShow = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, #path, #edit_path, 0}; +PathShow_data PathShow = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, #path, #temp, 0}; PathShow_data FileShow = {0, 56,215, 6, 100, 0, 0, 0x0, 0xFFFfff, #file_name, #temp, 0}; -inline fastcall signed int _strrchr( ESI,BL) -{ - int jj=0, last=strlen(ESI); - do{ - jj++; - $lodsb - IF(AL==BL) last=jj; - } while(AL!=0); - return last; -} - #include "include\some_code.h" #include "include\about_dialog.h" #include "include\sorting.h" @@ -94,52 +71,83 @@ inline fastcall signed int _strrchr( ESI,BL) #include "include\ini.h" #include "include\left_panel.h" #include "include\history.h" +#include "include\file_menu.h" void main() { - word key, id, can_show; - int min_win_h; + word key, id, can_show, can_select; + files.line_h=18; mem_Init(); if (load_dll2(boxlib, #box_lib_init,0)!=0) notify("Error while loading library /rd/1/lib/box_lib.obj"); - GetSystemDiscs(); + SystemDiscsGet(); GetIni(1); if (param) { strcpy(#path, #param); - if (strcmp(#path+strlen(#path)-1,"/")<>0) strcat(#path, "/"); //если нет, + "/" + if (path[strlen(#path)-1]!='/') chrcat(#path, '/'); //add "/" to the end of the string } else strcpy(#path, "/rd/1/"); Open_Dir(#path,ONLY_OPEN); SetEventMask(0x27); - loop() switch(WaitEvent()) + loop() switch(WaitEvent()) { case evMouse: - IF (del_active) break; - + IF (del_active) break; id=GetProcessSlot(Form.ID); - IF (id<>GetActiveProcess()) break; //если окно не активно на события мыши не реагируем - - IF (rename_active) edit_box_mouse stdcall(#edit2); + IF (id<>GetActiveProcess()) || (Form.status_window>2) break; + IF (rename_active) { edit_box_mouse stdcall(#edit2); break; } m.get(); - /*if (m.pkm) && (m.x > 192) && (m.y > 57) can_show = 1; - if (!m.pkm) && (can_show) + if (m.x > files.x) && (m.x < files.x + files.w) && (m.y > files.y) && (m.y < files.y+files.h) { + if (m.lkm) can_select = 1; + if (m.pkm) + { + can_show = 1; + if (m.y - 57 / files.line_h != files.current) can_select = 1; + } + } + + //select/open file { + if (!m.lkm) && (!m.pkm) && (can_select) + { + can_select = 0; + if (m.y<57) break; + id = m.y - 57 / files.line_h; + if (files.current!=id) FileList_ReDraw(id-files.current); + else Open(); + }; + // } select/open file + + //file menu { + if (!m.pkm) && (!m.lkm) && (can_show) + { + can_show = 0; + if (m.y<57) break; SwitchToAnotherThread(); CreateThread(#FileMenu,#stak2); - can_show = 0; - }*/ + break; + } + // } file menu + + + if (m.vert) + { + files.MouseScroll(m.vert); + List_ReDraw(); + break; + } if (m.x>=Form.width-26) && (m.x<=Form.width-6) && (m.y>40) && (m.y<57) { IF (m.lkm==1) DrawRectangle3D(onLeft(26,0),41,14,14,0xC7C7C7,0xFFFFFF); - WHILE (m.lkm==1) && (za_kadrom>0) + WHILE (m.lkm==1) && (files.first>0) { - pause(10); - za_kadrom--; + pause(8); + files.first--; List_ReDraw(); m.get(); } @@ -149,48 +157,29 @@ void main() if (m.x>=Form.width-26) && (m.x<=Form.width-6) && (m.y>onTop(22,0)+1) && (m.y0) - { - if (za_kadrom>0) za_kadrom--; - if (curbtn0) za_kadrom--; - if (curbtn0) curbtn--; - List_ReDraw(); - if (za_kadrom0) curbtn--; - List_ReDraw(); - } - //скролл - if (!m.lkm) && (scroll_used) { scroll_used=NULL; TVScroll(); } - if (m.x>=Form.width-26) && (m.x<=Form.width-6) && (m.y>56) && (m.y=Form.width-26) && (m.x<=Form.width-6) && (m.y>56) && (m.ym.y) || (m.y<0) || (m.y>4000) m.y=scroll_size/2+57; //если курсор над окном - id=za_kadrom; //сохраняем старое количество + IF (scroll_size/2+57>m.y) || (m.y<0) || (m.y>4000) m.y=scroll_size/2+57; //anee eo?ni? iaa ieiii + id=files.first; j= scroll_size/2; - za_kadrom = m.y -j -57 * count; - za_kadrom /= onTop(22,57); - IF (f_visible+za_kadrom>count) za_kadrom=count-f_visible; - IF (id<>za_kadrom) List_ReDraw(); //чтоб лишний раз не перерисовывать + files.first = m.y -j -57 * files.count; + files.first /= onTop(22,57); + IF (files.visible+files.first>files.count) files.first=files.count-files.visible; + IF (id<>files.first) List_ReDraw(); } break; //Button pressed----------------------------------------------------------------------------- @@ -211,7 +200,7 @@ void main() case 22: //Forward if (HistoryPath(GO_FORWARD)) { - za_kadrom=curbtn=NULL; //вверх списка + files.first=files.current=NULL; //aaa?o nienea Open_Dir(#path,WITH_REDRAW); } break; @@ -230,49 +219,24 @@ void main() IF(sort_num==2) DrawFilledBar(onLeft(115,0),42,6,10); IF(sort_num==3) DrawFilledBar(onLeft(44,0),42,6,10); sort_num=id-30; - Open_Dir(#path,1); - break; - case 30: //about - SwitchToAnotherThread(); - CreateThread(#about_dialog,#stak1); - break; - case 77: - IF (show_actions==1) show_actions=0; ELSE show_actions=1; - DrawLeftPanel(); + Open_Dir(#path,WITH_REDRAW); break; case 78: //rescan devices Tip(56, "Devices", 78, "-"); pause(10); GetIni(1); - GetSystemDiscs(); + SystemDiscsGet(); Open_Dir(#path,WITH_REDRAW); DrawLeftPanel(); break; - case 80: //rename - goto REN_MARK; - case 81: //Delete file - Del_Form(); - break; - case 82: //create folder - NEW_FOLDER_MARK: - strcpy(#temp, #path); - strcat(#temp, "New folder"); - CreateDir(#temp); - IF (!EAX){ - SelectFile("New folder"); - goto REN_MARK; - } - ELSE - { - Write_Error(EAX); - ShowMessage("Folder can not be created."); - } + case 50...60: //Actions + ActionsProcess(id-50); break; case 100...120: DEVICE_MARK: - DrawRectangle3D(17,id-100*16+74,159,16, 0, 0); //выделение + DrawRectangle3D(17,id-100*16+74,159,16, 0, 0); //auaaeaiea strcpy(#path, #disk_list[id-100].Item); - za_kadrom=curbtn=0; + files.first=files.current=0; Open_Dir(#path,1); pause(5); DrawRectangle3D(17,id-100*16+74,159,16, 0xFFFFFF, 0xFFFFFF); @@ -281,30 +245,10 @@ void main() tmp_disk_del_param[1]=disk_list[id-130].Item[4]; RunProgram("/sys/tmpdisk", #tmp_disk_del_param); pause(10); - GetSystemDiscs(); + SystemDiscsGet(); Open_Dir(#path,WITH_REDRAW); DrawLeftPanel(); break; - default: - if (id<200) break; //кнопки из списка файлов - if (curbtn!=id-201) {FileList_ReDraw(id-201-curbtn); break;} - else - { - OPEN_MARK: - if (!isdir) - { - GetIni(0); - } - else - { - if (!strcmp(#file_name,"..")) { Dir_Up(); break; } - OPEN_DEV: - strcpy(#path, #file_path); - IF (strcmp(#path+strlen(#path)-1,"/")<>0) strcat(#path,"/"); //если нет, + "/" - za_kadrom=curbtn=0; - Open_Dir(#path,1); - } - } } break; //Key pressed----------------------------------------------------------------------------- @@ -329,24 +273,24 @@ void main() id=key-110; IF (id-100>=disc_num) break; GOTO DEVICE_MARK; - case 8: //Назад + case 008: //GoBack(); Dir_Up(); break; - case 004: //Ctrl+D рис на раб стол растянуть + case 004: //Ctrl+D set as bg strcpy(#temp, "\\S__"); strcat(#temp, #file_path); RunProgram("/sys/media/kiv", #temp); break; - case 014: //Ctrl+N новое окно + 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 case 003: //Ctrl+C CTRLC_MARK: - IF (isdir) break; //папки пока что копировать не умеем - strcpy(#copy_file, #file_path); //вычисляем какой файл копировать + IF (isdir) break; + strcpy(#copy_file, #file_path); IF (key==24) cut_active=1; ELSE cut_active=0; break; case 022: //Ctrl+V @@ -357,11 +301,8 @@ void main() break; case 013: //Enter IF (rename_active==1) {ReName(true); break;} - GOTO OPEN_MARK; + Open(); break; - case 55: //F6 - new folder - goto NEW_FOLDER_MARK; - case 56: //IF (rename_active==1) break;//up case 178: //up FileList_ReDraw(-1); break; @@ -369,52 +310,34 @@ void main() FileList_ReDraw(1); break; case 180: //home - za_kadrom=0; - curbtn=0; + files.first=0; + files.current=0; List_ReDraw(); break; case 181: //end - za_kadrom=count-f_visible; - curbtn=f_visible-1; + files.first=files.count-files.visible; + files.current=files.visible-1; List_ReDraw(); break; case 183: //Page Down - FileList_ReDraw(f_visible-1); + FileList_ReDraw(files.visible-1); break; case 184: //Page Up - FileList_ReDraw(-f_visible+1); + FileList_ReDraw(-files.visible+1); break; - case 051: //Нажата F2 - REN_MARK: - if (!count) break; - DeleteButton(curbtn+201); //это чтоб можно было выделять мышью - edit2.flags=66; //делаем компонент активным - edit2.width=onLeft(24,217); - edit2.top=curbtn*BUTTON_HEIGHT+59; - edit2.size=edit2.pos=strlen(#file_name); - edit_box_draw stdcall (#edit2); - DrawBar(213,curbtn*BUTTON_HEIGHT+58,edit2.width+1,1,0xFFFFCC); //полоса желтая сверху для одинаковости - rename_active=1; - break; - case 052: //Нажата F3 - IF (!isdir) RunProgram("/sys/tinypad", #file_path); - break; - case 053: //Нажата F4 - IF (!isdir) RunProgram("/sys/develop/heed", #file_path); - break; - case 054: //F5 - Open_Dir(#path,1); - break; - case 182: //delete file + case 182: //del Del_Form(); + break; + case 050...059: //F1-F10 + ActionsProcess(key-49); break; default: - for (i=curbtn+za_kadrom+1; i2) break; - min_win_h = disc_num*16+195; - if (Form.height < min_win_h) MoveSize(OLD,OLD,OLD,min_win_h); + files.SetSizes(192, 57, onLeft(192,27), onTop(57,6), disc_num*16+195,files.line_h); + if (Form.height < files.min_h) MoveSize(OLD,OLD,OLD,files.min_h); if (Form.width<480) MoveSize(OLD,OLD,480,OLD); draw_window(); } @@ -434,38 +357,35 @@ void main() inline fastcall void draw_window() { - //toolbar buttons + //toolbar PutPaletteImage(#toolbar,246,34,0,0,8,#toolbar_pal); for (j=0; j<3; j++) DefineButton(toolbar_buttons_x[j]+2,5+2,31-5,29-5,21+j+BT_HIDE,col_work); for (j=3; j<6; j++) DefineButton(toolbar_buttons_x[j],5,31,29,21+j+BT_HIDE,col_work); - //полоса адреса DrawBar(246,0,onLeft(246,60),12, col_work); //фон над полосой адреса - DrawBar(246,29,onLeft(246,60),5,col_work); //фон под полосой адреса - DrawRectangle3D(246,12,onLeft(66,246),16,col_border,col_border); //ободок - DefineButton(onLeft(34,0),6,27,28,30+BT_HIDE+BT_NOFRAME,col_work); //about + DrawBar(246,29,onLeft(246,60),5,col_work); //фон под полосой адреса + DrawRectangle3D(246,12,onLeft(66,246),16,col_border,col_border); + DefineButton(onLeft(34,0),6,27,28,51+BT_HIDE+BT_NOFRAME,col_work); //about PutPaletteImage(#goto_about,56,34,Form.width-65,0,8,#goto_about_pal); - //прямоугольники внутри - DrawRectangle3D(1,40,Form.cwidth-3,onTop(46,0),col_border,col_border); //синий ободок - DrawRectangle3D(0,39,Form.cwidth-1,onTop(44,0),col_palette[4],col_palette[4]); //фон + //main rectangles + DrawRectangle3D(1,40,Form.cwidth-3,onTop(46,0),col_border,col_border); + DrawRectangle3D(0,39,Form.cwidth-1,onTop(44,0),col_palette[4],col_palette[4]); //bg for (i=0; i<5; i++) DrawBar(0, 34+i, Form.cwidth, 1, col_palette[8-i]); DrawLeftPanel(); - //SortButtons - DrawFlatButton(192,40,onLeft(192,168),16,31,col_work,"File"); + //ListBox + DrawFlatButton(files.x,40,onLeft(files.x,168),16,31,col_work,"File"); DrawFlatButton(onLeft(168,0),40,73,16,32,col_work,"Type"); DrawFlatButton(onLeft(95,0),40,68,16,33,col_work,"Size"); - //Перерисовываем список + DrawBar(onLeft(27,0),57,1,onTop(22,57),col_border); //line to the left from the scroll + DrawFlatButton(onLeft(27,0),40,16,16,0,col_work,"\x18"); + DrawFlatButton(onLeft(27,0),onTop(22,0),16,16,0,col_work,"\x19"); Open_Dir(#path,ONLY_SHOW); - //прокрутка - DrawBar(onLeft(27,0),57,1,onTop(22,57),col_border); //линия слева от прокрутки - DrawFlatButton(onLeft(27,0),40,16,16,0,col_work,"\x18"); //прокрутка вверх - DrawFlatButton(onLeft(27,0),onTop(22,0),16,16,0,col_work,"\x19");//прокрутка вниз if (del_active) Del_Form(); - DefineButton(onLeft(34,0),6,27,28,30+BT_HIDE+BT_NOFRAME,col_work); //about } void KEdit() { + if (Form.width<480) return; PathShow.area_size_x = Form.cwidth-306; DrawBar(PathShow.start_x-3, PathShow.start_y-4, PathShow.area_size_x+2, 15, 0xFFFfff); PathShow_prepare stdcall(#PathShow); @@ -473,52 +393,52 @@ void KEdit() } -void FileList_ReDraw(int curbtn_) +void FileList_ReDraw(int cur) { - if (curbtn_<=0) //вверх + if (cur<=0) //up { - IF (za_kadrom==0) && (curbtn<=0) return; - IF (-curbtn_-1curbtn_) + IF (files.first==files.count-files.visible) && (files.current==files.visible-1) return; + IF (files.visible-files.current>cur) { - Line_ReDraw(0xFFFFFF, curbtn); //белая полоса - curbtn+=curbtn_; - Line_ReDraw(col_selec, curbtn); //выделение + Line_ReDraw(0xFFFFFF, files.current); + files.current+=cur; + Line_ReDraw(col_selec, files.current); return; } else { - IF(za_kadrom+curbtn+curbtn_>=count) + IF(files.first+files.current+cur>=files.count) { - za_kadrom=count-f_visible; - curbtn=curbtn_-za_kadrom+curbtn; + files.first=files.count-files.visible; + files.current=cur-files.first+files.current; } ELSE { - za_kadrom+=curbtn_+curbtn-f_visible+1; - curbtn=f_visible-1; + files.first+=cur+files.current-files.visible+1; + files.current=files.visible-1; } - IF (curbtn<0) || (curbtn>f_visible) + IF (files.current<0) || (files.current>files.visible) { - curbtn=f_visible-1; + files.current=files.visible-1; } List_ReDraw(); } @@ -530,67 +450,70 @@ void FileList_ReDraw(int curbtn_) void List_ReDraw() { - int paint_x=f_visible*BUTTON_HEIGHT+57; - IF (count-za_kadromf_visible-1) //если мы в конце списка файлов развернём окно появяться пустяе белые кнопки - { za_kadrom=count-f_visible; curbtn=f_visible-1; } //это если выделение после схлопывания окна за кадром + int paint_y; + //если мы в конце списка файлов развернём окно появяться пустяе белые кнопки + //это если выделение после схлопывания окна за кадром + if (files.count-files.firstfiles.visible-1) + { files.first=files.count-files.visible; files.current=files.visible-1; } - FOR (j=0; jj) Line_ReDraw(0xFFFFFF, j); ELSE Line_ReDraw(col_selec, curbtn); - DrawBar(192,paint_x,onLeft(27,192),onTop(paint_x,6),0xFFFFFF); //заливка белым доконца - DrawBar(onLeft(168,0),paint_x,1,onTop(paint_x,6),col_work); //полоса серая вертикальная 1 - DrawBar(onLeft(95,0),paint_x,1,onTop(paint_x,6),col_work); //полоса серая вертикальная 2 - TVScroll(); + for (j=0; jj) Line_ReDraw(0xFFFFFF, j); else Line_ReDraw(col_selec, files.current); + //in the bottom + paint_y = j * files.line_h + files.y; + DrawBar(files.x,paint_y,files.w,onTop(paint_y,6),0xFFFFFF); + DrawBar(onLeft(168,0),paint_y,1,onTop(paint_y,6),col_work); + DrawBar(onLeft(95,0),paint_y,1,onTop(paint_y,6),col_work); + Scroll(); } void Line_ReDraw(dword color, filenum){ - dword text_col=0, name_len=0, y=filenum*BUTTON_HEIGHT+57; //положение текста по Y + dword text_col=0, name_len=0, y=filenum*files.line_h+57; IF (rename_active==1) ReName(false); - DefineButton(192,y,onLeft(28,192),BUTTON_HEIGHT,201+filenum+BT_HIDE+BT_NOFRAME,color); //кнопа - //да, я не спорю что изврат, но зато перерисовки не видно - DrawBar(192,y,3,BUTTON_HEIGHT,color); - DrawBar(192+19,y,onLeft(46,192),BUTTON_HEIGHT,color); DrawBar(195,y+17,16,1,color); - if (BUTTON_HEIGHT>18) DrawBar(195,y+18,16,BUTTON_HEIGHT-18,color); - if (BUTTON_HEIGHT>15) DrawBar(195,y,16,BUTTON_HEIGHT-15,color); + DrawBar(192,y,3,files.line_h,color); + DrawBar(192+19,y,onLeft(46,192),files.line_h,color); DrawBar(195,y+17,16,1,color); + if (files.line_h>18) DrawBar(195,y+18,16,files.line_h-18,color); + if (files.line_h>15) DrawBar(195,y,16,files.line_h-15,color); - off=file_mas[filenum+za_kadrom]*304 + buf+72; + off=file_mas[filenum+files.first]*304 + buf+72; - if (!TestBit(ESDWORD[off-40], 4)) //это ФАЙЛ или папка? + if (!TestBit(ESDWORD[off-40], 4)) //file or folder? { strcpy(#temp, off); - Put_icon(#temp+_strrchr(#temp,'.'), BUTTON_HEIGHT/2-7+y, color); - WriteText(7-strlen(ConvertMemSize(ESDWORD[off-8]))*6+onLeft(75,0),BUTTON_HEIGHT-6/2+y,0x80,0,ConvertMemSize(ESDWORD[off-8])); //size + Put_icon(#temp+_strrchr(#temp,'.'), files.line_h/2-7+y, color); + WriteText(7-strlen(ConvertMemSize(ESDWORD[off-8]))*6+onLeft(75,0),files.line_h-6/2+y,0x80,0,ConvertMemSize(ESDWORD[off-8])); //size } else if (!strcmp("..",off)) - Put_icon("..", BUTTON_HEIGHT/2-7+y, color); + Put_icon("..", files.line_h/2-7+y, color); else - Put_icon("", BUTTON_HEIGHT/2-7+y, color); - - if (TestBit(ESDWORD[off-40],1)) || (TestBit(ESDWORD[off-40],2)) text_col=0xA6A6B7; //файл скрытый или системный? + Put_icon("", files.line_h/2-7+y, color); + if (TestBit(ESDWORD[off-40],1)) || (TestBit(ESDWORD[off-40],2)) text_col=0xA6A6B7; //system or hiden? if (color<>0xFFFfff) { isdir=TestBit(ESDWORD[off-40], 4); strcpy(#file_name, off); strcpy(#file_path, #path); - strcat(#file_path, #file_name); //полный путь к файлу + strcat(#file_path, #file_name); if (text_col==0xA6A6B7) text_col=0xFFFFFF; } - FileShow.font_color = text_col; - FileShow.area_size_x = Form.width - 380; - FileShow.text_pointer = off; - FileShow.start_y = BUTTON_HEIGHT/2-3+y; - PathShow_prepare stdcall(#FileShow); - PathShow_draw stdcall(#FileShow); - - DrawBar(onLeft(168,0),y,1,BUTTON_HEIGHT,col_work); //полоса серая вертикальная 1 - DrawBar(onLeft(95,0),y,1,BUTTON_HEIGHT,col_work); //полоса серая вертикальная 2 + if (Form.width>=480) + { + FileShow.font_color = text_col; + FileShow.area_size_x = Form.width - 380; + FileShow.text_pointer = off; + FileShow.start_y = files.line_h/2-3+y; + PathShow_prepare stdcall(#FileShow); + PathShow_draw stdcall(#FileShow); + } + DrawBar(onLeft(168,0),y,1,files.line_h,col_work); //gray line 1 + DrawBar(onLeft(95,0),y,1,files.line_h,col_work); //gray line 2 } void Open_Dir(dword temp_, redraw){ - int errornum, max_count; + int errornum, count; char path_[4096], somelen=strlen(temp_)-1; - + if (redraw<>ONLY_SHOW) { strcpy(#path_, temp_); @@ -599,37 +522,35 @@ void Open_Dir(dword temp_, redraw){ if (buf) free(buf); buf = malloc(32); errornum=ReadDir(0, buf, #path_); - if (errornum<>0) //ошибка при чтении папки + if (errornum<>0) { HistoryPath(ADD_NEW_PATH); GoBack(); Write_Error(errornum); return; } - count = ESDWORD[buf+8]; - buf = realloc(buf, count * 304 + 32); - ReadDir(count, buf, #path_); - count=EBX; - max_count = sizeof(file_mas)/sizeof(dword)-1; - if (count>max_count) count=max_count; + files.count = ESDWORD[buf+8]; + buf = realloc(buf, files.count * 304 + 32); + ReadDir(files.count, buf, #path_); + files.count=EBX; + count = sizeof(file_mas)/sizeof(dword)-1; + if (files.count>count) files.count=count; } - if (count<>-1) + if (files.count<>-1) { KEdit(); HistoryPath(ADD_NEW_PATH); - IF (!strcmp(".",buf+72)) {count--; memmov(buf,buf+304,count*304);} //фильтруем элемент "." - FOR (j=0;jONLY_SHOW) Sorting(); //для больших папок при репеинте окна + IF (redraw<>ONLY_SHOW) Sorting(); IF (redraw<>ONLY_OPEN) List_ReDraw(); } - IF (count==-1) && (redraw<>ONLY_OPEN) {f_visible=count=0; List_ReDraw();} + IF (files.count==-1) && (redraw<>ONLY_OPEN) {files.visible=files.count=0; List_ReDraw();} } @@ -638,31 +559,31 @@ inline Sorting() { dword k=0, l=1; int i; - if (!strcmp(#path,"/")) //не сортировать папки и не менять регистр в "/" + if (!strcmp(#path,"/")) //do not sort { - FOR(k=1;k=0; j--, off-=304;) //папки вверх, файлы вниз + FOR (j=files.count-1, off=files.count-1*304+buf+32; j>=0; j--, off-=304;) //files | folders { strttl(off+40); - if (TestBit(ESDWORD[off],4)) //папка? + if (TestBit(ESDWORD[off],4)) //isdir? { file_mas[k]=j; k++; } else { - file_mas[count-l]=j; + file_mas[files.count-l]=j; l++; } } - //Собственно сортировка: вначале папки, потом файлы + //sorting: files first, then folders Sort_by_Name(0,k-1); - IF (sort_num==1) Sort_by_Name(k,count-1); - IF (sort_num==2) Sort_by_Type(k,count-1); - IF (sort_num==3) Sort_by_Size(k,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==3) Sort_by_Size(k,files.count-1); + //".." should be first 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]>0) && (file_name) IF (isdir) @@ -774,16 +693,16 @@ void ReName(byte rename) } SelectFile(#edit_name); } - Line_ReDraw(col_selec,curbtn); + Line_ReDraw(col_selec,files.current); } void SelectFile(dword that_file) { - za_kadrom=curbtn=0; //вверх списка + files.first=files.current=0; Open_Dir(#path,ONLY_OPEN); strttl(that_file); - for (i=count-1; i>=0; i--;) + for (i=files.count-1; i>=0; i--;) if (!strcmp(file_mas[i]*304+buf+72,that_file)) break; FileList_ReDraw(i); List_ReDraw(); @@ -802,15 +721,97 @@ void Dir_Up() SelectFile(#cur_folder); } +void Open() +{ + if (!isdir) + { + GetIni(0); + } + else + { + if (!strcmp(#file_name,"..")) { Dir_Up(); return; } + strcpy(#path, #file_path); + if (path[strlen(#path)-1]!='/') chrcat(#path, '/'); //need "/" in the end + files.first=files.current=0; + Open_Dir(#path,1); + } +} -inline fastcall void GoBack() //вначале удаляем текущий путь, а потом копируем то, что осталось + +inline fastcall void GoBack() { char cur_folder[4096]; strcpy(#cur_folder, GetCurrentFolder()); if (HistoryPath(GO_BACK)) SelectFile(#cur_folder); } +void ActionsProcess(char N) +{ + switch(N) + { + case 1: + SwitchToAnotherThread(); + CreateThread(#about_dialog,#stak1); + break; + case 2: + if (!files.count) break; + DeleteButton(files.current+201); + edit2.flags=100000000000010b; //set active + edit2.width=onLeft(24,217); + edit2.top=files.current*files.line_h+59; + edit2.size=edit2.pos=strlen(#file_name); + edit_box_draw stdcall (#edit2); + DrawBar(213,files.current*files.line_h+58,edit2.width+1,1,0xFFFFCC); //bg + rename_active=1; + break; + case 3: + IF (!isdir) RunProgram("/sys/tinypad", #file_path); + break; + case 4: + IF (!isdir) RunProgram("/sys/develop/heed", #file_path); + break; + case 5: + Open_Dir(#path,1); + break; + case 6: + strcpy(#temp, #path); + strcat(#temp, "New folder"); + CreateDir(#temp); + if (!EAX){ + SelectFile("New folder"); + ActionsProcess(2); + } + else + { + Write_Error(EAX); + ShowMessage("Folder can not be created."); + } + break; + case 7: + strcpy(#temp, #path); + strcat(#temp, "New file"); + WriteFile(0, 0, #temp); + if (!EAX){ + SelectFile("New file"); + ActionsProcess(2); + } + else + { + Write_Error(EAX); + ShowMessage("File can not be created."); + } + break; + case 10: //F10 + RunProgram(EDITOR_PATH, abspath("Eolite.ini")); + break; + } +} + +void copyf_Action() { + return; +} + stop: -char stak1[100]; -char stak2[100]; \ No newline at end of file +char stak1[512]; +char stak2[512]; \ No newline at end of file diff --git a/programs/cmm/eolite/imgs/actions.raw b/programs/cmm/eolite/imgs/actions.raw index 7b958bb240761a275d1758811137c7d0b5229672..fc32edb0db720f4cc28a2a8690e51b9fb226b630 100644 GIT binary patch literal 1638 zcmbu8Z%h+s9LM`=S>l#yd_`0w*}oSv^95pA5h|<V-l<(bfdjdj)y{1SIur zXr63fl9Xkoj0cl>JGmM=%iP)9#b-QZg2#P60=U1mIARs6Jj8LBhc&Mn+~PCIFttFsIcDFzLr@mXVMEq(P^{CMTC* zn=Rn;Mv#}jmCjqtwiy#G@J`#T$3eAK6c>f>e)+pHfR$wu_*lwsBo~(?hMV+935Q?q zLm}#wo*OX6)cwjjrD0WRSf?Lc_{~T^bsM{}vzrULHPb@hi8-YK<9$9kJc?MdJ~xhP zpDH%oi8^no^aK~zw!Zq~L=&vDidAle+P!EHp<#r+(xJHPQ=9AJ#HIp*^aB8JbbTyE zeytiqXmzbNTtIR=*$w&{tIr(Q{_ZBl`xIHy)k{*OjX+b2$lyUwoJcu%cWYw?#DV}@ zci{|0io5zl6nQ_06qbP8Nc>?l>?C3IAVV1(v#QZeXq;=;MwH@OgV%B`9B9{aq##h z38`Q7KQ_E1Y9%K(DmkCCUGU|oDVm+VDq;V>!bX#0&4>Bh?&uE8AF|qW_Ap^;lbtY#l{ddzw`|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sVO-(Nu*B6Io#9= z;JuXO`yI`Zw0t)Jz~iF+K5%XU%(^u>K5k9?3;gW!Y(Atc^9~e@a|T=7I7URSiwCYXYzX*V z03%YkOSZUiV`f&~>m9(*i@i&pZs*!X&z8^2b(}jBE@W6&`>Z6xHbTZsSYI`>qU=zN z@a{Y99>&$v*x5XCarvfvk( fJN<|L$94G!9>FvVW$VBt00000NkvXXu0mjf>Q*6> literal 0 HcmV?d00001 diff --git a/programs/cmm/eolite/imgs/png/file_actions.png b/programs/cmm/eolite/imgs/png/file_actions.png deleted file mode 100644 index d3c20f2421ea6b4be66fefffcc485833be61477a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 694 zcmV;n0!jUeP);`gd;iqhjS+!&YgHTZ{lIX8j5Dz zESh>;4sJd|SK>`{`@H7x( zMM+6XQ>RV^>Om7{_(LKXj2ixfK|#qBOf)ex=S@PwOD88F`EADzh)RS8G?PAW-Fiz= z{X=2Vx6I7%B_&_1t-o&Hj;`Sc7(g^Uj*EMrnEWju;ERa~5PfxXdlDayuHnmDKVDK4PSPE(4P}P5~9a#wvgx90NbN}Kn;4^?9F%E z2X69&Y4~&E_v>Xq1XK-S0FmViBcLp@2XvXM0H2~!x8h+kr$AusvfuaFOe!W_c3t`vr;c^8ogk8g%ONF=)iUuG8@(CiS2F$dC c3jtLE0L27=;pVvW^8f$<07*qoM6N<$f*av7s{jB1 diff --git a/programs/cmm/eolite/imgs/png/icons.png b/programs/cmm/eolite/imgs/png/icons.png index b0d42b1d916d3ac36b91385136ed0a09eb8183b0..296ddfdaca945ce61055b9098bf126419cb132aa 100644 GIT binary patch literal 6134 zcmVPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!~g&e!~vBn4jTXf7mG8}(xWX2z#M(_J|BjTV1mN=mc48Yp;-(li&^H`chIKEOSW2xB} zzQR^YkA8d*I>v@UukXUPtX}&y3kjPR==JrI=~+m6B+{*0H}vV#2i_qO! z<9wSnP6X_WSmQ!KbX3Nzv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u!Hc@_PY5z+^FlOH@%K=~%=Y060weg!*kp2Lb@Qg5Jzq2Y`V#1c2K< z{xStrYMS)|DY_2)D@~w7lNX}i0D$ybNonR9LINu-noGbNP-DFglzdWUEAmi<9R20z zmr^K6Jv}|(c}r1IflOAiu~{%-!ZY8_qE0=>+RFub0oUWs-Ibwu%Yb&d{ zrTzJ{#O7w^)@?h64;u=^FhC>{f%Vu&uxGqa5(J#e(v$($9C=7qpAwOMM;F5|Nl+Udv*_XNGUyR2)5e z4F1AVP*9MQlkMudzOSzjGysRm$mr#bfAxicY%BPS=1%*my|&{gw?_j44qp$l!jnr9-%z`)tF7tJiJ``HkO1F`$N z?Y^Fton0Iq9lmnqdNVU)Zs~juq)6lta!gmB+foh#KE8fO9nQ0R;mPIn_sGv~Ie74( zpPwIcP5R>{iKsYeUak^E{9$P}4EXt-+_QaOPag!n9}_vf%GwIF+~UZn@D(f8O`U4` zM{+tzPM!!66%`cD1V+HXxpQad+bodNG$KOmBGREr5AcT(J$F?|l^EX8$7io~TG_ntVs6l*F~Bds$<5E zxf4s_aJdg3rPVUt-w5^@uA_zK5|*vN$j!|^b^Z>U!|Cnqg$M*?C8dMA*PD(XOCWsA zRv@yN_Eq-FWJtO~Ft?nCSW+^wdyom>w6@9s05wrVLs|e)_r7=`9-z^nsZ%*jCQ)4- zQ+FB}2?EGlY`M8W3jPHOh3V5_=A&95XsjC`!kU%K%J^>uXNf@IZ;&vpFO#D|_btuM zkfid_Lsp73-3tH`yZ>tbisVO8yj+s9$gt9g>^}h?! diff --git a/programs/cmm/eolite/include/about_dialog.h b/programs/cmm/eolite/include/about_dialog.h index 28df23e9f4..8fb896ae90 100644 --- a/programs/cmm/eolite/include/about_dialog.h +++ b/programs/cmm/eolite/include/about_dialog.h @@ -14,7 +14,6 @@ void about_dialog() id=GetButtonID(); IF (id==1) || (id==10) ExitProcess(); IF (id==23) RunProgram(BROWSER_PATH, BROWSER_LINK); - IF (id==33) RunProgram(EDITOR_PATH, abspath("Eolite.ini")); break; case evKey: @@ -33,8 +32,6 @@ void about_dialog() WriteText(29,170,0x80,0,"Visit"); DrawLink(66,170,0x80,23, "kolibri-n.org"); DrawFlatButton(85,190,70,22,10,0xE4DFE1, "Close"); - DefineButton(20-1,195-1, 16+1,15+1, 33+BT_HIDE, 0); - PutPaletteImage(8*16*15+#ficons,16,15,20,195,8,#ficons_pal); DrawFilledBar(0, 216, 172, 12); } } \ No newline at end of file diff --git a/programs/cmm/eolite/include/file_menu.h b/programs/cmm/eolite/include/file_menu.h new file mode 100644 index 0000000000..54e779f345 --- /dev/null +++ b/programs/cmm/eolite/include/file_menu.h @@ -0,0 +1,66 @@ +//Leency 2008-2013 + +char *captions[] = { + "Open", "Enter", + "Open with...", "Ctrl+Ent", + "View as text", "F3", + "View as HEX", "F4", + "Rename", "F2", + "Delete", "Del", + 0}; + +void FileMenu() +{ + proc_info MenuForm; + word id, key, slot; + int ccount=0, linew=10, lineh=18, texty; + for (i=0; captions[i]!=0; i+=2) + { + ccount++; + if (strlen(captions[i])>linew) linew = strlen(captions[i]); + } + linew = linew + 3 * 6 + 70; + texty = lineh/2-4; + SetEventMask(100111b); + + goto _MENU_DRAW; + loop() switch(WaitEvent()) + { + case evMouse: + slot = GetProcessSlot(MenuForm.ID); + if (slot != GetActiveProcess()) ExitProcess(); + break; + + case evButton: + id=GetButtonID(); + if (id==100) Open(); + if (id==101) notify("Not compleated yet"); + if (id==102) ActionsProcess(3); + if (id==103) ActionsProcess(4); + if (id==104) ActionsProcess(2); + if (id==105) Del_Form(); + ExitProcess(); + break; + + case evKey: + IF (GetKey()==27) ExitProcess(); + break; + + case evReDraw: _MENU_DRAW: + DefineAndDrawWindow(m.x+Form.left+5,m.y+Form.top+GetSkinHeight(),linew+2,ccount*lineh+2,0x01,0xEEEeee,0x01fffFFF); + GetProcessInfo(#MenuForm, SelfInfo); + /* _PutImage(1,23, 16,44, #factions); //иконки */ + DrawRectangle(0,0,linew+1,ccount*lineh+1,col_border); + PutShadow(linew+2,1,1,ccount*lineh+1,0,1); + PutShadow(1,ccount*lineh+2,linew+1,1,0,1); + + for (i=0; captions[i*2]!=0; i++) + { + DefineButton(1,i*lineh,linew,lineh-1,i+100+BT_HIDE,0xFFFFFF); + DrawBar(1,i*lineh+1,1,lineh,0xFFFfff); + DrawBar(2,i*lineh+1,linew-1,lineh,col_work); + WriteText(6,i*lineh+texty+1,0x80,0x000000,captions[i*2]); + WriteText(-strlen(captions[i*2+1])*6-7+linew,i*lineh+texty+1,0x80,0x999999,captions[i*2+1]); + } + } +} \ No newline at end of file diff --git a/programs/cmm/eolite/include/ini.h b/programs/cmm/eolite/include/ini.h index 2b2c3bc851..f9f3a0cea7 100644 --- a/programs/cmm/eolite/include/ini.h +++ b/programs/cmm/eolite/include/ini.h @@ -6,25 +6,6 @@ #define PARAM 2 #define OPTION 3 -unsigned char *ERROR_TEXT[]={ -"Code #0 - No error", -"Error #1 - Base or partition of a hard disk is not defined", -"Error #2 - Function isn't supported for this file system", -"Error #3 - Unknown file system", -"Error #4 - Reserved, is never returned", -"Error #5 - File or folder not found", -"Error #6 - End of file, EOF", -"Error #7 - Pointer lies outside of application memory", -"Error #8 - Too less disk space", -"Error #9 - FAT table is destroyed", -"Error #10 - Access denied", -"Error #11 - Device error", -0, 0, 0, 0, 0, 0, 0, 0, 0, -0, 0, 0, 0, 0, 0, 0, 0, 0, -"Error #30 - Not enough memory", -"Error #31 - File is not executable", -"Error #32 - Too many processes", -0}; void GetIni(byte onload) { @@ -61,7 +42,7 @@ void GetIni(byte onload) case 0x0d: InfType=PARAM; IF (!strcmp(#parametr,"SelectionColor")) edit2.shift_color=col_selec=StrToCol(#option); - IF (!strcmp(#parametr,"LineHeight")) BUTTON_HEIGHT=atoi(#option); + IF (!strcmp(#parametr,"LineHeight")) files.line_h = atoi(#option); IF (!strcmp(#parametr,"ShowDeviceName")) show_dev_name=atoi(#option); /*if (!strcmp(#section,"UserDirectories")) && (parametr) && (onload) @@ -94,20 +75,9 @@ void GetIni(byte onload) void Write_Error(int error_number) { - char error[256]; - - if (error_number<0) error_number=-1*error_number; - - if (error_number<33) - strcpy(#error, ERROR_TEXT[error_number]); - else - { - strcpy(#error, itoa(error_number)); - strcat(#error, " - Unknown error number O_o"); - } - if (curbtn>=0) Line_ReDraw(0xFF0000, curbtn); + if (files.current>=0) Line_ReDraw(0xFF0000, files.current); pause(5); - notify(#error); + notify(get_error(error_number)); } diff --git a/programs/cmm/eolite/include/left_panel.h b/programs/cmm/eolite/include/left_panel.h index f64a345da1..0f4b9a1477 100644 --- a/programs/cmm/eolite/include/left_panel.h +++ b/programs/cmm/eolite/include/left_panel.h @@ -16,7 +16,7 @@ path_string disk_list[30]; int disc_num; dword devbuf; -void GetSystemDiscs() +void SystemDiscsGet() { unsigned char dev_name[10], sys_discs[10]; unsigned int i1, j1, dev_num, dev_disc_num; @@ -32,8 +32,8 @@ void GetSystemDiscs() strcat(#dev_name, i1*304+ devbuf+72); // /rd strcat(#dev_name, "/"); // /rd/ Open_Dir(#dev_name, ONLY_OPEN); - dev_disc_num = count; - //if (count<=0) copystr(#dev_name,#disk_list[disc_num].Item); else + dev_disc_num = files.count; + //if (files.count<=0) copystr(#dev_name,#disk_list[disc_num].Item); else for (j1=0; j1onTop(22,57)-on_y+56) || (za_kadrom+f_visible>=count) on_y=onTop(23+scroll_size,0); //для большого списка + if (scroll_size>onTop(22,57)-on_y+56) || (files.first+files.visible>=files.count) on_y=onTop(23+scroll_size,0); //для большого списка } DrawFlatButton(onLeft(27,0),on_y,16,scroll_size,0,-1,"");//ползунок if (!scroll_used) for (i=0; i<13; i++) DrawBar(onLeft(25-i,0), on_y+2, 1, scroll_size-3, col_palette[13-i]); if (scroll_used) for (i=0; i<13; i++) DrawBar(onLeft(25-i,0), on_y+2, 1, scroll_size-3, col_palette[i]); //поле до ползунка - if (on_y>58) DrawBar(onLeft(26,0),57,15,1, 0xC7C9C9); + if (on_y>58) DrawBar(onLeft(26,0),57,15,1, 0xC7C9C9); DrawBar(onLeft(26,0),58,1, on_y-58,0xC7C9C9); DrawBar(onLeft(25,0),58,14,on_y-58,0xCED0D0); //поле после ползунка diff --git a/programs/cmm/eolite/txt/History.txt b/programs/cmm/eolite/txt/History.txt index 4aaed15674..940ed0eaad 100644 --- a/programs/cmm/eolite/txt/History.txt +++ b/programs/cmm/eolite/txt/History.txt @@ -1,3 +1,11 @@ +01.05.13 -- v1.77 +- исправлено падение при изменении размера окна (нашёл 0CodErr); +- меню файлов (не закончено); +- перевод программы на элемент list_box: упрощение кода, гибкость элемента, + задел на двупанельность; +- вместо кнопок файлов теперь используются события мыши; +- очень много других исправлений и оптимизаций. + 03.03.13 -- v1.64 - перенос программы на общую библиотеку (очень хотел s1n). Это даёт доступ к множествам наработок основной ветви; diff --git a/programs/cmm/installer/installation.c b/programs/cmm/installer/installation.c index a6c687b3bb..e1b13c6d12 100644 --- a/programs/cmm/installer/installation.c +++ b/programs/cmm/installer/installation.c @@ -71,6 +71,14 @@ void Install() EndLoop(); } +void copyf_Action(dword filename) +{ + if (CheckEvent()==evReDraw) { DefineWindow("Installation Started", "Stop"); ShowProgress("Copying files..."); } + ShowProgress(NULL); + DrawBar(TEXTX, BLACK_H+50, Form.cwidth-TEXTX, 12, 0xFFFfff); + WriteText(TEXTX, BLACK_H+50, 0x80, 0, filename); +} + void EndLoop() { diff --git a/programs/cmm/installer/main.c b/programs/cmm/installer/main.c index aa3a8f476e..a432f0bdb5 100644 --- a/programs/cmm/installer/main.c +++ b/programs/cmm/installer/main.c @@ -6,6 +6,7 @@ #include "..\lib\file_system.h" #include "..\lib\mem.h" #include "..\lib\dll.h" +#include "..\lib\copyf.h" //*.obj libraries #include "..\lib\lib.obj\box_lib.h" #include "..\lib\lib.obj\libio_lib.h" @@ -47,7 +48,6 @@ int DefineWindow(dword wtitle, wbutton) return 1; } -#include "copyf.c" #include "tmp_add.c" #include "hallo.c"; #include "installation.c"; diff --git a/programs/cmm/installer/copyf.c b/programs/cmm/lib/copyf.h similarity index 81% rename from programs/cmm/installer/copyf.c rename to programs/cmm/lib/copyf.h index e3fc657739..2b216c9e28 100644 --- a/programs/cmm/installer/copyf.c +++ b/programs/cmm/lib/copyf.h @@ -75,10 +75,7 @@ void CopyFolder(dword from, to) strcpy(#copy_in, to); strcat(#copy_in, filename); - if (CheckEvent()==evReDraw) { DefineWindow("Installation Started", "Stop"); ShowProgress("Copying files..."); } - ShowProgress(NULL); - DrawBar(TEXTX, BLACK_H+50, Form.cwidth-TEXTX, 12, 0xFFFfff); - WriteText(TEXTX, BLACK_H+50, 0x80, 0, filename); + copyf_Action(filename); error = CopyFile(#copy_from, #copy_in); if (error) error = CopyFile(#copy_from, #copy_in); // #2 :) @@ -88,7 +85,6 @@ void CopyFolder(dword from, to) free(dirbuf); } - unsigned char *ERROR_TEXT[]={ "Code #0 - No error", "Error #1 - Base or partition of a hard disk is not defined", @@ -109,19 +105,24 @@ unsigned char *ERROR_TEXT[]={ "Error #32 - Too many processes", 0}; -void debug_error(int path, error_number) +dword get_error(int N) { char error[256]; - if (path) debug(path); - if (error_number<0) error_number*=-1; - if (error_number<33) + if (N<0) N*=-1; + if (N<33) { - strcpy(#error, ERROR_TEXT[error_number]); + strcpy(#error, ERROR_TEXT[N]); } else { - strcpy(#error, itoa(error_number)); + strcpy(#error, itoa(N)); strcat(#error, " - Unknown error number O_o"); } - debug(#error); + return #error; } + +void debug_error(dword path, error_number) +{ + if (path) debug(path); + debug(get_error(error_number)); +} \ No newline at end of file diff --git a/programs/cmm/lib/figures.h b/programs/cmm/lib/figures.h index ce29bcbe97..731f617476 100644 --- a/programs/cmm/lib/figures.h +++ b/programs/cmm/lib/figures.h @@ -101,9 +101,8 @@ void DrawCaptButton(dword x,y,w,h,id,color_b, color_t,text) proc_info wForm; dword shadow_buf, skin_height; shadow_buf = mem_Alloc(w*h*3); - //skin_height = GetSkinHeight(); GetProcessInfo(#wForm, SelfInfo); - CopyScreen(shadow_buf, x+wForm.left, y+wForm.top, w, h); + CopyScreen(shadow_buf, 5*border+x+wForm.left, GetSkinHeight()*border+y+wForm.top, w, h); ShadowImage(shadow_buf, w, h, strength); _PutImage(x,y,w,h,shadow_buf); mem_Free(shadow_buf); diff --git a/programs/cmm/lib/file_system.h b/programs/cmm/lib/file_system.h index aebcb195d4..e573c915ee 100644 --- a/programs/cmm/lib/file_system.h +++ b/programs/cmm/lib/file_system.h @@ -155,6 +155,7 @@ f70 read_dir_70; :int GetDir(dword dir_buf, file_count, path) { dword buf, fcount, error; + ESDWORD[file_count] = 0; buf = malloc(32); error = ReadDir(0, buf, path); if (!error) diff --git a/programs/cmm/lib/kolibri.h b/programs/cmm/lib/kolibri.h index c5013e0b55..844b99dea9 100644 --- a/programs/cmm/lib/kolibri.h +++ b/programs/cmm/lib/kolibri.h @@ -65,6 +65,7 @@ void mouse::get() $and ebx,0x0000FFFF //hor = EAX; vert = EBX; + if (y>6000) y=0; } diff --git a/programs/cmm/rb/rb.c b/programs/cmm/rb/rb.c index e7919a16ce..5c83354e27 100644 --- a/programs/cmm/rb/rb.c +++ b/programs/cmm/rb/rb.c @@ -35,7 +35,7 @@ 0}; #endif -char stak[100]; +char stak[512]; #define ITEM_HEIGHT 18 int ITEM_WIDTH; @@ -82,9 +82,8 @@ void window() case evMouse: m.get(); - GetProcessInfo(#MenuForm, SelfInfo); id1=GetProcessSlot(MenuForm.ID); - if (id1<>GetActiveProcess()) ExitProcess(); + if (id1<>GetActiveProcess()) ExitProcess(); id1=m.y-1/ITEM_HEIGHT; if (m.y<0) || (id1+1>items_num) || (m.x<0) || (m.x>ITEM_WIDTH) break; if (m.lkm) || (m.pkm) @@ -130,6 +129,7 @@ void window() while (ITEMS_LIST[items_num*3]) items_num++; m.get(); DefineAndDrawWindow(m.x+1,m.y,ITEM_WIDTH+1,items_num*ITEM_HEIGHT+2,0x01,sc.work,0, 0x01fffFFF); + GetProcessInfo(#MenuForm, SelfInfo); DrawRectangle(0,0,ITEM_WIDTH,items_num*ITEM_HEIGHT+1,sc.work_graph); //ободок PutShadow(ITEM_WIDTH+1,1,1,items_num*ITEM_HEIGHT+1,0,1); PutShadow(1,items_num*ITEM_HEIGHT+2,ITEM_WIDTH+1,1,0,1);