Subversion Repositories Kolibri OS

Rev

Rev 4072 | Rev 4078 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4072 Rev 4076
Line 77... Line 77...
77
	?define T_SELECT_APP_TO_OPEN_WITH "Select application to open file"
77
	?define T_SELECT_APP_TO_OPEN_WITH "Select application to open file"
78
#endif
78
#endif
Line 79... Line 79...
79
 
79
 
Line 80... Line 80...
80
enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir
80
enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir
81
 
81
 
82
#define TITLE "Eolite File Manager v2.0.2"
-
 
83
#define ABOUT_TITLE "Eolite v2.0.2"
-
 
84
dword col_work    = 0xE4DFE1;
82
#define TITLE "Eolite File Manager v2.0.3"
85
dword col_border  = 0x9098B0; //A0A0B8; //0x819FC5;
-
 
86
dword col_padding = 0xC8C9C9;
-
 
Line 87... Line 83...
87
dword col_selec   = 0x94AECE;
83
#define ABOUT_TITLE "Eolite v2.0.3"
88
dword col_lpanel  = 0x00699C;
84
dword col_padding, col_selec, col_lpanel;
89
 
85
 
Line 107... Line 103...
107
	show_dev_name=1,
103
	show_dev_name=1,
108
	sort_num=2,
104
	sort_num=2,
109
	itdir;
105
	itdir;
Line 110... Line 106...
110
 
106
 
-
 
107
proc_info Form;
111
proc_info Form;
108
system_colors sc;
112
mouse m;
109
mouse m;
113
int mouse_dd, scroll_used, scroll_size, sorting_arrow_x, kolibrios_drive;
110
int mouse_dd, scroll_used, scroll_size, sorting_arrow_x, kolibrios_drive;
114
dword buf, off;
111
dword buf, off;
115
dword file_mas[6898];
112
dword file_mas[6898];
Line 129... Line 126...
129
#include "include\history.h"
126
#include "include\history.h"
130
#include "include\menu.h"
127
#include "include\menu.h"
131
#include "include\about.h"
128
#include "include\about.h"
132
#include "include\open_with.h"
129
#include "include\open_with.h"
Line -... Line 130...
-
 
130
 
-
 
131
void SetAppColors()
-
 
132
{
-
 
133
	sc.work = 0xE4DFE1;
-
 
134
	sc.work_text = 0;
-
 
135
	sc.work_graph  = 0x9098B0; //A0A0B8; //0x819FC5;
-
 
136
	sc.work_button_text = 0x000000;
-
 
137
	col_padding = 0xC8C9C9;
-
 
138
	col_selec   = 0x94AECE;
-
 
139
	col_lpanel  = 0x00699C;
-
 
140
	/*
-
 
141
	sc.get();
-
 
142
	for (i=0; i<=14; i++) col_palette[i] = sc.work;
-
 
143
	toolbar_pal[0]= goto_about_pal[0] = sc.work = sc.work;
-
 
144
	col_lpanel = sc.work_graph;
-
 
145
	for (i=0; i<=99; i++) blue_hl_pal[i] = sc.work_graph;
-
 
146
	*/
-
 
147
}
133
 
148
 
