Subversion Repositories Kolibri OS

Rev

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

Rev 7972 Rev 7989
Line 44... Line 44...
44
	void Draw();
44
	void Draw();
45
	void Click();
45
	void Click();
46
} SystemDiscs=0;
46
} SystemDiscs=0;
47
 
47
 
Line -... Line 48...
-
 
48
#define DEV_H 17
-
 
49
#define DEV_H_HOR 21
Line 48... Line 50...
48
 
50
 
49
void GetDiskIconAndName(char disk_first_letter, dword dev_icon, disc_name)
51
void GetDiskIconAndName(char disk_first_letter, dword dev_icon, disc_name)
50
{
52
{
51
	switch(disk_first_letter)
53
	switch(disk_first_letter)
52
	{
-
 
53
		case 'k':
-
 
54
			ESBYTE[dev_icon]=0;
-
 
55
			strcpy(disc_name, T_PROG);
-
 
56
			break;
54
	{
57
		case 'r':
55
		case 'r':
58
			ESBYTE[dev_icon]=0;
56
			ESBYTE[dev_icon]=0;
59
			strcpy(disc_name, T_SYS);
57
			strcpy(disc_name, T_SYS);
60
			break;
58
			break;
61
		case 'c':
59
		case 'k':
62
			ESBYTE[dev_icon]=1;
60
			ESBYTE[dev_icon]=1;
63
			strcpy(disc_name, T_CD);
61
			strcpy(disc_name, T_PROG);
64
			break;
62
			break;
65
		case 'f':
63
		case 'f':
66
			ESBYTE[dev_icon]=2;
64
			ESBYTE[dev_icon]=2;
67
			strcpy(disc_name, T_FD);
65
			strcpy(disc_name, T_FD);
-
 
66
			break;
-
 
67
		case 'c':
-
 
68
			ESBYTE[dev_icon]=3;
-
 
69
			strcpy(disc_name, T_CD);
68
			break;
70
			break;
69
		case 'h':
71
		case 'h':
70
		case 'b':
72
		case 'b':
71
			ESBYTE[dev_icon]=3;
73
			ESBYTE[dev_icon]=4;
72
			strcpy(disc_name, T_HD);
74
			strcpy(disc_name, T_HD);
73
			break;
75
			break;
74
		case 's':
76
		case 's':
75
			ESBYTE[dev_icon]=3;
77
			ESBYTE[dev_icon]=4;
76
			strcpy(disc_name, T_SATA);
78
			strcpy(disc_name, T_SATA);
77
			break;
-
 
78
		case 'u':
-
 
79
			ESBYTE[dev_icon]=5;
-
 
80
			strcpy(disc_name, T_USB);
-
 
81
			break;
79
			break;
82
		case 't':
80
		case 't':
83
			ESBYTE[dev_icon]=4;
81
			ESBYTE[dev_icon]=5;
84
			strcpy(disc_name, T_RAM);
82
			strcpy(disc_name, T_RAM);
-
 
83
			break;
-
 
84
		case 'u':
-
 
85
			ESBYTE[dev_icon]=6;
-
 
86
			strcpy(disc_name, T_USB);
85
			break;
87
			break;
86
		default:
88
		default:
87
			ESBYTE[dev_icon]=3;
-
 
88
			strcpy(disc_name, T_UNC);				
89
			ESBYTE[dev_icon]=5;
89
	}
90
	}
Line 90... Line 91...
90
}
91
}
91
 
92
 
Line 124... Line 125...
124
 
125
 
