Subversion Repositories Kolibri OS

Rev

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