Subversion Repositories Kolibri OS

Rev

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

Rev 5437 Rev 5441
Line 81... Line 81...
81
	?define T_SELECT_APP_TO_OPEN_WITH "Select application to open file"
81
	?define T_SELECT_APP_TO_OPEN_WITH "Select application to open file"
82
#endif
82
#endif
Line 83... Line 83...
83
 
83
 
Line 84... Line 84...
84
enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir
84
enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir
85
 
85
 
86
#define TITLE "Eolite File Manager v2.49"
86
#define TITLE "Eolite File Manager v2.50"
Line 87... Line 87...
87
#define ABOUT_TITLE "Eolite v2.49"
87
#define ABOUT_TITLE "Eolite v2.50"
88
dword col_padding, col_selec, col_lpanel;
88
dword col_padding, col_selec, col_lpanel;
89
 
89
 
Line 111... Line 111...
111
	show_dev_name=1,
111
	show_dev_name=1,
112
	real_files_names_case=0,
112
	real_files_names_case=0,
113
	sort_num=2,
113
	sort_num=2,
114
	itdir;
114
	itdir;
Line -... Line 115...
-
 
115
 
-
 
116
dword eolite_ini_path;
115
 
117
 
116
proc_info Form;
118
proc_info Form;
117
system_colors sc;
119
system_colors sc;
118
mouse m;
120
mouse m;
119
int mouse_dd, scroll_used, scroll_size, sorting_arrow_x, kolibrios_drive;
121
int mouse_dd, scroll_used, scroll_size, sorting_arrow_x, kolibrios_drive;
Line 140... Line 142...
140
 
142
 
