Subversion Repositories Kolibri OS

Rev

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

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