Rev 2833 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2833 | Rev 2875 | ||
---|---|---|---|
Line 18... | Line 18... | ||
18 | #define ONLY_SHOW 0 |
18 | #define ONLY_SHOW 0 |
19 | #define WITH_REDRAW 1 |
19 | #define WITH_REDRAW 1 |
20 | #define ONLY_OPEN 2 |
20 | #define ONLY_OPEN 2 |
Line 21... | Line 21... | ||
21 | 21 | ||
22 | //ïåðåìåííûå |
22 | //ïåðåìåííûå |
23 | #define title "Eolite File Manager v1.28" |
23 | #define title "Eolite File Manager v1.31" |
24 | dword selection_col=0x94AECE; //öâåò âûäåëåííîãî ýëåìåíòà èç ñïèñêà ôàéëîâ |
24 | dword selection_col=0x94AECE; |
Line 25... | Line 25... | ||
25 | // |
25 | |
26 | 26 | ||
27 | /* |
27 | /* |
28 | int f_visible, |
28 | int f_visible, |
Line 185... | Line 185... | ||
185 | { |
185 | { |
186 | case 21: //Back |
186 | case 21: //Back |
187 | GoBack(); |
187 | GoBack(); |
188 | break; |
188 | break; |
189 | case 22: //Forward |
189 | case 22: //Forward |
190 | HistoryPath(GO_FORWARD); |
190 | if (HistoryPath(GO_FORWARD)) |
- | 191 | { |
|
191 | za_kadrom=curbtn=0; //ââåðõ ñïèñêà |
192 | za_kadrom=curbtn=0; //ââåðõ ñïèñêà |
192 | Open_Dir(#path,WITH_REDRAW); |
193 | Open_Dir(#path,WITH_REDRAW); |
- | 194 | } |
|
193 | break; |
195 | break; |
194 | case 23: //up! |
196 | case 23: //up! |
195 | Dir_Up(); |
197 | Dir_Up(); |
196 | break; |
198 | break; |
197 | case 24: //cut |
199 | case 24: //cut |
Line 396... | Line 398... | ||
396 | } |
398 | } |
Line 397... | Line 399... | ||
397 | 399 | ||
398 | 400 | ||
- | 401 | inline fastcall void draw_window() |
|
399 | inline fastcall void draw_window() |
402 | { |
- | 403 | if (GetScreenHeight()<480) |
|
400 | { |
404 | DefineAndDrawWindow(20,0,582,GetScreenHeight()-30,0x73,0xE4DFE1,title); |
401 | if (GetScreenHeight()<480) DefineAndDrawWindow(20,0,582,GetScreenHeight()-30,0x73,0x10E4DFE1,0,0,title); else |
405 | else |
402 | DefineAndDrawWindow(98,90,582,482,0x73,0x10E4DFE1,0,0,title); |
406 | DefineAndDrawWindow(98,90,582,482,0x73,0xE4DFE1,title); |
403 | Form.GetInfo(#Form, SelfInfo); |
407 | Form.GetInfo(#Form, SelfInfo); |
404 | IF (Form.status_window>2) return; //íè÷åãî íå äåëàòü åñëè îêíî ñõëîïíóòî â çàãîëîâîê |
408 | IF (Form.status_window>2) return; //íè÷åãî íå äåëàòü åñëè îêíî ñõëîïíóòî â çàãîëîâîê |
Line 437... | Line 441... | ||
437 | 441 | ||
438 | 442 | ||
439 | void KEdit() |
443 | void KEdit() |
- | 444 | { |
|
440 | { |
445 | edit1.size=edit1.pos=strlen(#edit_path); |
441 | edit1.size=edit1.pos=strlen(#edit_path); |
446 | edit1.offset=0; |
Line 442... | Line 447... | ||
442 | edit_box_draw stdcall (#edit1); |
447 | edit_box_draw stdcall (#edit1); |
Line 563... | Line 568... | ||
563 | off=file_mas[filenum+za_kadrom]*304 + buf+72; |
568 | off=file_mas[filenum+za_kadrom]*304 + buf+72; |
Line 564... | Line 569... | ||
564 | 569 | ||
565 | if (!TestBit(ESDWORD[off-40], 4)) |
570 | if (!TestBit(ESDWORD[off-40], 4)) |
566 | { |
571 | { |
567 | copystr(off,#temp); |
572 | copystr(off,#temp); |
568 | Put_icon(#temp+find_symbol(#temp,'.'), BUTTON_HEIGHT/2-7+y, color); |
573 | Put_icon(#temp+strchr(#temp,'.'), BUTTON_HEIGHT/2-7+y, color); |
569 | WriteText(7-strlen(ConvertSize(ESDWORD[off-8]))*6+onLeft(75,0),BUTTON_HEIGHT-6/2+y,0x80,0,ConvertSize(ESDWORD[off-8]),0); //size |
574 | WriteText(7-strlen(ConvertSize(ESDWORD[off-8]))*6+onLeft(75,0),BUTTON_HEIGHT-6/2+y,0x80,0,ConvertSize(ESDWORD[off-8]),0); //size |
570 | } |
575 | } |
571 | else |
576 | else |
572 | if (!strcmp("..",off)) |
577 | if (!strcmp("..",off)) |
Line 651... | Line 656... | ||
651 | FOR(k=1;k |
656 | FOR(k=1;k |
652 | return; |
657 | return; |
653 | } |
658 | } |
654 | FOR (j=count-1, off=count-1*304+buf+32; j>=0; j--, off-=304;) //ïàïêè ââåðõ, ôàéëû âíèç |
659 | FOR (j=count-1, off=count-1*304+buf+32; j>=0; j--, off-=304;) //ïàïêè ââåðõ, ôàéëû âíèç |
655 | { |
660 | { |
656 | ChangeCase(off+40); |
661 | TitleCase(off+40); |
657 | if (TestBit(ESDWORD[off],4)) //ïàïêà? |
662 | if (TestBit(ESDWORD[off],4)) //ïàïêà? |
658 | { |
663 | { |
659 | file_mas[k]=j; |
664 | file_mas[k]=j; |
660 | k++; |
665 | k++; |
661 | } |
666 | } |
Line 722... | Line 727... | ||
722 | char new_copy_path[4096]; |
727 | char new_copy_path[4096]; |
723 | int copy_rezult; |
728 | int copy_rezult; |
Line 724... | Line 729... | ||
724 | 729 | ||
725 | IF (!copy_file) return; //îòìåíà, åøè åù¸ íè÷¸ íå ñêîïèðîâàëè |
730 | IF (!copy_file) return; //îòìåíà, åøè åù¸ íè÷¸ íå ñêîïèðîâàëè |
726 | copystr(#path,#new_copy_path); |
731 | copystr(#path,#new_copy_path); |
727 | copystr(#copy_file+find_symbol(#copy_file,'/'),#new_copy_path+strlen(#new_copy_path)); |
732 | copystr(#copy_file+strchr(#copy_file,'/'),#new_copy_path+strlen(#new_copy_path)); |
728 | if (!strcmp(#copy_file,#new_copy_path)) //åñëè ìû êîïèðóåì è âñòàâëÿåì â îäíîé è òîé æå ïàïêå |
733 | if (!strcmp(#copy_file,#new_copy_path)) //åñëè ìû êîïèðóåì è âñòàâëÿåì â îäíîé è òîé æå ïàïêå |
729 | { |
734 | { |
730 | copystr(#path,#new_copy_path); |
735 | copystr(#path,#new_copy_path); |
731 | copystr("new_",#new_copy_path+strlen(#new_copy_path)); |
736 | copystr("new_",#new_copy_path+strlen(#new_copy_path)); |
732 | copystr(#copy_file+find_symbol(#copy_file,'/'),#new_copy_path+strlen(#new_copy_path)); |
737 | copystr(#copy_file+strchr(#copy_file,'/'),#new_copy_path+strlen(#new_copy_path)); |
733 | } |
738 | } |
734 | copy_rezult=CopyFile(#copy_file,#new_copy_path); |
739 | copy_rezult=CopyFile(#copy_file,#new_copy_path); |
735 | IF (copy_rezult<>0) //îøèáêà |
740 | IF (copy_rezult<>0) //îøèáêà |
736 | { |
741 | { |
Line 743... | Line 748... | ||
743 | copystr(#copy_file,#file_path); |
748 | copystr(#copy_file,#file_path); |
744 | Del_File(true); |
749 | Del_File(true); |
745 | copy_file=''; |
750 | copy_file=''; |
746 | cut_active=0; |
751 | cut_active=0; |
747 | } |
752 | } |
748 | SelectFile(#new_copy_path+find_symbol(#new_copy_path,'/')); |
753 | SelectFile(#new_copy_path+strchr(#new_copy_path,'/')); |
749 | } |
754 | } |
Line 750... | Line 755... | ||
750 | 755 | ||
751 | 756 | ||
Line 797... | Line 802... | ||
797 | 802 | ||
798 | 803 | ||
799 | void Actions() |
804 | void Actions() |
- | 805 | { |
|
800 | { |
806 | int actions_y=disc_num*16; |
801 | int actions_y=disc_num*16; |
807 | |
- | 808 | DrawBar(17,actions_y+75,160,15,0x00699C); //ñèíèé ïðÿìîóãîëüíèê - ïîä äåâàéñàìè |
|
- | 809 | DrawBar(17,show_actions*51+actions_y+108,160,onTop(show_actions*51+actions_y+108,6),0x00699C); //ñèíåå â êîíöå |
|
- | 810 | ||
- | 811 | DeleteButton(80); |
|
- | 812 | DeleteButton(81); |
|
802 | DrawBar(17,actions_y+75,160,15,0x00699C); //ñèíèé ïðÿìîóãîëüíèê - ïîä äåâàéñàìè |
813 | DeleteButton(82); |
- | 814 | ||
- | 815 | if (!show_actions) |
|
803 | DrawBar(17,show_actions*51+actions_y+108,160,onTop(show_actions*51+actions_y+108,6),0x00699C); //ñèíåå â êîíöå |
816 | Tip(actions_y+90, "Actions", 77, "\x18"); |
804 | if (show_actions==1) |
817 | else |
805 | { |
818 | { |
806 | Tip(actions_y+90, "Actions", 77, "\x19"); //çàãîëîâîê |
819 | Tip(actions_y+90, "Actions", 77, "\x19"); //çàãîëîâîê |
807 | DrawBar(17,actions_y+108,160,51,0xFFFFFF); //áåëîå |
820 | DrawBar(17,actions_y+108,160,51,0xFFFFFF); //áåëîå |
808 | PutImage(#factions,16,44,21,actions_y+113); //èêîíêè |
821 | PutImage(#factions,16,44,21,actions_y+113); //èêîíêè |
809 | //rename file |
822 | //rename file |
- | 823 | DefineButton(17,actions_y+108,159,16,80+BT_HIDE,0xE4DFE1); |
|
810 | DefineButton(17,actions_y+108,159,16,80+BT_HIDE,0xE4DFE1); |
824 | WriteText(42,actions_y+113,0x80,0,"Rename file",0); |
811 | WriteText(42,actions_y+113,0x80,0,"Rename file |
825 | WriteText(150,actions_y+113,0x80,0x999999,"[F2]",0); |
812 | //delete file |
826 | //delete file |
- | 827 | DefineButton(17,actions_y+125,159,16,81+BT_HIDE,0xE4DFE1); |
|
813 | DefineButton(17,actions_y+125,159,16,81+BT_HIDE,0xE4DFE1); |
828 | WriteText(42,actions_y+130,0x80,0,"Delete file",0); |
814 | WriteText(42,actions_y+130,0x80,0,"Delete file |
829 | WriteText(144,actions_y+130,0x80,0x999999,"[Del]",0); |
815 | //create folder |
830 | //create folder |
816 | DefineButton(17,actions_y+142,159,16,82+BT_HIDE,0xE4DFE1); |
- | |
817 | WriteText(42,actions_y+147,0x80,0,"Create folder |
- | |
818 | } |
- | |
819 | else |
- | |
820 | { |
- | |
821 | DeleteButton(80); |
- | |
822 | DeleteButton(81); |
831 | DefineButton(17,actions_y+142,159,16,82+BT_HIDE,0xE4DFE1); |
823 | DeleteButton(82); |
832 | WriteText(42,actions_y+147,0x80,0,"Create folder",0); |
824 | Tip(actions_y+90, "Actions", 77, "\x18"); |
833 | WriteText(150,actions_y+147,0x80,0x999999,"[F6]",0); |
Line 844... | Line 853... | ||
844 | 853 | ||
845 | void SelectFile(dword that_file) |
854 | void SelectFile(dword that_file) |
846 | { |
855 | { |
847 | za_kadrom=curbtn=0; //ââåðõ ñïèñêà |
856 | za_kadrom=curbtn=0; //ââåðõ ñïèñêà |
848 | Open_Dir(#path,ONLY_OPEN); |
857 | Open_Dir(#path,ONLY_OPEN); |
849 | ChangeCase(that_file); |
858 | TitleCase(that_file); |
850 | for (i=count-1; i>=0; i--;) |
859 | for (i=count-1; i>=0; i--;) |
851 | if (!strcmp(file_mas[i]*304+buf+72,that_file)) break; |
860 | if (!strcmp(file_mas[i]*304+buf+72,that_file)) break; |
852 | FileList_ReDraw(i); |
861 | FileList_ReDraw(i); |
853 | List_ReDraw(); |
862 | List_ReDraw(); |
Line 868... | Line 877... | ||
868 | 877 | ||
869 | inline fastcall void GoBack() //âíà÷àëå óäàëÿåì òåêóùèé ïóòü, à ïîòîì êîïèðóåì òî, ÷òî îñòàëîñü |
878 | inline fastcall void GoBack() //âíà÷àëå óäàëÿåì òåêóùèé ïóòü, à ïîòîì êîïèðóåì òî, ÷òî îñòàëîñü |
870 | { |
879 | { |
871 | char cur_folder[4096]; |
880 | char cur_folder[4096]; |
872 | copystr(GetCurrentFolder(), #cur_folder); |
881 | copystr(GetCurrentFolder(), #cur_folder); |
873 | HistoryPath(GO_BACK); |
882 | if (HistoryPath(GO_BACK)) |
874 | SelectFile(#cur_folder); |
883 | SelectFile(#cur_folder); |
Line 875... | Line 884... | ||
875 | } |
884 | } |