Subversion Repositories Kolibri OS

Rev

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

Rev 7447 Rev 7462
Line 24... Line 24...
24
#include "../lib/obj/box_lib.h"
24
#include "../lib/obj/box_lib.h"
25
#include "../lib/obj/libimg.h"
25
#include "../lib/obj/libimg.h"
Line 26... Line 26...
26
 
26
 
Line 27... Line -...
27
#include "../lib/patterns/history.h"
-
 
28
 
27
#include "../lib/patterns/history.h"
Line 29... Line 28...
29
//images
28
 
30
#include "imgs/left_p.txt"
29
#include "imgs/images.h"
31
 
30
 
32
//Button IDs
31
//Button IDs
Line 49... Line 48...
49
	ONLY_SHOW, 
48
	ONLY_SHOW, 
50
	WITH_REDRAW, 
49
	WITH_REDRAW, 
51
	ONLY_OPEN
50
	ONLY_OPEN
52
};
51
};
Line 53... Line 52...
53
 
52
 
Line 54... Line 53...
54
dword col_padding=0, col_selec, col_lpanel, col_work, col_graph, col_list_line=0xDDD7CF;
53
dword col_selec, col_lpanel, col_work, col_graph, col_list_line=0xDDD7CF;
Line 55... Line 54...
55
 
54
 
56
int toolbar_buttons_x[7]={9,46,85,134,167,203};
55
int toolbar_buttons_x[7]={9,46,85,134,167,203};
Line 115... Line 114...
115
	248,#new_element_name,0,100000000000010b,6,0};
114
	248,#new_element_name,0,100000000000010b,6,0};
116
PathShow_data FileShow = {0, 56,215, 8, 100, 1, 0, 0x0, 0xFFFfff, #file_name, #temp, 0};
115
PathShow_data FileShow = {0, 56,215, 8, 100, 1, 0, 0x0, 0xFFFfff, #file_name, #temp, 0};
117
byte cmd_free=0;
116
byte cmd_free=0;
118
#include "include\translations.h"
117
#include "include\translations.h"
Line -... Line 118...
-
 
118
 
119
 
119
#include "include\gui.h"
120
#include "include\settings.h"
120
#include "include\settings.h"
121
#include "include\progress_dialog.h"
121
#include "include\progress_dialog.h"
122
#include "include\copy.h"
-
 
123
#include "include\gui.h"
122
#include "include\copy.h"
124
#include "include\sorting.h"
123
#include "include\sorting.h"
125
#include "include\icons.h"
124
#include "include\icons.h"
126
#include "include\left_panel.h"
125
#include "include\left_panel.h"
127
#include "include\menu.h"
126
#include "include\menu.h"
Line 262... Line 261...
262
					break;
261
					break;
263
				}
262
				}
Line 264... Line 263...
264
 
263
 
265
				if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+16) && (mouse.y>files.y-17) && (mouse.y
264
				if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+16) && (mouse.y>files.y-17) && (mouse.y
266
				{
265
				{
267
					if (mouse.lkm==1) DrawRectangle3D(files.x+files.w+1,files.y-16,14,14,0xC7C7C7,0xFFFFFF);
266
					if (mouse.lkm) DrawRectangle3D(files.x+files.w+1,files.y-16,14,14,system.color.work_dark,system.color.work_light);
268
					WHILE (mouse.lkm==1) && (files.first>0)
267
					WHILE (mouse.lkm) && (files.first>0)
269
					{
268
					{
270
						pause(8);
269
						pause(8);
271
						files.first--;
270
						files.first--;
272
						List_ReDraw();
271
						List_ReDraw();
273
						mouse.get();
272
						mouse.get();
274
					}
273
					}
275
					DrawRectangle3D(files.x+files.w+1,files.y-16,14,14,0xFFFFFF,0xC7C7C7);
274
					DrawRectangle3D(files.x+files.w+1,files.y-16,14,14,system.color.work_light,system.color.work_dark);
Line 276... Line 275...
276
				}
275
				}
277
 
276
 
278
				if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+16) && (mouse.y>files.y+files.h-16) && (mouse.y
277
				if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+16) && (mouse.y>files.y+files.h-16) && (mouse.y
279
				{
278
				{
280
					if (mouse.lkm==1) DrawRectangle3D(files.x+files.w+1,files.y+files.h-15,14,14,0xC7C7C7,0xFFFFFF);
279
					if (mouse.lkm) DrawRectangle3D(files.x+files.w+1,files.y+files.h-15,14,14,system.color.work_dark,system.color.work_light);
281
					while (mouse.lkm==1) && (files.first
280
					while (mouse.lkm) && (files.first
282
					{
281
					{
283
						pause(8);
282
						pause(8);
284
						files.first++;
283
						files.first++;
285
						List_ReDraw();
284
						List_ReDraw();
286
						mouse.get();
285
						mouse.get();
287
					}
286
					}
Line 288... Line 287...
288
					DrawRectangle3D(files.x+files.w+1,files.y+files.h-15,14,14,0xFFFFFF,0xC7C7C7);
287
					DrawRectangle3D(files.x+files.w+1,files.y+files.h-15,14,14,system.color.work_light,system.color.work_dark);
289
				}
-
 
290
 
288
				}
-
 
289
 
Line 291... Line 290...
291
				//Scrooll
290
				//Scrooll
292
				if (!mouse.lkm) && (scroll_used) { scroll_used=false; Scroll(); }
291
				if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+18) && (mouse.y>files.y) && (mouse.y
293
				if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+18) && (mouse.y>files.y) && (mouse.y
292
				if (scroll_used) && (mouse.up) { scroll_used=false; Scroll(); }
294
				
293
				
Line 377... Line 376...
377
							break;
376
							break;
378
					case 50...60: //Actions
377
					case 50...60: //Actions
379
							FnProcess(id-50);
378
							FnProcess(id-50);
380
							break;
379
							break;
381
					case 61: // Set path as default
380
					case 61: // Set path as default
382
							ini.path = GetIni(#eolite_ini_path, "EOLITE.INI");
-
 
383
							ini.section = "Config";
-
 
384
							ini.SetString("DefaultPath", #path, strlen(#path));
381
							SetDefaultPath(#path);
385
							break;
382
							break;
386
					case 100...120:
383
					case 100...120:
387
						SystemDiscs.Click(id-100);
384
						SystemDiscs.Click(id-100);
388
						break;
385
						break;
389
					case BREADCRUMB_ID...360:
386
					case BREADCRUMB_ID...360:
Line 550... Line 547...
550
			cmd_free = false;
547
			cmd_free = false;
551
		}
548
		}
552
	}
549
	}
553
}
550
}
Line 554... Line -...
554
 
