Subversion Repositories Kolibri OS

Rev

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