Subversion Repositories Kolibri OS

Rev

Rev 6158 | Rev 6251 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. //Leency, Veliant, Punk_Joker & KolibriOS Team 2008-2015
  2. //GNU GPL licence.
  3.  
  4. #ifndef AUTOBUILD
  5. #include "lang.h--"
  6. #endif
  7.  
  8. //libraries
  9. #define MEMSIZE 4096 * 180
  10. #include "..\lib\clipboard.h"
  11. #include "..\lib\strings.h"
  12. #include "..\lib\mem.h"
  13. #include "..\lib\file_system.h"
  14. #include "..\lib\gui.h"
  15. #include "..\lib\list_box.h"
  16. #include "..\lib\random.h"
  17. #include "..\lib\font.h"
  18. #include "..\lib\collection.h"
  19. //obj
  20. #include "..\lib\obj\libini.h"
  21. #include "..\lib\obj\box_lib.h"
  22. //patterns
  23. #include "..\lib\patterns\history.h"
  24.  
  25. //images
  26. #include "imgs\toolbar.txt"
  27. #include "imgs\left_p.txt"
  28. #include "imgs\icons.txt"
  29.  
  30. enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir
  31. enum {CREATE_FILE=1, CREATE_FOLDER, RENAME_ITEM }; //NewElement
  32.  
  33. dword col_padding, col_selec, col_lpanel, col_work, col_graph;
  34.  
  35. int toolbar_buttons_x[7]={9,46,85,134,167,203};
  36.  
  37. byte active_about=0;
  38. word about_window;
  39. word settings_window;
  40. byte active_settings=0;
  41. dword _not_draw = false;
  42. byte menu_call_mouse=0;
  43.  
  44. byte del_active=0;
  45. byte new_element_active=0;
  46.  
  47. llist files, files_active, files_inactive;
  48.  
  49. byte list_full_redraw;
  50.  
  51. dword buf;
  52. dword file_mas[6898];
  53. int selected_count;
  54.  
  55.  
  56. byte
  57.         path[4096],
  58.         DefaultPath[4096],
  59.         file_path[4096],
  60.         file_name[256],
  61.         new_element_name[256],
  62.         temp[4096],
  63.         itdir;
  64.  
  65. char active_path[4096], inactive_path[4096];
  66.  
  67. dword eolite_ini_path;
  68.  
  69. char scroll_used=false;
  70.  
  71. dword menu_stak,about_stak,properties_stak,settings_stak,copy_stak,delete_stak;
  72.  
  73. proc_info Form;
  74. int mouse_dd, sc_slider_h;
  75. int j, i;
  76. int action_buf;
  77. int rand_n;
  78. byte CMD_REFRESH;
  79.  
  80. //struct t_settings {
  81. int sort_num=2,
  82.         show_dev_name=true,
  83.         real_files_names_case=false,
  84.         info_after_copy=false,
  85.         two_panels=false,
  86.         active_panel=1;
  87. //} settings;
  88.  
  89. edit_box new_file_ed = {171,213,180,0xFFFFFF,0x94AECE,0xFFFFFF,0xFFFFFF,0,248,#new_element_name,#mouse_dd,100000000000010b,6,0};
  90. PathShow_data PathShow = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, #path, #temp, 0};
  91. PathShow_data FileShow = {0, 56,215, 6, 100, 0, 0, 0x0, 0xFFFfff, #file_name, #temp, 0};
  92. byte cmd_free=0;
  93. #include "include\translations.h"
  94. #include "include\fs.h"
  95.  
  96. char *fd_path_eolite_ini_path;
  97.  
  98. #include "include\settings.h"
  99. #include "include\progress_dialog.h"
  100. #include "..\lib\copyf.h"
  101. #include "include\copy.h"
  102. #include "include\gui.h"
  103. #include "include\sorting.h"
  104. #include "include\icons.h"
  105. #include "include\left_panel.h"
  106. #include "include\menu.h"
  107. #include "include\about.h"
  108. #include "include\properties.h"
  109.  
  110. void main()
  111. {
  112.         word id;
  113.         byte count_sl = 0;
  114.         signed x_old, y_old, dif_x, dif_y, adif_x, adif_y;
  115.         char can_show, can_select, stats;
  116.         dword selected_offset;
  117.         dword IPC_LEN,IPC_ID;
  118.         char IPC_BUF[10];
  119.         rand_n = random(40);
  120.  
  121.         load_dll(boxlib, #box_lib_init,0);
  122.         load_dll(libini, #lib_init,1);
  123.  
  124.         eolite_ini_path = abspath("Eolite.ini");
  125.         fd_path_eolite_ini_path = "/fd/1/File Managers/Eolite.ini";
  126.        
  127.         LoadIniSettings();
  128.         SystemDiscs.Get();
  129.         SetAppColors();
  130.         if (param)
  131.         {
  132.                 strcpy(#path, #param);
  133.                 if (path[strlen(#path)-1]!='/') chrcat(#path, '/'); //add "/" to the end of the string
  134.         }              
  135.        
  136.         Open_Dir(#path,ONLY_OPEN);
  137.         strcpy(#inactive_path, #path);
  138.         llist_copy(#files_inactive, #files);
  139.         SetEventMask(1100111b);
  140.         loop(){
  141.                 switch(WaitEvent())
  142.                 {
  143.                         case evMouse:
  144.                                 if (del_active) || (!CheckActiveProcess(Form.ID)) || (Form.status_window>2) break;
  145.                                 if (new_element_active) || (!CheckActiveProcess(Form.ID)) || (Form.status_window>2)
  146.                                 {
  147.                                         edit_box_mouse stdcall(#new_file_ed);
  148.                                         break;
  149.                                 }                              
  150.                                
  151.                                 mouse.get();
  152.                                
  153.                                 if (!mouse.mkm) && (stats>0) stats = 0;
  154.                                 if (mouse.mkm) && (!stats)
  155.                                 {
  156.                                         x_old = mouse.x;
  157.                                         y_old = mouse.y;
  158.                                         stats = 1;
  159.                                 }
  160.                                 if (mouse.mkm) && (stats==1)
  161.                                 {
  162.                                         dif_x = mouse.x-x_old;
  163.                                         dif_y = mouse.y-y_old;
  164.                                         adif_x = fabs(dif_x);
  165.                                         adif_y = fabs(dif_y);
  166.                                        
  167.                                         if (adif_x>adif_y)
  168.                                         {
  169.                                                 if (dif_x > 150)
  170.                                                 {
  171.                                                         if (history.forward())
  172.                                                                 {
  173.                                                                         strcpy(#path, history.current());
  174.                                                                         files.KeyHome();
  175.                                                                         Open_Dir(#path,WITH_REDRAW);
  176.                                                                 }
  177.                                                         stats = 0;
  178.                                                 }
  179.                                                 if (dif_x < -150)
  180.                                                 {
  181.                                                         GoBack();
  182.                                                         stats = 0;
  183.                                                 }
  184.                                         }
  185.                                         else
  186.                                         {
  187.                                                 if (dif_y < -100)
  188.                                                 {
  189.                                                         Dir_Up();
  190.                                                         stats = 0;
  191.                                                 }
  192.                                         }
  193.                                 }      
  194.                                 if (files.MouseOver(mouse.x, mouse.y))
  195.                                 {
  196.                                         //open
  197.                                         if (mouse.key&MOUSE_LEFT)&&(mouse.dblclick)
  198.                                         {
  199.                                                 if (mouse.y - files.y / files.item_h + files.first < files.count)
  200.                                                 {
  201.                                                         files.ProcessMouse(mouse.x, mouse.y);
  202.                                                         List_ReDraw();
  203.                                                         Open(0);                                       
  204.                                                 }
  205.                                         }
  206.                                         //select file
  207.                                         else if (mouse.key&MOUSE_LEFT)&&((mouse.down)
  208.                                         {
  209.                                                 if (files.ProcessMouse(mouse.x, mouse.y)) List_ReDraw();
  210.                                         }
  211.                                         //file menu
  212.                                         else if (mouse.key&MOUSE_RIGHT)&&(mouse.up)
  213.                                         {
  214.                                                 menu_call_mouse = 1;
  215.                                                
  216.                                                 if (files.MouseOver(mouse.x, mouse.y))
  217.                                                 {
  218.                                                         files.cur_y = mouse.y - files.y / files.item_h + files.first;
  219.                                                         List_ReDraw();
  220.                                                         menu_stak = malloc(4096);
  221.                                                         CreateThread(#FileMenu,menu_stak+4092);
  222.                                                 }
  223.                                                 break;
  224.                                         }
  225.                                 }
  226.  
  227.                                 if (mouse.vert)
  228.                                 {
  229.                                         if (files.MouseScroll(mouse.vert)) List_ReDraw();
  230.                                         break;
  231.                                 }
  232.  
  233.                                 if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+16) && (mouse.y>files.y-17) && (mouse.y<files.y)
  234.                                 {
  235.                                         if (mouse.lkm==1) DrawRectangle3D(files.x+files.w+1,files.y-16,14,14,0xC7C7C7,0xFFFFFF);
  236.                                         WHILE (mouse.lkm==1) && (files.first>0)
  237.                                         {
  238.                                                 pause(8);
  239.                                                 files.first--;
  240.                                                 List_ReDraw();
  241.                                                 mouse.get();
  242.                                         }
  243.                                         DrawRectangle3D(files.x+files.w+1,files.y-16,14,14,0xFFFFFF,0xC7C7C7);
  244.                                 }
  245.  
  246.                                 if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+16) && (mouse.y>files.y+files.h-16) && (mouse.y<files.y+files.h)
  247.                                 {
  248.                                         if (mouse.lkm==1) DrawRectangle3D(files.x+files.w+1,files.y+files.h-15,14,14,0xC7C7C7,0xFFFFFF);
  249.                                         while (mouse.lkm==1) && (files.first<files.count-files.visible)
  250.                                         {
  251.                                                 pause(8);
  252.                                                 files.first++;
  253.                                                 List_ReDraw();
  254.                                                 mouse.get();
  255.                                         }
  256.                                         DrawRectangle3D(files.x+files.w+1,files.y+files.h-15,14,14,0xFFFFFF,0xC7C7C7);
  257.                                 }
  258.  
  259.                                 //Scrooll
  260.                                 if (!mouse.lkm) && (scroll_used) { scroll_used=false; Scroll(); }
  261.                                 if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+18) && (mouse.y>files.y) && (mouse.y<files.y+files.h-18) && (mouse.lkm) && (!scroll_used) {scroll_used=true; Scroll();}
  262.                                
  263.                                 if (scroll_used)
  264.                                 {
  265.                                         if (sc_slider_h/2+files.y>mouse.y) || (mouse.y<0) || (mouse.y>4000) mouse.y=sc_slider_h/2+files.y; //anee eo?ni? iaa ieiii
  266.                                         id = files.first;
  267.                                         files.first = -sc_slider_h / 2 + mouse.y -j -files.y * files.count;
  268.                                         files.first /= files.h - 18;
  269.                                         if (files.visible+files.first>files.count) files.first=files.count-files.visible;
  270.                                         if (files.first<0) files.first=0;
  271.                                         if (id!=files.first) List_ReDraw();
  272.                                         break;
  273.                                 }
  274.  
  275.                                 if (two_panels) && (mouse.y > files.y) && (mouse.down) {
  276.                                         if (mouse.x<Form.cwidth/2)
  277.                                         {
  278.                                                 if (active_panel!=1)
  279.                                                 {
  280.                                                         active_panel = 1;
  281.                                                         ChangeActivePanel();
  282.                                                 }
  283.                                         }
  284.                                         else
  285.                                         {
  286.                                                 if (active_panel!=2)
  287.                                                 {
  288.                                                         active_panel = 2;
  289.                                                         ChangeActivePanel();
  290.                                                 }
  291.                                         }
  292.                                 }
  293.                                 break;  
  294.         //Button pressed-----------------------------------------------------------------------------
  295.                         case evButton:
  296.                                 id=GetButtonID();
  297.                                 if (id==1)
  298.                                 {
  299.                                         KillProcess(about_window);
  300.                                         SaveIniSettings();
  301.                                         ExitProcess();
  302.                                 }
  303.                                 if (del_active)
  304.                                 {
  305.                                         if (id==301) || (id==302) Del_File(302-id);
  306.                                         break;
  307.                                 }
  308.                                 if (new_element_active)
  309.                                 {
  310.                                         if (id==301) || (id==302) NewElement(302-id);
  311.                                         break;
  312.                                 }
  313.                                
  314.                                 switch(id)
  315.                                 {
  316.                                         case 21: //Back
  317.                                                         GoBack();
  318.                                                         break;
  319.                                         case 22: //Forward
  320.                                                         if (history.forward())
  321.                                                         {
  322.                                                                 strcpy(#path, history.current());
  323.                                                                 files.KeyHome();
  324.                                                                 Open_Dir(#path,WITH_REDRAW);
  325.                                                         }
  326.                                                         break;
  327.                                         case 23:
  328.                                                         Dir_Up();
  329.                                                         break;
  330.                                         case 24:
  331.                                                         Copy(#file_path, CUT);
  332.                                                         break;
  333.                                         case 25:
  334.                                                         Copy(#file_path, NOCUT);
  335.                                                         break;
  336.                                         case 26:
  337.                                                         Paste();
  338.                                                         break;
  339.                                         case 31...33: //sorting
  340.                                                         sort_num = id - 30;
  341.                                                         DrawList();
  342.                                                         Open_Dir(#path,WITH_REDRAW);
  343.                                                         break;
  344.                                         case 50...60: //Actions
  345.                                                         FnProcess(id-50);
  346.                                                         break;
  347.                                         case 100...120:
  348.                                                 SystemDiscs.Click(id-100);
  349.                                                 break;
  350.                                 }
  351.                                 break;
  352.         //Key pressed-----------------------------------------------------------------------------
  353.                         case evKey:
  354.                                 GetKeys();
  355.  
  356.                                 if (Form.status_window>2) break;
  357.                                 if (del_active)
  358.                                 {
  359.                                         if (key_scancode == SCAN_CODE_ENTER) Del_File(true);
  360.                                         if (key_scancode == SCAN_CODE_ESC) Del_File(false);
  361.                                         break;
  362.                                 }
  363.                                 if (new_element_active)
  364.                                 {
  365.                                         if (key_scancode == SCAN_CODE_ENTER) NewElement(true);
  366.                                         if (key_scancode == SCAN_CODE_ESC) NewElement(false);
  367.                                         EAX= key_ascii << 8;
  368.                                         edit_box_key stdcall (#new_file_ed);
  369.                                         break;
  370.                                 }
  371.                                 if (files.ProcessKey(key_scancode))
  372.                                 {
  373.                                         List_ReDraw();
  374.                                         break;
  375.                                 }
  376.  
  377.                                 if (key_modifier&KEY_LCTRL) || (key_modifier&KEY_RCTRL)
  378.                                 {
  379.                                         switch(key_scancode)
  380.                                         {
  381.                                                 case 059...068:
  382.                                                                 key_scancode -= 59;
  383.                                                                 if (key_scancode < SystemDiscs.list.count)
  384.                                                                 {
  385.                                                                         if (!two_panels)
  386.                                                                         {
  387.                                                                                 DrawRectangle(17,key_scancode*16+74,159,16, 0); //display click
  388.                                                                                 pause(7);                                                                              
  389.                                                                         }
  390.                                                                         SystemDiscs.Click(key_scancode);
  391.                                                                 }
  392.                                                                 break;
  393.                                                 case 45:  //Ctrl+X
  394.                                                                 Copy(#file_path, CUT);
  395.                                                                 break;                                         
  396.                                                 case 46:  //Ctrl+C
  397.                                                                 Copy(#file_path, NOCUT);
  398.                                                                 break;
  399.                                                 case 47:  //Ctrl+V
  400.                                                                 Paste();
  401.                                                                 break;
  402.                                                 case 032: //Ctrl+D - set as bg
  403.                                                                 strlcpy(#temp, "\\S__",4);
  404.                                                                 strcat(#temp, #file_path);
  405.                                                                 RunProgram("/sys/media/kiv", #temp);
  406.                                                                 break;
  407.                                                 case 049: //Ctrl+N - create new window
  408.                                                                 if (Form.left==98) MoveSize(Form.left-20,Form.top-20,OLD,OLD);
  409.                                                                 RunProgram("/sys/File Managers/Eolite", #path);
  410.                                                                 break;
  411.                                                 case 050: //Ctrl+M
  412.                                                                 Open_Dir(#inactive_path,WITH_REDRAW);
  413.                                                                 break;
  414.                                                 case 028: //Ctrl+Enter
  415.                                                                 if (!itdir) ShowOpenWithDialog();
  416.                                                                 else Open(1);
  417.                                                                 break;
  418.                                                 case 030: //Ctrl+A - select all files
  419.                                                                 for (i=0; i<files.count; i++)
  420.                                                                 {
  421.                                                                         selected_offset = file_mas[i]*304 + buf+32 + 7;
  422.                                                                         if (!i) if (!strncmp(selected_offset+33, "..", 2)) continue; //do not selec ".." directory
  423.                                                                         ESBYTE[selected_offset] = 1;
  424.                                                                         selected_count++;
  425.                                                                 }
  426.                                                                 List_ReDraw();
  427.                                                                 break;
  428.                                                 case 022: //Ctrl+U - unselect all files
  429.                                                                 for (i=0; i<files.count; i++)
  430.                                                                 {
  431.                                                                         selected_offset = file_mas[i]*304 + buf+32 + 7;
  432.                                                                         ESBYTE[selected_offset] = 0;
  433.                                                                 }
  434.                                                                 selected_count = 0;
  435.                                                                 List_ReDraw();
  436.                                                                 break;
  437.                                         }
  438.                                         break;
  439.                                 }
  440.  
  441.                                 switch (key_scancode)
  442.                                 {
  443.                                                 case SCAN_CODE_BS:
  444.                                                                 //GoBack();
  445.                                                                 Dir_Up();
  446.                                                                 break;
  447.                                                 case SCAN_CODE_ENTER:
  448.                                                                 Open(0);
  449.                                                                 break;
  450.                                                 case SCAN_CODE_TAB:
  451.                                                                 if (!two_panels) break;
  452.                                                                 if (active_panel==1) active_panel=2; else active_panel=1;
  453.                                                                 ChangeActivePanel();
  454.                                                                 break;
  455.                                                 case 093: //menu
  456.                                                                 menu_call_mouse=0;
  457.                                                                 menu_stak = malloc(4096);
  458.                                                                 CreateThread(#FileMenu,menu_stak+4092);
  459.                                                                 break;
  460.                                                 case SCAN_CODE_DEL:
  461.                                                                 Del_Form();
  462.                                                                 break;
  463.                                                 case SCAN_CODE_INS:
  464.                                                                 selected_offset = file_mas[files.cur_y]*304 + buf+32 + 7;
  465.                                                                 if (files.cur_y==0) && (!strncmp(selected_offset+33, "..", 2)) goto _INSERT_END; //do not selec ".." directory
  466.                                                                 if (ESBYTE[selected_offset])
  467.                                                                 {
  468.                                                                         ESBYTE[selected_offset]=0;
  469.                                                                         selected_count--;
  470.                                                                 }
  471.                                                                 else
  472.                                                                 {
  473.                                                                         ESBYTE[selected_offset] = 1;
  474.                                                                         selected_count++;
  475.                                                                 }
  476.                                                                 _INSERT_END:
  477.                                                                 files.KeyDown();
  478.                                                                 List_ReDraw();
  479.                                                                 break;
  480.                                                 case 059...068: //F1-F10
  481.                                                                 FnProcess(key_scancode-58);
  482.                                                                 break;
  483.                                                 default:
  484.                                                                 for (i=files.cur_y+1; i<files.count; i++)
  485.                                                                 {
  486.                                                                         strcpy(#temp, file_mas[i]*304+buf+72);
  487.                                                                         if (temp[0]==key_ascii) || (temp[0]==key_ascii-32)
  488.                                                                         {
  489.                                                                                 files.cur_y = i - 1;
  490.                                                                                 files.KeyDown();
  491.                                                                                 List_ReDraw();
  492.                                                                                 break;
  493.                                                                         }
  494.                                                                 }
  495.                                 }                        
  496.                         break;
  497.                         case evIPC:
  498.                         case evReDraw:
  499.                                 draw_window();
  500.                                 if (action_buf)
  501.                                 {
  502.                                         if (action_buf==OPERATION_END)
  503.                                         {
  504.                                                 FnProcess(5);
  505.                                                 if (copy_stak) SelectFileByName(#copy_to+strrchr(#copy_to,'/'));
  506.                                         }
  507.                                         if (action_buf==100) Open(0);
  508.                                         if (action_buf==201) ShowOpenWithDialog();
  509.                                         if (action_buf==202) FnProcess(3); //F3
  510.                                         if (action_buf==203) FnProcess(4); //F4
  511.                                         if (action_buf==104) Copy(#file_path, NOCUT);
  512.                                         if (action_buf==105) Copy(#file_path, CUT);
  513.                                         if (action_buf==106) Paste();
  514.                                         if (action_buf==207) FnProcess(2);
  515.                                         if (action_buf==108) Del_Form();
  516.                                         if (action_buf==109) FnProcess(5);
  517.                                         if (action_buf==110) FnProcess(8);
  518.                                         action_buf=0;
  519.                                 }
  520.                 }
  521.                 if(cmd_free)
  522.                 {
  523.                         if(cmd_free==1)      menu_stak=free(menu_stak);
  524.                         else if(cmd_free==2) about_stak=free(about_stak);
  525.                         else if(cmd_free==3) properties_stak=free(properties_stak);
  526.                         else if(cmd_free==4) settings_stak=free(settings_stak);
  527.                         else if(cmd_free==5) copy_stak=free(copy_stak);
  528.                         else if(cmd_free==6) delete_stak=free(delete_stak);
  529.                         cmd_free = false;
  530.                 }
  531.         }
  532. }
  533.  
  534. void draw_window()
  535. {
  536.         DefineAndDrawWindow(WinX+rand_n,WinY+rand_n,WinW,WinH,0x73,NULL,TITLE,0);
  537.         GetProcessInfo(#Form, SelfInfo);
  538.         if (Form.status_window>2) return;
  539.         if (Form.height < 350) { MoveSize(OLD,OLD,OLD,350); return; }
  540.         if (Form.width  < 480) { MoveSize(OLD,OLD,480,OLD); return; }
  541.         GetProcessInfo(#Form, SelfInfo); //if win_size changed
  542.         PutPaletteImage(#toolbar,246,34,0,0,8,#toolbar_pal);
  543.         DrawBar(127, 8, 1, 25, col_graph);
  544.         for (j=0; j<3; j++) DefineButton(toolbar_buttons_x[j]+2,5+2,31-5,29-5,21+j+BT_HIDE,NULL);
  545.         for (j=3; j<6; j++) DefineButton(toolbar_buttons_x[j],5,31,29,21+j+BT_HIDE,NULL);
  546.         DrawBar(246,0, Form.cwidth - 297,12, col_work); //upper editbox
  547.         DrawBar(246,29,Form.cwidth - 297,5,  col_work); //lower editbox
  548.         DrawRectangle(246,12,Form.cwidth - 303,16,col_graph);
  549.         DefineButton(Form.cwidth - 32,6,27,28,51+BT_HIDE+BT_NOFRAME,0); //about
  550.         PutPaletteImage(#goto_about,56,34,Form.width-65,0,8,#goto_about_pal);
  551.         //main rectangles
  552.         DrawRectangle(1,40,Form.cwidth-3,Form.cheight - 42,col_graph);
  553.         DrawRectangle(0,39,Form.cwidth-1,Form.cheight - 40,col_palette[4]); //bg
  554.         for (i=0; i<5; i++) DrawBar(0, 34+i, Form.cwidth, 1, col_palette[8-i]);
  555.         llist_copy(#files_active, #files);
  556.         strcpy(#active_path, #path);
  557.         DrawFilePanels();
  558.         if (del_active) Del_Form();
  559.         if (new_element_active) NewElement_Form(new_element_active, #new_element_name);
  560. }
  561.  
  562. void DrawList()
  563. {
  564.         word sorting_arrow_x;
  565.         DrawFlatButton(files.x, files.y-17,     files.w - 141,16,31,T_FILE);
  566.         DrawFlatButton(files.x + files.w - 141, files.y-17,73,16,32,T_TYPE);
  567.         DrawFlatButton(files.x + files.w -  68, files.y-17,68,16,33,T_SIZE);
  568.         DrawFlatButton(files.x + files.w,       files.y-17,16,16, 0,"\x18");
  569.         DrawFlatButton(files.x + files.w,files.y+files.h-16,16,16,0,"\x19");
  570.         if (sort_num==1) sorting_arrow_x = files.w - 141 / 2 + files.x + 18;
  571.         if (sort_num==2) sorting_arrow_x = files.x + files.w - 90;
  572.         if (sort_num==3) sorting_arrow_x = strlen(T_SIZE)*3-30+files.x+files.w;
  573.         WriteText(sorting_arrow_x,files.y-12,0x80,col_graph,"\x19");
  574.         DrawBar(files.x+files.w,files.y,1,files.h,col_graph);
  575.         if (two_panels) && (files.x<5) DrawBar(files.x+files.w+16,files.y,1,files.h,col_graph);
  576. }
  577.  
  578. void DrawFilePanels()
  579. {
  580.         int files_y;
  581.         if (!two_panels)
  582.         {
  583.                 DrawDeviceAndActionsLeftPanel();
  584.                 files.SetSizes(192, 57, Form.cwidth - 210, Form.cheight - 59, files.item_h);
  585.                 DrawList();
  586.                 Open_Dir(#path,ONLY_SHOW);
  587.         }
  588.         else
  589.         {
  590.                 SystemDiscs.Get();
  591.                 llist_copy(#files, #files_inactive);
  592.                 strcpy(#path, #inactive_path);
  593.                 col_selec = 0xCCCccc;
  594.                 SystemDiscs.Draw();
  595.                 files_y = files.y;
  596.  
  597.                 if (active_panel==1)
  598.                 {
  599.                         llist_copy(#files, #files_inactive);
  600.                         strcpy(#path, #inactive_path);
  601.                         col_selec = 0xCCCccc;
  602.                         files.SetSizes(Form.cwidth/2, files_y, Form.cwidth/2 -17, Form.cheight-files_y-2, files.item_h);
  603.                         DrawList();
  604.                         Open_Dir(#path,WITH_REDRAW);
  605.                         llist_copy(#files, #files_active);
  606.                         strcpy(#path, #active_path);
  607.                         col_selec = 0x94AECE;
  608.                         files.SetSizes(2, files_y, Form.cwidth/2-2-17, Form.cheight-files_y-2, files.item_h);
  609.                         DrawList();
  610.                         Open_Dir(#path,WITH_REDRAW);
  611.                 }
  612.                 if (active_panel==2)
  613.                 {
  614.                         files.SetSizes(2, files_y, Form.cwidth/2-2-17, Form.cheight-files_y-2, files.item_h);
  615.                         DrawList();
  616.                         Open_Dir(#path,WITH_REDRAW);
  617.                         llist_copy(#files, #files_active);
  618.                         strcpy(#path, #active_path);
  619.                         col_selec = 0x94AECE;
  620.                         files.SetSizes(Form.cwidth/2, files_y, Form.cwidth/2 -17, Form.cheight-files_y-2, files.item_h);
  621.                         DrawList();
  622.                         Open_Dir(#path,WITH_REDRAW);
  623.                 }
  624.         }
  625. }
  626.  
  627.  
  628. void List_ReDraw()
  629. {
  630.         int all_lines_h;
  631.         static int old_cur_y, old_first;
  632.  
  633.         files.CheckDoesValuesOkey(); //prevent some shit
  634.  
  635.         if (list_full_redraw) || (old_first != files.first)
  636.         {
  637.                 old_cur_y = files.cur_y;
  638.                 old_first = files.first;
  639.                 list_full_redraw = false;
  640.                 goto _ALL_LIST_REDRAW;
  641.         }
  642.         if (old_cur_y != files.cur_y)
  643.         {
  644.                 if (old_cur_y-files.first<files.visible) Line_ReDraw(0xFFFFFF, old_cur_y-files.first);
  645.                 Line_ReDraw(col_selec, files.cur_y-files.first);
  646.                 old_cur_y = files.cur_y;
  647.                 return;
  648.         }
  649.  
  650.         _ALL_LIST_REDRAW:
  651.  
  652.         for (j=0; j<files.visible; j++) if (files.cur_y-files.first!=j) Line_ReDraw(0xFFFFFF, j); else Line_ReDraw(col_selec, files.cur_y-files.first);
  653.         //in the bottom
  654.         all_lines_h = j * files.item_h;
  655.         DrawBar(files.x,all_lines_h + files.y,files.w,files.h - all_lines_h,0xFFFFFF);
  656.         DrawBar(files.x+files.w-141,all_lines_h + files.y,1,files.h - all_lines_h,system.color.work);
  657.         DrawBar(files.x+files.w-68,all_lines_h + files.y,1,files.h - all_lines_h,system.color.work);
  658.         Scroll();
  659. }
  660.  
  661.  
  662. void Line_ReDraw(dword bgcol, filenum){
  663.         dword text_col=0,
  664.                   ext1, attr,
  665.                   file_offet,
  666.                   file_name_off,
  667.                   y=filenum*files.item_h+files.y;
  668.                   BDVK file;
  669.         char label_file_name[4096];
  670.         if (filenum==-1) return;
  671.         DrawBar(files.x,y,3,files.item_h,bgcol);
  672.         DrawBar(files.x+19,y,files.w-19,files.item_h,bgcol);
  673.         DrawBar(files.x+3,y+17,16,1,bgcol);
  674.         if (files.item_h>18) DrawBar(files.x+3,y+18,16,files.item_h-18,bgcol);
  675.         if (files.item_h>15) DrawBar(files.x+3,y,16,files.item_h-15,bgcol);
  676.  
  677.         file_offet = file_mas[filenum+files.first]*304 + buf+32;
  678.         attr = ESDWORD[file_offet];
  679.         file.selected = ESBYTE[file_offet+7];
  680.         file.sizelo   = ESDWORD[file_offet+32];
  681.         file_name_off = file_offet+40;
  682.  
  683.         if (! TestBit(attr, 4) ) //file or folder?
  684.         {      
  685.                 ext1 = strrchr(file_name_off,'.') + file_name_off;
  686.                 if (ext1==file_name_off) ext1 = " \0"; //if no extension then show nothing
  687.                 Put_icon(ext1, files.x+3, files.item_h/2-7+y, bgcol, 0);
  688.                 WriteText(7-strlen(ConvertSize(file.sizelo))*6+files.x+files.w - 58, files.text_y + y +1,files.font_type,0,ConvertSize(file.sizelo));
  689.         }
  690.         else
  691.         {
  692.                 if (!strncmp(file_name_off,"..",3)) ext1=".."; else ext1="<DIR>";
  693.                 Put_icon(ext1, files.x+3, files.item_h/2-7+y, bgcol, 0);               
  694.         }
  695.  
  696.         if (TestBit(attr, 1)) || (TestBit(attr, 2)) text_col=0xA6A6B7; //system or hiden?
  697.         if (bgcol!=0xFFFfff)
  698.         {
  699.                 itdir = TestBit(attr, 4);
  700.                 strcpy(#file_name, file_name_off);
  701.                 sprintf(#file_path,"%s%s",#path,file_name_off);
  702.                 if (text_col==0xA6A6B7) text_col=0xFFFFFF;
  703.         }
  704.         if (file.selected) text_col=0xFF0000;
  705.         if (label.size.pt==9) || (!label.font)
  706.         {
  707.                 if (Form.width>=480)
  708.                 {
  709.                         FileShow.start_x = files.x + 23;
  710.                         FileShow.font_color = text_col;
  711.                         FileShow.area_size_x = files.w - 164;
  712.                         FileShow.text_pointer = file_name_off;
  713.                         FileShow.start_y = files.text_y + y + 1;
  714.                         PathShow_prepare stdcall(#FileShow);
  715.                         PathShow_draw stdcall(#FileShow);
  716.                 }              
  717.         }
  718.         else
  719.         {
  720.                 strcpy(#label_file_name, file_name_off);
  721.                 if (label.getsize(#label_file_name) + 141 + 26 > files.w)
  722.                 {
  723.                         while (label.getsize(#label_file_name) + 141 + 26 > files.w) {
  724.                                 ESBYTE[#label_file_name+strlen(#label_file_name)-1] = NULL;
  725.                         }
  726.                         strcpy(#label_file_name+strlen(#label_file_name)-2, "...");                    
  727.                 }
  728.                 label.write(files.x + 23, files.item_h - label.height / 2 + y, bgcol, text_col, label.size.pt, #label_file_name);
  729.         }
  730.         DrawBar(files.x+files.w-141,y,1,files.item_h,system.color.work); //gray line 1
  731.         DrawBar(files.x+files.w-68,y,1,files.item_h,system.color.work); //gray line 2
  732. }
  733.  
  734.  
  735. void Open_Dir(dword dir_path, redraw){
  736.         int errornum, maxcount;
  737.  
  738.         if (redraw!=ONLY_SHOW)
  739.         {
  740.                 if (ESBYTE[dir_path+1]!='\0') ESBYTE[dir_path+strlen(dir_path)-1] = '\0';
  741.                 if (buf) free(buf);
  742.                 errornum = GetDir(#buf, #files.count, dir_path, DIRS_NOROOT);
  743.                 if (ESBYTE[dir_path+1]!='\0') chrcat(dir_path, '/');
  744.                 if (errornum)
  745.                 {
  746.                         history.add(#path);
  747.                         GoBack();
  748.                         Write_Error(errornum);
  749.                         return;
  750.                 }
  751.                 maxcount = sizeof(file_mas)/sizeof(dword)-1;
  752.                 if (files.count>maxcount) files.count = maxcount;
  753.                 if (files.count>0) && (files.cur_y-files.first==-1) files.cur_y=0;
  754.         }
  755.         if (files.count!=-1)
  756.         {
  757.                 if(!_not_draw)
  758.                 {
  759.                         PathShow.area_size_x = Form.cwidth-306;
  760.                         DrawBar(PathShow.start_x-3, PathShow.start_y-4, PathShow.area_size_x+2, 15, 0xFFFfff);
  761.                         PathShow_prepare stdcall(#PathShow);
  762.                         PathShow_draw stdcall(#PathShow);
  763.                 }
  764.                 history.add(#path);
  765.                 SystemDiscs.Draw();
  766.                 files.visible = files.h / files.item_h;
  767.                 if (files.count < files.visible) files.visible = files.count;
  768.                 if (redraw!=ONLY_SHOW) Sorting();
  769.                 list_full_redraw = true;
  770.                 if (redraw!=ONLY_OPEN)&&(!_not_draw) List_ReDraw();
  771.         }
  772.         if (files.count==-1) && (redraw!=ONLY_OPEN)
  773.         {
  774.                 files.KeyHome();
  775.                 if(!_not_draw) { list_full_redraw=true; List_ReDraw(); }
  776.         }
  777. }
  778.  
  779.  
  780. inline Sorting()
  781. {
  782.         dword k=0, l=1;
  783.         dword file_off;
  784.         if (!strncmp(#path,"/",2)) //do not sort
  785.         {
  786.                 for(k=1;k<files.count;k++;) file_mas[k]=k;
  787.                 return;
  788.         }
  789.         for (j=files.count-1, file_off=files.count-1*304+buf+32; j>=0; j--, file_off-=304;)  //files | folders
  790.         {
  791.                 if (!real_files_names_case) strttl(file_off+40);
  792.                 if (TestBit(ESDWORD[file_off],4)) //directory?
  793.                 {
  794.                         file_mas[k]=j;
  795.                         k++;
  796.                 }
  797.                 else
  798.                 {
  799.                         file_mas[files.count-l]=j;
  800.                         l++;
  801.                 }
  802.         }
  803.         //sorting: files first, then folders
  804.         Sort_by_Name(0,k-1);
  805.         if (sort_num==1) Sort_by_Name(k,files.count-1);
  806.         if (sort_num==2) Sort_by_Type(k,files.count-1);
  807.         if (sort_num==3) Sort_by_Size(k,files.count-1);
  808.         //make ".." first item in list
  809.         if (k>0) && (strncmp(file_mas[0]*304+buf+72,"..",2)!=0)
  810.                 for(k--; k>0; k--;) if (!strncmp(file_mas[k]*304+buf+72,"..",2)) {file_mas[k]><file_mas[0]; break;}
  811. }
  812.  
  813.  
  814. void Del_Form()
  815. {
  816.         dword selected_offset2;
  817.         int cont = 0;
  818.         byte f_count[128];
  819.         int dform_x = files.w - 220 / 2 + files.x;
  820.         if (!strncmp(#file_name,".",2)) || (!strncmp(#file_name,"..",2)) return;
  821.         else
  822.         {
  823.                 if (!files.count) return;
  824.                 DrawEolitePopup(T_YES, T_NO);
  825.                 WriteText(-strlen(T_DELETE_FILE)*3+110+dform_x,175,0x80,system.color.work_text,T_DELETE_FILE);
  826.                 for (i=0; i<files.count; i++)
  827.                 {
  828.                         selected_offset2 = file_mas[i]*304 + buf+32 + 7;
  829.                         if (ESBYTE[selected_offset2]) cont++;
  830.                 }
  831.                 if (cont)
  832.                 {
  833.                         sprintf(#f_count,"%s%d%s",DEL_MORE_FILES_1,cont,DEL_MORE_FILES_2);
  834.                         WriteText(-strlen(#f_count)*3+110+dform_x,190,0x80,system.color.work_text,#f_count);
  835.                 }
  836.                 else
  837.                 {
  838.                         if (strlen(#file_name)<28)
  839.                         {
  840.                                 WriteText(strlen(#file_name)*3+110+dform_x+2,190,0x80,system.color.work_text,"?");
  841.                                 WriteText(-strlen(#file_name)*3+110+dform_x,190,0x80,system.color.work_text,#file_name);
  842.                         }
  843.                         else
  844.                         {
  845.                                 WriteText(164+dform_x,190,0x80,0,"...?");
  846.                                 ESI = 24;
  847.                                 WriteText(dform_x+20,190,0,0,#file_name);
  848.                         }
  849.                 }              
  850.                 del_active=1;
  851.         }
  852. }
  853.  
  854. int del_error;
  855. int Del_File2(dword way, sh_progr)
  856. {    
  857.         dword dirbuf, fcount, i, filename;
  858.         int error;
  859.         char del_from[4096];
  860.         if (isdir(way))
  861.         {
  862.                 if (error = GetDir(#dirbuf, #fcount, way, DIRS_ONLYREAL)) del_error = error;
  863.                 for (i=0; i<fcount; i++)
  864.                 {
  865.                         if (CheckEvent()==evReDraw) draw_window();
  866.                         filename = i*304+dirbuf+72;
  867.                         sprintf(#del_from,"%s/%s",way,filename);
  868.                         if ( TestBit(ESDWORD[filename-40], 4) )
  869.                         {
  870.                                 Del_File2(#del_from, 1);
  871.                         }
  872.                         else
  873.                         {
  874.                                 if (sh_progr) Operation_Draw_Progress(#del_from);
  875.                                 if (error = DeleteFile(#del_from)) del_error = error;
  876.                         }
  877.                 }
  878.         }
  879.         if (error = DeleteFile(way)) del_error = error;
  880. }
  881.  
  882. void Del_File_Thread()
  883. {  
  884.         byte del_from[4096];
  885.         dword selected_offset2;
  886.         int tst, count, i;
  887.        
  888.         file_count_copy = 0;
  889.         copy_bar.value = 0;
  890.         operation_flag = DELETE_FLAG;
  891.        
  892.         if (selected_count)
  893.         {
  894.            for (i=0; i<files.count; i++)
  895.                   {
  896.                            selected_offset2 = file_mas[i]*304 + buf+32 + 7;
  897.                                 if (ESBYTE[selected_offset2]) {
  898.                                         sprintf(#del_from,"%s%s",#path,file_mas[i]*304+buf+72);
  899.                                         GetFileInfo(#del_from, #file_info_count);
  900.                                         if ( file_info_count.isfolder ) DirFileCount(#del_from);
  901.                                         else file_count_copy++;
  902.                                 }
  903.                    }
  904.         }
  905.         else
  906.         {
  907.                 if (itdir) DirFileCount(#file_path);
  908.                 else file_count_copy++;
  909.         }
  910.        
  911.         copy_bar.max = file_count_copy;
  912.        
  913.         del_error = 0;
  914.         DisplayOperationForm();
  915.         if (selected_count)
  916.         {
  917.                 for (i=0; i<files.count; i++)
  918.                 {
  919.                         selected_offset2 = file_mas[i]*304 + buf+32 + 7;
  920.                         if (ESBYTE[selected_offset2]) {
  921.                                 sprintf(#del_from,"%s%s",#path,file_mas[i]*304+buf+72);
  922.                                 Del_File2(#del_from, 1);
  923.                         }
  924.                 }
  925.         }
  926.         else
  927.         {
  928.                 Del_File2(#file_path, 1);                      
  929.         }
  930.         if (del_error) Write_Error(del_error);
  931.         cmd_free = 6;
  932.         DialogExit();
  933. }
  934.  
  935. void Del_File(byte dodel) {
  936.         del_active=0;
  937.         if (dodel)
  938.         {
  939.                 delete_stak = malloc(40000);
  940.                 CreateThread(#Del_File_Thread,delete_stak+40000-4);
  941.         }
  942.         else draw_window();
  943. }
  944.  
  945. void SelectFileByName(dword that_file)
  946. {
  947.         int ind;
  948.         files.KeyHome();
  949.         Open_Dir(#path,ONLY_OPEN);
  950.         if (!real_files_names_case) strttl(that_file);
  951.         for (ind=files.count-1; ind>=0; ind--;) { if (!strcmp(file_mas[ind]*304+buf+72,that_file)) break; }
  952.         files.cur_y = ind - 1;
  953.         files.KeyDown();
  954.         List_ReDraw();
  955. }
  956.  
  957.  
  958. void Dir_Up()
  959. {
  960.         char cur_folder[4096];
  961.         i=strlen(#path)-1;
  962.         if (i==0) return;
  963.         path[i]=0x00;
  964.         i = strrchr(#path, '/');
  965.         strcpy(#cur_folder, #path+i);
  966.         path[i]=0x00;
  967.         SelectFileByName(#cur_folder);
  968. }
  969.  
  970. void Open(byte rez)
  971. {
  972.         byte temp[4096];
  973.         selected_count = 0;
  974.         if (rez)
  975.         {
  976.                 if (!strncmp(#file_name,"..",3)) return;
  977.                 strcpy(#temp, #file_path);
  978.                 if (path[strlen(#temp)-1]!='/') chrcat(#temp, '/'); //need "/" in the end
  979.                 RunProgram("/sys/File Managers/Eolite", #temp);
  980.                 return;
  981.         }
  982.         if (!files.count) return;
  983.         if (!itdir)
  984.         {
  985.                 if (strrchr(#file_name, '.')==0) RunProgram(#file_path, ""); else RunProgram("/sys/@open", #file_path);
  986.         }
  987.         else
  988.         {
  989.                 if (!strncmp(#file_name,"..",3)) { Dir_Up(); return; }
  990.                 strcpy(#path, #file_path);
  991.                 if (path[strlen(#path)-1]!='/') chrcat(#path, '/'); //need "/" in the end
  992.                 files.first=files.cur_y=0;
  993.                 Open_Dir(#path,WITH_REDRAW);
  994.         }
  995. }
  996.  
  997. inline fastcall void GoBack()
  998. {
  999.         char cur_folder[4096];
  1000.         strcpy(#cur_folder, #path);
  1001.         cur_folder[strlen(#cur_folder)-1]=0x00; //delete last '/'
  1002.         if (history.back()) {
  1003.                 strcpy(#path, history.current());
  1004.                 SelectFileByName(#cur_folder+strrchr(#cur_folder,'/'));
  1005.         }
  1006. }
  1007.  
  1008. void ShowOpenWithDialog()
  1009. {
  1010.         byte param[4097];
  1011.         sprintf(#param,"~%s",#file_path);
  1012.         RunProgram("/sys/@open", #param);
  1013. }
  1014.  
  1015. void NewElement(byte newf)
  1016. {
  1017.         BDVK element_info;
  1018.         byte del_rezult, copy_rezult, info_result;
  1019.         if (newf)
  1020.         {
  1021.                 sprintf(#temp,"%s%s",#path,new_file_ed.text);
  1022.                 info_result = GetFileInfo(#temp, #element_info);
  1023.                 switch(new_element_active)
  1024.                 {
  1025.                         case CREATE_FILE:
  1026.                                 if (info_result==5)
  1027.                                 {
  1028.                                         WriteFile(0, 0, #temp);
  1029.                                         if (EAX)
  1030.                                         {
  1031.                                                 if (EAX==5) notify(NOT_CREATE_FILE);
  1032.                                                 else Write_Error(EAX);
  1033.                                         }
  1034.                                 }
  1035.                                 else
  1036.                                 {
  1037.                                         notify(FS_ITEM_ALREADY_EXISTS);
  1038.                                 }
  1039.                                 break;
  1040.                         case CREATE_FOLDER:
  1041.                                 if (info_result==5)
  1042.                                 {
  1043.                                         CreateDir(#temp);
  1044.                                         if (EAX)
  1045.                                         {
  1046.                                                 if (EAX==5) notify(NOT_CREATE_FOLDER);
  1047.                                                 else Write_Error(EAX);
  1048.                                         }
  1049.                                 }
  1050.                                 else
  1051.                                 {
  1052.                                         notify(FS_ITEM_ALREADY_EXISTS);
  1053.                                 }
  1054.                                 break;
  1055.                         case RENAME_ITEM:
  1056.                                 if (info_result==5)
  1057.                                 {
  1058.                                         if (itdir)
  1059.                                         {
  1060.                                                 //rename only empty folders
  1061.                                                 if (del_rezult = DeleteFile(#file_path))
  1062.                                                 {
  1063.                                                         Write_Error(del_rezult);
  1064.                                                         return;
  1065.                                                 }
  1066.                                                 if (CreateDir(#temp)) CreateDir(#file_path);
  1067.                                                 Open_Dir(#path,WITH_REDRAW);
  1068.                                                 SelectFileByName(new_file_ed.text);
  1069.                                         }
  1070.                                         else
  1071.                                         {
  1072.                                                 if (copy_rezult = CopyFile(#file_path,#temp))
  1073.                                                 {
  1074.                                                         Write_Error(copy_rezult);
  1075.                                                 }
  1076.                                                 else
  1077.                                                 {
  1078.                                                         DeleteFile(#file_path);
  1079.                                                         SelectFileByName(new_file_ed.text);
  1080.                                                 }
  1081.                                         }
  1082.                                 }
  1083.                                 else
  1084.                                 {
  1085.                                         notify(FS_ITEM_ALREADY_EXISTS);
  1086.                                 }
  1087.                 }
  1088.                 new_element_active = 0;
  1089.                 Open_Dir(#path,WITH_REDRAW);
  1090.                 SelectFileByName(new_file_ed.text);
  1091.         }
  1092.         new_element_active = 0;
  1093.         Open_Dir(#path,WITH_REDRAW);
  1094. }
  1095.  
  1096. void NewElement_Form(byte crt, dword strng)
  1097. {
  1098.         int dform_x=files.w-220/2+files.x;
  1099.         if (!new_element_active)
  1100.         {
  1101.                 new_element_active = crt;
  1102.                 strcpy(#new_element_name, strng);
  1103.                 new_file_ed.size = new_file_ed.pos = strlen(strng);
  1104.         }
  1105.         if (new_element_active==3) DrawEolitePopup(T_RENAME, T_CANCEL);
  1106.         else DrawEolitePopup(T_CREATE, T_CANCEL);
  1107.         new_file_ed.left = dform_x+24;
  1108.         edit_box_draw  stdcall (#new_file_ed);
  1109.         DrawRectangle(new_file_ed.left-1, new_file_ed.top-1, new_file_ed.width+2, 16, 0xFFFfff);
  1110.         DrawRectangle(new_file_ed.left-2, new_file_ed.top-2, new_file_ed.width+4, 18, col_graph);
  1111. }
  1112.  
  1113. void FnProcess(byte N)
  1114. {
  1115.         switch(N)
  1116.         {
  1117.                 case 1:
  1118.                         if (!active_about)
  1119.                         {
  1120.                                 about_stak = malloc(4096);
  1121.                                 about_window = CreateThread(#about_dialog,about_stak+4092);
  1122.                                 break;
  1123.                         }
  1124.                         else
  1125.                         {
  1126.                                 ActivateWindow(GetProcessSlot(about_window));
  1127.                         }
  1128.                         break;
  1129.                 case 2:
  1130.                         if (!files.count) break;
  1131.                         NewElement_Form(RENAME_ITEM, #file_name);
  1132.                         break;
  1133.                 case 3:
  1134.                         if (!itdir) RunProgram("/sys/tinypad", #file_path);
  1135.                         break;
  1136.                 case 4:
  1137.                         if (!itdir) RunProgram("/sys/develop/heed", #file_path);
  1138.                         break;
  1139.                 case 5: //refresh cur dir & devs
  1140.                         if (two_panels)
  1141.                         {
  1142.                                 DrawFilePanels();
  1143.                         }
  1144.                         else
  1145.                         {
  1146.                                 Tip(56, T_DEVICES, 55, "-");
  1147.                                 Open_Dir(#path,WITH_REDRAW);
  1148.                                 pause(10);
  1149.                                 SystemDiscs.Get();
  1150.                                 Open_Dir(#path,WITH_REDRAW);
  1151.                                 DrawDeviceAndActionsLeftPanel();                               
  1152.                         }
  1153.                         break;
  1154.                 case 6:
  1155.                         NewElement_Form(CREATE_FOLDER, T_NEW_FOLDER);
  1156.                         break;
  1157.                 case 7:
  1158.                         NewElement_Form(CREATE_FILE, T_NEW_FILE);
  1159.                         break;
  1160.                 case 8:
  1161.                         properties_stak = malloc(8096);
  1162.                         CreateThread(#properties_dialog, properties_stak+8092);
  1163.                         break;
  1164.                 case 10: //F10
  1165.                         if (!active_settings)
  1166.                         {
  1167.                                 settings_stak = malloc(4096);
  1168.                                 settings_window = CreateThread(#settings_dialog, settings_stak+4092);
  1169.                                 break;
  1170.                         }
  1171.                         else
  1172.                         {
  1173.                                 ActivateWindow(GetProcessSlot(settings_window));
  1174.                         }
  1175.                         break;
  1176.         }
  1177. }
  1178.  
  1179. void ChangeActivePanel()
  1180. {
  1181.         llist_copy(#files_active, #files_inactive);
  1182.         llist_copy(#files_inactive, #files);
  1183.         strcpy(#active_path, #inactive_path);
  1184.         strcpy(#inactive_path, #path);
  1185.         DrawFilePanels();
  1186. }
  1187.  
  1188.  
  1189. stop:
  1190.