Eolite 4.35: file selection with SHIFT holded, new /rd icon

git-svn-id: svn://kolibrios.org@7989 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2020-05-26 15:07:13 +00:00
parent 75b0246e8c
commit 36119794f4
7 changed files with 77 additions and 43 deletions

View File

@ -235,13 +235,24 @@ void main()
mouse.get(); mouse.get();
ProceedMouseGestures(); ProceedMouseGestures();
GetKeyModifier();
if (key_modifier&KEY_LSHIFT) || (key_modifier&KEY_RSHIFT)
if (mouse.key&MOUSE_LEFT) && (mouse.up) {
files.ProcessMouse(mouse.x, mouse.y);
EventChooseFile(files.cur_y);
List_ReDraw();
break;
}
if (files.MouseOver(mouse.x, mouse.y)) if (files.MouseOver(mouse.x, mouse.y))
{ {
//select file //select file
if (mouse.key&MOUSE_LEFT) && (mouse.up) if (mouse.key&MOUSE_LEFT) && (mouse.up)
{ {
if (files.ProcessMouse(mouse.x, mouse.y)) List_ReDraw(); else { if (files.ProcessMouse(mouse.x, mouse.y)) {
List_ReDraw();
} else {
if (mouse.y - files.y / files.item_h + files.first == files.cur_y) Open(0); if (mouse.y - files.y / files.item_h + files.first == files.cur_y) Open(0);
} }
} }
@ -405,6 +416,18 @@ void main()
break; break;
} }
if (key_modifier&KEY_LSHIFT) || (key_modifier&KEY_RSHIFT) {
if (key_scancode == SCAN_CODE_DOWN) {
EventChooseFile(files.cur_y);
files.KeyDown();
} else if (key_scancode == SCAN_CODE_UP) {
EventChooseFile(files.cur_y);
files.KeyUp();
} else break;
List_ReDraw();
break;
}
if (files.ProcessKey(key_scancode)) if (files.ProcessKey(key_scancode))
{ {
List_ReDraw(); List_ReDraw();
@ -489,11 +512,9 @@ void main()
Del_Form(); Del_Form();
break; break;
case SCAN_CODE_INS: case SCAN_CODE_INS:
if (getElementSelectedFlag(files.cur_y) == true) setElementSelectedFlag(files.cur_y, false); EventChooseFile(files.cur_y);
else setElementSelectedFlag(files.cur_y, true);
files.KeyDown(); files.KeyDown();
List_ReDraw(); List_ReDraw();
DrawStatusBar();
break; break;
case SCAN_CODE_F1...SCAN_CODE_F10: case SCAN_CODE_F1...SCAN_CODE_F10:
FnProcess(key_scancode-58); FnProcess(key_scancode-58);
@ -1314,4 +1335,14 @@ char line_param[4096+5];
} }
} }
void EventChooseFile(int _id)
{
if (getElementSelectedFlag(_id) == true) {
setElementSelectedFlag(_id, false);
} else {
setElementSelectedFlag(_id, true);
}
DrawStatusBar();
}
stop: stop:

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -43,7 +43,7 @@ void about_dialog()
WriteTextB(about_x+2,107,0x82,0xD49CD2,ABOUT_TITLE); WriteTextB(about_x+2,107,0x82,0xD49CD2,ABOUT_TITLE);
WriteTextB(about_x,105,0x82,0x9D129D,ABOUT_TITLE); WriteTextB(about_x,105,0x82,0x9D129D,ABOUT_TITLE);
DrawRectangle3D(0,154,about_form.cwidth,1,sc.work_dark,sc.work_light); DrawRectangle3D(0,154,about_form.cwidth,1,sc.work_dark,sc.work_light);
WriteTextLines(7,163,0x90,sc.work_text,"KolibriOS File Manager\nAuthors: Leency, Veliant\nPunk_Joker, Pavelyakov\n2008 - 2019",20); WriteTextLines(7,163,0x90,sc.work_text,"KolibriOS File Manager\nAuthors: Leency, Veliant\nPunk_Joker, Pavelyakov\n2008 - 2020",20);
#ifdef LANG_RUS #ifdef LANG_RUS
DrawStandartCaptButton(60,about_form.cheight-38,11,"ˆáâ®à¨ï ࠧࠡ®âª¨"); DrawStandartCaptButton(60,about_form.cheight-38,11,"ˆáâ®à¨ï ࠧࠡ®âª¨");
#endif #endif

View File

