2015-02-26 23:29:09 +01:00
|
|
|
|
//Leency, Veliant, Punk_Joker & KolibriOS Team 2008-2015
|
2013-03-11 19:16:24 +01:00
|
|
|
|
//GNU GPL licence.
|
|
|
|
|
|
2013-10-14 00:18:41 +02:00
|
|
|
|
#ifndef AUTOBUILD
|
|
|
|
|
#include "lang.h--"
|
|
|
|
|
#endif
|
|
|
|
|
|
2013-03-11 19:16:24 +01:00
|
|
|
|
//libraries
|
2013-10-17 23:02:47 +02:00
|
|
|
|
#define MEMSIZE 0xD0000
|
2013-03-11 19:16:24 +01:00
|
|
|
|
#include "..\lib\kolibri.h"
|
2014-01-06 01:36:08 +01:00
|
|
|
|
#include "..\lib\clipboard.h"
|
2013-03-11 19:16:24 +01:00
|
|
|
|
#include "..\lib\strings.h"
|
|
|
|
|
#include "..\lib\mem.h"
|
|
|
|
|
#include "..\lib\dll.h"
|
|
|
|
|
#include "..\lib\file_system.h"
|
2015-03-05 21:55:28 +01:00
|
|
|
|
#include "..\lib\gui.h"
|
2013-03-31 22:25:54 +02:00
|
|
|
|
#include "..\lib\list_box.h"
|
|
|
|
|
#include "..\lib\copyf.h"
|
2014-04-20 15:00:51 +02:00
|
|
|
|
#include "..\lib\random.h"
|
2015-02-27 21:25:28 +01:00
|
|
|
|
//obj
|
2015-03-05 21:55:28 +01:00
|
|
|
|
#include "..\lib\obj\libini.h"
|
|
|
|
|
#include "..\lib\obj\box_lib.h"
|
2013-03-11 19:16:24 +01:00
|
|
|
|
//images
|
|
|
|
|
#include "imgs\toolbar.txt"
|
|
|
|
|
#include "imgs\left_p.txt"
|
2014-04-17 20:07:07 +02:00
|
|
|
|
#include "imgs\icons.txt"
|
2013-03-11 19:16:24 +01:00
|
|
|
|
|
2013-08-04 01:35:59 +02:00
|
|
|
|
#ifdef LANG_RUS
|
|
|
|
|
?define T_FILE "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
|
|
|
|
?define T_TYPE "<EFBFBD><EFBFBD><EFBFBD>"
|
|
|
|
|
?define T_SIZE "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
|
|
|
|
?define T_NEW_FOLDER "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>"
|
|
|
|
|
?define T_NEW_FILE "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<>"
|
|
|
|
|
?define T_DELETE_FILE "<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>⢨⥫쭮 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㤠<><E3A4A0><EFBFBD><EFBFBD>"
|
|
|
|
|
?define T_YES "<EFBFBD><EFBFBD>"
|
|
|
|
|
?define T_NO "<EFBFBD><EFBFBD><EFBFBD>"
|
2015-05-14 18:09:36 +02:00
|
|
|
|
?define T_CANCEL "<EFBFBD>⬥<EFBFBD><EFBFBD>"
|
|
|
|
|
?define T_CREATE "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
2015-06-20 00:23:51 +02:00
|
|
|
|
?define T_RENAME "<EFBFBD><EFBFBD>२<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
2015-05-15 14:32:26 +02:00
|
|
|
|
?define FILE_EXISTS "<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> ⠪<><E2A0AA> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
|
|
|
|
?define FOLDER_EXISTS "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> ⠪<><E2A0AA> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
2013-08-04 01:35:59 +02:00
|
|
|
|
?define T_DEL_ERROR_1 "<EFBFBD>訡<EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>."
|
2013-10-10 00:46:17 +02:00
|
|
|
|
?define WAIT_DELETING_FOLDER "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>..."
|
2013-08-04 01:35:59 +02:00
|
|
|
|
?define NOT_CREATE_FOLDER "<EFBFBD><EFBFBD> 㤠<><E3A4A0><EFBFBD><EFBFBD> ᮧ<><E1AEA7><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>."
|
|
|
|
|
?define NOT_CREATE_FILE "<EFBFBD><EFBFBD> 㤠<><E3A4A0><EFBFBD><EFBFBD> ᮧ<><E1AEA7><EFBFBD><EFBFBD> 䠩<>."
|
2015-03-07 19:11:31 +01:00
|
|
|
|
?define ERROR_1 "<EFBFBD>訡<EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>㧪<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD> /rd/1/lib/box_lib.obj"
|
2015-03-09 19:49:34 +01:00
|
|
|
|
?define T_PASTE_WINDOW_TITLE "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>..."
|
2013-09-02 00:45:38 +02:00
|
|
|
|
?define T_PASTE_WINDOW_TEXT "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<>:"
|
2015-03-09 19:49:34 +01:00
|
|
|
|
?define T_PASTE_WINDOW_BUTTON "<EFBFBD><EFBFBD><EFBFBD>ࢠ<EFBFBD><EFBFBD>"
|
|
|
|
|
?define INFO_AFTER_COPY "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>襭<EFBFBD>"
|
2013-10-14 00:18:41 +02:00
|
|
|
|
?define T_CANCEL_PASTE "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>४<EFBFBD><E0A5AA>饭<EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD> <><E1AAAE><EFBFBD><E0AEA2><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>."
|
2013-10-17 23:02:47 +02:00
|
|
|
|
?define T_SELECT_APP_TO_OPEN_WITH "<EFBFBD>롥<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>"
|
2015-03-09 19:49:34 +01:00
|
|
|
|
?define DEL_MORE_FILES_1 "<EFBFBD><EFBFBD><EFBFBD>࠭<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ("
|
2015-03-09 16:14:09 +01:00
|
|
|
|
?define DEL_MORE_FILES_2 " <20><>.)?"
|
2013-09-24 20:50:05 +02:00
|
|
|
|
#elif LANG_EST
|
|
|
|
|
?define T_FILE "Fail"
|
|
|
|
|
?define T_TYPE "T<EFBFBD><EFBFBD>p"
|
|
|
|
|
?define T_SIZE "Suurus"
|
|
|
|
|
?define T_NEW_FOLDER "Uus kataloog"
|
|
|
|
|
?define T_NEW_FILE "Uus fail"
|
|
|
|
|
?define T_DELETE_FILE "Kas sa tahad t<>esti kustutada"
|
|
|
|
|
?define T_YES "Jah"
|
|
|
|
|
?define T_NO "Ei"
|
2015-05-14 18:11:10 +02:00
|
|
|
|
?define T_CANCEL "Cancel"
|
|
|
|
|
?define T_CREATE "Create"
|
2015-06-20 00:23:51 +02:00
|
|
|
|
?define T_RENAME "Rename"
|
2015-05-15 14:32:26 +02:00
|
|
|
|
?define FILE_EXISTS "The file with the same name exists"
|
|
|
|
|
?define FOLDER_EXISTS "A folder with the same name exists"
|
2013-09-24 20:50:05 +02:00
|
|
|
|
?define T_DEL_ERROR_1 "Viga. Kataloog ei ole t<>hi."
|
2013-10-10 00:46:17 +02:00
|
|
|
|
?define WAIT_DELETING_FOLDER "Deleting folder. Please, wait..."
|
2013-09-24 20:50:05 +02:00
|
|
|
|
?define NOT_CREATE_FOLDER "Kataloogi ei saa luua."
|
|
|
|
|
?define NOT_CREATE_FILE "Faili ei saa luua."
|
2015-03-07 19:11:31 +01:00
|
|
|
|
?define ERROR_1 "Viga teegi laadimisel /rd/1/lib/box_lib.obj"
|
2015-03-09 19:49:34 +01:00
|
|
|
|
?define T_PASTE_WINDOW_TITLE "Kopeerin..."
|
2013-09-24 20:50:05 +02:00
|
|
|
|
?define T_PASTE_WINDOW_TEXT "Kopeerin faili:"
|
2015-03-09 19:49:34 +01:00
|
|
|
|
?define T_PASTE_WINDOW_BUTTON "Abort"
|
|
|
|
|
?define INFO_AFTER_COPY "Copy finished"
|
2013-10-14 00:18:41 +02:00
|
|
|
|
?define T_CANCEL_PASTE "Copy process terminated. Folder copied incompletely."
|
2013-10-17 23:02:47 +02:00
|
|
|
|
?define T_SELECT_APP_TO_OPEN_WITH "Select application to open file"
|
2015-03-09 19:49:34 +01:00
|
|
|
|
?define DEL_MORE_FILES_1 "selected items("
|
|
|
|
|
?define DEL_MORE_FILES_2 " pcs.)?"
|
2013-08-04 01:35:59 +02:00
|
|
|
|
#else
|
|
|
|
|
?define T_FILE "File"
|
|
|
|
|
?define T_TYPE "Type"
|
|
|
|
|
?define T_SIZE "Size"
|
|
|
|
|
?define T_NEW_FOLDER "New folder"
|
|
|
|
|
?define T_NEW_FILE "New file"
|
|
|
|
|
?define T_DELETE_FILE "Do you really want to delete"
|
|
|
|
|
?define T_YES "Yes"
|
|
|
|
|
?define T_NO "No"
|
2015-05-14 18:11:10 +02:00
|
|
|
|
?define T_CANCEL "Cancel"
|
|
|
|
|
?define T_CREATE "Create"
|
2015-06-20 00:23:51 +02:00
|
|
|
|
?define T_RENAME "Rename"
|
2015-05-15 14:32:26 +02:00
|
|
|
|
?define FILE_EXISTS "The file with the same name exists"
|
|
|
|
|
?define FOLDER_EXISTS "A folder with the same name exists"
|
2013-08-04 01:35:59 +02:00
|
|
|
|
?define T_DEL_ERROR_1 "Error. Folder isn't empty."
|
2013-10-10 00:46:17 +02:00
|
|
|
|
?define WAIT_DELETING_FOLDER "Deleting folder. Please, wait..."
|
2013-08-04 01:35:59 +02:00
|
|
|
|
?define NOT_CREATE_FOLDER "Folder can not be created."
|
|
|
|
|
?define NOT_CREATE_FILE "File can not be created."
|
2015-03-07 19:11:31 +01:00
|
|
|
|
?define ERROR_1 "Error while loading library /rd/1/lib/box_lib.obj"
|
2015-03-09 19:49:34 +01:00
|
|
|
|
?define T_PASTE_WINDOW_TITLE "Copying..."
|
2013-09-02 00:45:38 +02:00
|
|
|
|
?define T_PASTE_WINDOW_TEXT "Copying file:"
|
2015-03-09 19:49:34 +01:00
|
|
|
|
?define T_PASTE_WINDOW_BUTTON "Abort"
|
|
|
|
|
?define INFO_AFTER_COPY "Copy finished"
|
2013-10-14 00:18:41 +02:00
|
|
|
|
?define T_CANCEL_PASTE "Copy process terminated. Folder copied incompletely."
|
2013-10-17 23:02:47 +02:00
|
|
|
|
?define T_SELECT_APP_TO_OPEN_WITH "Select application to open file"
|
2015-03-09 19:49:34 +01:00
|
|
|
|
?define DEL_MORE_FILES_1 "selected items("
|
|
|
|
|
?define DEL_MORE_FILES_2 " pcs.)?"
|
2013-08-04 01:35:59 +02:00
|
|
|
|
#endif
|
2013-03-11 19:16:24 +01:00
|
|
|
|
|
2013-04-04 19:07:38 +02:00
|
|
|
|
enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir
|
2015-07-19 20:45:59 +02:00
|
|
|
|
enum { CREATE_FILE=1, CREATE_FOLDER, RENAME_ITEM }; //NewElement
|
2013-04-04 19:07:38 +02:00
|
|
|
|
|
2015-07-19 20:45:59 +02:00
|
|
|
|
#define TITLE "Eolite File Manager v2.81"
|
|
|
|
|
#define ABOUT_TITLE "Eolite v2.81"
|
2013-10-23 19:55:07 +02:00
|
|
|
|
dword col_padding, col_selec, col_lpanel;
|
2013-03-11 19:16:24 +01:00
|
|
|
|
|
2013-03-31 22:25:54 +02:00
|
|
|
|
int toolbar_buttons_x[7]={9,46,85,134,167,203};
|
|
|
|
|
struct path_string { char Item[4096]; };
|
|
|
|
|
|
2013-10-29 22:50:46 +01:00
|
|
|
|
byte active_about=0;
|
2013-10-22 00:24:36 +02:00
|
|
|
|
word about_window;
|
2015-02-17 17:46:38 +01:00
|
|
|
|
byte active_settings=0;
|
|
|
|
|
word settings_window;
|
2013-10-16 23:03:17 +02:00
|
|
|
|
|
2013-10-29 22:50:46 +01:00
|
|
|
|
byte menu_call_mouse=0;
|
|
|
|
|
|
2013-03-31 22:25:54 +02:00
|
|
|
|
llist files;
|
2013-03-11 19:16:24 +01:00
|
|
|
|
|
2013-03-31 22:25:54 +02:00
|
|
|
|
byte
|
2013-03-11 19:16:24 +01:00
|
|
|
|
path[4096],
|
|
|
|
|
file_path[4096],
|
2013-03-23 01:00:11 +01:00
|
|
|
|
file_name[256],
|
2015-05-14 18:09:36 +02:00
|
|
|
|
new_element_name[256],
|
2013-03-31 22:25:54 +02:00
|
|
|
|
temp[4096];
|
|
|
|
|
byte
|
2013-04-01 17:41:17 +02:00
|
|
|
|
del_active=0,
|
2015-05-14 18:09:36 +02:00
|
|
|
|
new_element_active=0,
|
2013-12-22 23:37:18 +01:00
|
|
|
|
show_dev_name=1,
|
2013-11-14 01:22:55 +01:00
|
|
|
|
real_files_names_case=0,
|
2015-03-19 14:49:26 +01:00
|
|
|
|
use_big_fonts=0,
|
|
|
|
|
font_type,
|
2015-02-24 13:48:22 +01:00
|
|
|
|
info_after_copy=0,
|
2013-03-31 22:25:54 +02:00
|
|
|
|
sort_num=2,
|
2013-04-02 15:39:25 +02:00
|
|
|
|
itdir;
|
2013-03-11 19:16:24 +01:00
|
|
|
|
|
2015-02-21 13:24:30 +01:00
|
|
|
|
dword eolite_ini_path;
|
|
|
|
|
|
2013-03-11 19:16:24 +01:00
|
|
|
|
proc_info Form;
|
2013-10-23 19:55:07 +02:00
|
|
|
|
system_colors sc;
|
2013-03-11 19:16:24 +01:00
|
|
|
|
mouse m;
|
2015-03-19 14:49:26 +01:00
|
|
|
|
int mouse_dd, scroll_used, sc_slider_h, sorting_arrow_x, kolibrios_drive;
|
2014-04-26 11:49:20 +02:00
|
|
|
|
dword buf;
|
2013-03-31 22:25:54 +02:00
|
|
|
|
dword file_mas[6898];
|
|
|
|
|
int j, i;
|
2013-10-15 01:16:04 +02:00
|
|
|
|
int action_buf;
|
2014-04-20 15:00:51 +02:00
|
|
|
|
int rand_n;
|
2015-03-09 19:02:10 +01:00
|
|
|
|
int selected_count;
|
2013-03-11 19:16:24 +01:00
|
|
|
|
|
2015-04-02 23:27:51 +02:00
|
|
|
|
mouse gestures;
|
|
|
|
|
signed x_old, y_old, dif_x, dif_y, adif_x, adif_y;
|
|
|
|
|
byte stats;
|
|
|
|
|
|
2015-05-15 14:32:26 +02:00
|
|
|
|
edit_box edit2 = {250,213,80,0xFFFFCC,0x94AECE,0xFFFFCC,0xFFFFFF,0,248,#file_name,#mouse_dd,64,6,6};
|
2015-07-19 20:45:59 +02:00
|
|
|
|
edit_box new_file_ed = {171,213,180,0xFFFFFF,0x94AECE,0xFFFFFF,0xFFFFFF,0,248,#new_element_name,#mouse_dd,100000000000010b,6,0};
|
2013-03-31 22:25:54 +02:00
|
|
|
|
PathShow_data PathShow = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, #path, #temp, 0};
|
2013-03-11 19:16:24 +01:00
|
|
|
|
PathShow_data FileShow = {0, 56,215, 6, 100, 0, 0, 0x0, 0xFFFfff, #file_name, #temp, 0};
|
2015-07-16 03:44:30 +02:00
|
|
|
|
byte cmd_free;
|
2013-10-17 01:48:20 +02:00
|
|
|
|
#include "include\copy.h"
|
2015-02-20 16:25:51 +01:00
|
|
|
|
#include "include\gui.h"
|
2013-03-11 19:16:24 +01:00
|
|
|
|
#include "include\sorting.h"
|
2013-10-17 01:48:20 +02:00
|
|
|
|
#include "include\icons.h"
|
2013-03-11 19:16:24 +01:00
|
|
|
|
#include "include\left_panel.h"
|
|
|
|
|
#include "include\history.h"
|
2013-10-17 01:48:20 +02:00
|
|
|
|
#include "include\menu.h"
|
|
|
|
|
#include "include\about.h"
|
2015-02-17 17:46:38 +01:00
|
|
|
|
#include "include\settings.h"
|
2015-02-22 19:42:51 +01:00
|
|
|
|
#include "include\properties.h"
|
2013-10-23 19:55:07 +02:00
|
|
|
|
|
2015-07-16 03:44:30 +02:00
|
|
|
|
dword menu_stak,about_stak,properties_stak,settings_stak,copy_stak;
|
|
|
|
|
|
2013-03-11 19:16:24 +01:00
|
|
|
|
void main()
|
|
|
|
|
{
|
2013-04-04 19:07:38 +02:00
|
|
|
|
word key, id, can_show, can_select, m_selected;
|
2014-04-26 11:49:20 +02:00
|
|
|
|
dword selected_offset;
|
2014-04-20 15:00:51 +02:00
|
|
|
|
rand_n = random(40);
|
2015-04-02 23:27:51 +02:00
|
|
|
|
gestures.get();
|
2013-03-11 19:16:24 +01:00
|
|
|
|
mem_Init();
|
2013-08-04 01:35:59 +02:00
|
|
|
|
if (load_dll2(boxlib, #box_lib_init,0)!=0) notify(ERROR_1);
|
2015-02-13 23:17:57 +01:00
|
|
|
|
if (load_dll2(libini, #lib_init,1)!=0) notify("Error: library doesn't exists - libini");
|
2015-02-21 13:24:30 +01:00
|
|
|
|
eolite_ini_path = abspath("Eolite.ini");
|
|
|
|
|
LoadIniSettings();
|
|
|
|
|
GetSystemDiscs();
|
2013-10-23 19:55:07 +02:00
|
|
|
|
SetAppColors();
|
2013-03-11 19:16:24 +01:00
|
|
|
|
if (param)
|
|
|
|
|
{
|
|
|
|
|
strcpy(#path, #param);
|
2013-03-31 22:25:54 +02:00
|
|
|
|
if (path[strlen(#path)-1]!='/') chrcat(#path, '/'); //add "/" to the end of the string
|
2013-03-11 19:16:24 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
2013-06-22 00:49:43 +02:00
|
|
|
|
{
|
2013-03-30 01:52:50 +01:00
|
|
|
|
strcpy(#path, "/rd/1/");
|
2013-06-22 00:49:43 +02:00
|
|
|
|
}
|
2013-03-11 19:16:24 +01:00
|
|
|
|
Open_Dir(#path,ONLY_OPEN);
|
2013-03-30 01:52:50 +01:00
|
|
|
|
SetEventMask(0x27);
|
2015-07-16 03:44:30 +02:00
|
|
|
|
loop(){ switch(WaitEvent())
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
|
|
|
|
case evMouse:
|
2013-10-24 20:26:04 +02:00
|
|
|
|
if (del_active) || (!CheckActiveProcess(Form.ID)) || (Form.status_window>2) break;
|
2015-05-14 18:09:36 +02:00
|
|
|
|
if (new_element_active) || (!CheckActiveProcess(Form.ID)) || (Form.status_window>2)
|
|
|
|
|
{
|
|
|
|
|
edit_box_mouse stdcall(#new_file_ed);
|
|
|
|
|
break;
|
|
|
|
|
}
|
2013-03-11 19:16:24 +01:00
|
|
|
|
|
|
|
|
|
m.get();
|
2015-04-02 23:27:51 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gestures.get();
|
2015-04-05 01:35:11 +02:00
|
|
|
|
if (!gestures.mkm) && (stats>0) stats = 0;
|
2015-04-02 23:27:51 +02:00
|
|
|
|
if (gestures.mkm) && (stats==0)
|
|
|
|
|
{
|
|
|
|
|
x_old = gestures.x;
|
|
|
|
|
y_old = gestures.y;
|
|
|
|
|
stats = 1;
|
|
|
|
|
}
|
|
|
|
|
if (gestures.mkm) && (stats==1)
|
|
|
|
|
{
|
|
|
|
|
dif_x = gestures.x-x_old;
|
|
|
|
|
dif_y = gestures.y-y_old;
|
2015-04-05 01:35:11 +02:00
|
|
|
|
adif_x = fabs(dif_x);
|
|
|
|
|
adif_y = fabs(dif_y);
|
2015-04-02 23:27:51 +02:00
|
|
|
|
|
|
|
|
|
if (adif_x>adif_y)
|
|
|
|
|
{
|
|
|
|
|
if (dif_x > 150)
|
|
|
|
|
{
|
|
|
|
|
if (HistoryPath(GO_FORWARD))
|
|
|
|
|
{
|
2015-04-05 01:35:11 +02:00
|
|
|
|
files.first=files.current=NULL;
|
2015-04-02 23:27:51 +02:00
|
|
|
|
Open_Dir(#path,WITH_REDRAW);
|
|
|
|
|
}
|
|
|
|
|
stats = 0;
|
|
|
|
|
}
|
|
|
|
|
if (dif_x < -150)
|
|
|
|
|
{
|
|
|
|
|
GoBack();
|
|
|
|
|
stats = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2015-04-05 01:35:11 +02:00
|
|
|
|
if (dif_y < -100)
|
2015-04-02 23:27:51 +02:00
|
|
|
|
{
|
|
|
|
|
Dir_Up();
|
|
|
|
|
stats = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-07-16 03:44:30 +02:00
|
|
|
|
}
|
|
|
|
|
if (files.MouseOver(m.x, m.y))&&((m.up)||(m.down)||(m.dblclick))
|
2015-07-12 01:45:19 +02:00
|
|
|
|
{
|
|
|
|
|
//select/open file {
|
2015-07-16 03:44:30 +02:00
|
|
|
|
if (m.key&MOUSE_LEFT)&&((m.down)||(m.dblclick))
|
2015-07-12 01:45:19 +02:00
|
|
|
|
{
|
|
|
|
|
if (m.y>=files.y)//&&(m.click)
|
|
|
|
|
{
|
|
|
|
|
id = m.y - files.y / files.line_h;
|
|
|
|
|
if (files.current!=id)
|
|
|
|
|
{
|
2015-07-16 03:44:30 +02:00
|
|
|
|
m.clearTime();
|
2015-07-12 01:45:19 +02:00
|
|
|
|
if (id<files.visible) List_Current(id-files.current);
|
|
|
|
|
}
|
|
|
|
|
else if(m.dblclick)Open(0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// } select/open file
|
|
|
|
|
else
|
|
|
|
|
//file menu {
|
2015-07-16 03:44:30 +02:00
|
|
|
|
if (m.key&MOUSE_RIGHT)&&(m.up)
|
2015-07-12 01:45:19 +02:00
|
|
|
|
{
|
|
|
|
|
menu_call_mouse = 1;
|
2015-07-16 03:44:30 +02:00
|
|
|
|
if (m.y>=files.y)//&&(m.click)
|
2015-07-12 01:45:19 +02:00
|
|
|
|
{
|
|
|
|
|
id = m.y - files.y / files.line_h;
|
|
|
|
|
if (files.current!=id) List_Current(id-files.current);
|
2015-07-16 03:44:30 +02:00
|
|
|
|
//SwitchToAnotherThread();
|
|
|
|
|
menu_stak = malloc(4096);
|
|
|
|
|
CreateThread(#FileMenu,menu_stak+4092);
|
2015-07-12 01:45:19 +02:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
// } file menu
|
|
|
|
|
}
|
2013-03-31 22:25:54 +02:00
|
|
|
|
|
|
|
|
|
if (m.vert)
|
|
|
|
|
{
|
2013-10-22 00:11:23 +02:00
|
|
|
|
if (files.MouseScroll(m.vert)) List_ReDraw();
|
2013-03-31 22:25:54 +02:00
|
|
|
|
break;
|
|
|
|
|
}
|
2013-03-11 19:16:24 +01:00
|
|
|
|
|
2013-10-17 01:48:20 +02:00
|
|
|
|
if (m.x>=Form.width-26) && (m.x<=Form.width-6) && (m.y>40) && (m.y<files.y)
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
2015-02-21 13:24:30 +01:00
|
|
|
|
IF (m.lkm==1) DrawRectangle3D(Form.cwidth - 17,41,14,14,0xC7C7C7,0xFFFFFF);
|
2013-03-31 22:25:54 +02:00
|
|
|
|
WHILE (m.lkm==1) && (files.first>0)
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
2013-03-31 22:25:54 +02:00
|
|
|
|
pause(8);
|
|
|
|
|
files.first--;
|
2013-03-11 19:16:24 +01:00
|
|
|
|
List_ReDraw();
|
|
|
|
|
m.get();
|
|
|
|
|
}
|
2015-02-21 13:24:30 +01:00
|
|
|
|
DrawRectangle3D(Form.cwidth - 17,41,14,14,0xFFFFFF,0xC7C7C7);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m.x>=Form.width-26) && (m.x<=Form.width-6) && (m.y>onTop(22,0)+1) && (m.y<onTop(22,0)+16)
|
|
|
|
|
{
|
2015-02-21 13:24:30 +01:00
|
|
|
|
IF (m.lkm==1) DrawRectangle3D(Form.cwidth - 17,onTop(21,0),14,14,0xC7C7C7,0xFFFFFF);
|
2013-03-31 22:25:54 +02:00
|
|
|
|
while (m.lkm==1) && (files.first<files.count-files.visible)
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
2013-03-31 22:25:54 +02:00
|
|
|
|
pause(8);
|
|
|
|
|
files.first++;
|
2013-03-11 19:16:24 +01:00
|
|
|
|
List_ReDraw();
|
|
|
|
|
m.get();
|
|
|
|
|
}
|
2015-02-21 13:24:30 +01:00
|
|
|
|
DrawRectangle3D(Form.cwidth - 17,onTop(21,0),14,14,0xFFFFFF,0xC7C7C7);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
}
|
|
|
|
|
|
2013-03-31 22:25:54 +02:00
|
|
|
|
//Scrooll
|
|
|
|
|
if (!m.lkm) && (scroll_used) { scroll_used=NULL; Scroll(); }
|
|
|
|
|
if (m.x>=Form.width-26) && (m.x<=Form.width-6) && (m.y>56) && (m.y<Form.height) && (m.lkm) && (!scroll_used) {scroll_used=1;Scroll();}
|
2013-03-11 19:16:24 +01:00
|
|
|
|
|
|
|
|
|
if (scroll_used)
|
|
|
|
|
{
|
2015-03-19 14:49:26 +01:00
|
|
|
|
IF (sc_slider_h/2+files.y>m.y) || (m.y<0) || (m.y>4000) m.y=sc_slider_h/2+files.y; //anee eo?ni? iaa ieiii
|
2013-03-31 22:25:54 +02:00
|
|
|
|
id=files.first;
|
2015-03-19 14:49:26 +01:00
|
|
|
|
j= sc_slider_h/2;
|
2013-10-17 01:48:20 +02:00
|
|
|
|
files.first = m.y -j -files.y * files.count;
|
|
|
|
|
files.first /= onTop(22,files.y);
|
2013-03-31 22:25:54 +02:00
|
|
|
|
IF (files.visible+files.first>files.count) files.first=files.count-files.visible;
|
2013-04-04 19:07:38 +02:00
|
|
|
|
IF (id!=files.first) List_ReDraw();
|
2013-03-11 19:16:24 +01:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
//Button pressed-----------------------------------------------------------------------------
|
|
|
|
|
case evButton:
|
|
|
|
|
id=GetButtonID();
|
2013-10-22 00:24:36 +02:00
|
|
|
|
if (id==1)
|
|
|
|
|
{
|
|
|
|
|
KillProcess(about_window);
|
|
|
|
|
ExitProcess();
|
|
|
|
|
}
|
2013-04-01 17:41:17 +02:00
|
|
|
|
if (del_active)
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
|
|
|
|
IF (id==301) || (id==302) Del_File(302-id);
|
|
|
|
|
break;
|
|
|
|
|
}
|
2015-05-14 18:09:36 +02:00
|
|
|
|
if (new_element_active)
|
|
|
|
|
{
|
|
|
|
|
IF (id==301) || (id==302) NewElement(302-id);
|
|
|
|
|
break;
|
|
|
|
|
}
|
2013-04-01 17:41:17 +02:00
|
|
|
|
|
2013-03-11 19:16:24 +01:00
|
|
|
|
switch(id)
|
|
|
|
|
{
|
|
|
|
|
case 21: //Back
|
|
|
|
|
GoBack();
|
|
|
|
|
break;
|
|
|
|
|
case 22: //Forward
|
|
|
|
|
if (HistoryPath(GO_FORWARD))
|
|
|
|
|
{
|
2013-03-31 22:25:54 +02:00
|
|
|
|
files.first=files.current=NULL; //aaa?o nienea
|
2013-03-11 19:16:24 +01:00
|
|
|
|
Open_Dir(#path,WITH_REDRAW);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 23: //up!
|
|
|
|
|
Dir_Up();
|
|
|
|
|
break;
|
|
|
|
|
case 24: //cut
|
2013-08-03 15:11:35 +02:00
|
|
|
|
Copy(#file_path, CUT);
|
2013-04-04 19:07:38 +02:00
|
|
|
|
break;
|
2013-03-11 19:16:24 +01:00
|
|
|
|
case 25: //copy
|
2013-08-03 15:11:35 +02:00
|
|
|
|
Copy(#file_path, NOCUT);
|
2013-04-04 19:07:38 +02:00
|
|
|
|
break;
|
2013-03-11 19:16:24 +01:00
|
|
|
|
case 26: //paste
|
2015-07-16 03:44:30 +02:00
|
|
|
|
copy_stak = malloc(4096);
|
|
|
|
|
CreateThread(#Paste,copy_stak+4092);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
break;
|
|
|
|
|
case 31...33: //sort
|
2013-10-14 00:18:41 +02:00
|
|
|
|
IF(sort_num==1) DrawFilledBar(sorting_arrow_x,42,6,10);
|
|
|
|
|
IF(sort_num==2) DrawFilledBar(sorting_arrow_x,42,6,10);
|
|
|
|
|
IF(sort_num==3) DrawFilledBar(sorting_arrow_x,42,6,10);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
sort_num=id-30;
|
2013-03-31 22:25:54 +02:00
|
|
|
|
Open_Dir(#path,WITH_REDRAW);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
break;
|
2013-03-31 22:25:54 +02:00
|
|
|
|
case 50...60: //Actions
|
2013-04-04 19:07:38 +02:00
|
|
|
|
FnProcess(id-50);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
break;
|
|
|
|
|
case 100...120:
|
|
|
|
|
DEVICE_MARK:
|
2013-04-04 19:07:38 +02:00
|
|
|
|
DrawRectangle(17,id-100*16+74,159,16, 0); //auaaeaiea
|
2013-03-11 19:16:24 +01:00
|
|
|
|
strcpy(#path, #disk_list[id-100].Item);
|
2013-03-31 22:25:54 +02:00
|
|
|
|
files.first=files.current=0;
|
2013-04-04 19:07:38 +02:00
|
|
|
|
Open_Dir(#path,WITH_REDRAW);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
pause(5);
|
2013-04-04 19:07:38 +02:00
|
|
|
|
DrawRectangle(17,id-100*16+74,159,16, 0xFFFFFF);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
//Key pressed-----------------------------------------------------------------------------
|
|
|
|
|
case evKey:
|
|
|
|
|
key = GetKey();
|
|
|
|
|
if (Form.status_window>2) break;
|
|
|
|
|
IF (del_active)
|
|
|
|
|
{
|
|
|
|
|
IF (key==013) Del_File(true);
|
|
|
|
|
IF (key==027) Del_File(false);
|
|
|
|
|
break;
|
|
|
|
|
}
|
2015-05-14 18:09:36 +02:00
|
|
|
|
IF (new_element_active)
|
|
|
|
|
{
|
|
|
|
|
IF (key==027) NewElement(0);
|
2015-05-15 14:32:26 +02:00
|
|
|
|
IF (key==013) NewElement(1);
|
2015-05-14 18:09:36 +02:00
|
|
|
|
EAX=key<<8;
|
|
|
|
|
edit_box_key stdcall (#new_file_ed);
|
|
|
|
|
break;
|
|
|
|
|
}
|
2013-04-04 19:07:38 +02:00
|
|
|
|
IF (edit2.flags!=64) && (key!=13) && (key!=27)
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
|
|
|
|
EAX=key<<8;
|
|
|
|
|
edit_box_key stdcall (#edit2);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
switch (key)
|
|
|
|
|
{
|
|
|
|
|
case 209...217:
|
|
|
|
|
id=key-110;
|
|
|
|
|
IF (id-100>=disc_num) break;
|
|
|
|
|
GOTO DEVICE_MARK;
|
2015-03-08 20:19:24 +01:00
|
|
|
|
case ASCII_KEY_BS:
|
2013-03-11 19:16:24 +01:00
|
|
|
|
//GoBack();
|
|
|
|
|
Dir_Up();
|
|
|
|
|
break;
|
2013-03-31 22:25:54 +02:00
|
|
|
|
case 004: //Ctrl+D set as bg
|
2013-03-11 19:16:24 +01:00
|
|
|
|
strcpy(#temp, "\\S__");
|
|
|
|
|
strcat(#temp, #file_path);
|
|
|
|
|
RunProgram("/sys/media/kiv", #temp);
|
|
|
|
|
break;
|
2013-03-31 22:25:54 +02:00
|
|
|
|
case 014: //Ctrl+N new window
|
2013-03-11 19:16:24 +01:00
|
|
|
|
IF (Form.left==98) MoveSize(Form.left-20,Form.top-20,OLD,OLD);
|
|
|
|
|
RunProgram("/sys/File Managers/Eolite", #path);
|
|
|
|
|
break;
|
|
|
|
|
case 024: //Ctrl+X
|
2013-04-04 19:07:38 +02:00
|
|
|
|
Copy(#file_path, CUT);
|
|
|
|
|
break;
|
2013-03-11 19:16:24 +01:00
|
|
|
|
case 003: //Ctrl+C
|
2013-04-04 19:07:38 +02:00
|
|
|
|
Copy(#file_path, NOCUT);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
break;
|
|
|
|
|
case 022: //Ctrl+V
|
2015-07-16 03:44:30 +02:00
|
|
|
|
copy_stak = malloc(4096);
|
|
|
|
|
CreateThread(#Paste,copy_stak+4092);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
break;
|
2015-03-09 16:14:09 +01:00
|
|
|
|
case 001: //Ctrl+A
|
|
|
|
|
debugln("press Ctrl+A");
|
|
|
|
|
for (i=0; i<files.count; i++)
|
|
|
|
|
{
|
|
|
|
|
selected_offset = file_mas[i]*304 + buf+32 + 7;
|
|
|
|
|
ESBYTE[selected_offset] = 1;
|
2015-03-09 19:02:10 +01:00
|
|
|
|
selected_count++;
|
2015-03-09 16:14:09 +01:00
|
|
|
|
}
|
|
|
|
|
List_ReDraw();
|
|
|
|
|
break;
|
|
|
|
|
case 021: //Ctrl+U
|
|
|
|
|
debugln("press Ctrl+A");
|
|
|
|
|
for (i=0; i<files.count; i++)
|
|
|
|
|
{
|
|
|
|
|
selected_offset = file_mas[i]*304 + buf+32 + 7;
|
|
|
|
|
ESBYTE[selected_offset] = 0;
|
|
|
|
|
}
|
2015-03-09 19:02:10 +01:00
|
|
|
|
selected_count = 0;
|
2015-03-09 16:14:09 +01:00
|
|
|
|
List_ReDraw();
|
|
|
|
|
break;
|
2015-03-08 20:19:24 +01:00
|
|
|
|
case ASCII_KEY_ESC:
|
2013-03-11 19:16:24 +01:00
|
|
|
|
break;
|
2015-03-08 20:19:24 +01:00
|
|
|
|
case ASCII_KEY_ENTER:
|
2015-02-21 21:12:52 +01:00
|
|
|
|
Open(0);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
break;
|
2013-10-29 22:50:46 +01:00
|
|
|
|
case 074: //menu
|
|
|
|
|
menu_call_mouse=0;
|
2015-07-16 03:44:30 +02:00
|
|
|
|
//SwitchToAnotherThread();
|
|
|
|
|
menu_stak = malloc(4096);
|
|
|
|
|
CreateThread(#FileMenu,menu_stak+4092);
|
2013-10-29 22:50:46 +01:00
|
|
|
|
break;
|
2013-10-22 00:24:36 +02:00
|
|
|
|
case 173: //Ctrl+Enter
|
2013-11-14 01:22:55 +01:00
|
|
|
|
if (!itdir) ShowOpenWithDialog();
|
2015-02-21 21:12:52 +01:00
|
|
|
|
else Open(1);
|
2013-10-22 00:24:36 +02:00
|
|
|
|
break;
|
2015-03-08 20:19:24 +01:00
|
|
|
|
case ASCII_KEY_UP:
|
2013-04-04 19:07:38 +02:00
|
|
|
|
List_Current(-1);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
break;
|
2015-03-08 20:19:24 +01:00
|
|
|
|
case ASCII_KEY_DOWN:
|
2013-04-04 19:07:38 +02:00
|
|
|
|
List_Current(1);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
break;
|
2015-03-08 20:19:24 +01:00
|
|
|
|
case ASCII_KEY_HOME:
|
2013-10-22 00:11:23 +02:00
|
|
|
|
if (files.KeyHome()) List_ReDraw();
|
2013-03-11 19:16:24 +01:00
|
|
|
|
break;
|
2015-03-08 20:19:24 +01:00
|
|
|
|
case ASCII_KEY_END:
|
2013-10-22 00:11:23 +02:00
|
|
|
|
if (files.KeyEnd()) List_ReDraw();
|
2013-03-11 19:16:24 +01:00
|
|
|
|
break;
|
2015-03-08 20:19:24 +01:00
|
|
|
|
case ASCII_KEY_PGDN:
|
2013-04-04 19:07:38 +02:00
|
|
|
|
List_Current(files.visible-1);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
break;
|
2015-03-08 20:19:24 +01:00
|
|
|
|
case ASCII_KEY_PGUP:
|
2013-04-04 19:07:38 +02:00
|
|
|
|
List_Current(-files.visible+1);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
break;
|
2015-03-08 20:19:24 +01:00
|
|
|
|
case ASCII_KEY_DEL:
|
2013-03-11 19:16:24 +01:00
|
|
|
|
Del_Form();
|
2013-03-31 22:25:54 +02:00
|
|
|
|
break;
|
2015-03-08 20:19:24 +01:00
|
|
|
|
case ASCII_KEY_INS:
|
2014-04-26 11:49:20 +02:00
|
|
|
|
selected_offset = file_mas[files.current+files.first]*304 + buf+32 + 7;
|
2015-03-09 19:02:10 +01:00
|
|
|
|
if (ESBYTE[selected_offset])
|
|
|
|
|
{
|
|
|
|
|
ESBYTE[selected_offset]=0;
|
|
|
|
|
selected_count--;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ESBYTE[selected_offset] = 1;
|
|
|
|
|
selected_count++;
|
|
|
|
|
}
|
2014-04-26 11:49:20 +02:00
|
|
|
|
List_Current(1);
|
2014-03-26 13:51:42 +01:00
|
|
|
|
break;
|
2015-02-21 21:12:52 +01:00
|
|
|
|
case 048...059: //F1-F10
|
2013-04-04 19:07:38 +02:00
|
|
|
|
FnProcess(key-49);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
break;
|
|
|
|
|
default:
|
2013-03-31 22:25:54 +02:00
|
|
|
|
for (i=files.current+files.first+1; i<files.count; i++)
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
|
|
|
|
strcpy(#temp, file_mas[i]*304+buf+72);
|
|
|
|
|
IF (temp[0]==key) || (temp[0]==key-32)
|
|
|
|
|
{
|
2013-04-04 19:07:38 +02:00
|
|
|
|
List_Current(i-files.current-files.first);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case evReDraw:
|
|
|
|
|
draw_window();
|
2013-10-17 01:48:20 +02:00
|
|
|
|
if (action_buf) { menu_action(action_buf); action_buf=0;}
|
2013-03-11 19:16:24 +01:00
|
|
|
|
}
|
2015-07-16 03:44:30 +02:00
|
|
|
|
if(cmd_free){
|
|
|
|
|
if(cmd_free==1) free(menu_stak);
|
|
|
|
|
else if(cmd_free==2)free(about_stak);
|
|
|
|
|
else if(cmd_free==3)free(properties_stak);
|
|
|
|
|
else if(cmd_free==4)free(settings_stak);
|
|
|
|
|
else if(cmd_free==5)free(copy_stak);
|
|
|
|
|
cmd_free = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
2013-03-11 19:16:24 +01:00
|
|
|
|
}
|
|
|
|
|
|
2013-11-14 01:22:55 +01:00
|
|
|
|
|
2015-02-20 16:25:51 +01:00
|
|
|
|
inline fastcall signed int _strrchr( ESI,BL)
|
|
|
|
|
{
|
|
|
|
|
int jj=0, last=strlen(ESI);
|
|
|
|
|
do{
|
|
|
|
|
jj++;
|
|
|
|
|
$lodsb
|
|
|
|
|
IF(AL==BL) last=jj;
|
|
|
|
|
} while(AL!=0);
|
|
|
|
|
return last;
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-14 01:22:55 +01:00
|
|
|
|
|
2013-10-15 01:16:04 +02:00
|
|
|
|
void menu_action(dword id)
|
|
|
|
|
{
|
|
|
|
|
if (id==COPY_PASTE_END)
|
|
|
|
|
{
|
|
|
|
|
FnProcess(5);
|
|
|
|
|
SelectFile(#copy_to+strrchr(#copy_to,'/'));
|
|
|
|
|
}
|
2015-02-21 21:12:52 +01:00
|
|
|
|
if (id==100) Open(0);
|
2013-11-14 01:22:55 +01:00
|
|
|
|
if (id==201) ShowOpenWithDialog();
|
2013-10-15 01:16:04 +02:00
|
|
|
|
if (id==202) FnProcess(3); //F3
|
|
|
|
|
if (id==203) FnProcess(4); //F4
|
|
|
|
|
if (id==104) Copy(#file_path, NOCUT);
|
|
|
|
|
if (id==105) Copy(#file_path, CUT);
|
2015-07-16 03:44:30 +02:00
|
|
|
|
if (id==106) { copy_stak = malloc(4096); CreateThread(#Paste,copy_stak+4092);}
|
2013-10-15 17:51:05 +02:00
|
|
|
|
if (id==207) FnProcess(2);
|
2013-10-15 01:16:04 +02:00
|
|
|
|
if (id==108) Del_Form();
|
|
|
|
|
if (id==109) FnProcess(5);
|
2015-02-22 19:42:51 +01:00
|
|
|
|
if (id==110) FnProcess(8);
|
2015-02-19 08:42:42 +01:00
|
|
|
|
if (id==300) { FnProcess(5); List_ReDraw(); }
|
2013-10-15 01:16:04 +02:00
|
|
|
|
}
|
|
|
|
|
|
2013-03-11 19:16:24 +01:00
|
|
|
|
|
2013-04-04 19:07:38 +02:00
|
|
|
|
void draw_window()
|
|
|
|
|
{
|
2014-04-20 15:00:51 +02:00
|
|
|
|
DefineAndDrawWindow(GetScreenWidth()-550/4+rand_n,rand_n+30,550,500,0x73,sc.work,TITLE,0);
|
2013-04-04 19:07:38 +02:00
|
|
|
|
GetProcessInfo(#Form, SelfInfo);
|
|
|
|
|
if (Form.status_window>2) return;
|
2015-02-21 13:24:30 +01:00
|
|
|
|
files.SetSizes(192, 57, Form.cwidth - 210, onTop(57,6), disc_num*16+195,files.line_h);
|
2013-04-04 19:07:38 +02:00
|
|
|
|
if (Form.height < files.min_h) MoveSize(OLD,OLD,OLD,files.min_h);
|
|
|
|
|
if (Form.width<480) MoveSize(OLD,OLD,480,OLD);
|
|
|
|
|
GetProcessInfo(#Form, SelfInfo); //if win_size changed
|
|
|
|
|
|
2013-03-11 19:16:24 +01:00
|
|
|
|
PutPaletteImage(#toolbar,246,34,0,0,8,#toolbar_pal);
|
2013-10-23 19:55:07 +02:00
|
|
|
|
DrawBar(127, 8, 1, 25, sc.work_graph);
|
|
|
|
|
for (j=0; j<3; j++) DefineButton(toolbar_buttons_x[j]+2,5+2,31-5,29-5,21+j+BT_HIDE,sc.work);
|
|
|
|
|
for (j=3; j<6; j++) DefineButton(toolbar_buttons_x[j],5,31,29,21+j+BT_HIDE,sc.work);
|
2015-02-21 13:24:30 +01:00
|
|
|
|
DrawBar(246,0,Form.cwidth - 297,12, sc.work); //upper editbox
|
|
|
|
|
DrawBar(246,29,Form.cwidth - 297,5,sc.work); //under editbox
|
|
|
|
|
DrawRectangle(246,12,Form.cwidth - 303,16,sc.work_graph);
|
2015-07-16 03:44:30 +02:00
|
|
|
|
DefineButton(Form.cwidth - 32,6,27,28,51+BT_HIDE+BT_NOFRAME,0); //about
|
2013-03-11 19:16:24 +01:00
|
|
|
|
PutPaletteImage(#goto_about,56,34,Form.width-65,0,8,#goto_about_pal);
|
2013-03-31 22:25:54 +02:00
|
|
|
|
//main rectangles
|
2013-10-23 19:55:07 +02:00
|
|
|
|
DrawRectangle(1,40,Form.cwidth-3,onTop(46,0),sc.work_graph);
|
2013-04-04 19:07:38 +02:00
|
|
|
|
DrawRectangle(0,39,Form.cwidth-1,onTop(44,0),col_palette[4]); //bg
|
2013-03-11 19:16:24 +01:00
|
|
|
|
for (i=0; i<5; i++) DrawBar(0, 34+i, Form.cwidth, 1, col_palette[8-i]);
|
|
|
|
|
DrawLeftPanel();
|
2013-03-31 22:25:54 +02:00
|
|
|
|
//ListBox
|
2015-02-21 22:32:15 +01:00
|
|
|
|
DrawFlatButton(files.x,40,Form.cwidth - files.x - 159,16,31,sc.work,T_FILE);
|
|
|
|
|
DrawFlatButton(Form.cwidth - 159,40,73,16,32,sc.work,T_TYPE);
|
|
|
|
|
DrawFlatButton(Form.cwidth - 86,40,68,16,33,sc.work,T_SIZE);
|
2013-10-23 19:55:07 +02:00
|
|
|
|
DrawBar(files.x+files.w,files.y,1,onTop(22,files.y),sc.work_graph); //line to the left from the scroll
|
|
|
|
|
DrawFlatButton(files.x+files.w,40,16,16,0,sc.work,"\x18");
|
|
|
|
|
DrawFlatButton(files.x+files.w,onTop(22,0),16,16,0,sc.work,"\x19");
|
2013-03-11 19:16:24 +01:00
|
|
|
|
Open_Dir(#path,ONLY_SHOW);
|
|
|
|
|
if (del_active) Del_Form();
|
2015-07-19 20:45:59 +02:00
|
|
|
|
if (new_element_active) NewElement_Form(new_element_active, #new_element_name);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void KEdit()
|
|
|
|
|
{
|
2013-03-31 22:25:54 +02:00
|
|
|
|
if (Form.width<480) return;
|
2013-03-11 19:16:24 +01:00
|
|
|
|
PathShow.area_size_x = Form.cwidth-306;
|
|
|
|
|
DrawBar(PathShow.start_x-3, PathShow.start_y-4, PathShow.area_size_x+2, 15, 0xFFFfff);
|
|
|
|
|
PathShow_prepare stdcall(#PathShow);
|
|
|
|
|
PathShow_draw stdcall(#PathShow);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2015-03-08 20:19:24 +01:00
|
|
|
|
void List_Current(signed int cur)
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
2013-03-31 22:25:54 +02:00
|
|
|
|
if (cur<=0) //up
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
2013-03-31 22:25:54 +02:00
|
|
|
|
IF (files.first==0) && (files.current<=0) return;
|
|
|
|
|
IF (-cur-1<files.current)
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
2013-03-31 22:25:54 +02:00
|
|
|
|
Line_ReDraw(0xFFFFFF, files.current);
|
|
|
|
|
files.current+=cur;
|
|
|
|
|
Line_ReDraw(col_selec, files.current);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
ELSE
|
|
|
|
|
{
|
2013-03-31 22:25:54 +02:00
|
|
|
|
IF (-cur<files.first) files.first+=cur; ELSE files.first=0;
|
|
|
|
|
files.current=0;
|
2013-03-11 19:16:24 +01:00
|
|
|
|
List_ReDraw();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
2013-03-31 22:25:54 +02:00
|
|
|
|
else //down
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
2015-03-08 20:19:24 +01:00
|
|
|
|
IF (files.first==files.count-files.visible) && (files.current==files.visible-1)
|
|
|
|
|
{
|
|
|
|
|
Line_ReDraw(col_selec, files.current);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2013-03-31 22:25:54 +02:00
|
|
|
|
IF (files.visible-files.current>cur)
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
2013-03-31 22:25:54 +02:00
|
|
|
|
Line_ReDraw(0xFFFFFF, files.current);
|
|
|
|
|
files.current+=cur;
|
|
|
|
|
Line_ReDraw(col_selec, files.current);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2013-03-31 22:25:54 +02:00
|
|
|
|
IF(files.first+files.current+cur>=files.count)
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
2013-03-31 22:25:54 +02:00
|
|
|
|
files.first=files.count-files.visible;
|
|
|
|
|
files.current=cur-files.first+files.current;
|
2013-03-11 19:16:24 +01:00
|
|
|
|
}
|
|
|
|
|
ELSE
|
|
|
|
|
{
|
2013-03-31 22:25:54 +02:00
|
|
|
|
files.first+=cur+files.current-files.visible+1;
|
|
|
|
|
files.current=files.visible-1;
|
2013-03-11 19:16:24 +01:00
|
|
|
|
}
|
|
|
|
|
|
2013-03-31 22:25:54 +02:00
|
|
|
|
IF (files.current<0) || (files.current>files.visible)
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
2013-03-31 22:25:54 +02:00
|
|
|
|
files.current=files.visible-1;
|
2013-03-11 19:16:24 +01:00
|
|
|
|
}
|
|
|
|
|
List_ReDraw();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void List_ReDraw()
|
|
|
|
|
{
|
2013-03-31 22:25:54 +02:00
|
|
|
|
int paint_y;
|
2013-08-31 19:20:15 +02:00
|
|
|
|
//we are in the end of the list => maximize window => there will be white lines after the last element
|
2013-03-31 22:25:54 +02:00
|
|
|
|
if (files.count-files.first<files.visible) || (files.current>files.visible-1)
|
|
|
|
|
{ files.first=files.count-files.visible; files.current=files.visible-1; }
|
2013-04-04 19:07:38 +02:00
|
|
|
|
for (j=0; j<files.visible; j++) if (files.current!=j) Line_ReDraw(0xFFFFFF, j); else Line_ReDraw(col_selec, files.current);
|
2013-03-31 22:25:54 +02:00
|
|
|
|
//in the bottom
|
|
|
|
|
paint_y = j * files.line_h + files.y;
|
|
|
|
|
DrawBar(files.x,paint_y,files.w,onTop(paint_y,6),0xFFFFFF);
|
2013-10-23 19:55:07 +02:00
|
|
|
|
DrawBar(Form.cwidth-159,paint_y,1,onTop(paint_y,6),sc.work);
|
|
|
|
|
DrawBar(Form.cwidth-86,paint_y,1,onTop(paint_y,6),sc.work);
|
2013-03-31 22:25:54 +02:00
|
|
|
|
Scroll();
|
2013-03-11 19:16:24 +01:00
|
|
|
|
}
|
|
|
|
|
|
2013-04-04 19:07:38 +02:00
|
|
|
|
|
2013-03-11 19:16:24 +01:00
|
|
|
|
void Line_ReDraw(dword color, filenum){
|
2013-04-12 02:15:39 +02:00
|
|
|
|
dword text_col=0,
|
2015-02-27 21:25:28 +01:00
|
|
|
|
ext1, attr,
|
2014-04-26 11:49:20 +02:00
|
|
|
|
file_offet,
|
|
|
|
|
file_name_off,
|
2013-10-17 01:48:20 +02:00
|
|
|
|
y=filenum*files.line_h+files.y;
|
2014-04-26 11:49:20 +02:00
|
|
|
|
BDVK file;
|
2014-04-20 11:01:20 +02:00
|
|
|
|
if (filenum==-1) return;
|
2013-04-05 02:26:21 +02:00
|
|
|
|
DrawBar(files.x,y,3,files.line_h,color);
|
|
|
|
|
DrawBar(files.x+19,y,files.w-19,files.line_h,color);
|
|
|
|
|
DrawBar(files.x+3,y+17,16,1,color);
|
|
|
|
|
if (files.line_h>18) DrawBar(files.x+3,y+18,16,files.line_h-18,color);
|
|
|
|
|
if (files.line_h>15) DrawBar(files.x+3,y,16,files.line_h-15,color);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
|
2014-04-26 11:49:20 +02:00
|
|
|
|
file_offet = file_mas[filenum+files.first]*304 + buf+32;
|
2015-02-27 21:25:28 +01:00
|
|
|
|
attr = ESDWORD[file_offet];
|
2014-04-26 11:49:20 +02:00
|
|
|
|
file.selected = ESBYTE[file_offet+7];
|
|
|
|
|
file.sizelo = ESDWORD[file_offet+32];
|
|
|
|
|
file_name_off = file_offet+40;
|
2013-03-11 19:16:24 +01:00
|
|
|
|
|
2015-02-27 21:25:28 +01:00
|
|
|
|
if (! TestBit(attr, 4) ) //file or folder?
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
2014-04-26 11:49:20 +02:00
|
|
|
|
Put_icon(file_name_off+_strrchr(file_name_off,'.'), files.x+3, files.line_h/2-7+y, color, 0);
|
2015-03-19 14:49:26 +01:00
|
|
|
|
WriteText(7-strlen(ConvertSize(file.sizelo))*6+Form.cwidth - 76,files.line_h-6/2+y,font_type,0,ConvertSize(file.sizelo));
|
2013-03-11 19:16:24 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
2014-04-17 20:07:07 +02:00
|
|
|
|
{
|
2014-04-26 11:49:20 +02:00
|
|
|
|
if (strcmp("..",file_name_off)==0) ext1=".."; else ext1="<DIR>";
|
2014-04-17 20:07:07 +02:00
|
|
|
|
Put_icon(ext1, files.x+3, files.line_h/2-7+y, color, 0);
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-27 21:25:28 +01:00
|
|
|
|
if (TestBit(attr, 1)) || (TestBit(attr, 2)) text_col=0xA6A6B7; //system or hiden?
|
2013-04-04 19:07:38 +02:00
|
|
|
|
if (color!=0xFFFfff)
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
2015-02-27 21:25:28 +01:00
|
|
|
|
itdir = TestBit(attr, 4);
|
2014-04-26 11:49:20 +02:00
|
|
|
|
strcpy(#file_name, file_name_off);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
strcpy(#file_path, #path);
|
2013-03-31 22:25:54 +02:00
|
|
|
|
strcat(#file_path, #file_name);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
if (text_col==0xA6A6B7) text_col=0xFFFFFF;
|
|
|
|
|
}
|
2014-04-26 11:49:20 +02:00
|
|
|
|
if (file.selected) text_col=0xFF0000;
|
2013-03-31 22:25:54 +02:00
|
|
|
|
if (Form.width>=480)
|
|
|
|
|
{
|
2013-04-05 02:26:21 +02:00
|
|
|
|
FileShow.start_x = files.x + 23;
|
2013-03-31 22:25:54 +02:00
|
|
|
|
FileShow.font_color = text_col;
|
|
|
|
|
FileShow.area_size_x = Form.width - 380;
|
2014-04-26 11:49:20 +02:00
|
|
|
|
FileShow.text_pointer = file_name_off;
|
|
|
|
|
FileShow.start_y = files.text_y+y;
|
2013-03-31 22:25:54 +02:00
|
|
|
|
PathShow_prepare stdcall(#FileShow);
|
|
|
|
|
PathShow_draw stdcall(#FileShow);
|
|
|
|
|
}
|
2013-10-23 19:55:07 +02:00
|
|
|
|
DrawBar(Form.cwidth-159,y,1,files.line_h,sc.work); //gray line 1
|
|
|
|
|
DrawBar(Form.cwidth-86,y,1,files.line_h,sc.work); //gray line 2
|
2013-03-11 19:16:24 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2013-04-04 19:07:38 +02:00
|
|
|
|
void Open_Dir(dword dir_path, redraw){
|
|
|
|
|
int errornum, maxcount;
|
2013-03-31 22:25:54 +02:00
|
|
|
|
|
2013-04-04 19:07:38 +02:00
|
|
|
|
if (redraw!=ONLY_SHOW)
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
2013-04-04 19:07:38 +02:00
|
|
|
|
if (ESBYTE[dir_path+1]!='\0') ESBYTE[dir_path+strlen(dir_path)-1] = '\0';
|
2013-03-11 19:16:24 +01:00
|
|
|
|
if (buf) free(buf);
|
2013-04-04 19:07:38 +02:00
|
|
|
|
errornum = GetDir(#buf, #files.count, dir_path, DIRS_NOROOT);
|
|
|
|
|
if (ESBYTE[dir_path+1]!='\0') chrcat(dir_path, '/');
|
|
|
|
|
if (errornum)
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
|
|
|
|
HistoryPath(ADD_NEW_PATH);
|
|
|
|
|
GoBack();
|
|
|
|
|
Write_Error(errornum);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2013-04-04 19:07:38 +02:00
|
|
|
|
maxcount = sizeof(file_mas)/sizeof(dword)-1;
|
2013-11-14 01:22:55 +01:00
|
|
|
|
if (files.count>maxcount) files.count = maxcount;
|
2014-04-20 11:01:20 +02:00
|
|
|
|
if (files.count>0) && (files.current==-1) files.current=0;
|
2013-03-11 19:16:24 +01:00
|
|
|
|
}
|
2013-04-04 19:07:38 +02:00
|
|
|
|
if (files.count!=-1)
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
|
|
|
|
KEdit();
|
|
|
|
|
HistoryPath(ADD_NEW_PATH);
|
2013-04-04 19:07:38 +02:00
|
|
|
|
files.visible = files.h / files.line_h;
|
|
|
|
|
IF (files.count < files.visible) files.visible = files.count;
|
2013-10-14 00:18:41 +02:00
|
|
|
|
IF (sort_num==1) sorting_arrow_x = Form.width+60/2;
|
|
|
|
|
IF (sort_num==2) sorting_arrow_x = Form.width-115;
|
|
|
|
|
IF (sort_num==3) sorting_arrow_x = strlen(T_SIZE)*3-30+files.x+files.w;
|
2013-10-23 19:55:07 +02:00
|
|
|
|
WriteText(sorting_arrow_x,45,0x80,sc.work_graph,"\x19");
|
2013-04-04 19:07:38 +02:00
|
|
|
|
IF (redraw!=ONLY_SHOW) Sorting();
|
|
|
|
|
IF (redraw!=ONLY_OPEN) List_ReDraw();
|
2013-03-11 19:16:24 +01:00
|
|
|
|
}
|
2013-04-04 19:07:38 +02:00
|
|
|
|
IF (files.count==-1) && (redraw!=ONLY_OPEN) {files.visible=files.count=0; List_ReDraw();}
|
2013-03-11 19:16:24 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline Sorting()
|
|
|
|
|
{
|
|
|
|
|
dword k=0, l=1;
|
2014-04-26 11:49:20 +02:00
|
|
|
|
dword file_off;
|
2013-03-11 19:16:24 +01:00
|
|
|
|
int i;
|
2013-03-31 22:25:54 +02:00
|
|
|
|
if (!strcmp(#path,"/")) //do not sort
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
2013-03-31 22:25:54 +02:00
|
|
|
|
FOR(k=1;k<files.count;k++;) file_mas[k]=k;
|
2013-03-11 19:16:24 +01:00
|
|
|
|
return;
|
|
|
|
|
}
|
2014-04-26 11:49:20 +02:00
|
|
|
|
FOR (j=files.count-1, file_off=files.count-1*304+buf+32; j>=0; j--, file_off-=304;) //files | folders
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
2014-04-26 11:49:20 +02:00
|
|
|
|
if (!real_files_names_case) strttl(file_off+40);
|
|
|
|
|
if (TestBit(ESDWORD[file_off],4)) //directory?
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
|
|
|
|
file_mas[k]=j;
|
|
|
|
|
k++;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2013-03-31 22:25:54 +02:00
|
|
|
|
file_mas[files.count-l]=j;
|
2013-03-11 19:16:24 +01:00
|
|
|
|
l++;
|
|
|
|
|
}
|
|
|
|
|
}
|
2013-03-31 22:25:54 +02:00
|
|
|
|
//sorting: files first, then folders
|
2013-03-11 19:16:24 +01:00
|
|
|
|
Sort_by_Name(0,k-1);
|
2013-03-31 22:25:54 +02:00
|
|
|
|
IF (sort_num==1) Sort_by_Name(k,files.count-1);
|
|
|
|
|
IF (sort_num==2) Sort_by_Type(k,files.count-1);
|
|
|
|
|
IF (sort_num==3) Sort_by_Size(k,files.count-1);
|
2015-07-19 20:45:59 +02:00
|
|
|
|
//make ".." first item in list
|
2013-04-04 19:07:38 +02:00
|
|
|
|
IF (k>0) && (strcmp(file_mas[0]*304+buf+72,"..")!=0)
|
|
|
|
|
FOR(k--; k>0; k--;) IF (!strcmp(file_mas[k]*304+buf+72,"..")) {file_mas[k]><file_mas[0]; break;}
|
2013-03-11 19:16:24 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Del_Form()
|
|
|
|
|
{
|
2015-03-09 16:14:09 +01:00
|
|
|
|
dword selected_offset2;
|
|
|
|
|
int cont = 0;
|
|
|
|
|
byte f_count[128];
|
2015-07-19 20:45:59 +02:00
|
|
|
|
int dform_x = files.w - 220 / 2 + files.x;
|
2013-10-14 00:18:41 +02:00
|
|
|
|
if (strcmp(#file_name,".")==0) || (strcmp(#file_name,"..")==0) return;
|
2013-10-10 09:16:37 +02:00
|
|
|
|
if (del_active==2)
|
2013-10-09 20:10:23 +02:00
|
|
|
|
{
|
2013-10-10 09:16:37 +02:00
|
|
|
|
if (itdir) ShowMessage(WAIT_DELETING_FOLDER, 0);
|
2013-10-09 20:10:23 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2013-10-10 09:16:37 +02:00
|
|
|
|
if (!files.count) return;
|
2015-07-19 20:45:59 +02:00
|
|
|
|
DrawPopup(dform_x,160,220,85,1,sc.work,sc.work_graph);
|
2013-10-23 19:55:07 +02:00
|
|
|
|
WriteText(-strlen(T_DELETE_FILE)*3+110+dform_x,175,0x80,sc.work_text,T_DELETE_FILE);
|
2015-03-09 16:14:09 +01:00
|
|
|
|
for (i=0; i<files.count; i++)
|
2013-10-10 09:16:37 +02:00
|
|
|
|
{
|
2015-03-09 16:14:09 +01:00
|
|
|
|
selected_offset2 = file_mas[i]*304 + buf+32 + 7;
|
|
|
|
|
if (ESBYTE[selected_offset2]) cont++;
|
|
|
|
|
}
|
|
|
|
|
if (cont)
|
|
|
|
|
{
|
2015-07-16 03:44:30 +02:00
|
|
|
|
sprintf(#f_count,"%s%d%s",DEL_MORE_FILES_1,cont,DEL_MORE_FILES_2);
|
2015-03-09 16:14:09 +01:00
|
|
|
|
WriteText(-strlen(#f_count)*3+110+dform_x,190,0x80,sc.work_text,#f_count);
|
2013-10-10 09:16:37 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2015-03-09 16:14:09 +01:00
|
|
|
|
IF (strlen(#file_name)<28)
|
|
|
|
|
{
|
|
|
|
|
WriteText(strlen(#file_name)*3+110+dform_x+2,190,0x80,sc.work_text,"?");
|
|
|
|
|
WriteText(-strlen(#file_name)*3+110+dform_x,190,0x80,sc.work_text,#file_name);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
WriteText(164+dform_x,190,0x80,0,"...?");
|
|
|
|
|
ESI = 24;
|
|
|
|
|
WriteText(dform_x+20,190,0,0,#file_name);
|
|
|
|
|
}
|
2013-10-10 09:16:37 +02:00
|
|
|
|
}
|
|
|
|
|
DrawFlatButton(dform_x+27,208,70,20,301,0xFFB6B5,T_YES);
|
|
|
|
|
DrawFlatButton(dform_x+120,208,70,20,302,0xC6DFC6,T_NO);
|
|
|
|
|
del_active=1;
|
2013-10-09 20:10:23 +02:00
|
|
|
|
}
|
2013-03-11 19:16:24 +01:00
|
|
|
|
}
|
|
|
|
|
|
2013-10-14 00:18:41 +02:00
|
|
|
|
int del_error;
|
|
|
|
|
int Del_File2(dword way)
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
2013-10-07 00:56:22 +02:00
|
|
|
|
dword dirbuf, fcount, i, filename;
|
2013-10-14 00:18:41 +02:00
|
|
|
|
int error;
|
|
|
|
|
char del_from[4096];
|
|
|
|
|
if (isdir(way))
|
2013-10-10 00:46:17 +02:00
|
|
|
|
{
|
2013-10-14 00:18:41 +02:00
|
|
|
|
if (error = GetDir(#dirbuf, #fcount, way, DIRS_ONLYREAL)) del_error = error;
|
2013-10-10 00:46:17 +02:00
|
|
|
|
for (i=0; i<fcount; i++)
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
2013-10-10 09:16:37 +02:00
|
|
|
|
if (CheckEvent()==evReDraw) draw_window();
|
2013-10-10 00:46:17 +02:00
|
|
|
|
filename = i*304+dirbuf+72;
|
|
|
|
|
strcpy(#del_from, way);
|
|
|
|
|
chrcat(#del_from, '/');
|
|
|
|
|
strcat(#del_from, filename);
|
|
|
|
|
if ( TestBit(ESDWORD[filename-40], 4) )
|
2015-07-19 20:45:59 +02:00
|
|
|
|
{
|
2013-10-10 00:46:17 +02:00
|
|
|
|
Del_File2(#del_from);
|
2015-07-19 20:45:59 +02:00
|
|
|
|
}
|
2013-10-10 00:46:17 +02:00
|
|
|
|
else
|
2013-10-14 00:18:41 +02:00
|
|
|
|
{
|
|
|
|
|
if (error = DeleteFile(#del_from)) del_error = error;
|
|
|
|
|
}
|
2013-03-11 19:16:24 +01:00
|
|
|
|
}
|
2013-10-10 00:46:17 +02:00
|
|
|
|
}
|
2013-10-14 00:18:41 +02:00
|
|
|
|
if (error = DeleteFile(way)) del_error = error;
|
2013-10-07 00:56:22 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Del_File(byte dodel)
|
2013-10-14 00:18:41 +02:00
|
|
|
|
{
|
2014-04-26 00:31:07 +02:00
|
|
|
|
byte del_from[4096];
|
2014-12-03 02:04:03 +01:00
|
|
|
|
dword selected_offset2;
|
|
|
|
|
int tst, count, i;
|
2014-04-26 00:31:07 +02:00
|
|
|
|
|
2013-10-07 00:56:22 +02:00
|
|
|
|
if (dodel==true)
|
|
|
|
|
{
|
2013-10-10 09:16:37 +02:00
|
|
|
|
del_active=2;
|
2013-10-10 00:46:17 +02:00
|
|
|
|
if (itdir) ShowMessage(WAIT_DELETING_FOLDER, 0);
|
2013-10-14 00:18:41 +02:00
|
|
|
|
del_error = 0;
|
2014-12-03 02:04:03 +01:00
|
|
|
|
|
2015-03-09 19:02:10 +01:00
|
|
|
|
if (selected_count)
|
2014-12-03 02:04:03 +01:00
|
|
|
|
{
|
2015-03-09 19:02:10 +01:00
|
|
|
|
for (i=0; i<files.count; i++)
|
|
|
|
|
{
|
|
|
|
|
selected_offset2 = file_mas[i]*304 + buf+32 + 7;
|
|
|
|
|
if (ESBYTE[selected_offset2]) {
|
|
|
|
|
strcpy(#del_from, #path);
|
|
|
|
|
strcat(#del_from, file_mas[i]*304+buf+72);
|
|
|
|
|
Del_File2(#del_from);
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-12-03 02:04:03 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2015-03-09 19:02:10 +01:00
|
|
|
|
Del_File2(#file_path);
|
2014-12-03 02:04:03 +01:00
|
|
|
|
}
|
2013-10-14 00:18:41 +02:00
|
|
|
|
if (del_error) Write_Error(del_error);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
}
|
|
|
|
|
del_active=0;
|
2013-10-10 00:46:17 +02:00
|
|
|
|
DeleteButton(301);
|
|
|
|
|
DeleteButton(302);
|
2013-04-04 19:07:38 +02:00
|
|
|
|
Open_Dir(#path,WITH_REDRAW);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SelectFile(dword that_file)
|
|
|
|
|
{
|
2013-03-31 22:25:54 +02:00
|
|
|
|
files.first=files.current=0;
|
2013-03-11 19:16:24 +01:00
|
|
|
|
Open_Dir(#path,ONLY_OPEN);
|
2013-11-14 01:22:55 +01:00
|
|
|
|
if (!real_files_names_case) strttl(that_file);
|
2013-03-31 22:25:54 +02:00
|
|
|
|
for (i=files.count-1; i>=0; i--;)
|
2013-03-11 19:16:24 +01:00
|
|
|
|
if (!strcmp(file_mas[i]*304+buf+72,that_file)) break;
|
2013-04-04 19:07:38 +02:00
|
|
|
|
List_Current(i);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
List_ReDraw();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Dir_Up()
|
|
|
|
|
{
|
|
|
|
|
char cur_folder[4096];
|
|
|
|
|
i=strlen(#path)-1;
|
|
|
|
|
if (i==0) return;
|
|
|
|
|
path[i]=0x00;
|
|
|
|
|
i = strrchr(#path, '/');
|
|
|
|
|
strcpy(#cur_folder, #path+i);
|
|
|
|
|
path[i]=0x00;
|
|
|
|
|
SelectFile(#cur_folder);
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-21 22:32:15 +01:00
|
|
|
|
void Open(byte rez)
|
2013-03-31 22:25:54 +02:00
|
|
|
|
{
|
2015-02-21 21:12:52 +01:00
|
|
|
|
byte temp[4096];
|
2015-03-09 19:02:10 +01:00
|
|
|
|
selected_count = 0;
|
2015-02-21 21:12:52 +01:00
|
|
|
|
if (rez)
|
|
|
|
|
{
|
|
|
|
|
if (!strcmp(#file_name,"..")) return;
|
|
|
|
|
strcpy(#temp, #file_path);
|
|
|
|
|
if (path[strlen(#temp)-1]!='/') chrcat(#temp, '/'); //need "/" in the end
|
|
|
|
|
RunProgram("/sys/File Managers/Eolite", #temp);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2013-04-04 19:07:38 +02:00
|
|
|
|
if (!files.count) return;
|
2013-04-02 15:39:25 +02:00
|
|
|
|
if (!itdir)
|
2013-03-31 22:25:54 +02:00
|
|
|
|
{
|
2015-02-13 23:54:42 +01:00
|
|
|
|
if (strrchr(#file_name, '.')==0) RunProgram(#file_path, ""); else RunProgram("/sys/@open", #file_path);
|
2013-03-31 22:25:54 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (!strcmp(#file_name,"..")) { Dir_Up(); return; }
|
|
|
|
|
strcpy(#path, #file_path);
|
|
|
|
|
if (path[strlen(#path)-1]!='/') chrcat(#path, '/'); //need "/" in the end
|
|
|
|
|
files.first=files.current=0;
|
2013-04-04 19:07:38 +02:00
|
|
|
|
Open_Dir(#path,WITH_REDRAW);
|
2013-03-31 22:25:54 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2013-03-11 19:16:24 +01:00
|
|
|
|
|
2013-03-31 22:25:54 +02:00
|
|
|
|
inline fastcall void GoBack()
|
2013-03-11 19:16:24 +01:00
|
|
|
|
{
|
|
|
|
|
char cur_folder[4096];
|
|
|
|
|
strcpy(#cur_folder, GetCurrentFolder());
|
|
|
|
|
if (HistoryPath(GO_BACK)) SelectFile(#cur_folder);
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-12 13:52:49 +01:00
|
|
|
|
void ShowOpenWithDialog()
|
|
|
|
|
{
|
|
|
|
|
byte param[4097];
|
|
|
|
|
param[0] = '~';
|
2015-02-12 14:37:18 +01:00
|
|
|
|
param[1] = '\0';
|
2015-02-12 13:52:49 +01:00
|
|
|
|
strcat(#param, #file_path);
|
|
|
|
|
RunProgram("/sys/@open", #param);
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-14 18:09:36 +02:00
|
|
|
|
void NewElement(byte newf)
|
|
|
|
|
{
|
2015-05-15 14:32:26 +02:00
|
|
|
|
BDVK element_info;
|
2015-07-19 20:45:59 +02:00
|
|
|
|
byte del_rezult, copy_rezult, info_result;
|
2015-05-14 18:09:36 +02:00
|
|
|
|
if (newf)
|
|
|
|
|
{
|
|
|
|
|
strcpy(#temp, #path);
|
|
|
|
|
strcat(#temp, new_file_ed.text);
|
2015-07-19 20:45:59 +02:00
|
|
|
|
info_result = GetFileInfo(#temp, #element_info);
|
2015-06-20 00:23:51 +02:00
|
|
|
|
switch(new_element_active)
|
2015-05-14 18:09:36 +02:00
|
|
|
|
{
|
2015-07-19 20:45:59 +02:00
|
|
|
|
case CREATE_FILE:
|
|
|
|
|
if (info_result==5)
|
2015-05-15 14:32:26 +02:00
|
|
|
|
{
|
2015-06-20 00:23:51 +02:00
|
|
|
|
WriteFile(0, 0, #temp);
|
|
|
|
|
if (EAX)
|
|
|
|
|
{
|
|
|
|
|
Write_Error(EAX);
|
|
|
|
|
ShowMessage(NOT_CREATE_FILE, 150);
|
|
|
|
|
}
|
2015-05-15 14:32:26 +02:00
|
|
|
|
}
|
2015-06-20 00:23:51 +02:00
|
|
|
|
else
|
2015-05-15 14:32:26 +02:00
|
|
|
|
{
|
2015-06-20 00:23:51 +02:00
|
|
|
|
notify(FILE_EXISTS);
|
|
|
|
|
}
|
2015-07-19 20:45:59 +02:00
|
|
|
|
break;
|
|
|
|
|
case CREATE_FOLDER:
|
|
|
|
|
if (info_result==5)
|
2015-06-20 00:23:51 +02:00
|
|
|
|
{
|
|
|
|
|
CreateDir(#temp);
|
|
|
|
|
if (EAX)
|
|
|
|
|
{
|
|
|
|
|
Write_Error(EAX);
|
|
|
|
|
ShowMessage(NOT_CREATE_FOLDER, 150);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
notify(FOLDER_EXISTS);
|
|
|
|
|
}
|
2015-07-19 20:45:59 +02:00
|
|
|
|
break;
|
|
|
|
|
case RENAME_ITEM:
|
|
|
|
|
if (info_result==5)
|
2015-06-20 00:23:51 +02:00
|
|
|
|
{
|
|
|
|
|
if (itdir)
|
|
|
|
|
{
|
|
|
|
|
if (del_rezult = DeleteFile(#file_path))
|
|
|
|
|
{
|
|
|
|
|
Write_Error(del_rezult);
|
|
|
|
|
ShowMessage(T_DEL_ERROR_1, 150);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (CreateDir(#temp)) CreateDir(#file_path);
|
|
|
|
|
Open_Dir(#path,WITH_REDRAW);
|
|
|
|
|
SelectFile(new_file_ed.text);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (copy_rezult = CopyFile(#file_path,#temp))
|
|
|
|
|
{
|
|
|
|
|
Write_Error(copy_rezult);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Del_File(true);
|
|
|
|
|
SelectFile(new_file_ed.text);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
notify(FILE_EXISTS);
|
2015-05-15 14:32:26 +02:00
|
|
|
|
}
|
2015-05-14 18:09:36 +02:00
|
|
|
|
}
|
2015-05-15 14:32:26 +02:00
|
|
|
|
new_element_active = 0;
|
|
|
|
|
Open_Dir(#path,WITH_REDRAW);
|
|
|
|
|
SelectFile(new_file_ed.text);
|
2015-05-14 18:09:36 +02:00
|
|
|
|
}
|
|
|
|
|
new_element_active = 0;
|
2015-05-15 14:32:26 +02:00
|
|
|
|
Open_Dir(#path,WITH_REDRAW);
|
2015-05-14 18:09:36 +02:00
|
|
|
|
}
|
|
|
|
|
|
2015-06-20 00:23:51 +02:00
|
|
|
|
void NewElement_Form(byte crt, dword strng)
|
2015-05-14 18:09:36 +02:00
|
|
|
|
{
|
|
|
|
|
int dform_x=files.w-220/2+files.x;
|
2015-05-15 14:32:26 +02:00
|
|
|
|
if (!new_element_active)
|
2015-05-14 18:09:36 +02:00
|
|
|
|
{
|
2015-05-15 14:32:26 +02:00
|
|
|
|
new_element_active = crt;
|
2015-06-20 00:23:51 +02:00
|
|
|
|
strcpy(#new_element_name, strng);
|
|
|
|
|
new_file_ed.size = new_file_ed.pos = strlen(strng);
|
2015-05-14 18:09:36 +02:00
|
|
|
|
}
|
2015-07-19 20:45:59 +02:00
|
|
|
|
DrawPopup(dform_x,160,220,85,1,sc.work,sc.work_graph);
|
|
|
|
|
new_file_ed.left = dform_x+24;
|
2015-05-14 18:09:36 +02:00
|
|
|
|
edit_box_draw stdcall (#new_file_ed);
|
2015-07-19 20:45:59 +02:00
|
|
|
|
DrawRectangle(new_file_ed.left-1, new_file_ed.top-1, new_file_ed.width+2, 16, 0xFFFfff);
|
|
|
|
|
DrawRectangle(new_file_ed.left-2, new_file_ed.top-2, new_file_ed.width+4, 18, sc.work_graph);
|
|
|
|
|
IF (new_element_active==3) DrawFlatButton(dform_x+22,208,85,22,301,0xFFB6B5,T_RENAME);
|
|
|
|
|
ELSE DrawFlatButton(dform_x+27,208,70,22,301,0xFFB6B5,T_CREATE);
|
|
|
|
|
DrawFlatButton(dform_x+120,208,70,22,302,0xC6DFC6,T_CANCEL);
|
2015-05-14 18:09:36 +02:00
|
|
|
|
}
|
|
|
|
|
|
2015-07-16 03:44:30 +02:00
|
|
|
|
void FnProcess(byte N)
|
2013-03-31 22:25:54 +02:00
|
|
|
|
{
|
|
|
|
|
switch(N)
|
|
|
|
|
{
|
|
|
|
|
case 1:
|
2013-12-22 01:09:21 +01:00
|
|
|
|
if (!active_about)
|
|
|
|
|
{
|
2015-07-16 03:44:30 +02:00
|
|
|
|
//SwitchToAnotherThread();
|
|
|
|
|
about_stak = malloc(4096);
|
|
|
|
|
about_window = CreateThread(#about_dialog,about_stak+4092);
|
2013-12-22 01:09:21 +01:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ActivateWindow(GetProcessSlot(about_window));
|
|
|
|
|
}
|
2013-03-31 22:25:54 +02:00
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
if (!files.count) break;
|
2015-07-19 20:45:59 +02:00
|
|
|
|
NewElement_Form(RENAME_ITEM, #file_name);
|
2013-03-31 22:25:54 +02:00
|
|
|
|
break;
|
|
|
|
|
case 3:
|
2013-04-02 15:39:25 +02:00
|
|
|
|
IF (!itdir) RunProgram("/sys/tinypad", #file_path);
|
2013-03-31 22:25:54 +02:00
|
|
|
|
break;
|
|
|
|
|
case 4:
|
2013-04-02 15:39:25 +02:00
|
|
|
|
IF (!itdir) RunProgram("/sys/develop/heed", #file_path);
|
2013-03-31 22:25:54 +02:00
|
|
|
|
break;
|
2013-04-02 15:33:32 +02:00
|
|
|
|
case 5: //refresh cur dir & devs
|
2013-08-05 10:42:47 +02:00
|
|
|
|
Tip(56, T_DEVICES, 55, "-");
|
2013-04-02 15:33:32 +02:00
|
|
|
|
Open_Dir(#path,WITH_REDRAW);
|
|
|
|
|
pause(10);
|
2015-02-21 13:24:30 +01:00
|
|
|
|
LoadIniSettings();
|
|
|
|
|
GetSystemDiscs();
|
2013-04-04 19:07:38 +02:00
|
|
|
|
Open_Dir(#path,WITH_REDRAW);
|
2013-04-02 15:33:32 +02:00
|
|
|
|
DrawLeftPanel();
|
2013-03-31 22:25:54 +02:00
|
|
|
|
break;
|
|
|
|
|
case 6:
|
2015-07-19 20:45:59 +02:00
|
|
|
|
NewElement_Form(CREATE_FOLDER, T_NEW_FOLDER);
|
2013-03-31 22:25:54 +02:00
|
|
|
|
break;
|
|
|
|
|
case 7:
|
2015-07-19 20:45:59 +02:00
|
|
|
|
NewElement_Form(CREATE_FILE, T_NEW_FILE);
|
2013-03-31 22:25:54 +02:00
|
|
|
|
break;
|
2015-02-22 19:42:51 +01:00
|
|
|
|
case 8:
|
2015-07-16 03:44:30 +02:00
|
|
|
|
//SwitchToAnotherThread();
|
|
|
|
|
properties_stak = malloc(8096);
|
|
|
|
|
CreateThread(#properties_dialog, properties_stak+8092);
|
2015-02-22 19:42:51 +01:00
|
|
|
|
break;
|
2013-03-31 22:25:54 +02:00
|
|
|
|
case 10: //F10
|
2015-02-17 17:46:38 +01:00
|
|
|
|
if (!active_settings)
|
|
|
|
|
{
|
2015-07-16 03:44:30 +02:00
|
|
|
|
//SwitchToAnotherThread();
|
|
|
|
|
settings_stak = malloc(4096);
|
|
|
|
|
settings_window = CreateThread(#settings_dialog, settings_stak+4092);
|
2015-02-17 17:46:38 +01:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ActivateWindow(GetProcessSlot(settings_window));
|
|
|
|
|
}
|
2013-03-31 22:25:54 +02:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-20 16:25:51 +01:00
|
|
|
|
//need to remove these functiones, they are a very old shit :)
|
|
|
|
|
dword onTop(dword down,up) {EAX=Form.height-GetSkinHeight()-down-up;}
|
|
|
|
|
|
2013-03-31 22:25:54 +02:00
|
|
|
|
|
2013-03-11 19:16:24 +01:00
|
|
|
|
stop:
|