Line 125... Line 126...
125
void _SystemDiscs::Draw()
126
void _SystemDiscs::Draw()
126
{    
127
{    
127
	char dev_name[15], disc_name[100], i, dev_icon, is_active, name_len;
128
	char dev_name[15], disc_name[100], i, dev_icon, is_active, name_len;
128
	int draw_y, draw_x, draw_h;
129
	int draw_y, draw_x;
Line 129... Line 130...
129
	
130
	
Line 130... Line 131...
130
	for (i=0; i<30; i++) DeleteButton(100+i);
131
	for (i=0; i<30; i++) DeleteButton(100+i);
131
 
132
 
Line 132... Line 133...
132
	if ( two_panels.checked) { draw_y = 41; draw_x =  2; draw_h = 21; }
133
	if ( two_panels.checked) { draw_y = 41; draw_x =  2; }
133
	if (!two_panels.checked) { draw_y = 74; draw_x = 17; draw_h = 16; }
134
	if (!two_panels.checked) { draw_y = 74; draw_x = 17; }
134
 
135
 
135
	for (i=0;i
136
	for (i=0;i
136
	{
137
	{
137
		strcpy(#dev_name, list.get(i));
138
		strcpy(#dev_name, list.get(i));
138
		GetDiskIconAndName(dev_name[1], #dev_icon, #disc_name);
139
		GetDiskIconAndName(dev_name[1], #dev_icon, #disc_name);
139
		if (strstr(#path, #dev_name)-#path==0) is_active=true; else is_active=false;
140
		if (strstr(#path, #dev_name)-#path==0) is_active=true; else is_active=false;
140
		if (two_panels.checked)
141
		if (two_panels.checked)
141
		{
142
		{
142
			name_len = strlen(#dev_name)-1*8;
143
			name_len = strlen(#dev_name)-1*8;
143
			DrawBar(draw_x, draw_y, name_len + 31, draw_h, 0xFFFFFF);
144
			DrawBar(draw_x, draw_y, name_len + 31, DEV_H_HOR, 0xFFFFFF);
144
			DefineButton(draw_x+2, draw_y, name_len + 27, draw_h-1, 100+i+BT_HIDE,0xFFFFFF);
145
			DefineButton(draw_x+2, draw_y, name_len + 27, DEV_H_HOR-1, 100+i+BT_HIDE,0xFFFFFF);
145
			_PutImage(draw_x + 5, draw_y+2, 18,17, is_active*6+dev_icon*17*18*3+#devices);
146
			_PutImage(draw_x + 5, draw_y+2, 18,17, is_active*7+dev_icon*17*18*3+#devices);
146
			WriteText(draw_x + 24, draw_y+3, 10110000b, 0, #dev_name+1);
147
			WriteText(draw_x + 24, draw_y+3, 10110000b, 0, #dev_name+1);
147
			draw_x += name_len + 31;
148
			draw_x += name_len + 31;
148
			if (draw_x>=Form.cwidth-100) && (Form.cwidth) {
149
			if (draw_x>=Form.cwidth-100) && (Form.cwidth) {
149
				DrawBar(draw_x, draw_y, Form.cwidth - draw_x - 2, draw_h, 0xFFFFFF);
150
				DrawBar(draw_x, draw_y, Form.cwidth - draw_x - 2, DEV_H_HOR, 0xFFFFFF);
150
				draw_x = 2;
151
				draw_x = 2;
151
				draw_y += draw_h;
152
				draw_y += DEV_H_HOR;
152
			}
153
			}
153
		}
154
		}
154
		else
155
		else
155
		{
156
		{
156
			DrawBar(draw_x,draw_y,6,draw_h+1,0xFFFFFF);
157
			DrawBar(draw_x,draw_y,6,DEV_H+1,0xFFFFFF);
157
			DrawBar(draw_x+6+18,draw_y,160-6-18,draw_h+1,0xFFFFFF);
158
			DrawBar(draw_x+6+18,draw_y,160-6-18,DEV_H+1,0xFFFFFF);
158
			DefineButton(draw_x,draw_y,159,16,100+i+BT_HIDE,0xFFFFFF);
159
			DefineButton(draw_x,draw_y,159,16,100+i+BT_HIDE,0xFFFFFF);
159
			if (show_dev_name.checked)
160
			if (show_dev_name.checked)
160
			{
161
			{
161
				strcat(#disc_name, #dev_name);
162
				strcat(#disc_name, #dev_name);
162
				if (is_active) WriteText(draw_x+30,draw_y+5,0x80,0x555555,#disc_name);
163
				if (is_active) WriteText(draw_x+30,draw_y+5,0x80,0x555555,#disc_name);
163
				WriteText(draw_x+29,draw_y+5,0x80,0,#disc_name);
164
				WriteText(draw_x+29,draw_y+5,0x80,0,#disc_name);
164
			} else {
165
			} else {
165
				if (is_active) WriteText(draw_x+30,draw_y+5,0x80,0x555555,#dev_name);
166
				if (is_active) WriteText(draw_x+30,draw_y+5,0x80,0x555555,#dev_name);
166
				WriteText(draw_x+29,draw_y+5,0x80,0,#dev_name);
167
				WriteText(draw_x+29,draw_y+5,0x80,0,#dev_name);
167
			}
168
			}
168
			_PutImage(draw_x+6,draw_y, 18,17, is_active*6+dev_icon*17*18*3+#devices);
169
			_PutImage(draw_x+6,draw_y, 18,17, is_active*7+dev_icon*17*18*3+#devices);
169
			draw_y += draw_h;
170
			draw_y += DEV_H;
170
		}
171
		}
171
	}
172
	}
172
	if (two_panels.checked)
173
	if (two_panels.checked)
173
	{
174
	{
174
		DrawBar(draw_x, draw_y, Form.cwidth - draw_x - 2, draw_h, 0xFFFFFF);
175
		DrawBar(draw_x, draw_y, Form.cwidth - draw_x - 2, DEV_H_HOR, 0xFFFFFF);
-
 
176
		DefineButton(Form.cwidth - 23, draw_y+2, 17,16, 60+BT_HIDE, 0xCCCccc);
-
 
177
		_PutImage(Form.cwidth - 21, draw_y+4, 14,13, 2*14*13*3+#factions);
175
		DefineButton(Form.cwidth - 23, draw_y+2, 17,16, 60+BT_HIDE, 0xCCCccc);
178
		files.y = draw_y + DEV_H_HOR + 17;
176
		_PutImage(Form.cwidth - 21, draw_y+4, 14,13, 2*14*13*3+#factions);
179
	} else {
Line 177... Line 180...
177
		files.y = draw_y + draw_h + 17;
180
		DrawBar(draw_x+6, draw_y, 18, 1, 0xFFFfff);
178
	}
181
	}
Line 223... Line 226...
223
 
226
 
Line 224... Line 227...
224
void ActionsDraw()
227
void ActionsDraw()
225
{
228
{
226
	int i;
229
	int i;
227
	int actions_y= SystemDiscs.list.count*16+108, lineh=16;
230
	int actions_y= SystemDiscs.list.count*DEV_H+108;
228
	Tip(actions_y-18, T_ACTIONS, 77, ""); //çàãîëîâîê
231
	Tip(actions_y-18, T_ACTIONS, 77, ""); //çàãîëîâîê
229
	for (i=0; actions[i*3]!=0; i++, actions_y+=lineh)
232
	for (i=0; actions[i*3]!=0; i++, actions_y+=DEV_H)
230
	{
233
	{
231
		DrawBar(17,actions_y,160,lineh,0xFFFFFF); //áåëîå
234
		DrawBar(17,actions_y,160,DEV_H,0xFFFFFF); //áåëîå
232
		DefineButton(17,actions_y,159,lineh,actions[i*3]+BT_HIDE,0xE4DFE1);
235
		DefineButton(17,actions_y,159,DEV_H,actions[i*3]+BT_HIDE,0xE4DFE1);
233
		WriteText(45,actions_y+4,0x80,0,actions[i*3+1]);
236
		WriteText(45,actions_y+4,0x80,0,actions[i*3+1]);
234
		WriteText(-strlen(actions[i*3+2])*6+170,actions_y+4,0x80,0x999999,actions[i*3+2]);
237
		WriteText(-strlen(actions[i*3+2])*6+170,actions_y+4,0x80,0x999999,actions[i*3+2]);
235
		_PutImage(23,actions_y+2, 14,13, i*14*13*3+#factions);
238
		_PutImage(23,actions_y+2, 14,13, i*14*13*3+#factions);
236
	}
239
	}
237
}
240
}
Line 238... Line 241...
238
 
241
 
239
void DrawLeftPanelBg()
242
void DrawLeftPanelBg()
240
{
243
{
241
	int actions_y = SystemDiscs.list.count*16;
244
	int actions_y = SystemDiscs.list.count*DEV_H;
242
	int start_y = actions_y+156;
245
	int start_y = actions_y+159;
243
	int area_h;
246
	int area_h;
244
	DrawBar(2,41,190,15,col.lpanel);		      //ñèíèé ïðÿìîóãîëüíèê - íàä äåâàéñàìè
247
	DrawBar(2,41,190,15,col.lpanel);		      //ñèíèé ïðÿìîóãîëüíèê - íàä äåâàéñàìè
245
	DrawBar(17,actions_y+75,160,15,col.lpanel); //ñèíèé ïðÿìîóãîëüíèê - ïîä äåâàéñàìè
248
	DrawBar(17,actions_y+75,160,15,col.lpanel); //ñèíèé ïðÿìîóãîëüíèê - ïîä äåâàéñàìè
246
	PutShadow(17,actions_y+75,160,1,1,3);
249
	PutShadow(17,actions_y+75,160,1,1,3);