forked from KolibriOS/kolibrios
Eolite 2.61: properties window for selected files
git-svn-id: svn://kolibrios.org@5510 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
b7d84b4904
commit
c4fe30fe4b
@ -83,8 +83,8 @@
|
|||||||
|
|
||||||
enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir
|
enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir
|
||||||
|
|
||||||
#define TITLE "Eolite File Manager v2.6"
|
#define TITLE "Eolite File Manager v2.61"
|
||||||
#define ABOUT_TITLE "Eolite v2.6"
|
#define ABOUT_TITLE "Eolite v2.61"
|
||||||
dword col_padding, col_selec, col_lpanel;
|
dword col_padding, col_selec, col_lpanel;
|
||||||
|
|
||||||
int toolbar_buttons_x[7]={9,46,85,134,167,203};
|
int toolbar_buttons_x[7]={9,46,85,134,167,203};
|
||||||
|
@ -73,12 +73,51 @@ void GetSizeDir(dword way)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GetSizeMoreFiles(dword way)
|
||||||
|
{
|
||||||
|
int all_file_count, all_dir_count, all_size;
|
||||||
|
char cur_file[4096];
|
||||||
|
dword selected_offset2;
|
||||||
|
|
||||||
|
all_file_count = 0;
|
||||||
|
all_dir_count = 0;
|
||||||
|
all_size = 0;
|
||||||
|
|
||||||
|
for (i=0; i<files.count; i++)
|
||||||
|
{
|
||||||
|
selected_offset2 = file_mas[i]*304 + buf+32 + 7;
|
||||||
|
if (ESBYTE[selected_offset2]) {
|
||||||
|
strcpy(#cur_file, way);
|
||||||
|
strcat(#cur_file, file_mas[i]*304+buf+72);
|
||||||
|
|
||||||
|
GetFileInfo(#cur_file, #file_info_general);
|
||||||
|
if ( file_info_general.isfolder )
|
||||||
|
{
|
||||||
|
GetSizeDir(#cur_file);
|
||||||
|
all_file_count = all_file_count + file_count;
|
||||||
|
all_dir_count = all_dir_count + dir_count +1;
|
||||||
|
all_size = all_size + size_dir;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
all_file_count++;
|
||||||
|
all_size = all_size + file_info_general.sizelo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_count = all_file_count;
|
||||||
|
dir_count = all_dir_count;
|
||||||
|
size_dir = all_size;
|
||||||
|
}
|
||||||
|
|
||||||
void properties_dialog()
|
void properties_dialog()
|
||||||
{
|
{
|
||||||
byte id;
|
byte id;
|
||||||
byte key;
|
byte key;
|
||||||
dword file_name_off;
|
dword file_name_off;
|
||||||
dword element_size;
|
dword element_size;
|
||||||
|
dword selected_offset2;
|
||||||
|
int cont = 0;
|
||||||
char element_size_label[32];
|
char element_size_label[32];
|
||||||
proc_info settings_form;
|
proc_info settings_form;
|
||||||
|
|
||||||
@ -86,14 +125,24 @@ void properties_dialog()
|
|||||||
file_count = 0;
|
file_count = 0;
|
||||||
dir_count = 0;
|
dir_count = 0;
|
||||||
size_dir = 0;
|
size_dir = 0;
|
||||||
|
|
||||||
|
for (i=0; i<files.count; i++)
|
||||||
|
{
|
||||||
|
selected_offset2 = file_mas[i]*304 + buf+32 + 7;
|
||||||
|
if (ESBYTE[selected_offset2]) cont++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cont) GetSizeMoreFiles(#path);
|
||||||
|
else
|
||||||
|
{
|
||||||
GetFileInfo(#file_path, #file_info_general);
|
GetFileInfo(#file_path, #file_info_general);
|
||||||
strcpy(#file_name2, #file_name);
|
strcpy(#file_name2, #file_name);
|
||||||
file_name_ed.size = strlen(#file_name2);
|
file_name_ed.size = strlen(#file_name2);
|
||||||
|
if (itdir) GetSizeDir(#file_path);
|
||||||
|
}
|
||||||
strcpy(#path_to_file, #path);
|
strcpy(#path_to_file, #path);
|
||||||
path_to_file_ed.size = strlen(#path_to_file);
|
path_to_file_ed.size = strlen(#path_to_file);
|
||||||
|
|
||||||
if (itdir) GetSizeDir(#file_path);
|
|
||||||
|
|
||||||
SetEventMask(0x27);
|
SetEventMask(0x27);
|
||||||
loop() switch(WaitEvent())
|
loop() switch(WaitEvent())
|
||||||
{
|
{
|
||||||
@ -120,6 +169,29 @@ void properties_dialog()
|
|||||||
GetProcessInfo(#settings_form, SelfInfo);
|
GetProcessInfo(#settings_form, SelfInfo);
|
||||||
DrawFlatButton(settings_form.cwidth - 70 - 13, settings_form.cheight - 34, 70, 22, 10, 0xE4DFE1, BTN_CLOSE);
|
DrawFlatButton(settings_form.cwidth - 70 - 13, settings_form.cheight - 34, 70, 22, 10, 0xE4DFE1, BTN_CLOSE);
|
||||||
DrawBar(10, 10, 32, 32, 0xFFFfff);
|
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 (cont)
|
||||||
|
{
|
||||||
|
Put_icon('', 18, 20, 0xFFFfff, 0);
|
||||||
|
strcpy(#folder_info, SET_6);
|
||||||
|
strcat(#folder_info, itoa(file_count));
|
||||||
|
strcat(#folder_info, SET_7);
|
||||||
|
strcat(#folder_info, itoa(dir_count));
|
||||||
|
WriteText(50, 23, 0x80, 0x000000, #folder_info);
|
||||||
|
EAX = ConvertSize(size_dir);
|
||||||
|
strcpy(#element_size_label, EAX);
|
||||||
|
strcat(#element_size_label, " (");
|
||||||
|
strcat(#element_size_label, itoa(size_dir));
|
||||||
|
strcat(#element_size_label, " b)");
|
||||||
|
WriteText(100, 65, 0x80, 0x000000, #element_size_label);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if ( file_info_general.isfolder )
|
if ( file_info_general.isfolder )
|
||||||
Put_icon("<DIR>", 18, 20, 0xFFFfff, 0);
|
Put_icon("<DIR>", 18, 20, 0xFFFfff, 0);
|
||||||
else
|
else
|
||||||
@ -128,10 +200,6 @@ void properties_dialog()
|
|||||||
WriteText(50, 13, 0x80, 0x000000, PR_T_NAME);
|
WriteText(50, 13, 0x80, 0x000000, PR_T_NAME);
|
||||||
edit_box_draw stdcall (#file_name_ed);
|
edit_box_draw stdcall (#file_name_ed);
|
||||||
|
|
||||||
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 (!itdir)
|
if (!itdir)
|
||||||
{
|
{
|
||||||
element_size = file_info_general.sizelo;
|
element_size = file_info_general.sizelo;
|
||||||
@ -169,6 +237,7 @@ void properties_dialog()
|
|||||||
|
|
||||||
DrawPropertiesCheckBoxes();
|
DrawPropertiesCheckBoxes();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawPropertiesCheckBoxes()
|
void DrawPropertiesCheckBoxes()
|
||||||
|
Loading…
Reference in New Issue
Block a user