Subversion Repositories Kolibri OS

Rev

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

Rev 3135 Rev 3306
Line 45... Line 45...
45
int mouse_dd;
45
int mouse_dd;
46
unsigned char dsize[30];
46
unsigned char dsize[30];
47
edit_box edit1= {40,20,200,0xffffff,0x94AECE,0x94AECE,0x94AECE,0,4,#dsize,#mouse_dd,100000000000010b};
47
edit_box edit1= {40,20,200,0xffffff,0x94AECE,0x94AECE,0x94AECE,0,4,#dsize,#mouse_dd,100000000000010b};
Line 48... Line 48...
48
 
48
 
-
 
49
unsigned char icons[14*56] = FROM "icons.raw";
-
 
50
#define TOPPANELH 30
Line 49... Line 51...
49
unsigned char icons[14*56] = FROM "icons.raw";
51
#define BOTPANELH 20
50
 
52
 
51
 
53
 
52
 
54
 
Line 53... Line 55...
53
void Main_Window()
55
void Main_Window()
54
{
56
{
55
	unsigned int id;
57
	unsigned int id, key, err;
56
	unsigned char key;
58
	int i, x;
Line 81... Line 83...
81
					notify(NOTIFY_TEXT_NO_DISK);
83
					notify(NOTIFY_TEXT_NO_DISK);
82
					break;
84
					break;
83
				}
85
				}
84
				param[0]='d';
86
				param[0]='d';
85
				param[1]=disk_list[selected].Item[3];
87
				param[1]=disk_list[selected].Item[3];
86
				Console_Work();
88
				err = Console_Work();
-
 
89
				if ((err!=0) && (err<7)) notify(rezult_text[err]);
87
				pause(15);
90
				pause(15);
88
				GetDisks();
91
				GetDisks();
89
				DrawTmpDisks();
92
				DrawTmpDisks();
90
			}
93
			}
91
			if (id>=20)
94
			if (id>=20)
Line 126... Line 129...
126
			}
129
			}
127
			//EAX=key<<8;
130
			//EAX=key<<8;
128
			//edit_box_key stdcall(#edit1);
131
			//edit_box_key stdcall(#edit1);
129
			break;
132
			break;
130
         case evReDraw:
133
         case evReDraw:			
-
 
134
			sc.get();
-
 
135
			DefineAndDrawWindow(170,150,314,250,0x74,sc.work,"Virtual Disk Manager 0.45",0);
-
 
136
			GetProcessInfo(#Form, SelfInfo);
-
 
137
			if (Form.status_window>2) return;
-
 
138
 
-
 
139
			DrawBar(0,0,  Form.cwidth,TOPPANELH, sc.work);
-
 
140
			DrawBar(0,TOPPANELH, Form.cwidth,1,  sc.work_graph);
-
 
141
			x=6;
-
 
142
			for (i=0; i<2; i++)
-
 
143
			{
-
 
144
				DefineButton(x,5, strlen(but_text[i])*6+28,19, 10+i, sc.work_button);
-
 
145
				_PutImage(x+3,8,  14,14,   i*14*14*3+#icons);
-
 
146
				WriteText(x+22,11, 0x80, sc.work_button_text, but_text[i]);
-
 
147
				x+=strlen(but_text[i])*6+37; 
-
 
148
			}			
-
 
149
			GetDisks();
131
			Draw_Window();
150
			DrawTmpDisks();
132
		}
151
		}
133
	}
152
	}
134
}
153
}
Line 173... Line 192...
173
unsigned int disk_pos_y[]={40,65,90,40,65,90,40,65,90,40,65,90};
192
unsigned int disk_pos_y[]={40,65,90,40,65,90,40,65,90,40,65,90};
Line 174... Line 193...
174
 
193
 
