From 13153fc63254f984ea3b4a8742a868230aafa223 Mon Sep 17 00:00:00 2001 From: Serhii Sakhno Date: Thu, 6 Aug 2015 17:54:42 +0000 Subject: [PATCH] Eolite 2.94: change attributes for selected elements git-svn-id: svn://kolibrios.org@5688 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/eolite/Eolite.c | 4 +- programs/cmm/eolite/include/properties.h | 274 ++++++++++++++++------- 2 files changed, 201 insertions(+), 77 deletions(-) diff --git a/programs/cmm/eolite/Eolite.c b/programs/cmm/eolite/Eolite.c index 4dec8af26b..3c37a3d242 100644 --- a/programs/cmm/eolite/Eolite.c +++ b/programs/cmm/eolite/Eolite.c @@ -103,8 +103,8 @@ enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir enum { CREATE_FILE=1, CREATE_FOLDER, RENAME_ITEM }; //NewElement -#define TITLE "Eolite File Manager v2.93" -#define ABOUT_TITLE "Eolite 2.93" +#define TITLE "Eolite File Manager v2.94" +#define ABOUT_TITLE "Eolite 2.94" dword col_padding, col_selec, col_lpanel; int toolbar_buttons_x[7]={9,46,85,134,167,203}; diff --git a/programs/cmm/eolite/include/properties.h b/programs/cmm/eolite/include/properties.h index 40214d5474..2bd8023669 100644 --- a/programs/cmm/eolite/include/properties.h +++ b/programs/cmm/eolite/include/properties.h @@ -1,6 +1,9 @@ #ifdef LANG_RUS ?define WINDOW_TITLE_PROPERTIES "Свойства" ?define BTN_CLOSE "Закрыть" + ?define BTN_APPLY "Применить" + ?define QUEST_1 "Применить ко всем вложенным" + ?define QUEST_2 "файлам и папкам" ?define PR_T_NAME "Имя:" ?define PR_T_DEST "Расположение:" ?define PR_T_SIZE "Размер:" @@ -18,6 +21,9 @@ #else ?define WINDOW_TITLE_PROPERTIES "Properties" ?define BTN_CLOSE "Close" + ?define BTN_APPLY "Apply" + ?define QUEST_1 "Применить ко всем вложенным" + ?define QUEST_2 "файлам и папкам" ?define PR_T_NAME "Name:" ?define PR_T_DEST "Destination:" ?define PR_T_SIZE "Size:" @@ -39,23 +45,114 @@ char path_to_file[4096]="\0"; char file_name2[4096]="\0"; edit_box file_name_ed = {195,50,25,0xffffff,0x94AECE,0x000000,0xffffff,2,4098,#file_name2,#mouse_ddd2, 1000000000000000b,2,2}; edit_box path_to_file_ed = {145,100,46,0xffffff,0x94AECE,0x000000,0xffffff,2,4098,#path_to_file,#mouse_ddd2, 1000000000000000b,2,2}; -frame flags_frame = { 0, 280, 10, 83, 151, 0x000111, 0xFFFfff, 1, FLAGS, 0, 0, 6, 0x000111, 0xCCCccc }; +frame flags_frame = { 0, 280, 10, 83, 151, 0x000111, 0xFFFfff, 1, FLAGS, 0, 0, 6, 0x000111, 0xFFFFFF }; int file_count, dir_count, size_dir; char folder_info[200]; +dword element_size; +char element_size_label[32]; BDVK file_info_general; BDVK file_info_dirsize; -void SetProperties(byte id) +proc_info settings_form; +byte quest_active, atr_readonly, atr_hidden, atr_system; + +void SetPropertiesDir(dword way) { - if (selected_count) return; + dword dirbuf, fcount, i, filename; + dword cur_file; + if (isdir(way)) + { + cur_file = malloc(4096); + GetDir(#dirbuf, #fcount, way, DIRS_ONLYREAL); + for (i=0; i", 18, 19, 0xFFFfff, 0); - else - Put_icon(#file_name2+strrchr(#file_name2,'.'), 18, 19, 0xFFFfff, 0); - - WriteText(50, 13, 0x80, 0x000000, PR_T_NAME); - edit_box_draw stdcall (#file_name_ed); - - if (!itdir) element_size = file_info_general.sizelo; - else - { - WriteText(10, 80, 0x80, 0x000000, PR_T_CONTAINS); - sprintf(#folder_info,"%s%d%s%d",SET_6,file_count,SET_7,dir_count); - WriteText(100, 80, 0x80, 0x000000, #folder_info); - element_size = size_dir; - } - WriteText(10, 95, 0x80, 0x000000, SET_3); - WriteText(10, 110, 0x80, 0x000000, SET_4); - WriteText(10, 125, 0x80, 0x000000, SET_5); - DrawDate(100, 95, 0, #file_info_general.datecreate); - DrawDate(100, 110, 0, #file_info_general.datelastaccess); - DrawDate(100, 125, 0, #file_info_general.datelastedit); - - sprintf(#element_size_label,"%s (%d %s)",ConvertSize(element_size),element_size,SET_BYTE_LANG); - WriteText(100, 65, 0x80, 0x000000, #element_size_label); - - flags_frame.size_x = - flags_frame.start_x * 2 + settings_form.cwidth - 2; - flags_frame.font_color = system.color.work_text; - flags_frame.font_backgr_color = system.color.work; - flags_frame.ext_col = system.color.work_graph; - frame_draw stdcall (#flags_frame); - DrawPropertiesCheckBoxes(); - } + DrawPropertiesWindow(); } } +void DrawPropertiesWindow() +{ + DefineAndDrawWindow(Form.left + 150,150,270,285+GetSkinHeight(),0x34,0xFFFFFF,WINDOW_TITLE_PROPERTIES); + GetProcessInfo(#settings_form, SelfInfo); + DrawFlatButton(settings_form.cwidth - 70 - 13, settings_form.cheight - 34, 70, 22, 10, 0xE4DFE1, BTN_CLOSE); + DrawFlatButton(settings_form.cwidth - 150 - 13, settings_form.cheight - 34, 70, 22, 11, 0xE4DFE1, BTN_APPLY); + DrawBar(10, 10, 32, 32, 0xFFFfff); + + WriteText(10, 50, 0x80, 0x000000, PR_T_DEST); + edit_box_draw stdcall (#path_to_file_ed); + + WriteText(10, 65, 0x80, 0x000000, PR_T_SIZE); + + if (selected_count) + { + Put_icon('', 18, 19, 0xFFFfff, 0); + sprintf(#folder_info,"%s%d%s%d",SET_6,file_count,SET_7,dir_count); + WriteText(50, 23, 0x80, 0x000000, #folder_info); + sprintf(#element_size_label,"%s (%d %s)",ConvertSize(size_dir),size_dir,SET_BYTE_LANG); + WriteText(100, 65, 0x80, 0x000000, #element_size_label); + } + else + { + if ( file_info_general.isfolder ) + Put_icon("", 18, 19, 0xFFFfff, 0); + else + Put_icon(#file_name2+strrchr(#file_name2,'.'), 18, 19, 0xFFFfff, 0); + + WriteText(50, 13, 0x80, 0x000000, PR_T_NAME); + edit_box_draw stdcall (#file_name_ed); + + if (!itdir) element_size = file_info_general.sizelo; + else + { + WriteText(10, 80, 0x80, 0x000000, PR_T_CONTAINS); + sprintf(#folder_info,"%s%d%s%d",SET_6,file_count,SET_7,dir_count); + WriteText(100, 80, 0x80, 0x000000, #folder_info); + element_size = size_dir; + } + WriteText(10, 95, 0x80, 0x000000, SET_3); + WriteText(10, 110, 0x80, 0x000000, SET_4); + WriteText(10, 125, 0x80, 0x000000, SET_5); + DrawDate(100, 95, 0, #file_info_general.datecreate); + DrawDate(100, 110, 0, #file_info_general.datelastaccess); + DrawDate(100, 125, 0, #file_info_general.datelastedit); + + sprintf(#element_size_label,"%s (%d %s)",ConvertSize(element_size),element_size,SET_BYTE_LANG); + WriteText(100, 65, 0x80, 0x000000, #element_size_label); + } + flags_frame.size_x = - flags_frame.start_x * 2 + settings_form.cwidth - 2; + flags_frame.font_color = system.color.work_text; + flags_frame.ext_col = system.color.work_graph; + frame_draw stdcall (#flags_frame); + DrawPropertiesCheckBoxes(); +} + void DrawPropertiesCheckBoxes() { - CheckBox2(22, flags_frame.start_y + 14, 20, PR_T_ONLY_READ, file_info_general.readonly); - CheckBox2(22, flags_frame.start_y + 36, 21, PR_T_HIDDEN, file_info_general.hidden); - CheckBox2(22, flags_frame.start_y + 58, 22, PR_T_SYSTEM, file_info_general.system); + CheckBox2(22, flags_frame.start_y + 14, 20, PR_T_ONLY_READ, atr_readonly); + CheckBox2(22, flags_frame.start_y + 36, 21, PR_T_HIDDEN, atr_hidden); + CheckBox2(22, flags_frame.start_y + 58, 22, PR_T_SYSTEM, atr_system); } \ No newline at end of file