Subversion Repositories Kolibri OS

Rev

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

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