175
void DrawTmpDisks()
194
void DrawTmpDisks()
176
{
195
{
177
	int i;
196
	int i;
-
 
197
	DrawBar(0,31, Form.cwidth,Form.cheight-TOPPANELH-BOTPANELH-2, 0xFFFFFF);
-
 
198
	DrawBar(0,Form.cheight-BOTPANELH-1, Form.cwidth,1, sc.work_graph);
-
 
199
	DrawBar(0,Form.cheight-BOTPANELH, Form.cwidth,BOTPANELH, sc.work);
-
 
200
	WriteText(10, Form.cheight-13, 0x80, sc.work_text, "Free RAM size:");
-
 
201
	WriteText(100, Form.cheight-13, 0x80, sc.work_text, itoa(GetFreeRAM()/2048));
178
	DrawBar(0,31, Form.width-9,Form.height-GetSkinHeight()-5-30, 0xFFFFFF);
202
	WriteText(strlen(itoa(GetFreeRAM()/2048))*6 + 100, Form.cheight-13, 0x80, sc.work_text, " MB");
179
	if (disk_num==0)
203
	if (disk_num==0)
180
	{
204
	{
181
		WriteText(17,45,    0x90, 0x777777, INTRO_TEXT_1);
205
		WriteText(17,45,    0x90, 0x777777, INTRO_TEXT_1);
182
		WriteText(17,45+15, 0x90, 0x777777, INTRO_TEXT_2);
206
		WriteText(17,45+15, 0x90, 0x777777, INTRO_TEXT_2);
183
		WriteText(17,45+42, 0x90, 0x777777, INTRO_TEXT_3);
207
		WriteText(17,45+42, 0x90, 0x777777, INTRO_TEXT_3);
184
		return;
208
		return;
185
	};
209
	};
186
	if (selected>=disk_num) selected=disk_num-1; //âîññòàíàâëèâàåò âûäåëåíèå - õîðîøàÿ ôè÷à
210
	if (selected>=disk_num) selected=disk_num-1; //restore selected
187
	for (i=0; i<10; i++) DeleteButton(20+i);
211
	for (i=0; i<10; i++) DeleteButton(20+i);
188
	for (i=0; i
212
	for (i=0; i
189
	{
213
	{
190
		DefineButton(disk_pos_x[i], disk_pos_y[i], 60, 20, 20+i, 0xFFFfff);
214
		DefineButton(disk_pos_x[i], disk_pos_y[i], 60, 20, 20+i, 0xFFFfff);
Line 194... Line 218...
194
	}
218
	}
195
}
219
}
Line 196... Line 220...
196
 
220
 
197
void AddDisk()
221
void AddDisk()
198
{
222
{
199
	unsigned int i, j;
223
	unsigned int i, j, err;
200
	if (disk_num>=10)
224
	if (disk_num>=10)
201
	{
225
	{
202
		notify(NOTIFY_TEXT_DISK_LIMIT);
226
		notify(NOTIFY_TEXT_DISK_LIMIT);
203
		return;
227
		return;
Line 210... Line 234...
210
			if (i+48==disk_list[j].Item[3]) continue 1;
234
			if (i+48==disk_list[j].Item[3]) continue 1;
211
		}
235
		}
212
		break;
236
		break;
213
	}
237
	}
214
	param[1]=i+48;
238
	param[1]=i+48;
215
	Console_Work();
239
	err = Console_Work();
-
 
240
	if ((err!=0) && (err<7)) notify(rezult_text[err]);
216
	pause(5);
241
	pause(5);
217
	GetDisks();
242
	GetDisks();
218
	DrawTmpDisks();
243
	DrawTmpDisks();
219
}
244
}
Line 220... Line -...
220
 
-
 
221
void Draw_Window()
-
 
222
{	
-
 
223
	int i, x;
-
 
224
	
-
 
225
	sc.get();
-
 
226
	DefineAndDrawWindow(170,150,314,250,0x74,sc.work,"Virtual Disk Manager 0.4",0);
-
 
227
	GetProcessInfo(#Form, SelfInfo);
-
 
228
	if (Form.status_window>2) return;
-
 
229
	
-
 
230
	//ðèñóåì ïàíåëü
-
 
231
	DrawBar(0,0,  Form.width-9,30, sc.work);
-
 
232
	DrawBar(0,30, Form.width-9,1,  sc.work_graph);
-
 
233
	x=6;
-
 
234
	for (i=0; i<2; i++)
-
 
235
	{
-
 
236
		DefineButton(x,5, strlen(but_text[i])*6+28,19, 10+i, sc.work_button);
-
 
237
		_PutImage(x+3,8,  14,14,   i*14*14*3+#icons);
-
 
238
		WriteText(x+22,11, 0x80, sc.work_button_text, but_text[i]);
-
 
239
		x+=strlen(but_text[i])*6+37; 
-
 
240
	}
-
 
241
	
-
 
242
	GetDisks();
-
 
243
	DrawTmpDisks();
-
 
244
	//AddPanel();
-
 
245
}
-
 
246
 
-
 
247
/*void AddPanel()
-
 
248
{
-
 
249
	DrawBar(0,Form.height-GetSkinHeight()-40, Form.width-9,1,  sc.work_graph);
-
 
250
	DrawBar(0,Form.height-GetSkinHeight()-39, Form.width-9,35, sc.work);
-
 
251
 
-
 
252
	strcpy(#dsize, itoa(GetFreeRAM()/10));
-
 
253
	//strcpy(#dsize, "100");
-
 
254
	edit1.size=edit1.pos=strlen(#dsize);
-
 
255
	edit_box_draw stdcall(#edit1); //ðèñóåì ñòðîêó àäðåñà
-
 
256
	//DefineButton(-strlen(but_text[2])+Form.width-9,200, strlen(but_text[2])*6+28,19, 12, sc.work_button);
-
 
257
	//_PutImage(-strlen(but_text[2])+Form.width-9+3,200+3,  14,14,   2*14*14*3+#icons);
-
 
258
}*/
-
 
259
>
-