Rev 3846 | Rev 3854 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3846 | Rev 3848 | ||
---|---|---|---|
Line 17... | Line 17... | ||
17 | #include "..\lib\copyf.h" |
17 | #include "..\lib\copyf.h" |
18 | //images |
18 | //images |
19 | #include "imgs\toolbar.txt" |
19 | #include "imgs\toolbar.txt" |
20 | #include "imgs\left_p.txt" |
20 | #include "imgs\left_p.txt" |
Line -... | Line 21... | ||
- | 21 | ||
- | 22 | #ifndef AUTOBUILD |
|
- | 23 | #include "lang.h--" |
|
- | 24 | #endif |
|
- | 25 | ||
- | 26 | #ifdef LANG_RUS |
|
- | 27 | ?define T_FILE " ©«" |
|
- | 28 | ?define T_TYPE "¨¯" |
|
- | 29 | ?define T_SIZE " §¬¥à" |
|
- | 30 | ?define T_NEW_FOLDER "®¢ ï ¯ ¯ª " |
|
- | 31 | ?define T_NEW_FILE "®¢ë© ä ©«" |
|
- | 32 | ?define T_DELETE_FILE "ë ¤¥©áâ¢¨â¥«ì® å®â¨â¥ 㤠«¨âì" |
|
- | 33 | ?define T_YES " " |
|
- | 34 | ?define T_NO "¥â" |
|
- | 35 | ?define T_DEL_ERROR_1 "訡ª . ¯ª ¥ ¯ãáâ ï." |
|
- | 36 | ?define T_DEL_ERROR_2 "訡ª . ©«®¢ ï á¨á⥬ ⮫쪮 ¤«ï ç⥨ï." |
|
- | 37 | ?define NOT_CREATE_FOLDER "¥ 㤠«®áì ᮧ¤ âì ¯ ¯ªã." |
|
- | 38 | ?define NOT_CREATE_FILE "¥ 㤠«®áì ᮧ¤ âì ä ©«." |
|
- | 39 | ?define ERROR_1 "訡ª ¯à¨ § £à㧪¥ ¡¨¡«¨®â¥ª¨ /rd/1/lib/box_lib.obj" |
|
- | 40 | ||
- | 41 | #else |
|
- | 42 | ?define T_FILE "File" |
|
- | 43 | ?define T_TYPE "Type" |
|
- | 44 | ?define T_SIZE "Size" |
|
- | 45 | ?define T_NEW_FOLDER "New folder" |
|
- | 46 | ?define T_NEW_FILE "New file" |
|
- | 47 | ?define T_DELETE_FILE "Do you really want to delete" |
|
- | 48 | ?define T_YES "Yes" |
|
- | 49 | ?define T_NO "No" |
|
- | 50 | ?define T_DEL_ERROR_1 "Error. Folder isn't empty." |
|
- | 51 | ?define T_DEL_ERROR_2 "Error. Filesystem read-only." |
|
- | 52 | ?define NOT_CREATE_FOLDER "Folder can not be created." |
|
- | 53 | ?define NOT_CREATE_FILE "File can not be created." |
|
- | 54 | ?define ERROR_1 "Error while loading library /rd/1/lib/box_lib.obj" |
|
Line 21... | Line 55... | ||
21 | 55 | #endif |
|
Line 22... | Line 56... | ||
22 | 56 | ||
23 | enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir |
57 | enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir |
24 | 58 | ||
25 | #define TITLE "Eolite File Manager v1.91" |
59 | #define TITLE "Eolite File Manager v1.92" |
26 | #define ABOUT_TITLE "Eolite v1.91" |
60 | #define ABOUT_TITLE "Eolite v1.92" |
27 | dword col_work = 0xE4DFE1; |
61 | dword col_work = 0xE4DFE1; |
28 | dword col_border = 0x9098B0; //A0A0B8; //0x819FC5; |
62 | dword col_border = 0x9098B0; //A0A0B8; //0x819FC5; |
Line 73... | Line 107... | ||
73 | { |
107 | { |
74 | word key, id, can_show, can_select, m_selected; |
108 | word key, id, can_show, can_select, m_selected; |
Line 75... | Line 109... | ||
75 | 109 | ||
76 | files.line_h=18; |
110 | files.line_h=18; |
77 | mem_Init(); |
111 | mem_Init(); |
78 | if (load_dll2(boxlib, #box_lib_init,0)!=0) notify("Error while loading library /rd/1/lib/box_lib.obj"); |
112 | if (load_dll2(boxlib, #box_lib_init,0)!=0) notify(ERROR_1); |
79 | SystemDiscsGet(); |
113 | SystemDiscsGet(); |
80 | GetIni(1); |
114 | GetIni(1); |
81 | if (param) |
115 | if (param) |
82 | { |
116 | { |
Line 375... | Line 409... | ||
375 | DrawRectangle(1,40,Form.cwidth-3,onTop(46,0),col_border); |
409 | DrawRectangle(1,40,Form.cwidth-3,onTop(46,0),col_border); |
376 | DrawRectangle(0,39,Form.cwidth-1,onTop(44,0),col_palette[4]); //bg |
410 | DrawRectangle(0,39,Form.cwidth-1,onTop(44,0),col_palette[4]); //bg |
377 | for (i=0; i<5; i++) DrawBar(0, 34+i, Form.cwidth, 1, col_palette[8-i]); |
411 | for (i=0; i<5; i++) DrawBar(0, 34+i, Form.cwidth, 1, col_palette[8-i]); |
378 | DrawLeftPanel(); |
412 | DrawLeftPanel(); |
379 | //ListBox |
413 | //ListBox |
380 | DrawFlatButton(files.x,40,onLeft(files.x,168),16,31,col_work,"File"); |
414 | DrawFlatButton(files.x,40,onLeft(files.x,168),16,31,col_work,T_FILE); |
381 | DrawFlatButton(onLeft(168,0),40,73,16,32,col_work,"Type"); |
415 | DrawFlatButton(onLeft(168,0),40,73,16,32,col_work,T_TYPE); |
382 | DrawFlatButton(onLeft(95,0),40,68,16,33,col_work,"Size"); |
416 | DrawFlatButton(onLeft(95,0),40,68,16,33,col_work,T_SIZE); |
383 | DrawBar(onLeft(27,0),57,1,onTop(22,57),col_border); //line to the left from the scroll |
417 | DrawBar(onLeft(27,0),57,1,onTop(22,57),col_border); //line to the left from the scroll |
384 | DrawFlatButton(onLeft(27,0),40,16,16,0,col_work,"\x18"); |
418 | DrawFlatButton(onLeft(27,0),40,16,16,0,col_work,"\x18"); |
385 | DrawFlatButton(onLeft(27,0),onTop(22,0),16,16,0,col_work,"\x19"); |
419 | DrawFlatButton(onLeft(27,0),onTop(22,0),16,16,0,col_work,"\x19"); |
386 | Open_Dir(#path,ONLY_SHOW); |
420 | Open_Dir(#path,ONLY_SHOW); |
387 | if (del_active) Del_Form(); |
421 | if (del_active) Del_Form(); |
Line 590... | Line 624... | ||
590 | void Del_Form() |
624 | void Del_Form() |
591 | { |
625 | { |
592 | int dform_x = files.w - 200 / 2 + files.x; |
626 | int dform_x = files.w - 200 / 2 + files.x; |
593 | //oeia ieii |
627 | //oeia ieii |
594 | if (!files.count) return; |
628 | if (!files.count) return; |
- | 629 | #ifdef LANG_RUS |
|
- | 630 | DrawFlatButton(dform_x,160,215,80,0,col_work, ""); //oi?ia |
|
- | 631 | #else |
|
595 | DrawFlatButton(dform_x,160,200,80,0,col_work, ""); //oi?ia |
632 | DrawFlatButton(dform_x,160,200,80,0,col_work, ""); //oi?ia |
- | 633 | #endif |
|
596 | WriteText(dform_x+19,175,0x80,0,"Do you really want to delete"); |
634 | WriteText(dform_x+19,175,0x80,0,T_DELETE_FILE); |
597 | IF (strlen(#file_name)<28) |
635 | IF (strlen(#file_name)<28) |
598 | { |
636 | { |
599 | WriteText(strlen(#file_name)*6+dform_x+20,190,0x80,0,"?"); |
637 | WriteText(strlen(#file_name)*6+dform_x+20,190,0x80,0,"?"); |
600 | WriteText(dform_x+20,190,0x80,0,#file_name); //ieoai eiy |
638 | WriteText(dform_x+20,190,0x80,0,#file_name); //ieoai eiy |
601 | } |
639 | } |
Line 603... | Line 641... | ||
603 | { |
641 | { |
604 | WriteText(164+dform_x,190,0x80,0,"...?"); |
642 | WriteText(164+dform_x,190,0x80,0,"...?"); |
605 | ESI = 24; |
643 | ESI = 24; |
606 | WriteText(dform_x+20,190,0,0,#file_name); //ieoai eiy |
644 | WriteText(dform_x+20,190,0,0,#file_name); //ieoai eiy |
607 | } |
645 | } |
608 | DrawFlatButton(dform_x+20,208,70,20,301,0xFFB6B5,"Yes"); |
646 | DrawFlatButton(dform_x+20,208,70,20,301,0xFFB6B5,T_YES); |
609 | DrawFlatButton(dform_x+111,208,70,20,302,0xC6DFC6,"No"); |
647 | DrawFlatButton(dform_x+111,208,70,20,302,0xC6DFC6,T_NO); |
610 | del_active=1; |
648 | del_active=1; |
611 | } |
649 | } |
Line 612... | Line 650... | ||
612 | 650 | ||
Line 618... | Line 656... | ||
618 | { |
656 | { |
619 | del_rezult = DeleteFile(#file_path); |
657 | del_rezult = DeleteFile(#file_path); |
620 | IF (del_rezult) |
658 | IF (del_rezult) |
621 | { |
659 | { |
622 | Write_Error(del_rezult); |
660 | Write_Error(del_rezult); |
623 | IF ( itdir) ShowMessage("Error. Folder isn't empty."); |
661 | IF ( itdir) ShowMessage(T_DEL_ERROR_1); |
624 | IF (!itdir) ShowMessage("Error. Filesystem read-only."); |
662 | IF (!itdir) ShowMessage(T_DEL_ERROR_2); |
625 | } |
663 | } |
626 | } |
664 | } |
627 | del_active=0; |
665 | del_active=0; |
628 | DeleteButton(301); DeleteButton(302); |
666 | DeleteButton(301); DeleteButton(302); |
629 | Open_Dir(#path,WITH_REDRAW); |
667 | Open_Dir(#path,WITH_REDRAW); |
Line 646... | Line 684... | ||
646 | { |
684 | { |
647 | del_rezult = DeleteFile(#file_path); |
685 | del_rezult = DeleteFile(#file_path); |
648 | if (del_rezult!=0) |
686 | if (del_rezult!=0) |
649 | { |
687 | { |
650 | Write_Error(del_rezult); |
688 | Write_Error(del_rezult); |
651 | ShowMessage("Error. Folder isn't empty."); |
689 | ShowMessage(T_DEL_ERROR_1); |
652 | return; |
690 | return; |
653 | } |
691 | } |
654 | ELSE CreateDir(#temp); |
692 | ELSE CreateDir(#temp); |
655 | Open_Dir(#path,WITH_REDRAW); |
693 | Open_Dir(#path,WITH_REDRAW); |
656 | } |
694 | } |
Line 748... | Line 786... | ||
748 | Open_Dir(#path,WITH_REDRAW); |
786 | Open_Dir(#path,WITH_REDRAW); |
749 | DrawLeftPanel(); |
787 | DrawLeftPanel(); |
750 | break; |
788 | break; |
751 | case 6: |
789 | case 6: |
752 | strcpy(#temp, #path); |
790 | strcpy(#temp, #path); |
753 | strcat(#temp, "New folder"); |
791 | strcat(#temp, T_NEW_FOLDER); |
754 | CreateDir(#temp); |
792 | CreateDir(#temp); |
755 | if (!EAX){ |
793 | if (!EAX){ |
756 | SelectFile("New folder"); |
794 | SelectFile(T_NEW_FOLDER); |
757 | FnProcess(2); |
795 | FnProcess(2); |
758 | } |
796 | } |
759 | else |
797 | else |
760 | { |
798 | { |
761 | Write_Error(EAX); |
799 | Write_Error(EAX); |
762 | ShowMessage("Folder can not be created."); |
800 | ShowMessage(NOT_CREATE_FOLDER); |
763 | } |
801 | } |
764 | break; |
802 | break; |
765 | case 7: |
803 | case 7: |
766 | strcpy(#temp, #path); |
804 | strcpy(#temp, #path); |
767 | strcat(#temp, "New file"); |
805 | strcat(#temp, T_NEW_FILE); |
768 | WriteFile(0, 0, #temp); |
806 | WriteFile(0, 0, #temp); |
769 | if (!EAX){ |
807 | if (!EAX){ |
770 | SelectFile("New file"); |
808 | SelectFile(T_NEW_FILE); |
771 | FnProcess(2); |
809 | FnProcess(2); |
772 | } |
810 | } |
773 | else |
811 | else |
774 | { |
812 | { |
775 | Write_Error(EAX); |
813 | Write_Error(EAX); |
776 | ShowMessage("File can not be created."); |
814 | ShowMessage(NOT_CREATE_FILE); |
777 | } |
815 | } |
778 | break; |
816 | break; |
779 | case 10: //F10 |
817 | case 10: //F10 |
780 | RunProgram(EDITOR_PATH, abspath("Eolite.ini")); |
818 | RunProgram(EDITOR_PATH, abspath("Eolite.ini")); |
781 | break; |
819 | break; |