@ -46,47 +46,48 @@ struct _SystemDiscs
void Click(); void Click();
} SystemDiscs=0; } SystemDiscs=0;
#define DEV_H 17
#define DEV_H_HOR 21
void GetDiskIconAndName(char disk_first_letter, dword dev_icon, disc_name) void GetDiskIconAndName(char disk_first_letter, dword dev_icon, disc_name)
{ {
switch(disk_first_letter) switch(disk_first_letter)
{ {
case 'k':
ESBYTE[dev_icon]=0;
strcpy(disc_name, T_PROG);
break;
case 'r': case 'r':
ESBYTE[dev_icon]=0; ESBYTE[dev_icon]=0;
strcpy(disc_name, T_SYS); strcpy(disc_name, T_SYS);
break; break;
case 'c': case 'k':
ESBYTE[dev_icon]=1; ESBYTE[dev_icon]=1;
strcpy(disc_name, T_CD); strcpy(disc_name, T_PROG);
break; break;
case 'f': case 'f':
ESBYTE[dev_icon]=2; ESBYTE[dev_icon]=2;
strcpy(disc_name, T_FD); strcpy(disc_name, T_FD);
break; break;
case 'c':
ESBYTE[dev_icon]=3;
strcpy(disc_name, T_CD);
break;
case 'h': case 'h':
case 'b': case 'b':
ESBYTE[dev_icon]=3; ESBYTE[dev_icon]=4;
strcpy(disc_name, T_HD); strcpy(disc_name, T_HD);
break; break;
case 's': case 's':
ESBYTE[dev_icon]=3; ESBYTE[dev_icon]=4;
strcpy(disc_name, T_SATA); strcpy(disc_name, T_SATA);
break; break;
case 'u':
ESBYTE[dev_icon]=5;
strcpy(disc_name, T_USB);
break;
case 't': case 't':
ESBYTE[dev_icon]=4; ESBYTE[dev_icon]=5;
strcpy(disc_name, T_RAM); strcpy(disc_name, T_RAM);
break; break;
case 'u':
ESBYTE[dev_icon]=6;
strcpy(disc_name, T_USB);
break;
default: default:
ESBYTE[dev_icon]=3; ESBYTE[dev_icon]=5;
strcpy(disc_name, T_UNC);
} }
} }
@ -126,12 +127,12 @@ void _SystemDiscs::Get()
void _SystemDiscs::Draw() void _SystemDiscs::Draw()
{ {
char dev_name[15], disc_name[100], i, dev_icon, is_active, name_len; char dev_name[15], disc_name[100], i, dev_icon, is_active, name_len;
int draw_y, draw_x, draw_h; int draw_y, draw_x;
for (i=0; i<30; i++) DeleteButton(100+i); for (i=0; i<30; i++) DeleteButton(100+i);
if ( two_panels.checked) { draw_y = 41; draw_x = 2; draw_h = 21; } if ( two_panels.checked) { draw_y = 41; draw_x = 2; }
if (!two_panels.checked) { draw_y = 74; draw_x = 17; draw_h = 16; } if (!two_panels.checked) { draw_y = 74; draw_x = 17; }
for (i=0;i<list.count;i++) for (i=0;i<list.count;i++)
{ {
@ -141,21 +142,21 @@ void _SystemDiscs::Draw()
if (two_panels.checked) if (two_panels.checked)
{ {
name_len = strlen(#dev_name)-1*8; name_len = strlen(#dev_name)-1*8;
DrawBar(draw_x, draw_y, name_len + 31, draw_h, 0xFFFFFF); DrawBar(draw_x, draw_y, name_len + 31, DEV_H_HOR, 0xFFFFFF);
DefineButton(draw_x+2, draw_y, name_len + 27, draw_h-1, 100+i+BT_HIDE,0xFFFFFF); DefineButton(draw_x+2, draw_y, name_len + 27, DEV_H_HOR-1, 100+i+BT_HIDE,0xFFFFFF);
_PutImage(draw_x + 5, draw_y+2, 18,17, is_active*6+dev_icon*17*18*3+#devices); _PutImage(draw_x + 5, draw_y+2, 18,17, is_active*7+dev_icon*17*18*3+#devices);
WriteText(draw_x + 24, draw_y+3, 10110000b, 0, #dev_name+1); WriteText(draw_x + 24, draw_y+3, 10110000b, 0, #dev_name+1);
draw_x += name_len + 31; draw_x += name_len + 31;
if (draw_x>=Form.cwidth-100) && (Form.cwidth) { if (draw_x>=Form.cwidth-100) && (Form.cwidth) {
DrawBar(draw_x, draw_y, Form.cwidth - draw_x - 2, draw_h, 0xFFFFFF); DrawBar(draw_x, draw_y, Form.cwidth - draw_x - 2, DEV_H_HOR, 0xFFFFFF);
draw_x = 2; draw_x = 2;
draw_y += draw_h; draw_y += DEV_H_HOR;
} }
} }
else else
{ {
DrawBar(draw_x,draw_y,6,draw_h+1,0xFFFFFF); DrawBar(draw_x,draw_y,6,DEV_H+1,0xFFFFFF);
DrawBar(draw_x+6+18,draw_y,160-6-18,draw_h+1,0xFFFFFF); DrawBar(draw_x+6+18,draw_y,160-6-18,DEV_H+1,0xFFFFFF);
DefineButton(draw_x,draw_y,159,16,100+i+BT_HIDE,0xFFFFFF); DefineButton(draw_x,draw_y,159,16,100+i+BT_HIDE,0xFFFFFF);
if (show_dev_name.checked) if (show_dev_name.checked)
{ {
@ -166,16 +167,18 @@ void _SystemDiscs::Draw()
if (is_active) WriteText(draw_x+30,draw_y+5,0x80,0x555555,#dev_name); if (is_active) WriteText(draw_x+30,draw_y+5,0x80,0x555555,#dev_name);
WriteText(draw_x+29,draw_y+5,0x80,0,#dev_name); WriteText(draw_x+29,draw_y+5,0x80,0,#dev_name);
} }
_PutImage(draw_x+6,draw_y, 18,17, is_active*6+dev_icon*17*18*3+#devices); _PutImage(draw_x+6,draw_y, 18,17, is_active*7+dev_icon*17*18*3+#devices);
draw_y += draw_h; draw_y += DEV_H;
} }
} }
if (two_panels.checked) if (two_panels.checked)
{ {
DrawBar(draw_x, draw_y, Form.cwidth - draw_x - 2, draw_h, 0xFFFFFF); DrawBar(draw_x, draw_y, Form.cwidth - draw_x - 2, DEV_H_HOR, 0xFFFFFF);
DefineButton(Form.cwidth - 23, draw_y+2, 17,16, 60+BT_HIDE, 0xCCCccc); DefineButton(Form.cwidth - 23, draw_y+2, 17,16, 60+BT_HIDE, 0xCCCccc);
_PutImage(Form.cwidth - 21, draw_y+4, 14,13, 2*14*13*3+#factions); _PutImage(Form.cwidth - 21, draw_y+4, 14,13, 2*14*13*3+#factions);
files.y = draw_y + draw_h + 17; files.y = draw_y + DEV_H_HOR + 17;
} else {
DrawBar(draw_x+6, draw_y, 18, 1, 0xFFFfff);
} }
} }
@ -225,12 +228,12 @@ void Tip(int y, dword caption, id, arrow)
void ActionsDraw() void ActionsDraw()
{ {
int i; int i;
int actions_y= SystemDiscs.list.count*16+108, lineh=16; int actions_y= SystemDiscs.list.count*DEV_H+108;
Tip(actions_y-18, T_ACTIONS, 77, ""); //çàãîëîâîê Tip(actions_y-18, T_ACTIONS, 77, ""); //çàãîëîâîê
for (i=0; actions[i*3]!=0; i++, actions_y+=lineh) for (i=0; actions[i*3]!=0; i++, actions_y+=DEV_H)
{ {
DrawBar(17,actions_y,160,lineh,0xFFFFFF); //áåëîå DrawBar(17,actions_y,160,DEV_H,0xFFFFFF); //áåëîå
DefineButton(17,actions_y,159,lineh,actions[i*3]+BT_HIDE,0xE4DFE1); DefineButton(17,actions_y,159,DEV_H,actions[i*3]+BT_HIDE,0xE4DFE1);
WriteText(45,actions_y+4,0x80,0,actions[i*3+1]); WriteText(45,actions_y+4,0x80,0,actions[i*3+1]);
WriteText(-strlen(actions[i*3+2])*6+170,actions_y+4,0x80,0x999999,actions[i*3+2]); WriteText(-strlen(actions[i*3+2])*6+170,actions_y+4,0x80,0x999999,actions[i*3+2]);
_PutImage(23,actions_y+2, 14,13, i*14*13*3+#factions); _PutImage(23,actions_y+2, 14,13, i*14*13*3+#factions);
@ -239,8 +242,8 @@ void ActionsDraw()
void DrawLeftPanelBg() void DrawLeftPanelBg()
{ {
int actions_y = SystemDiscs.list.count*16; int actions_y = SystemDiscs.list.count*DEV_H;
int start_y = actions_y+156; int start_y = actions_y+159;
int area_h; int area_h;
DrawBar(2,41,190,15,col.lpanel); //ñèíèé ïðÿìîóãîëüíèê - íàä äåâàéñàìè DrawBar(2,41,190,15,col.lpanel); //ñèíèé ïðÿìîóãîëüíèê - íàä äåâàéñàìè
DrawBar(17,actions_y+75,160,15,col.lpanel); //ñèíèé ïðÿìîóãîëüíèê - ïîä äåâàéñàìè DrawBar(17,actions_y+75,160,15,col.lpanel); //ñèíèé ïðÿìîóãîëüíèê - ïîä äåâàéñàìè

View File

@ -1,5 +1,5 @@
#define TITLE "Eolite File Manager 4.3" #define TITLE "Eolite File Manager 4.35"
#define ABOUT_TITLE "EOLITE 4.3" #define ABOUT_TITLE "EOLITE 4.35"
#ifdef LANG_RUS #ifdef LANG_RUS
?define T_FILE "” ©«" ?define T_FILE "” ©«"

View File

@ -4,7 +4,7 @@
#include "../lib/gui.h" #include "../lib/gui.h"
#define PANELH 28 #define PANELH 28
#define WIN_W 490 #define WIN_W 520
#define WIN_H 315 #define WIN_H 315
#define BASE_TAB_BUTTON_ID 97 #define BASE_TAB_BUTTON_ID 97