Eolite 3.0 RC1: two panels almost implemented, need some fixes

git-svn-id: svn://kolibrios.org@5719 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2015-08-13 15:28:53 +00:00
parent 93bb33137f
commit 01dcf2d4d4
6 changed files with 118 additions and 49 deletions

View File

@ -6,7 +6,7 @@
#endif
//libraries
#define MEMSIZE 500000
#define MEMSIZE 510000
#include "..\lib\clipboard.h"
#include "..\lib\strings.h"
#include "..\lib\mem.h"
@ -64,9 +64,13 @@ byte use_big_fonts=false,
show_dev_name=true,
real_files_names_case=false,
info_after_copy=false,
two_panels=false;
two_panels=false,
active_panel=1;
//} settings;
int active_current, inactive_current, active_first, inactive_first;
char active_path[4096], inactive_path[4096];
dword eolite_ini_path;
@ -128,6 +132,8 @@ void main()
{
strlcpy(#path, "/rd/1/", 6);
}
strcpy(#active_path, #path);
strcpy(#inactive_path, #path);
Open_Dir(#path,ONLY_OPEN);
SetEventMask(1100111b);
loop(){
@ -255,7 +261,7 @@ void main()
//Scrooll
if (!mouse.lkm) && (scroll_used) { scroll_used=false; Scroll(); }
if (mouse.x>=Form.width-26) && (mouse.x<=Form.width-6) && (mouse.y>56) && (mouse.y<Form.height) && (mouse.lkm) && (!scroll_used) {scroll_used=true; Scroll();}
if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+18) && (mouse.y>files.y) && (mouse.y<files.y+files.y-18) && (mouse.lkm) && (!scroll_used) {scroll_used=true; Scroll();}
if (scroll_used)
{
@ -266,6 +272,38 @@ void main()
files.first /= onTop(22,files.y);
if (files.visible+files.first>files.count) files.first=files.count-files.visible;
if (id!=files.first) List_ReDraw();
break;
}
if (two_panels) && (mouse.y > files.y) {
if (mouse.x<Form.cwidth/2)
{
if (active_panel!=1)
{
active_panel = 1;
active_current = inactive_current;
inactive_current = files.current;
active_first = inactive_first;
inactive_first = files.first;
strcpy(#active_path, #inactive_path);
strcpy(#inactive_path, #path);
draw_window();
}
}
else
{
if (active_panel!=2)
{
active_panel = 2;
active_current = inactive_current;
inactive_current = files.current;
active_first = inactive_first;
inactive_first = files.first;
strcpy(#active_path, #inactive_path);
strcpy(#inactive_path, #path);
draw_window();
}
}
}
break;
//Button pressed-----------------------------------------------------------------------------
@ -312,9 +350,9 @@ void main()
Paste();
break;
case 31...33: //sort
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);
if(sort_num==1) DrawFilledBar(sorting_arrow_x,files.y-12,6,10);
if(sort_num==2) DrawFilledBar(sorting_arrow_x,files.y-12,6,10);
if(sort_num==3) DrawFilledBar(sorting_arrow_x,files.y-12,6,10);
sort_num=id-30;
Open_Dir(#path,WITH_REDRAW);
break;
@ -411,10 +449,6 @@ void main()
switch (key_scancode)
{
case 198:
two_panels ^= 1;
draw_window();
break;
case SCAN_CODE_BS:
//GoBack();
Dir_Up();
@ -501,7 +535,6 @@ void main()
}
}
void draw_window()
{
DefineAndDrawWindow(GetScreenWidth()-550/4+rand_n,rand_n+30,550,500,0x73,system.color.work,TITLE,0);
@ -527,23 +560,42 @@ void draw_window()
{
DrawLeftPanel();
files.SetSizes(192, 57, Form.cwidth - 210, Form.cheight - 59, files.line_h);
DrawListColumns();
Open_Dir(#path,ONLY_SHOW);
DrawList();
}
else
{
files.SetSizes(2, 57+22, Form.cwidth/2-2-17, Form.cheight-59-22, files.line_h);
DrawListColumns();
Open_Dir(#path,ONLY_SHOW);
files.SetSizes(Form.cwidth/2, 57+22, Form.cwidth/2 -17, Form.cheight-59-22, files.line_h);
DrawListColumns();
Open_Dir(#path,ONLY_SHOW);
if (active_panel==1)
{
files.current = inactive_current;
files.first = inactive_first;
strcpy(#path, #inactive_path);
files.SetSizes(Form.cwidth/2, 57+22, Form.cwidth/2 -17, Form.cheight-59-22, files.line_h);
DrawList();
files.current = active_current;
files.first = active_first;
strcpy(#path, #active_path);
files.SetSizes(2, 57+22, Form.cwidth/2-2-17, Form.cheight-59-22, files.line_h);
DrawList();
}
if (active_panel==2)
{
files.current = inactive_current;
files.first = inactive_first;
strcpy(#path, #inactive_path);
files.SetSizes(2, 57+22, Form.cwidth/2-2-17, Form.cheight-59-22, files.line_h);
DrawList();
files.current = active_current;
files.first = active_first;
strcpy(#path, #active_path);
files.SetSizes(Form.cwidth/2, 57+22, Form.cwidth/2 -17, Form.cheight-59-22, files.line_h);
DrawList();
}
}
if (del_active) Del_Form();
if (new_element_active) NewElement_Form(new_element_active, #new_element_name);
}
void DrawListColumns()
void DrawList()
{
DrawFlatButton(files.x,files.y - 17, files.w - 141,16,31,system.color.work,T_FILE);
DrawFlatButton(files.x + files.w - 141, files.y-17,73,16,32,system.color.work,T_TYPE);
@ -551,12 +603,13 @@ void DrawListColumns()
DrawFlatButton(files.x + files.w, files.y-17,16,16, 0,system.color.work,"\x18");
DrawFlatButton(files.x + files.w,files.y+files.h-16,16,16, 0,system.color.work,"\x19");
DrawBar(files.x+files.w,files.y,1,files.h,system.color.work_graph);
Open_Dir(#path,WITH_REDRAW);
}
void List_ReDraw()
{
int paint_y;
int all_lines_h;
static int old_current, old_first;
files.CheckDoesValuesOkey(); //prevent some shit
@ -580,10 +633,10 @@ void List_ReDraw()
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);
//in the bottom
paint_y = j * files.line_h + files.y;
DrawBar(files.x,paint_y,files.w,onTop(paint_y,6),0xFFFFFF);
DrawBar(Form.cwidth-159,paint_y,1,onTop(paint_y,6),system.color.work);
DrawBar(Form.cwidth-86,paint_y,1,onTop(paint_y,6),system.color.work);
all_lines_h = j * files.line_h;
DrawBar(files.x,all_lines_h + files.y,files.w,files.h - all_lines_h,0xFFFFFF);
DrawBar(files.x+files.w-141,all_lines_h + files.y,1,files.h - all_lines_h,system.color.work);
DrawBar(files.x+files.w-68,all_lines_h + files.y,1,files.h - all_lines_h,system.color.work);
Scroll();
}
@ -613,7 +666,7 @@ void Line_ReDraw(dword color, filenum){
ext1 = strrchr(file_name_off,'.') + file_name_off;
if (ext1==file_name_off) ext1 = " \0"; //if no extension then show nothing
Put_icon(ext1, files.x+3, files.line_h/2-7+y, color, 0);
WriteText(7-strlen(ConvertSize(file.sizelo))*6+Form.cwidth - 76, files.text_y + y,files.font_type,0,ConvertSize(file.sizelo));
WriteText(7-strlen(ConvertSize(file.sizelo))*6+files.x+files.w - 58, files.text_y + y,files.font_type,0,ConvertSize(file.sizelo));
}
else
{
@ -640,8 +693,8 @@ void Line_ReDraw(dword color, filenum){
PathShow_prepare stdcall(#FileShow);
PathShow_draw stdcall(#FileShow);
}
DrawBar(Form.cwidth-159,y,1,files.line_h,system.color.work); //gray line 1
DrawBar(Form.cwidth-86,y,1,files.line_h,system.color.work); //gray line 2
DrawBar(files.x+files.w-141,y,1,files.line_h,system.color.work); //gray line 1
DrawBar(files.x+files.w-68,y,1,files.line_h,system.color.work); //gray line 2
}
@ -680,7 +733,7 @@ void Open_Dir(dword dir_path, redraw){
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;
WriteText(sorting_arrow_x,45,0x80,system.color.work_graph,"\x19");
WriteText(sorting_arrow_x,files.y-12,0x80,system.color.work_graph,"\x19");
if (redraw!=ONLY_SHOW) Sorting();
list_full_redraw = true;
if (redraw!=ONLY_OPEN)&&(!_not_draw) List_ReDraw();
@ -1033,13 +1086,20 @@ void FnProcess(byte N)
if (!itdir) RunProgram("/sys/develop/heed", #file_path);
break;
case 5: //refresh cur dir & devs
Tip(56, T_DEVICES, 55, "-");
Open_Dir(#path,WITH_REDRAW);
pause(10);
LoadIniSettings();
GetSystemDiscs();
Open_Dir(#path,WITH_REDRAW);
DrawLeftPanel();
if (two_panels)
{
draw_window();
}
else
{
Tip(56, T_DEVICES, 55, "-");
Open_Dir(#path,WITH_REDRAW);
pause(10);
LoadIniSettings();
GetSystemDiscs();
Open_Dir(#path,WITH_REDRAW);
DrawLeftPanel();
}
break;
case 6:
NewElement_Form(CREATE_FOLDER, T_NEW_FOLDER);

View File

@ -44,7 +44,7 @@ void Put_icon(dword extension, xx, yy, fairing_color, icon_n)
PutPaletteImage(icon_n*16*15+#ficons,16,15,xx,yy,8,#ficons_pal);
if (fairing_color!=0xFFFfff) IconFairing(icon_n, xx, yy, fairing_color);
if (use_big_fonts) font_half_height=0; else font_half_height=4;
if (icon_n!=17) && (strlen(extension)<9) WriteText(-FileShow.font_size_x/2*strlen(extension)+Form.cwidth-121,yy+font_half_height,files.font_type,0,extension);
if (icon_n!=17) && (strlen(extension)<9) WriteText(-FileShow.font_size_x/2*strlen(extension)+files.x+files.w-103,yy+font_half_height,files.font_type,0,extension);
}
@ -53,7 +53,7 @@ void IconFairing(dword filenum, x,y, color)
switch(filenum)
{
case 0...1: //file
case 3: //íàñòðîéêè
case 3: //íàñòðîéêè
RIGHT_PAINT:
PutPixel(x+10,y,color);
PutPixel(x+11,y+1,color);
@ -114,18 +114,18 @@ void IconFairing(dword filenum, x,y, color)
DrawBar(x+8,y,8,2,color);
IF (filenum==17) PutPixel(x+11,y+1,0x1A7B17); //green arrow part
DrawBar(x+1,y+13,15,2,color);
PutPixel(x+1,y,color); //.òî÷êè
PutPixel(x+1,y,color);
PutPixel(x+7,y,color);
PutPixel(x+15,y+2,color);
PutPixel(x+1,y+12,color);
PutPixel(x+15,y+12,color);
return;
case 18: //êàðòðèäæ
case 18:
DrawBar(x,y+11,1,2,color);
DrawBar(x+15,y+11,1,2,color);
DrawBar(x,y+13,16,1,color);
return;
case 24: //îáðàç
case 24:
DrawBar(x,y,6,1,color);
DrawBar(x,y+1,4,1,color);
DrawBar(x,y+2,3,1,color);

View File

@ -181,7 +181,7 @@ void DrawSystemDiscs()
else
{
pos_y = 43;
DrawBar(pos_x, pos_y, 80, 17, 0xFFFFFF);
DrawBar(pos_x, pos_y, strlen(#dev_name)*6 + 37, 17, 0xFFFFFF);
DefineButton(pos_x+2, pos_y, strlen(#dev_name)*6 + 33, 16, 100+i+BT_HIDE,0xFFFFFF);
_PutImage(pos_x + 5, pos_y, 18,17, is_active*6+dev_icon*17*18*3+#devices);
WriteText(pos_x + 24, pos_y+5, 0x80, 0, #dev_name);

View File

@ -8,6 +8,7 @@
?define SHOW_DEVICE_CLASS "‚뢮¤¨âì ­ §¢ ­¨ï ª« áá  ãáâனáâ¢"
?define SHOW_REAL_NAMES "<EFBFBD>®ª §ë¢ âì ¨¬¥­  ä ©«®¢ ­¥ ¬¥­ïï ॣ¨áâà"
?define USE_BIG_FONTS "<EFBFBD>®«ì让 èà¨äâ (⮫쪮  ­£«¨©áª¨¥ ᨬ¢®«ë!)"
?define USE_TWO_PANELS "„¢¥ ¯ ­¥«¨"
?define LIST_LINE_HEIGHT "‚ëá®â  áâப¨ ¢ ᯨ᪥"
?define NOTIFY_COPY_END "“¢¥¤®¬«ïâì ® § ¢¥à襭¨¨ ª®¯¨à®¢ ­¨ï"
?define CANCEL_T "Žâ¬¥­ "
@ -19,6 +20,7 @@
?define SHOW_DEVICE_CLASS "Show device class name"
?define SHOW_REAL_NAMES "Show real file names without changing case"
?define USE_BIG_FONTS "Use big fonts (English characters only!)"
?define USE_TWO_PANELS "Two panels"
?define LIST_LINE_HEIGHT "List line height"
?define NOTIFY_COPY_END "Notify when copying finished"
?define CANCEL_T "Cancel"
@ -34,7 +36,7 @@ void settings_dialog()
byte id;
proc_info settings_form;
dword save_show_dev_name,save_real_files_names_case, save_info_after_copy, save_use_big_fonts, save_files_h, save_DBLTime;
dword save_show_dev_name,save_real_files_names_case, save_info_after_copy, save_use_big_fonts, save_two_panels, save_files_h, save_DBLTime;
if (active_settings){
EXIT_SETTING:
@ -43,6 +45,7 @@ void settings_dialog()
real_files_names_case = save_real_files_names_case;
info_after_copy = save_info_after_copy;
use_big_fonts = save_use_big_fonts;
two_panels = save_two_panels;
files.line_h = save_files_h;
MOUSE_TIME = save_DBLTime;
@ -56,6 +59,7 @@ void settings_dialog()
save_real_files_names_case = real_files_names_case;
save_info_after_copy = info_after_copy;
save_use_big_fonts = use_big_fonts;
two_panels = two_panels;
save_files_h = files.line_h;
save_DBLTime = MOUSE_TIME;
@ -86,6 +90,7 @@ void settings_dialog()
else if (id==21) real_files_names_case ^= 1;
else if (id==22) info_after_copy ^= 1;
else if (id==23) { use_big_fonts ^= 1; BigFontsChange(); }
else if (id==24) two_panels ^= 1;
else if (id==25) files.line_h++;
else if (id==26) && (files.line_h>14) files.line_h--;
else if (id==27) MOUSE_TIME++;
@ -105,10 +110,10 @@ void settings_dialog()
break;
case evReDraw:
DefineAndDrawWindow(Form.left + Form.width/2, Form.top + Form.height/2 - 75, 300, 234+GetSkinHeight(),0x34,system.color.work,TITLE_SETT);
DefineAndDrawWindow(Form.left + Form.width/2-10, Form.top + Form.height/2 - 75, 300, 254+GetSkinHeight(),0x34,system.color.work,TITLE_SETT);
GetProcessInfo(#settings_form, SelfInfo);
DrawSettingsCheckBoxes();
DrawFlatButton(9, 166, strlen(EDIT_FILE_ASSOCIATIONS)+4*6, 22, 5, 0xE4DFE1, EDIT_FILE_ASSOCIATIONS);
DrawFlatButton(9, 186, strlen(EDIT_FILE_ASSOCIATIONS)+4*6, 22, 5, 0xE4DFE1, EDIT_FILE_ASSOCIATIONS);
DrawFlatButton(128, settings_form.cheight - 30, 70, 22, 10, 0xE4DFE1, APPLY_T);
DrawFlatButton(208, settings_form.cheight - 30, 70, 22, 11, 0xE4DFE1, CANCEL_T);
}
@ -121,8 +126,9 @@ void DrawSettingsCheckBoxes()
CheckBox2(10, 33, 21, SHOW_REAL_NAMES, real_files_names_case);
CheckBox2(10, 55, 22, NOTIFY_COPY_END, info_after_copy);
CheckBox2(10, 77, 23, USE_BIG_FONTS, use_big_fonts);
MoreLessBox(10, 104, 18, 25, 26, #system.color, files.line_h, LIST_LINE_HEIGHT);
MoreLessBox(10, 134, 18, 27, 28, #system.color, MOUSE_TIME, T_DOUBLE_CLICK);
CheckBox2(10, 99, 24, USE_TWO_PANELS, two_panels);
MoreLessBox(10, 124, 18, 25, 26, #system.color, files.line_h, LIST_LINE_HEIGHT);
MoreLessBox(10, 154, 18, 27, 28, #system.color, MOUSE_TIME, T_DOUBLE_CLICK);
}
@ -133,6 +139,7 @@ void LoadIniSettings()
ini_get_int stdcall (eolite_ini_path, #confir_section, "RealFileNamesCase", 0); real_files_names_case = EAX;
ini_get_int stdcall (eolite_ini_path, #confir_section, "InfoAfterCopy", 0); info_after_copy = EAX;
ini_get_int stdcall (eolite_ini_path, #confir_section, "UseBigFonts", 0); use_big_fonts = EAX;
ini_get_int stdcall (eolite_ini_path, #confir_section, "TwoPanels", 0); two_panels = EAX;
ini_get_int stdcall (eolite_ini_path, #confir_section, "LineHeight", 18); files.line_h = EAX;
ini_get_int stdcall (eolite_ini_path, #confir_section, "TimeDoubleClick", 50); MOUSE_TIME = EAX;
BigFontsChange();
@ -145,6 +152,7 @@ void SaveIniSettings()
ini_set_int stdcall (eolite_ini_path, #confir_section, "RealFileNamesCase", real_files_names_case);
ini_set_int stdcall (eolite_ini_path, #confir_section, "InfoAfterCopy", info_after_copy);
ini_set_int stdcall (eolite_ini_path, #confir_section, "UseBigFonts", use_big_fonts);
ini_set_int stdcall (eolite_ini_path, #confir_section, "TwoPanels", two_panels);
ini_set_int stdcall (eolite_ini_path, #confir_section, "LineHeight", files.line_h);
ini_set_int stdcall (eolite_ini_path, #confir_section, "TimeDoubleClick", MOUSE_TIME);
}

View File

@ -1,5 +1,5 @@
#define TITLE "Eolite File Manager v3.0 beta 6"
#define ABOUT_TITLE "Eolite 3.0 beta 6"
#define TITLE "Eolite File Manager v3.0 RC1"
#define ABOUT_TITLE "Eolite 3.0 RC1"
#ifdef LANG_RUS
?define T_FILE "” ©«"

View File

@ -241,6 +241,7 @@
if(!strncmp(pos,"cd/",3)) return PATH;
if(!strncmp(pos,"bd/",3)) return PATH;
if(!strncmp(pos,"usbhd/",6)) return PATH;
if(!strncmp(pos,"kolibrios/",10)) return PATH;
sprintf(#__PATH_NEW,"/sys%s",PATH);
return #__PATH_NEW;
}