-
 
555
void DrawFavButton(int x)
-
 
556
{
-
 
557
	_PutImage(x,10,20,22,#fav);
-
 
558
	DefineHiddenButton(x+1,11,20-2,22-3,61);
-
 
559
}
-
 
560
 
551
 
561
void draw_window()
552
void draw_window()
562
{
553
{
563
	int i;
554
	int i;
564
	if (show_status_bar.checked) status_bar_h = STATUS_BAR_H; else status_bar_h = 0;
555
	if (show_status_bar.checked) status_bar_h = STATUS_BAR_H; else status_bar_h = 0;
565
	DefineAndDrawWindow(Form.left+rand_n,Form.top+rand_n,Form.width,Form.height,0x73,NULL,TITLE,0);
556
	DefineAndDrawWindow(Form.left+rand_n,Form.top+rand_n,Form.width,Form.height,0x73,NULL,TITLE,0);
566
	GetProcessInfo(#Form, SelfInfo);
557
	GetProcessInfo(#Form, SelfInfo);
567
	if (Form.status_window>2) return;
558
	if (Form.status_window>2) return;
568
	if (Form.height < 350) { MoveSize(OLD,OLD,OLD,350); return; }
559
	if (Form.height < 350) { MoveSize(OLD,OLD,OLD,350); return; }
569
	if (Form.width  < 480) { MoveSize(OLD,OLD,480,OLD); return; }
560
	if (Form.width  < 480) { MoveSize(OLD,OLD,480,OLD); return; }
-
 
561
	GetProcessInfo(#Form, SelfInfo); //if win_size changed
-
 
562
	ESDWORD[#toolbar_pal] = col_work;
570
	GetProcessInfo(#Form, SelfInfo); //if win_size changed
563
	ESDWORD[#toolbar_pal+4] = MixColors(0, col_work, 35);
571
	_PutImage(0,0,246,34,#toolbar);
564
	PutPaletteImage(#toolbar, 246, 34, 0, 0, 8, #toolbar_pal);
572
	DrawBar(127, 8, 1, 25, col_graph);
565
	DrawBar(127, 8, 1, 25, col_graph);
573
	for (i=0; i<3; i++) DefineHiddenButton(toolbar_buttons_x[i]+2,7,31-5,29-5,21+i);
566
	for (i=0; i<3; i++) DefineHiddenButton(toolbar_buttons_x[i]+2,7,31-5,29-5,21+i);
574
	for (i=3; i<6; i++) DefineHiddenButton(toolbar_buttons_x[i],  5,31,  29,  21+i);
567
	for (i=3; i<6; i++) DefineHiddenButton(toolbar_buttons_x[i],  5,31,  29,  21+i);
-
 
568
	DrawBar(246,0, Form.cwidth - 246, 34, col_work);
-
 
569
	DrawDot(Form.cwidth-17,12);
575
	DrawBar(246,0, Form.cwidth - 246, 34, col_work);
570
	DrawDot(Form.cwidth-17,12+6);
576
	_PutImage(Form.cwidth-17,11,6,18,#dots);
571
	DrawDot(Form.cwidth-17,12+12);
577
	DefineHiddenButton(Form.cwidth-24,7,20,25,51+BT_NOFRAME); //dots
572
	DefineHiddenButton(Form.cwidth-24,7,20,25,51+BT_NOFRAME); //dots
578
	//main rectangles
573
	//main rectangles
579
	DrawRectangle(1,40,Form.cwidth-3,Form.cheight - 42-status_bar_h,col_graph);
574
	DrawRectangle(1,40,Form.cwidth-3,Form.cheight - 42-status_bar_h,col_graph);
580
	DrawRectangle(0,39,Form.cwidth-1,Form.cheight - 40,col_palette[4]); //bg
575
	DrawRectangle(0,39,Form.cwidth-1,-show_status_bar.checked*status_bar_h + Form.cheight - 40,col_work_gradient[4]); //bg
581
	for (i=0; i<5; i++) DrawBar(0, 34+i, Form.cwidth, 1, col_palette[8-i]);
576
	for (i=0; i<5; i++) DrawBar(0, 34+i, Form.cwidth, 1, col_work_gradient[11-i]);
582
	llist_copy(#files_active, #files);
577
	llist_copy(#files_active, #files);
583
	strcpy(#active_path, #path);
578
	strcpy(#active_path, #path);
584
	DrawStatusBar();
579
	DrawStatusBar();
585
	if (selected_count==0) Open_Dir(#path,ONLY_OPEN); //if there are no selected files -> refresh folder [L001] 
580
	if (selected_count==0) Open_Dir(#path,ONLY_OPEN); //if there are no selected files -> refresh folder [L001] 
Line 595... Line 590...
595
	DrawFlatButtonSmall(files.x + files.w,       files.y-17,16,16, 0,"\x18");
590
	DrawFlatButtonSmall(files.x + files.w,       files.y-17,16,16, 0,"\x18");
596
	DrawFlatButtonSmall(files.x + files.w,files.y+files.h-16,16,16,0,"\x19");
591
	DrawFlatButtonSmall(files.x + files.w,files.y+files.h-16,16,16,0,"\x19");
597
	if (sort_num==1) sorting_arrow_x = files.w - 141 / 2 + files.x + 18;
592
	if (sort_num==1) sorting_arrow_x = files.w - 141 / 2 + files.x + 18;
598
	if (sort_num==2) sorting_arrow_x = files.x + files.w - 90;
593
	if (sort_num==2) sorting_arrow_x = files.x + files.w - 90;
599
	if (sort_num==3) sorting_arrow_x = strlen(T_SIZE)*3-30+files.x+files.w;
594
	if (sort_num==3) sorting_arrow_x = strlen(T_SIZE)*3-30+files.x+files.w;
600
	WriteText(sorting_arrow_x,files.y-12,0x80,col_graph,"\x19");
595
	WriteText(sorting_arrow_x,files.y-12,0x80, system.color.work_text,"\x19");
601
	DrawBar(files.x+files.w,files.y,1,files.h,col_graph);
596
	DrawBar(files.x+files.w,files.y,1,files.h,col_graph);
602
	if (two_panels.checked) && (files.x<5) DrawBar(files.x+files.w+16,files.y,1,files.h,col_graph);	
597
	if (two_panels.checked) && (files.x<5) DrawBar(files.x+files.w+16,files.y,1,files.h,col_graph);	
603
}
598
}
Line 604... Line 599...
604
 
599
 
605
void DrawStatusBar()
600
void DrawStatusBar()
606
{
601
{
607
	char status_bar_str[80];
602
	char status_bar_str[80];
608
	int go_up_folder_exists=0;
603
	int go_up_folder_exists=0;
609
	if (!show_status_bar.checked) return;
604
	if (!show_status_bar.checked) return;
610
	if (files.count>0) && (strcmp(file_mas[0]*304+buf+72,"..")==0) go_up_folder_exists=1;
605
	if (files.count>0) && (strcmp(file_mas[0]*304+buf+72,"..")==0) go_up_folder_exists=1;
611
	DrawBar(1, Form.cheight - status_bar_h-1, Form.cwidth-2,  status_bar_h, system.color.work);
606
	DrawBar(0, Form.cheight - status_bar_h, Form.cwidth,  status_bar_h, system.color.work);
612
	sprintf(#status_bar_str, STATUS_STR, files.count-go_up_folder_exists, count_dir-go_up_folder_exists, files.count-count_dir, selected_count);
607
	sprintf(#status_bar_str, STATUS_STR, files.count-go_up_folder_exists, count_dir-go_up_folder_exists, files.count-count_dir, selected_count);
613
	WriteText(6,Form.cheight - 13,0x80,system.color.work_text,#status_bar_str);
608
	WriteText(6,Form.cheight - 13,0x80,system.color.work_text,#status_bar_str);
Line 614... Line 609...
614
}
609
}