141
void main() 
143
void main() 
142
{
144
{
143
	word key, id, can_show, can_select, m_selected;
145
	word key, id, can_show, can_select, m_selected;
144
	dword selected_offset;
-
 
145
	randomize();
146
	dword selected_offset;
Line 146... Line 147...
146
	rand_n = random(40);
147
	rand_n = random(40);
147
 
148
 
148
	files.line_h=18;
149
	files.line_h=18;
149
	mem_Init();
150
	mem_Init();
-
 
151
	if (load_dll2(boxlib, #box_lib_init,0)!=0) notify(ERROR_1);
150
	if (load_dll2(boxlib, #box_lib_init,0)!=0) notify(ERROR_1);
152
    if (load_dll2(libini, #lib_init,1)!=0) notify("Error: library doesn't exists - libini");
151
    if (load_dll2(libini, #lib_init,1)!=0) notify("Error: library doesn't exists - libini");
153
	eolite_ini_path = abspath("Eolite.ini"); 
152
	SystemDiscsGet();
154
	LoadIniSettings();
153
	GetIni();
155
	GetSystemDiscs();
154
	SetAppColors();
156
	SetAppColors();
155
	if (param)
157
	if (param)
156
	{
158
	{
Line 224... Line 226...
224
				break;
226
				break;
225
			}
227
			}
Line 226... Line 228...
226
 
228
 
227
			if (m.x>=Form.width-26) && (m.x<=Form.width-6) && (m.y>40) && (m.y
229
			if (m.x>=Form.width-26) && (m.x<=Form.width-6) && (m.y>40) && (m.y
228
			{
230
			{
229
				IF (m.lkm==1) DrawRectangle3D(onLeft(26,0),41,14,14,0xC7C7C7,0xFFFFFF);
231
				IF (m.lkm==1) DrawRectangle3D(Form.cwidth - 17,41,14,14,0xC7C7C7,0xFFFFFF);
230
				WHILE (m.lkm==1) && (files.first>0)
232
				WHILE (m.lkm==1) && (files.first>0)
231
				{
233
				{
232
					pause(8);
234
					pause(8);
233
					files.first--;
235
					files.first--;
234
					List_ReDraw();
236
					List_ReDraw();
235
					m.get();
237
					m.get();
236
				}
238
				}
237
				DrawRectangle3D(onLeft(26,0),41,14,14,0xFFFFFF,0xC7C7C7);
239
				DrawRectangle3D(Form.cwidth - 17,41,14,14,0xFFFFFF,0xC7C7C7);
Line 238... Line 240...
238
			}
240
			}
239
 
241
 
240
			if (m.x>=Form.width-26) && (m.x<=Form.width-6) && (m.y>onTop(22,0)+1) && (m.y
242
			if (m.x>=Form.width-26) && (m.x<=Form.width-6) && (m.y>onTop(22,0)+1) && (m.y
241
			{
243
			{
242
				IF (m.lkm==1) DrawRectangle3D(onLeft(26,0),onTop(21,0),14,14,0xC7C7C7,0xFFFFFF);
244
				IF (m.lkm==1) DrawRectangle3D(Form.cwidth - 17,onTop(21,0),14,14,0xC7C7C7,0xFFFFFF);
243
				while (m.lkm==1) && (files.first
245
				while (m.lkm==1) && (files.first
244
				{
246
				{
245
					pause(8);
247
					pause(8);
246
					files.first++;
248
					files.first++;
247
					List_ReDraw();
249
					List_ReDraw();
248
					m.get();
250
					m.get();
249
				}
251
				}
Line 250... Line 252...
250
				DrawRectangle3D(onLeft(26,0),onTop(21,0),14,14,0xFFFFFF,0xC7C7C7);
252
				DrawRectangle3D(Form.cwidth - 17,onTop(21,0),14,14,0xFFFFFF,0xC7C7C7);
251
			}
253
			}
252
 
254
 
Line 325... Line 327...
325
						break;
327
						break;
326
				case 130...160:
328
				case 130...160:
327
						tmp_disk_del_param[1] = id - 130 + 48;
329
						tmp_disk_del_param[1] = id - 130 + 48;
328
						RunProgram("/sys/tmpdisk", #tmp_disk_del_param);
330
						RunProgram("/sys/tmpdisk", #tmp_disk_del_param);
329
						pause(10);
331
						pause(10);
330
						SystemDiscsGet();
332
						GetSystemDiscs();
331
						Open_Dir(#path,WITH_REDRAW);
333
						Open_Dir(#path,WITH_REDRAW);
332
						DrawLeftPanel();
334
						DrawLeftPanel();
333
						//m.get();
335
						//m.get();
334
						break;
336
						break;
335
			}
337
			}
Line 477... Line 479...
477
void draw_window()
479
void draw_window()
478
{
480
{
479
	DefineAndDrawWindow(GetScreenWidth()-550/4+rand_n,rand_n+30,550,500,0x73,sc.work,TITLE,0);
481
	DefineAndDrawWindow(GetScreenWidth()-550/4+rand_n,rand_n+30,550,500,0x73,sc.work,TITLE,0);
480
	GetProcessInfo(#Form, SelfInfo);
482
	GetProcessInfo(#Form, SelfInfo);
481
	if (Form.status_window>2) return;
483
	if (Form.status_window>2) return;
482
	files.SetSizes(192, 57, onLeft(192,27), onTop(57,6), disc_num*16+195,files.line_h);
484
	files.SetSizes(192, 57, Form.cwidth - 210, onTop(57,6), disc_num*16+195,files.line_h);
483
	if (Form.height < files.min_h) MoveSize(OLD,OLD,OLD,files.min_h);
485
	if (Form.height < files.min_h) MoveSize(OLD,OLD,OLD,files.min_h);
484
	if (Form.width<480) MoveSize(OLD,OLD,480,OLD);
486
	if (Form.width<480) MoveSize(OLD,OLD,480,OLD);
485
	GetProcessInfo(#Form, SelfInfo); //if win_size changed
487
	GetProcessInfo(#Form, SelfInfo); //if win_size changed
Line 486... Line 488...
486
 
488
 
487
	PutPaletteImage(#toolbar,246,34,0,0,8,#toolbar_pal);
489
	PutPaletteImage(#toolbar,246,34,0,0,8,#toolbar_pal);
488
	DrawBar(127, 8, 1, 25, sc.work_graph);
490
	DrawBar(127, 8, 1, 25, sc.work_graph);
489
	for (j=0; j<3; j++) DefineButton(toolbar_buttons_x[j]+2,5+2,31-5,29-5,21+j+BT_HIDE,sc.work);
491
	for (j=0; j<3; j++) DefineButton(toolbar_buttons_x[j]+2,5+2,31-5,29-5,21+j+BT_HIDE,sc.work);
490
	for (j=3; j<6; j++) DefineButton(toolbar_buttons_x[j],5,31,29,21+j+BT_HIDE,sc.work);
492
	for (j=3; j<6; j++) DefineButton(toolbar_buttons_x[j],5,31,29,21+j+BT_HIDE,sc.work);
491
	DrawBar(246,0,onLeft(246,60),12, sc.work); //upper editbox
493
	DrawBar(246,0,Form.cwidth - 297,12, sc.work); //upper editbox
492
	DrawBar(246,29,onLeft(246,60),5,sc.work);  //under editbox
494
	DrawBar(246,29,Form.cwidth - 297,5,sc.work);  //under editbox
493
	DrawRectangle(246,12,onLeft(66,246),16,sc.work_graph);
495
	DrawRectangle(246,12,Form.cwidth - 303,16,sc.work_graph);
494
	DefineButton(onLeft(34,0),6,27,28,51+BT_HIDE+BT_NOFRAME,0); //about
496
	DefineButton(Form.cwidth - 25,6,27,28,51+BT_HIDE+BT_NOFRAME,0); //about
495
	PutPaletteImage(#goto_about,56,34,Form.width-65,0,8,#goto_about_pal);
497
	PutPaletteImage(#goto_about,56,34,Form.width-65,0,8,#goto_about_pal);
496
	//main rectangles
498
	//main rectangles
497
	DrawRectangle(1,40,Form.cwidth-3,onTop(46,0),sc.work_graph);
499
	DrawRectangle(1,40,Form.cwidth-3,onTop(46,0),sc.work_graph);
498
	DrawRectangle(0,39,Form.cwidth-1,onTop(44,0),col_palette[4]); //bg
500
	DrawRectangle(0,39,Form.cwidth-1,onTop(44,0),col_palette[4]); //bg
499
	for (i=0; i<5; i++) DrawBar(0, 34+i, Form.cwidth, 1, col_palette[8-i]);	
501
	for (i=0; i<5; i++) DrawBar(0, 34+i, Form.cwidth, 1, col_palette[8-i]);	
500
	DrawLeftPanel();
502
	DrawLeftPanel();
501
	//ListBox
503
	//ListBox
502
	DrawFlatButton(files.x,40,onLeft(files.x,168),16,31,sc.work,T_FILE);
504
	DrawFlatButton(files.x,40,Form.cwidth + files.x - 159,16,31,sc.work,T_FILE);
503
	DrawFlatButton(onLeft(168,0),40,73,16,32,sc.work,T_TYPE);
505
	DrawFlatButton(Form.cwidth + 159,40,73,16,32,sc.work,T_TYPE);
504
	DrawFlatButton(onLeft(95,0),40,68,16,33,sc.work,T_SIZE);
506
	DrawFlatButton(Form.cwidth + 96,40,68,16,33,sc.work,T_SIZE);
505
	DrawBar(files.x+files.w,files.y,1,onTop(22,files.y),sc.work_graph); //line to the left from the scroll
507
	DrawBar(files.x+files.w,files.y,1,onTop(22,files.y),sc.work_graph); //line to the left from the scroll
506
	DrawFlatButton(files.x+files.w,40,16,16,0,sc.work,"\x18");
508
	DrawFlatButton(files.x+files.w,40,16,16,0,sc.work,"\x18");
507
	DrawFlatButton(files.x+files.w,onTop(22,0),16,16,0,sc.work,"\x19");
509
	DrawFlatButton(files.x+files.w,onTop(22,0),16,16,0,sc.work,"\x19");
508
	Open_Dir(#path,ONLY_SHOW);
510
	Open_Dir(#path,ONLY_SHOW);
Line 612... Line 614...
612
	file_name_off = file_offet+40;
614
	file_name_off = file_offet+40;
Line 613... Line 615...
613
 
615
 
614
	if (! TestBit(file.attr, 4) ) //file or folder?
616
	if (! TestBit(file.attr, 4) ) //file or folder?
615
	{	
617
	{	
616
		Put_icon(file_name_off+_strrchr(file_name_off,'.'), files.x+3, files.line_h/2-7+y, color, 0);
618
		Put_icon(file_name_off+_strrchr(file_name_off,'.'), files.x+3, files.line_h/2-7+y, color, 0);
617
		WriteText(7-strlen(ConvertSize(file.sizelo))*6+onLeft(75,0),files.line_h-6/2+y,0x80,0,ConvertSize(file.sizelo));
619
		WriteText(7-strlen(ConvertSize(file.sizelo))*6+Form.cwidth - 76,files.line_h-6/2+y,0x80,0,ConvertSize(file.sizelo));
618
	}
620
	}
619
	else
621
	else
620
	{
622
	{
621
		if (strcmp("..",file_name_off)==0) ext1=".."; else ext1="";
623
		if (strcmp("..",file_name_off)==0) ext1=".."; else ext1="";
Line 955... Line 957...
955
			break;
957
			break;
956
		case 5: //refresh cur dir & devs
958
		case 5: //refresh cur dir & devs
957
			Tip(56, T_DEVICES, 55, "-");
959
			Tip(56, T_DEVICES, 55, "-");
958
			Open_Dir(#path,WITH_REDRAW);
960
			Open_Dir(#path,WITH_REDRAW);
959
			pause(10);
961
			pause(10);
960
			GetIni();
962
			LoadIniSettings();
961
			SystemDiscsGet();
963
			GetSystemDiscs();
962
			Open_Dir(#path,WITH_REDRAW);
964
			Open_Dir(#path,WITH_REDRAW);
963
			DrawLeftPanel();
965
			DrawLeftPanel();
964
			break;
966
			break;
965
		case 6:
967
		case 6:
966
			strcpy(#temp, #path);
968
			strcpy(#temp, #path);
Line 1004... Line 1006...
1004
			break;
1006
			break;
1005
	}
1007
	}
1006
}
1008
}
Line 1007... Line 1009...
1007
 
1009
 
1008
//need to remove these functiones, they are a very old shit :)
-
 
1009
dword onLeft(dword right,left) {EAX=Form.width-right-left;}
1010
//need to remove these functiones, they are a very old shit :)
Line 1010... Line 1011...
1010
dword onTop(dword down,up) {EAX=Form.height-GetSkinHeight()-down-up;}
1011
dword onTop(dword down,up) {EAX=Form.height-GetSkinHeight()-down-up;}