Rev 5576 | Rev 5591 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5576 | Rev 5581 | ||
---|---|---|---|
Line 107... | Line 107... | ||
107 | ?define DEL_MORE_FILES_1 "selected items(" |
107 | ?define DEL_MORE_FILES_1 "selected items(" |
108 | ?define DEL_MORE_FILES_2 " pcs.)?" |
108 | ?define DEL_MORE_FILES_2 " pcs.)?" |
109 | #endif |
109 | #endif |
Line 110... | Line 110... | ||
110 | 110 | ||
- | 111 | enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir |
|
Line 111... | Line 112... | ||
111 | enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir |
112 | enum { CREATE_FILE=1, CREATE_FOLDER, RENAME_ITEM }; //NewElement |
112 | 113 | ||
113 | #define TITLE "Eolite File Manager v2.8" |
114 | #define TITLE "Eolite File Manager v2.81" |
Line 114... | Line 115... | ||
114 | #define ABOUT_TITLE "Eolite v2.8" |
115 | #define ABOUT_TITLE "Eolite v2.81" |
115 | dword col_padding, col_selec, col_lpanel; |
116 | dword col_padding, col_selec, col_lpanel; |
Line 159... | Line 160... | ||
159 | mouse gestures; |
160 | mouse gestures; |
160 | signed x_old, y_old, dif_x, dif_y, adif_x, adif_y; |
161 | signed x_old, y_old, dif_x, dif_y, adif_x, adif_y; |
161 | byte stats; |
162 | byte stats; |
Line 162... | Line 163... | ||
162 | 163 | ||
163 | edit_box edit2 = {250,213,80,0xFFFFCC,0x94AECE,0xFFFFCC,0xFFFFFF,0,248,#file_name,#mouse_dd,64,6,6}; |
164 | edit_box edit2 = {250,213,80,0xFFFFCC,0x94AECE,0xFFFFCC,0xFFFFFF,0,248,#file_name,#mouse_dd,64,6,6}; |
164 | edit_box new_file_ed = {150,213,80,0xFFFFFF,0x94AECE,0x000000,0xFFFFFF,0,248,#new_element_name,#mouse_dd,100000000000010b,6,0}; |
165 | edit_box new_file_ed = {171,213,180,0xFFFFFF,0x94AECE,0xFFFFFF,0xFFFFFF,0,248,#new_element_name,#mouse_dd,100000000000010b,6,0}; |
165 | PathShow_data PathShow = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, #path, #temp, 0}; |
166 | PathShow_data PathShow = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, #path, #temp, 0}; |
166 | PathShow_data FileShow = {0, 56,215, 6, 100, 0, 0, 0x0, 0xFFFfff, #file_name, #temp, 0}; |
167 | PathShow_data FileShow = {0, 56,215, 6, 100, 0, 0, 0x0, 0xFFFfff, #file_name, #temp, 0}; |
167 | byte cmd_free; |
168 | byte cmd_free; |
168 | #include "include\copy.h" |
169 | #include "include\copy.h" |
Line 189... | Line 190... | ||
189 | if (load_dll2(libini, #lib_init,1)!=0) notify("Error: library doesn't exists - libini"); |
190 | if (load_dll2(libini, #lib_init,1)!=0) notify("Error: library doesn't exists - libini"); |
190 | eolite_ini_path = abspath("Eolite.ini"); |
191 | eolite_ini_path = abspath("Eolite.ini"); |
191 | LoadIniSettings(); |
192 | LoadIniSettings(); |
192 | GetSystemDiscs(); |
193 | GetSystemDiscs(); |
193 | SetAppColors(); |
194 | SetAppColors(); |
194 | strcpy(#new_element_name, T_NEW_FILE); |
- | |
195 | new_file_ed.size = strlen(T_NEW_FILE); |
- | |
196 | if (param) |
195 | if (param) |
197 | { |
196 | { |
198 | strcpy(#path, #param); |
197 | strcpy(#path, #param); |
199 | if (path[strlen(#path)-1]!='/') chrcat(#path, '/'); //add "/" to the end of the string |
198 | if (path[strlen(#path)-1]!='/') chrcat(#path, '/'); //add "/" to the end of the string |
200 | } |
199 | } |
Line 479... | Line 478... | ||
479 | List_ReDraw(); |
478 | List_ReDraw(); |
480 | break; |
479 | break; |
481 | case ASCII_KEY_ESC: |
480 | case ASCII_KEY_ESC: |
482 | break; |
481 | break; |
483 | case ASCII_KEY_ENTER: |
482 | case ASCII_KEY_ENTER: |
484 | //IF (rename_active==1) {ReName(true); break;} |
- | |
485 | Open(0); |
483 | Open(0); |
486 | break; |
484 | break; |
487 | case 074: //menu |
485 | case 074: //menu |
488 | menu_call_mouse=0; |
486 | menu_call_mouse=0; |
489 | //SwitchToAnotherThread(); |
487 | //SwitchToAnotherThread(); |
Line 625... | Line 623... | ||
625 | DrawBar(files.x+files.w,files.y,1,onTop(22,files.y),sc.work_graph); //line to the left from the scroll |
623 | DrawBar(files.x+files.w,files.y,1,onTop(22,files.y),sc.work_graph); //line to the left from the scroll |
626 | DrawFlatButton(files.x+files.w,40,16,16,0,sc.work,"\x18"); |
624 | DrawFlatButton(files.x+files.w,40,16,16,0,sc.work,"\x18"); |
627 | DrawFlatButton(files.x+files.w,onTop(22,0),16,16,0,sc.work,"\x19"); |
625 | DrawFlatButton(files.x+files.w,onTop(22,0),16,16,0,sc.work,"\x19"); |
628 | Open_Dir(#path,ONLY_SHOW); |
626 | Open_Dir(#path,ONLY_SHOW); |
629 | if (del_active) Del_Form(); |
627 | if (del_active) Del_Form(); |
630 | if (new_element_active) NewElement_Form(new_element_active); |
628 | if (new_element_active) NewElement_Form(new_element_active, #new_element_name); |
631 | } |
629 | } |
Line 632... | Line 630... | ||
632 | 630 | ||
633 | 631 | ||
Line 834... | Line 832... | ||
834 | //sorting: files first, then folders |
832 | //sorting: files first, then folders |
835 | Sort_by_Name(0,k-1); |
833 | Sort_by_Name(0,k-1); |
836 | IF (sort_num==1) Sort_by_Name(k,files.count-1); |
834 | IF (sort_num==1) Sort_by_Name(k,files.count-1); |
837 | IF (sort_num==2) Sort_by_Type(k,files.count-1); |
835 | IF (sort_num==2) Sort_by_Type(k,files.count-1); |
838 | IF (sort_num==3) Sort_by_Size(k,files.count-1); |
836 | IF (sort_num==3) Sort_by_Size(k,files.count-1); |
839 | //".." should be first |
837 | //make ".." first item in list |
840 | IF (k>0) && (strcmp(file_mas[0]*304+buf+72,"..")!=0) |
838 | IF (k>0) && (strcmp(file_mas[0]*304+buf+72,"..")!=0) |
841 | FOR(k--; k>0; k--;) IF (!strcmp(file_mas[k]*304+buf+72,"..")) {file_mas[k]> |
839 | FOR(k--; k>0; k--;) IF (!strcmp(file_mas[k]*304+buf+72,"..")) {file_mas[k]> |
842 | } |
840 | } |
Line 854... | Line 852... | ||
854 | if (itdir) ShowMessage(WAIT_DELETING_FOLDER, 0); |
852 | if (itdir) ShowMessage(WAIT_DELETING_FOLDER, 0); |
855 | } |
853 | } |
856 | else |
854 | else |
857 | { |
855 | { |
858 | if (!files.count) return; |
856 | if (!files.count) return; |
859 | DrawPopup(dform_x,160,220,80,1,sc.work,sc.work_graph); |
857 | DrawPopup(dform_x,160,220,85,1,sc.work,sc.work_graph); |
860 | WriteText(-strlen(T_DELETE_FILE)*3+110+dform_x,175,0x80,sc.work_text,T_DELETE_FILE); |
858 | WriteText(-strlen(T_DELETE_FILE)*3+110+dform_x,175,0x80,sc.work_text,T_DELETE_FILE); |
861 | for (i=0; i |
859 | for (i=0; i |
862 | { |
860 | { |
863 | selected_offset2 = file_mas[i]*304 + buf+32 + 7; |
861 | selected_offset2 = file_mas[i]*304 + buf+32 + 7; |
864 | if (ESBYTE[selected_offset2]) cont++; |
862 | if (ESBYTE[selected_offset2]) cont++; |
865 | } |
863 | } |
866 | if (cont) |
864 | if (cont) |
867 | { |
865 | { |
868 | /*strcpy(#f_count, DEL_MORE_FILES_1); |
- | |
869 | strcat(#f_count, itoa(cont)); |
- | |
870 | strcat(#f_count, DEL_MORE_FILES_2);*/ |
- | |
871 | sprintf(#f_count,"%s%d%s",DEL_MORE_FILES_1,cont,DEL_MORE_FILES_2); |
866 | sprintf(#f_count,"%s%d%s",DEL_MORE_FILES_1,cont,DEL_MORE_FILES_2); |
872 | WriteText(-strlen(#f_count)*3+110+dform_x,190,0x80,sc.work_text,#f_count); |
867 | WriteText(-strlen(#f_count)*3+110+dform_x,190,0x80,sc.work_text,#f_count); |
873 | } |
868 | } |
874 | else |
869 | else |
875 | { |
870 | { |
Line 906... | Line 901... | ||
906 | filename = i*304+dirbuf+72; |
901 | filename = i*304+dirbuf+72; |
907 | strcpy(#del_from, way); |
902 | strcpy(#del_from, way); |
908 | chrcat(#del_from, '/'); |
903 | chrcat(#del_from, '/'); |
909 | strcat(#del_from, filename); |
904 | strcat(#del_from, filename); |
910 | if ( TestBit(ESDWORD[filename-40], 4) ) |
905 | if ( TestBit(ESDWORD[filename-40], 4) ) |
- | 906 | { |
|
911 | Del_File2(#del_from); |
907 | Del_File2(#del_from); |
- | 908 | } |
|
912 | else |
909 | else |
913 | { |
910 | { |
914 | if (error = DeleteFile(#del_from)) del_error = error; |
911 | if (error = DeleteFile(#del_from)) del_error = error; |
915 | } |
912 | } |
916 | } |
913 | } |
Line 1025... | Line 1022... | ||
1025 | } |
1022 | } |
Line 1026... | Line 1023... | ||
1026 | 1023 | ||
1027 | void NewElement(byte newf) |
1024 | void NewElement(byte newf) |
1028 | { |
1025 | { |
1029 | BDVK element_info; |
1026 | BDVK element_info; |
1030 | int del_rezult, copy_rezult; |
1027 | byte del_rezult, copy_rezult, info_result; |
1031 | if (newf) |
1028 | if (newf) |
1032 | { |
1029 | { |
1033 | strcpy(#temp, #path); |
1030 | strcpy(#temp, #path); |
- | 1031 | strcat(#temp, new_file_ed.text); |
|
1034 | strcat(#temp, new_file_ed.text); |
1032 | info_result = GetFileInfo(#temp, #element_info); |
1035 | switch(new_element_active) |
1033 | switch(new_element_active) |
1036 | { |
1034 | { |
1037 | case 1: |
- | |
1038 | GetFileInfo(#temp, #element_info); |
1035 | case CREATE_FILE: |
1039 | if (EAX==5) |
1036 | if (info_result==5) |
1040 | { |
1037 | { |
1041 | WriteFile(0, 0, #temp); |
1038 | WriteFile(0, 0, #temp); |
1042 | if (EAX) |
1039 | if (EAX) |
1043 | { |
1040 | { |
Line 1047... | Line 1044... | ||
1047 | } |
1044 | } |
1048 | else |
1045 | else |
1049 | { |
1046 | { |
1050 | notify(FILE_EXISTS); |
1047 | notify(FILE_EXISTS); |
1051 | } |
1048 | } |
1052 | case 2: |
1049 | break; |
1053 | GetFileInfo(#temp, #element_info); |
1050 | case CREATE_FOLDER: |
1054 | if (EAX==5) |
1051 | if (info_result==5) |
1055 | { |
1052 | { |
1056 | CreateDir(#temp); |
1053 | CreateDir(#temp); |
1057 | if (EAX) |
1054 | if (EAX) |
1058 | { |
1055 | { |
1059 | Write_Error(EAX); |
1056 | Write_Error(EAX); |
Line 1062... | Line 1059... | ||
1062 | } |
1059 | } |
1063 | else |
1060 | else |
1064 | { |
1061 | { |
1065 | notify(FOLDER_EXISTS); |
1062 | notify(FOLDER_EXISTS); |
1066 | } |
1063 | } |
1067 | case 3: |
1064 | break; |
1068 | GetFileInfo(#temp, #element_info); |
1065 | case RENAME_ITEM: |
1069 | if (EAX==5) |
1066 | if (info_result==5) |
1070 | { |
1067 | { |
1071 | if (itdir) |
1068 | if (itdir) |
1072 | { |
1069 | { |
1073 | if (del_rezult = DeleteFile(#file_path)) |
1070 | if (del_rezult = DeleteFile(#file_path)) |
1074 | { |
1071 | { |
Line 1113... | Line 1110... | ||
1113 | { |
1110 | { |
1114 | new_element_active = crt; |
1111 | new_element_active = crt; |
1115 | strcpy(#new_element_name, strng); |
1112 | strcpy(#new_element_name, strng); |
1116 | new_file_ed.size = new_file_ed.pos = strlen(strng); |
1113 | new_file_ed.size = new_file_ed.pos = strlen(strng); |
1117 | } |
1114 | } |
1118 | DrawPopup(dform_x,160,220,80,1,sc.work,sc.work_graph); |
1115 | DrawPopup(dform_x,160,220,85,1,sc.work,sc.work_graph); |
1119 | new_file_ed.left = dform_x+27; |
1116 | new_file_ed.left = dform_x+24; |
1120 | new_file_ed.top = 180; |
- | |
1121 | edit_box_draw stdcall (#new_file_ed); |
1117 | edit_box_draw stdcall (#new_file_ed); |
- | 1118 | DrawRectangle(new_file_ed.left-1, new_file_ed.top-1, new_file_ed.width+2, 16, 0xFFFfff); |
|
- | 1119 | DrawRectangle(new_file_ed.left-2, new_file_ed.top-2, new_file_ed.width+4, 18, sc.work_graph); |
|
1122 | IF (new_element_active==3) DrawFlatButton(dform_x+22,208,85,20,301,0xFFB6B5,T_RENAME); |
1120 | IF (new_element_active==3) DrawFlatButton(dform_x+22,208,85,22,301,0xFFB6B5,T_RENAME); |
1123 | ELSE DrawFlatButton(dform_x+27,208,70,20,301,0xFFB6B5,T_CREATE); |
1121 | ELSE DrawFlatButton(dform_x+27,208,70,22,301,0xFFB6B5,T_CREATE); |
1124 | DrawFlatButton(dform_x+120,208,70,20,302,0xC6DFC6,T_CANCEL); |
1122 | DrawFlatButton(dform_x+120,208,70,22,302,0xC6DFC6,T_CANCEL); |
1125 | } |
1123 | } |
Line 1126... | Line 1124... | ||
1126 | 1124 | ||
1127 | void FnProcess(byte N) |
1125 | void FnProcess(byte N) |
1128 | { |
1126 | { |
Line 1141... | Line 1139... | ||
1141 | ActivateWindow(GetProcessSlot(about_window)); |
1139 | ActivateWindow(GetProcessSlot(about_window)); |
1142 | } |
1140 | } |
1143 | break; |
1141 | break; |
1144 | case 2: |
1142 | case 2: |
1145 | if (!files.count) break; |
1143 | if (!files.count) break; |
1146 | //edit2.flags = 100000000000010b; //set active |
- | |
1147 | //edit2.left = files.x + 21; |
- | |
1148 | //edit2.width = files.w - 26; |
- | |
1149 | //edit2.top=files.current*files.line_h+59; |
- | |
1150 | //edit2.size=edit2.pos=strlen(#file_name); |
- | |
1151 | //edit_box_draw stdcall (#edit2); |
- | |
1152 | //DrawBar(edit2.left,files.current*files.line_h+58,edit2.width+1,1,0xFFFFCC); //bg |
- | |
1153 | //rename_active=1; |
- | |
1154 | NewElement_Form(3, #file_name); |
1144 | NewElement_Form(RENAME_ITEM, #file_name); |
1155 | break; |
1145 | break; |
1156 | case 3: |
1146 | case 3: |
1157 | IF (!itdir) RunProgram("/sys/tinypad", #file_path); |
1147 | IF (!itdir) RunProgram("/sys/tinypad", #file_path); |
1158 | break; |
1148 | break; |
1159 | case 4: |
1149 | case 4: |
Line 1167... | Line 1157... | ||
1167 | GetSystemDiscs(); |
1157 | GetSystemDiscs(); |
1168 | Open_Dir(#path,WITH_REDRAW); |
1158 | Open_Dir(#path,WITH_REDRAW); |
1169 | DrawLeftPanel(); |
1159 | DrawLeftPanel(); |
1170 | break; |
1160 | break; |
1171 | case 6: |
1161 | case 6: |
1172 | /*strcpy(#temp, #path); |
- | |
1173 | strcat(#temp, T_NEW_FOLDER); |
- | |
1174 | CreateDir(#temp); |
- | |
1175 | if (!EAX){ |
- | |
1176 | SelectFile(T_NEW_FOLDER); |
- | |
1177 | FnProcess(2); |
- | |
1178 | } |
- | |
1179 | else |
- | |
1180 | { |
- | |
1181 | Write_Error(EAX); |
- | |
1182 | ShowMessage(NOT_CREATE_FOLDER, 150); |
- | |
1183 | }*/ |
- | |
1184 | NewElement_Form(2, T_NEW_FOLDER); |
1162 | NewElement_Form(CREATE_FOLDER, T_NEW_FOLDER); |
1185 | break; |
1163 | break; |
1186 | case 7: |
1164 | case 7: |
1187 | /*strcpy(#temp, #path); |
- | |
1188 | strcat(#temp, T_NEW_FILE); |
- | |
1189 | WriteFile(0, 0, #temp); |
- | |
1190 | if (!EAX){ |
- | |
1191 | SelectFile(T_NEW_FILE); |
- | |
1192 | FnProcess(2); |
- | |
1193 | } |
- | |
1194 | else |
- | |
1195 | { |
- | |
1196 | Write_Error(EAX); |
- | |
1197 | ShowMessage(NOT_CREATE_FILE, 150); |
- | |
1198 | }*/ |
- | |
1199 | NewElement_Form(1, T_NEW_FILE); |
1165 | NewElement_Form(CREATE_FILE, T_NEW_FILE); |
1200 | break; |
1166 | break; |
1201 | case 8: |
1167 | case 8: |
1202 | //SwitchToAnotherThread(); |
1168 | //SwitchToAnotherThread(); |
1203 | properties_stak = malloc(8096); |
1169 | properties_stak = malloc(8096); |
1204 | CreateThread(#properties_dialog, properties_stak+8092); |
1170 | CreateThread(#properties_dialog, properties_stak+8092); |