134
void main() 
149
void main() 
135
{
150
{
Line 136... Line 151...
136
	word key, id, can_show, can_select, m_selected;
151
	word key, id, can_show, can_select, m_selected;
137
 
152
 
138
	files.line_h=18;
153
	files.line_h=18;
139
	mem_Init();
154
	mem_Init();
140
	if (load_dll2(boxlib, #box_lib_init,0)!=0) notify(ERROR_1);
155
	if (load_dll2(boxlib, #box_lib_init,0)!=0) notify(ERROR_1);
-
 
156
	SystemDiscsGet();
141
	SystemDiscsGet();
157
	GetIni(1);
142
	GetIni(1);	
158
	SetAppColors();
143
	if (param)
159
	if (param)
144
	{
160
	{
145
		strcpy(#path, #param);
161
		strcpy(#path, #param);
Line 446... Line 462...
446
}
462
}
Line 447... Line 463...
447
 
463
 
448
 
464
 
449
void draw_window()
465
void draw_window()
450
{
466
{
451
	DefineAndDrawWindow(40,20,550,500,0x73,col_work,TITLE);
467
	DefineAndDrawWindow(40,20,550,500,0x73,sc.work,TITLE);
452
	GetProcessInfo(#Form, SelfInfo);
468
	GetProcessInfo(#Form, SelfInfo);
453
	if (Form.status_window>2) return;
469
	if (Form.status_window>2) return;
454
	files.SetSizes(192, 57, onLeft(192,27), onTop(57,6), disc_num*16+195,files.line_h);
470
	files.SetSizes(192, 57, onLeft(192,27), onTop(57,6), disc_num*16+195,files.line_h);
455
	if (Form.height < files.min_h) MoveSize(OLD,OLD,OLD,files.min_h);
471
	if (Form.height < files.min_h) MoveSize(OLD,OLD,OLD,files.min_h);
Line 456... Line 472...
456
	if (Form.width<480) MoveSize(OLD,OLD,480,OLD);
472
	if (Form.width<480) MoveSize(OLD,OLD,480,OLD);
457
	GetProcessInfo(#Form, SelfInfo); //if win_size changed
473
	GetProcessInfo(#Form, SelfInfo); //if win_size changed
458
 
474
 
459
	PutPaletteImage(#toolbar,246,34,0,0,8,#toolbar_pal);
475
	PutPaletteImage(#toolbar,246,34,0,0,8,#toolbar_pal);
460
	DrawBar(127, 8, 1, 25, col_border);
476
	DrawBar(127, 8, 1, 25, sc.work_graph);
461
	for (j=0; j<3; j++) DefineButton(toolbar_buttons_x[j]+2,5+2,31-5,29-5,21+j+BT_HIDE,col_work);
477
	for (j=0; j<3; j++) DefineButton(toolbar_buttons_x[j]+2,5+2,31-5,29-5,21+j+BT_HIDE,sc.work);
462
	for (j=3; j<6; j++) DefineButton(toolbar_buttons_x[j],5,31,29,21+j+BT_HIDE,col_work);
478
	for (j=3; j<6; j++) DefineButton(toolbar_buttons_x[j],5,31,29,21+j+BT_HIDE,sc.work);
463
	DrawBar(246,0,onLeft(246,60),12, col_work); //upper editbox
479
	DrawBar(246,0,onLeft(246,60),12, sc.work); //upper editbox
464
	DrawBar(246,29,onLeft(246,60),5,col_work);  //under editbox
480
	DrawBar(246,29,onLeft(246,60),5,sc.work);  //under editbox
465
	DrawRectangle(246,12,onLeft(66,246),16,col_border);
481
	DrawRectangle(246,12,onLeft(66,246),16,sc.work_graph);
466
	DefineButton(onLeft(34,0),6,27,28,51+BT_HIDE+BT_NOFRAME,0); //about
482
	DefineButton(onLeft(34,0),6,27,28,51+BT_HIDE+BT_NOFRAME,0); //about
467
	PutPaletteImage(#goto_about,56,34,Form.width-65,0,8,#goto_about_pal);
483
	PutPaletteImage(#goto_about,56,34,Form.width-65,0,8,#goto_about_pal);
468
	//main rectangles
484
	//main rectangles
469
	DrawRectangle(1,40,Form.cwidth-3,onTop(46,0),col_border);
485
	DrawRectangle(1,40,Form.cwidth-3,onTop(46,0),sc.work_graph);
470
	DrawRectangle(0,39,Form.cwidth-1,onTop(44,0),col_palette[4]); //bg
486
	DrawRectangle(0,39,Form.cwidth-1,onTop(44,0),col_palette[4]); //bg
471
	for (i=0; i<5; i++) DrawBar(0, 34+i, Form.cwidth, 1, col_palette[8-i]);	
487
	for (i=0; i<5; i++) DrawBar(0, 34+i, Form.cwidth, 1, col_palette[8-i]);	
472
	DrawLeftPanel();
488
	DrawLeftPanel();
473
	//ListBox
489
	//ListBox
474
	DrawFlatButton(files.x,40,onLeft(files.x,168),16,31,col_work,T_FILE);
490
	DrawFlatButton(files.x,40,onLeft(files.x,168),16,31,sc.work,T_FILE);
475
	DrawFlatButton(onLeft(168,0),40,73,16,32,col_work,T_TYPE);
491
	DrawFlatButton(onLeft(168,0),40,73,16,32,sc.work,T_TYPE);
476
	DrawFlatButton(onLeft(95,0),40,68,16,33,col_work,T_SIZE);
492
	DrawFlatButton(onLeft(95,0),40,68,16,33,sc.work,T_SIZE);
477
	DrawBar(onLeft(27,0),files.y,1,onTop(22,files.y),col_border); //line to the left from the scroll
493
	DrawBar(files.x+files.w,files.y,1,onTop(22,files.y),sc.work_graph); //line to the left from the scroll
478
	DrawFlatButton(onLeft(27,0),40,16,16,0,col_work,"\x18");
494
	DrawFlatButton(files.x+files.w,40,16,16,0,sc.work,"\x18");
479
	DrawFlatButton(onLeft(27,0),onTop(22,0),16,16,0,col_work,"\x19");
495
	DrawFlatButton(files.x+files.w,onTop(22,0),16,16,0,sc.work,"\x19");
480
	Open_Dir(#path,ONLY_SHOW);
496
	Open_Dir(#path,ONLY_SHOW);
481
	if (del_active) Del_Form();
497
	if (del_active) Del_Form();
Line 555... Line 571...
555
	{ files.first=files.count-files.visible; files.current=files.visible-1; }
571
	{ files.first=files.count-files.visible; files.current=files.visible-1; }
556
	for (j=0; j
572
	for (j=0; j
557
	//in the bottom
573
	//in the bottom
558
	paint_y = j * files.line_h + files.y;
574
	paint_y = j * files.line_h + files.y;
559
	DrawBar(files.x,paint_y,files.w,onTop(paint_y,6),0xFFFFFF);
575
	DrawBar(files.x,paint_y,files.w,onTop(paint_y,6),0xFFFFFF);
560
	DrawBar(Form.cwidth-159,paint_y,1,onTop(paint_y,6),col_work);
576
	DrawBar(Form.cwidth-159,paint_y,1,onTop(paint_y,6),sc.work);
561
	DrawBar(Form.cwidth-86,paint_y,1,onTop(paint_y,6),col_work);
577
	DrawBar(Form.cwidth-86,paint_y,1,onTop(paint_y,6),sc.work);
562
	Scroll();
578
	Scroll();
563
}
579
}
Line 564... Line 580...
564
 
580
 
Line 604... Line 620...
604
		FileShow.text_pointer = off;
620
		FileShow.text_pointer = off;
605
		FileShow.start_y = files.line_h/2-3+y;
621
		FileShow.start_y = files.line_h/2-3+y;
606
		PathShow_prepare stdcall(#FileShow);
622
		PathShow_prepare stdcall(#FileShow);
607
		PathShow_draw stdcall(#FileShow);
623
		PathShow_draw stdcall(#FileShow);
608
	}
624
	}
609
	DrawBar(Form.cwidth-159,y,1,files.line_h,col_work); //gray line 1
625
	DrawBar(Form.cwidth-159,y,1,files.line_h,sc.work); //gray line 1
610
	DrawBar(Form.cwidth-86,y,1,files.line_h,col_work); //gray line 2
626
	DrawBar(Form.cwidth-86,y,1,files.line_h,sc.work); //gray line 2
611
}
627
}
Line 612... Line 628...
612
 
628
 
613
 
629
 
Line 637... Line 653...
637
		files.visible = files.h / files.line_h;
653
		files.visible = files.h / files.line_h;
638
		IF (files.count < files.visible) files.visible = files.count;
654
		IF (files.count < files.visible) files.visible = files.count;
639
		IF (sort_num==1) sorting_arrow_x = Form.width+60/2;
655
		IF (sort_num==1) sorting_arrow_x = Form.width+60/2;
640
		IF (sort_num==2) sorting_arrow_x = Form.width-115;
656
		IF (sort_num==2) sorting_arrow_x = Form.width-115;
641
		IF (sort_num==3) sorting_arrow_x = strlen(T_SIZE)*3-30+files.x+files.w;
657
		IF (sort_num==3) sorting_arrow_x = strlen(T_SIZE)*3-30+files.x+files.w;
642
		WriteText(sorting_arrow_x,45,0x80,col_border,"\x19");
658
		WriteText(sorting_arrow_x,45,0x80,sc.work_graph,"\x19");
643
		IF (redraw!=ONLY_SHOW) Sorting();
659
		IF (redraw!=ONLY_SHOW) Sorting();
644
		IF (redraw!=ONLY_OPEN) List_ReDraw();
660
		IF (redraw!=ONLY_OPEN) List_ReDraw();
645
	}
661
	}
646
	IF (files.count==-1) && (redraw!=ONLY_OPEN) {files.visible=files.count=0; List_ReDraw();}
662
	IF (files.count==-1) && (redraw!=ONLY_OPEN) {files.visible=files.count=0; List_ReDraw();}
647
}
663
}
Line 690... Line 706...
690
		if (itdir) ShowMessage(WAIT_DELETING_FOLDER, 0);
706
		if (itdir) ShowMessage(WAIT_DELETING_FOLDER, 0);
691
	}
707
	}
692
	else
708
	else
693
	{
709
	{
694
		if (!files.count) return;
710
		if (!files.count) return;
695
		DrawPopup(dform_x,160,220,80,1,col_work,col_border);
711
		DrawPopup(dform_x,160,220,80,1,sc.work,sc.work_graph);
696
		WriteText(-strlen(T_DELETE_FILE)*3+110+dform_x,175,0x80,0,T_DELETE_FILE);
712
		WriteText(-strlen(T_DELETE_FILE)*3+110+dform_x,175,0x80,sc.work_text,T_DELETE_FILE);
697
		IF (strlen(#file_name)<28) 
713
		IF (strlen(#file_name)<28) 
698
		{
714
		{
699
			WriteText(strlen(#file_name)*3+110+dform_x+2,190,0x80,0,"?");
715
			WriteText(strlen(#file_name)*3+110+dform_x+2,190,0x80,sc.work_text,"?");
700
			WriteText(-strlen(#file_name)*3+110+dform_x,190,0x80,0,#file_name);
716
			WriteText(-strlen(#file_name)*3+110+dform_x,190,0x80,sc.work_text,#file_name);
701
		}
717
		}
702
		else
718
		else
703
		{
719
		{
704
			WriteText(164+dform_x,190,0x80,0,"...?");
720
			WriteText(164+dform_x,190,0x80,0,"...?");
705
			ESI = 24;
721
			ESI = 24;