Subversion Repositories Kolibri OS

Rev

Rev 8946 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8946 Rev 8949
1
//===================================================//
1
//===================================================//
2
//                                                   //
2
//                                                   //
3
//                      PATH                         //
3
//                      PATH                         //
4
//                                                   //
4
//                                                   //
5
//===================================================//
5
//===================================================//
6
 
6
 
7
char work_area_pointer[1024];
7
char work_area_pointer[1024];
8
PathShow_data PathShow = {0, 17,250, 6, 250, 0, 0, 0x000000, 0xFFFFCC, #path, #work_area_pointer, 0};
8
PathShow_data PathShow = {0, 17,250, 6, 250, 0, 0, 0x000000, 0xFFFFCC, NULL, #work_area_pointer, 0};
9
void DrawPathBar()
9
void DrawPathBar()
10
{
10
{
11
	if (efm) {
11
	if (efm) {
12
		DrawPathBarKfm();
12
		DrawPathBarKfm();
13
		return;
13
		return;
14
	}
14
	}
15
 
15
 
16
	if (show_breadcrumb.checked) {
16
	if (show_breadcrumb.checked) {
17
		DrawBreadCrumbs(); 
17
		DrawBreadCrumbs(); 
18
		return;
18
		return;
19
	}
19
	}
20
 
20
 
-
 
21
	PathShow.text_pointer = location[0];
21
	PathShow.start_x = 250;
22
	PathShow.start_x = 250;
22
	PathShow.start_y = 17;
23
	PathShow.start_y = 17;
23
	PathShow.area_size_x = Form.cwidth-300;
24
	PathShow.area_size_x = Form.cwidth-300;
24
	DrawBar(PathShow.start_x-3, PathShow.start_y-6, PathShow.area_size_x+3, 19, col.odd_line);
25
	DrawBar(PathShow.start_x-3, PathShow.start_y-6, PathShow.area_size_x+3, 19, col.odd_line);
25
	DrawRectangle(PathShow.start_x-4,PathShow.start_y-7,PathShow.area_size_x+4,20,sc.work_graph);
26
	DrawRectangle(PathShow.start_x-4,PathShow.start_y-7,PathShow.area_size_x+4,20,sc.work_graph);
26
	DefineHiddenButton(PathShow.start_x-4+1,PathShow.start_y-7+1,PathShow.area_size_x+4-2,20-2,PATH_BTN);
27
	DefineHiddenButton(PathShow.start_x-4+1,PathShow.start_y-7+1,PathShow.area_size_x+4-2,20-2,PATH_BTN);
27
	DrawBar(PathShow.start_x-4, PathShow.start_y+14, PathShow.area_size_x+5+18, 1, sc.work_light);
28
	DrawBar(PathShow.start_x-4, PathShow.start_y+14, PathShow.area_size_x+5+18, 1, sc.work_light);
28
 
29
 
29
	DrawFlatButtonSmall(PathShow.start_x+PathShow.area_size_x,PathShow.start_y-7,18,20, 61, "\26");
30
	DrawFlatButtonSmall(PathShow.start_x+PathShow.area_size_x,PathShow.start_y-7,18,20, 61, "\26");
30
 
31
 
31
	PathShow.font_color = col.list_gb_text;
32
	PathShow.font_color = col.list_gb_text;
32
	PathShow_prepare stdcall(#PathShow);
33
	PathShow_prepare stdcall(#PathShow);
33
	PathShow_draw stdcall(#PathShow);
34
	PathShow_draw stdcall(#PathShow);
34
}
35
}
35
 
36
 
36
void DrawPathBarKfm()
37
void DrawPathBarKfm()
37
{
38
{
38
	dword bgc;
39
	dword bgc;
39
	int i=0;
40
	int i=0;
40
	if (!Form.cwidth) return;
41
	if (!Form.cwidth) return;
41
 
42
 
42
	if (skin_is_dark()) {
43
	if (skin_is_dark()) {
43
		bgc = col.odd_line;
44
		bgc = col.odd_line;
44
		PathShow.font_color = col.list_gb_text;
45
		PathShow.font_color = col.list_gb_text;
45
	} else {
46
	} else {
46
		bgc = 0xFFFFCC; 
47
		bgc = 0xFFFFCC; 
47
		PathShow.font_color = 0x222222;
48
		PathShow.font_color = 0x222222;
48
	}
49
	}
49
	if (active_panel==0) PathShow.text_pointer = #path; else PathShow.text_pointer = #inactive_path;
50
	PathShow.start_y = Form.cheight - status_bar_h+2;
50
	PathShow.start_x = 4;
-
 
51
	PathShow.area_size_x = Form.cwidth/2-8;
-
 
52
	PathShow.start_y = Form.cheight - status_bar_h+2;
-
 
53
 
51
 
-
 
52
	PathShow.start_x = 4;
-
 
53
	PathShow.area_size_x = Form.cwidth/2-8;
54
	_DRAW_BAR:
54
	do {
55
	DrawBar(PathShow.start_x-2,PathShow.start_y-3,PathShow.area_size_x+5,14,bgc);
55
		DrawBar(PathShow.start_x-2,PathShow.start_y-3,PathShow.area_size_x+5,14,bgc);
56
	DrawRectangle(PathShow.start_x-3,PathShow.start_y-4,PathShow.area_size_x+6,15,sc.work_graph);
56
		DrawRectangle(PathShow.start_x-3,PathShow.start_y-4,PathShow.area_size_x+6,15,sc.work_graph);
-
 
57
		PathShow.text_pointer = location[i];
57
	PathShow_prepare stdcall(#PathShow);
58
		PathShow_prepare stdcall(#PathShow);
58
	PathShow_draw stdcall(#PathShow);
59
		PathShow_draw stdcall(#PathShow);
59
	i++;
60
		
60
	if (i<2) {
-
 
61
		if (active_panel==0) PathShow.text_pointer = #inactive_path; else PathShow.text_pointer = #path;
-
 
62
		PathShow.start_x = Form.cwidth/2 + 2;
61
		PathShow.start_x = Form.cwidth/2 + 2;
63
		PathShow.area_size_x = Form.cwidth - PathShow.start_x - 5;
62
		PathShow.area_size_x = Form.cwidth - PathShow.start_x - 5;		
64
		goto _DRAW_BAR;
63
		i++;
65
	}
64
	} while (i<2);
66
 
65
 
67
	DrawBar(0,PathShow.start_y-2,1,15,sc.work);
66
	DrawBar(0,PathShow.start_y-2,1,15,sc.work);
68
	DrawBar(Form.cwidth-1,PathShow.start_y-2,1,15,sc.work);
67
	DrawBar(Form.cwidth-1,PathShow.start_y-2,1,15,sc.work);
69
	DrawBar(1,PathShow.start_y+12,Form.cwidth-2,1,sc.work_light);
68
	DrawBar(1,PathShow.start_y+12,Form.cwidth-2,1,sc.work_light);
70
}
69
}
71
 
70
 
72
void DrawPathBarKfm_Line()
-
 
73
{
-
 
74
 
-
 
75
}
-
 
76
 
-
 
77
 
-
 
78
//===================================================//
71
//===================================================//
79
//                                                   //
72
//                                                   //
80
//                   BREADCRUMBS                     //
73
//                   BREADCRUMBS                     //
81
//                                                   //
74
//                                                   //
82
//===================================================//
75
//===================================================//
83
 
76
 
84
void DrawBreadCrumbs()
77
void DrawBreadCrumbs()
85
 collection_int breadCrumb=0;
78
 collection_int breadCrumb=0;
86
 char PathShow_path[4096];
79
 char PathShow_path[4096];
87
 block btn;
80
 block btn;
88
 int i;
81
 int i;
89
 unsigned text_line;
82
 unsigned text_line;
90
 {
83
 {
91
	strcat(#PathShow_path, #path);
84
	strcat(#PathShow_path, path);
92
	for (i=0; i<50; i++) DeleteButton(i+BREADCRUMB_ID);
85
	for (i=0; i<50; i++) DeleteButton(i+BREADCRUMB_ID);
93
	breadCrumb.drop();
86
	breadCrumb.drop();
94
	for (i=0; (PathShow_path[i]) && (i
87
	for (i=0; (PathShow_path[i]) && (i
95
	{
88
	{
96
		if (PathShow_path[i]=='/') {
89
		if (PathShow_path[i]=='/') {
97
			PathShow_path[i] = NULL;
90
			PathShow_path[i] = NULL;
98
			breadCrumb.add(i+1);
91
			breadCrumb.add(i+1);
99
		}
92
		}
100
	}
93
	}
101
	breadCrumb.add(i+1);
94
	breadCrumb.add(i+1);
102
	btn.set_size(246,10,NULL,20);
95
	btn.set_size(246,10,NULL,20);
103
	//area_w = Form.cwidth - btn.x - 20;
96
	//area_w = Form.cwidth - btn.x - 20;
104
	for (i=0; i
97
	for (i=0; i
105
	{
98
	{
106
		text_line = breadCrumb.get(i) + #PathShow_path;
99
		text_line = breadCrumb.get(i) + #PathShow_path;
107
		btn.w = strlen(text_line)*8+10;
100
		btn.w = strlen(text_line)*8+10;
108
		DrawBreadcrumbButton(btn.x, btn.y, btn.w, btn.h, i+BREADCRUMB_ID, text_line);
101
		DrawBreadcrumbButton(btn.x, btn.y, btn.w, btn.h, i+BREADCRUMB_ID, text_line);
109
		btn.x += btn.w;
102
		btn.x += btn.w;
110
	}
103
	}
111
	//DrawFavButton(btn.x);
104
	//DrawFavButton(btn.x);
112
	//btn.x+=20;
105
	//btn.x+=20;
113
	btn.x++;
106
	btn.x++;
114
	DrawBar(btn.x,btn.y-1,Form.cwidth-btn.x-25,btn.h+3,sc.work);
107
	DrawBar(btn.x,btn.y-1,Form.cwidth-btn.x-25,btn.h+3,sc.work);
115
}
108
}
116
 
109
 
117
 
110
 
118
void ClickOnBreadCrumb(unsigned clickid)
111
void ClickOnBreadCrumb(unsigned clickid)
119
{
112
{
120
	int i, slashpos = #path;
113
	int i, slashpos = path;
121
	for (i=0; i!=clickid+2; i++) {
114
	for (i=0; i!=clickid+2; i++) {
122
		slashpos=strchr(slashpos,'/')+1;
115
		slashpos=strchr(slashpos,'/')+1;
123
	}
116
	}
124
	ESBYTE[slashpos-1] = NULL;
117
	ESBYTE[slashpos-1] = NULL;
125
	Open_Dir(#path,WITH_REDRAW);
118
	Open_Dir(path,WITH_REDRAW);
126
}
119
}
127
 
120
 
128
 
121
 
129
void DrawBreadcrumbButton(dword x,y,w,h,id,text)
122
void DrawBreadcrumbButton(dword x,y,w,h,id,text)
130
{
123
{
131
	int i;
124
	int i;
132
	DrawRectangle(x,y,w,h,sc.work_graph);
125
	DrawRectangle(x,y,w,h,sc.work_graph);
133
	for (i=0; (i
126
	for (i=0; (i
134
	DrawRectangle3D(x+1,y+1,w-2,h-2,sc.work_light, sc.work_dark);
127
	DrawRectangle3D(x+1,y+1,w-2,h-2,sc.work_light, sc.work_dark);
135
	DefineHiddenButton(x+1,y+1,w-2,h-2,id);
128
	DefineHiddenButton(x+1,y+1,w-2,h-2,id);
136
	WriteText(-strlen(text)*8+w/2+x,h/2+y-7,0x90,sc.work_text,text);
129
	WriteText(-strlen(text)*8+w/2+x,h/2+y-7,0x90,sc.work_text,text);
137
	DrawBar(x, y+h+1, w+1, 1, sc.work_light);
130
	DrawBar(x, y+h+1, w+1, 1, sc.work_light);
138
}
131
}
-
 
132
 
-
 
133
>