Subversion Repositories Kolibri OS

Rev

Rev 6251 | Rev 6289 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6278 leency 1
//Leency, Veliant, Punk_Joker, PavelYakov & KolibriOS Team 2008-2016
3363 leency 2
//GNU GPL licence.
3
 
4022 leency 4
#ifndef AUTOBUILD
5
#include "lang.h--"
6
#endif
7
 
3363 leency 8
//libraries
5974 leency 9
#define MEMSIZE 4096 * 180
4427 punk_joker 10
#include "..\lib\clipboard.h"
3363 leency 11
#include "..\lib\strings.h"
12
#include "..\lib\mem.h"
13
#include "..\lib\file_system.h"
5499 leency 14
#include "..\lib\gui.h"
3434 leency 15
#include "..\lib\list_box.h"
4863 leency 16
#include "..\lib\random.h"
5743 leency 17
#include "..\lib\font.h"
5960 leency 18
#include "..\lib\collection.h"
5499 leency 19
#include "..\lib\obj\libini.h"
20
#include "..\lib\obj\box_lib.h"
5977 leency 21
#include "..\lib\patterns\history.h"
5834 pavelyakov 22
 
3363 leency 23
//images
24
#include "imgs\toolbar.txt"
25
#include "imgs\left_p.txt"
4846 leency 26
#include "imgs\icons.txt"
3363 leency 27
 
6278 leency 28
//Button IDs
29
enum {
30
	POPUP_BTN1 = 201,
31
	POPUP_BTN2 = 202
32
};
3444 leency 33
 
6278 leency 34
//NewElement options
35
enum {
36
	CREATE_FILE=1,
37
	CREATE_FOLDER,
38
	RENAME_ITEM
39
};
40
 
41
//OpenDir options
42
enum {
43
	ONLY_SHOW,
44
	WITH_REDRAW,
45
	ONLY_OPEN
46
};
47
 
6191 leency 48
dword col_padding, col_selec, col_lpanel, col_work, col_graph;
3363 leency 49
 
3434 leency 50
int toolbar_buttons_x[7]={9,46,85,134,167,203};
3363 leency 51
 
4136 punk_joker 52
byte active_about=0;
4070 punk_joker 53
word about_window;
5416 punk_joker 54
word settings_window;
5753 leency 55
byte active_settings=0;
5606 pavelyakov 56
dword _not_draw = false;
4136 punk_joker 57
byte menu_call_mouse=0;
58
 
5733 leency 59
byte del_active=0;
60
byte new_element_active=0;
5698 leency 61
 
5733 leency 62
llist files, files_active, files_inactive;
3434 leency 63
 
5694 leency 64
byte list_full_redraw;
65
 
5698 leency 66
dword buf;
67
dword file_mas[6898];
68
int selected_count;
69
 
70
 
3434 leency 71
byte
3363 leency 72
	path[4096],
5833 pavelyakov 73
	DefaultPath[4096],
3363 leency 74
	file_path[4096],
3404 leency 75
	file_name[256],
5555 punk_joker 76
	new_element_name[256],
5698 leency 77
	temp[4096],
3441 leency 78
	itdir;
3363 leency 79
 
5719 leency 80
char active_path[4096], inactive_path[4096];
5698 leency 81
 
5441 leency 82
dword eolite_ini_path;
83
 
5698 leency 84
char scroll_used=false;
5695 leency 85
 
5804 punk_joker 86
dword menu_stak,about_stak,properties_stak,settings_stak,copy_stak,delete_stak;
5608 leency 87
 
3363 leency 88
proc_info Form;
5960 leency 89
int mouse_dd, sc_slider_h;
3434 leency 90
int j, i;
4028 leency 91
int action_buf;
4863 leency 92
int rand_n;
5591 pavelyakov 93
byte CMD_REFRESH;
3363 leency 94
 
5748 leency 95
//struct t_settings {
6034 leency 96
int sort_num=2,
5748 leency 97
	show_dev_name=true,
98
	real_files_names_case=false,
99
	info_after_copy=false,
100
	two_panels=false,
101
	active_panel=1;
102
//} settings;
5549 punk_joker 103
 
5581 leency 104
edit_box new_file_ed = {171,213,180,0xFFFFFF,0x94AECE,0xFFFFFF,0xFFFFFF,0,248,#new_element_name,#mouse_dd,100000000000010b,6,0};
3434 leency 105
PathShow_data PathShow = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, #path, #temp, 0};
3363 leency 106
PathShow_data FileShow = {0, 56,215, 6, 100, 0, 0, 0x0, 0xFFFfff, #file_name, #temp, 0};
5694 leency 107
byte cmd_free=0;
5698 leency 108
#include "include\translations.h"
5804 punk_joker 109
#include "include\fs.h"
5834 pavelyakov 110
 
111
char *fd_path_eolite_ini_path;
112
 
5748 leency 113
#include "include\settings.h"
5804 punk_joker 114
#include "include\progress_dialog.h"
115
#include "..\lib\copyf.h"
4042 leency 116
#include "include\copy.h"
5435 leency 117
#include "include\gui.h"
3363 leency 118
#include "include\sorting.h"
4042 leency 119
#include "include\icons.h"
3363 leency 120
#include "include\left_panel.h"
4042 leency 121
#include "include\menu.h"
6278 leency 122
#include "include\delete.h"
4042 leency 123
#include "include\about.h"
5447 punk_joker 124
#include "include\properties.h"
3363 leency 125
 
126
void main()
127
{
5706 leency 128
	word id;
5834 pavelyakov 129
	byte count_sl = 0;
5748 leency 130
	signed x_old, y_old, dif_x, dif_y, adif_x, adif_y;
5695 leency 131
	char can_show, can_select, stats;
4897 leency 132
	dword selected_offset;
5591 pavelyakov 133
	dword IPC_LEN,IPC_ID;
134
	char IPC_BUF[10];
4863 leency 135
	rand_n = random(40);
5651 pavelyakov 136
 
5626 leency 137
	load_dll(boxlib, #box_lib_init,0);
5991 leency 138
	load_dll(libini, #lib_init,1);
5974 leency 139
 
5743 leency 140
	eolite_ini_path = abspath("Eolite.ini");
5834 pavelyakov 141
	fd_path_eolite_ini_path = "/fd/1/File Managers/Eolite.ini";
142
 
5441 leency 143
	LoadIniSettings();
6034 leency 144
	SystemDiscs.Get();
4076 leency 145
	SetAppColors();
3363 leency 146
	if (param)
147
	{
5743 leency 148
		strcpy(#path, #param);
149
		if (path[strlen(#path)-1]!='/') chrcat(#path, '/'); //add "/" to the end of the string
5833 pavelyakov 150
	}
151
 
5733 leency 152
	Open_Dir(#path,ONLY_OPEN);
5719 leency 153
	strcpy(#inactive_path, #path);
5733 leency 154
	llist_copy(#files_inactive, #files);
5606 pavelyakov 155
	SetEventMask(1100111b);
5591 pavelyakov 156
	loop(){
157
		switch(WaitEvent())
158
		{
159
			case evMouse:
160
				if (del_active) || (!CheckActiveProcess(Form.ID)) || (Form.status_window>2) break;
161
				if (new_element_active) || (!CheckActiveProcess(Form.ID)) || (Form.status_window>2)
162
				{
163
					edit_box_mouse stdcall(#new_file_ed);
164
					break;
165
				}
5549 punk_joker 166
 
5640 pavelyakov 167
				mouse.get();
5591 pavelyakov 168
 
5640 pavelyakov 169
				if (!mouse.mkm) && (stats>0) stats = 0;
5657 pavelyakov 170
				if (mouse.mkm) && (!stats)
5549 punk_joker 171
				{
5640 pavelyakov 172
					x_old = mouse.x;
173
					y_old = mouse.y;
5591 pavelyakov 174
					stats = 1;
175
				}
5640 pavelyakov 176
				if (mouse.mkm) && (stats==1)
5591 pavelyakov 177
				{
5640 pavelyakov 178
					dif_x = mouse.x-x_old;
179
					dif_y = mouse.y-y_old;
5591 pavelyakov 180
					adif_x = fabs(dif_x);
181
					adif_y = fabs(dif_y);
182
 
183
					if (adif_x>adif_y)
5549 punk_joker 184
					{
5591 pavelyakov 185
						if (dif_x > 150)
186
						{
6021 leency 187
							if (history.forward())
5591 pavelyakov 188
								{
6021 leency 189
									strcpy(#path, history.current());
5694 leency 190
									files.KeyHome();
5591 pavelyakov 191
									Open_Dir(#path,WITH_REDRAW);
192
								}
193
							stats = 0;
194
						}
195
						if (dif_x < -150)
196
						{
197
							GoBack();
198
							stats = 0;
199
						}
5549 punk_joker 200
					}
5591 pavelyakov 201
					else
5549 punk_joker 202
					{
5591 pavelyakov 203
						if (dif_y < -100)
204
						{
205
							Dir_Up();
206
							stats = 0;
207
						}
5549 punk_joker 208
					}
5591 pavelyakov 209
				}
6191 leency 210
				if (files.MouseOver(mouse.x, mouse.y))
5549 punk_joker 211
				{
6191 leency 212
					//select file
6278 leency 213
					if (mouse.key&MOUSE_LEFT) && (mouse.up)
5575 pavelyakov 214
					{
6191 leency 215
						if (files.ProcessMouse(mouse.x, mouse.y)) List_ReDraw();
6278 leency 216
						else if (mouse.dblclick)) Open(0);
6191 leency 217
					}
218
					//file menu
6278 leency 219
					if (mouse.key&MOUSE_RIGHT)
6191 leency 220
					{
5591 pavelyakov 221
						menu_call_mouse = 1;
6278 leency 222
						if (files.ProcessMouse(mouse.x, mouse.y)) List_ReDraw();
223
						menu_stak = malloc(4096);
224
						CreateThread(#FileMenu,menu_stak+4092);
5591 pavelyakov 225
						break;
5575 pavelyakov 226
					}
227
				}
5591 pavelyakov 228
 
5640 pavelyakov 229
				if (mouse.vert)
5575 pavelyakov 230
				{
5640 pavelyakov 231
					if (files.MouseScroll(mouse.vert)) List_ReDraw();
5591 pavelyakov 232
					break;
233
				}
234
 
5723 leency 235
				if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+16) && (mouse.y>files.y-17) && (mouse.y
5591 pavelyakov 236
				{
5723 leency 237
					if (mouse.lkm==1) DrawRectangle3D(files.x+files.w+1,files.y-16,14,14,0xC7C7C7,0xFFFFFF);
5640 pavelyakov 238
					WHILE (mouse.lkm==1) && (files.first>0)
5575 pavelyakov 239
					{
5591 pavelyakov 240
						pause(8);
241
						files.first--;
242
						List_ReDraw();
5640 pavelyakov 243
						mouse.get();
5575 pavelyakov 244
					}
5723 leency 245
					DrawRectangle3D(files.x+files.w+1,files.y-16,14,14,0xFFFFFF,0xC7C7C7);
5575 pavelyakov 246
				}
3363 leency 247
 
5723 leency 248
				if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+16) && (mouse.y>files.y+files.h-16) && (mouse.y
3363 leency 249
				{
5723 leency 250
					if (mouse.lkm==1) DrawRectangle3D(files.x+files.w+1,files.y+files.h-15,14,14,0xC7C7C7,0xFFFFFF);
5640 pavelyakov 251
					while (mouse.lkm==1) && (files.first
5591 pavelyakov 252
					{
253
						pause(8);
254
						files.first++;
255
						List_ReDraw();
5640 pavelyakov 256
						mouse.get();
5591 pavelyakov 257
					}
5723 leency 258
					DrawRectangle3D(files.x+files.w+1,files.y+files.h-15,14,14,0xFFFFFF,0xC7C7C7);
3363 leency 259
				}
260
 
5591 pavelyakov 261
				//Scrooll
5695 leency 262
				if (!mouse.lkm) && (scroll_used) { scroll_used=false; Scroll(); }
5723 leency 263
				if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+18) && (mouse.y>files.y) && (mouse.y
5591 pavelyakov 264
 
265
				if (scroll_used)
3363 leency 266
				{
5640 pavelyakov 267
					if (sc_slider_h/2+files.y>mouse.y) || (mouse.y<0) || (mouse.y>4000) mouse.y=sc_slider_h/2+files.y; //anee eo?ni? iaa ieiii
5723 leency 268
					id = files.first;
269
					files.first = -sc_slider_h / 2 + mouse.y -j -files.y * files.count;
5743 leency 270
					files.first /= files.h - 18;
5591 pavelyakov 271
					if (files.visible+files.first>files.count) files.first=files.count-files.visible;
5743 leency 272
					if (files.first<0) files.first=0;
5591 pavelyakov 273
					if (id!=files.first) List_ReDraw();
5719 leency 274
					break;
3363 leency 275
				}
5719 leency 276
 
5735 leency 277
				if (two_panels) && (mouse.y > files.y) && (mouse.down) {
5719 leency 278
					if (mouse.x
279
					{
280
						if (active_panel!=1)
281
						{
282
							active_panel = 1;
5738 leency 283
							ChangeActivePanel();
5719 leency 284
						}
285
					}
286
					else
287
					{
288
						if (active_panel!=2)
289
						{
290
							active_panel = 2;
5738 leency 291
							ChangeActivePanel();
5719 leency 292
						}
293
					}
294
				}
5591 pavelyakov 295
				break;
296
	//Button pressed-----------------------------------------------------------------------------
297
			case evButton:
6278 leency 298
				id=GetButtonID();
5591 pavelyakov 299
				switch(id)
300
				{
6278 leency 301
					case 01:
302
							KillProcess(about_window);
303
							SaveIniSettings();
304
							ExitProcess();
5591 pavelyakov 305
					case 21: //Back
306
							GoBack();
307
							break;
308
					case 22: //Forward
6021 leency 309
							if (history.forward())
5591 pavelyakov 310
							{
6021 leency 311
								strcpy(#path, history.current());
5694 leency 312
								files.KeyHome();
5591 pavelyakov 313
								Open_Dir(#path,WITH_REDRAW);
314
							}
315
							break;
5608 leency 316
					case 23:
3363 leency 317
							Dir_Up();
318
							break;
5608 leency 319
					case 24:
3444 leency 320
							Copy(#file_path, CUT);
321
							break;
5608 leency 322
					case 25:
3444 leency 323
							Copy(#file_path, NOCUT);
3363 leency 324
							break;
5608 leency 325
					case 26:
326
							Paste();
3363 leency 327
							break;
5733 leency 328
					case 31...33: //sorting
329
							sort_num = id - 30;
330
							DrawList();
5591 pavelyakov 331
							Open_Dir(#path,WITH_REDRAW);
5512 punk_joker 332
							break;
5591 pavelyakov 333
					case 50...60: //Actions
334
							FnProcess(id-50);
5512 punk_joker 335
							break;
5591 pavelyakov 336
					case 100...120:
6034 leency 337
						SystemDiscs.Click(id-100);
5698 leency 338
						break;
6278 leency 339
					case POPUP_BTN1:
340
					case POPUP_BTN2:
341
						if (del_active) Del_File(id-POPUP_BTN2);
342
						if (new_element_active) NewElement(id-POPUP_BTN2);
343
						DeleteButton(POPUP_BTN1);
344
						DeleteButton(POPUP_BTN2);
345
						break;
5591 pavelyakov 346
				}
347
				break;
348
	//Key pressed-----------------------------------------------------------------------------
349
			case evKey:
5706 leency 350
				GetKeys();
5698 leency 351
 
5591 pavelyakov 352
				if (Form.status_window>2) break;
353
				if (del_active)
354
				{
5706 leency 355
					if (key_scancode == SCAN_CODE_ENTER) Del_File(true);
356
					if (key_scancode == SCAN_CODE_ESC) Del_File(false);
5591 pavelyakov 357
					break;
358
				}
359
				if (new_element_active)
360
				{
5991 leency 361
					if (key_scancode == SCAN_CODE_ENTER) NewElement(true);
362
					if (key_scancode == SCAN_CODE_ESC) NewElement(false);
5706 leency 363
					EAX= key_ascii << 8;
5591 pavelyakov 364
					edit_box_key stdcall (#new_file_ed);
365
					break;
366
				}
5706 leency 367
				if (files.ProcessKey(key_scancode))
5694 leency 368
				{
369
					List_ReDraw();
370
					break;
371
				}
5698 leency 372
 
5795 leency 373
				if (key_modifier&KEY_LCTRL) || (key_modifier&KEY_RCTRL)
5591 pavelyakov 374
				{
5706 leency 375
					switch(key_scancode)
5697 punk_joker 376
					{
5702 punk_joker 377
						case 059...068:
5706 leency 378
								key_scancode -= 59;
6034 leency 379
								if (key_scancode < SystemDiscs.list.count)
5702 punk_joker 380
								{
5723 leency 381
									if (!two_panels)
382
									{
383
										DrawRectangle(17,key_scancode*16+74,159,16, 0); //display click
384
										pause(7);
385
									}
6034 leency 386
									SystemDiscs.Click(key_scancode);
5702 punk_joker 387
								}
388
								break;
5697 punk_joker 389
						case 45:  //Ctrl+X
390
								Copy(#file_path, CUT);
391
								break;
392
						case 46:  //Ctrl+C
393
								Copy(#file_path, NOCUT);
394
								break;
395
						case 47:  //Ctrl+V
396
								Paste();
397
								break;
398
						case 032: //Ctrl+D - set as bg
5803 leency 399
								strlcpy(#temp, "\\S__",4);
5591 pavelyakov 400
								strcat(#temp, #file_path);
401
								RunProgram("/sys/media/kiv", #temp);
402
								break;
5697 punk_joker 403
						case 049: //Ctrl+N - create new window
5591 pavelyakov 404
								if (Form.left==98) MoveSize(Form.left-20,Form.top-20,OLD,OLD);
405
								RunProgram("/sys/File Managers/Eolite", #path);
406
								break;
6157 punk_joker 407
						case 050: //Ctrl+M
408
								Open_Dir(#inactive_path,WITH_REDRAW);
409
								break;
6278 leency 410
						case SCAN_CODE_ENTER: //Ctrl+Enter
5702 punk_joker 411
								if (!itdir) ShowOpenWithDialog();
412
								else Open(1);
413
								break;
5697 punk_joker 414
						case 030: //Ctrl+A - select all files
5591 pavelyakov 415
								for (i=0; i
3363 leency 416
								{
5591 pavelyakov 417
									selected_offset = file_mas[i]*304 + buf+32 + 7;
5661 leency 418
									if (!i) if (!strncmp(selected_offset+33, "..", 2)) continue; //do not selec ".." directory
5591 pavelyakov 419
									ESBYTE[selected_offset] = 1;
420
									selected_count++;
3363 leency 421
								}
5591 pavelyakov 422
								List_ReDraw();
423
								break;
5697 punk_joker 424
						case 022: //Ctrl+U - unselect all files
5591 pavelyakov 425
								for (i=0; i
426
								{
427
									selected_offset = file_mas[i]*304 + buf+32 + 7;
428
									ESBYTE[selected_offset] = 0;
429
								}
430
								selected_count = 0;
431
								List_ReDraw();
432
								break;
5697 punk_joker 433
					}
434
					break;
435
				}
5698 leency 436
 
5706 leency 437
				switch (key_scancode)
5697 punk_joker 438
				{
5702 punk_joker 439
						case SCAN_CODE_BS:
5697 punk_joker 440
								//GoBack();
441
								Dir_Up();
442
								break;
5702 punk_joker 443
						case SCAN_CODE_ENTER:
5591 pavelyakov 444
								Open(0);
445
								break;
5738 leency 446
						case SCAN_CODE_TAB:
447
								if (!two_panels) break;
448
								if (active_panel==1) active_panel=2; else active_panel=1;
449
								ChangeActivePanel();
450
								break;
5702 punk_joker 451
						case 093: //menu
5591 pavelyakov 452
								menu_call_mouse=0;
453
								menu_stak = malloc(4096);
454
								CreateThread(#FileMenu,menu_stak+4092);
455
								break;
5702 punk_joker 456
						case SCAN_CODE_DEL:
5591 pavelyakov 457
								Del_Form();
458
								break;
5702 punk_joker 459
						case SCAN_CODE_INS:
5825 leency 460
								selected_offset = file_mas[files.cur_y]*304 + buf+32 + 7;
461
								if (files.cur_y==0) && (!strncmp(selected_offset+33, "..", 2)) goto _INSERT_END; //do not selec ".." directory
5591 pavelyakov 462
								if (ESBYTE[selected_offset])
463
								{
464
									ESBYTE[selected_offset]=0;
465
									selected_count--;
466
								}
467
								else
468
								{
469
									ESBYTE[selected_offset] = 1;
470
									selected_count++;
471
								}
5661 leency 472
								_INSERT_END:
5955 leency 473
								files.KeyDown();
474
								List_ReDraw();
5591 pavelyakov 475
								break;
5702 punk_joker 476
						case 059...068: //F1-F10
5706 leency 477
								FnProcess(key_scancode-58);
5591 pavelyakov 478
								break;
5974 leency 479
						default:
5825 leency 480
								for (i=files.cur_y+1; i
5591 pavelyakov 481
								{
482
									strcpy(#temp, file_mas[i]*304+buf+72);
5706 leency 483
									if (temp[0]==key_ascii) || (temp[0]==key_ascii-32)
5591 pavelyakov 484
									{
5825 leency 485
										files.cur_y = i - 1;
5694 leency 486
										files.KeyDown();
487
										List_ReDraw();
5591 pavelyakov 488
										break;
489
									}
490
								}
491
				}
3363 leency 492
			break;
5698 leency 493
			case evIPC:
5591 pavelyakov 494
			case evReDraw:
495
				draw_window();
496
				if (action_buf)
497
				{
5804 punk_joker 498
					if (action_buf==OPERATION_END)
5698 leency 499
					{
500
						FnProcess(5);
5991 leency 501
						if (copy_stak) SelectFileByName(#copy_to+strrchr(#copy_to,'/'));
5698 leency 502
					}
503
					if (action_buf==100) Open(0);
504
					if (action_buf==201) ShowOpenWithDialog();
505
					if (action_buf==202) FnProcess(3); //F3
506
					if (action_buf==203) FnProcess(4); //F4
507
					if (action_buf==104) Copy(#file_path, NOCUT);
508
					if (action_buf==105) Copy(#file_path, CUT);
509
					if (action_buf==106) Paste();
510
					if (action_buf==207) FnProcess(2);
511
					if (action_buf==108) Del_Form();
512
					if (action_buf==109) FnProcess(5);
513
					if (action_buf==110) FnProcess(8);
5591 pavelyakov 514
					action_buf=0;
515
				}
516
		}
517
		if(cmd_free)
518
		{
5991 leency 519
			if(cmd_free==1)      menu_stak=free(menu_stak);
520
			else if(cmd_free==2) about_stak=free(about_stak);
521
			else if(cmd_free==3) properties_stak=free(properties_stak);
522
			else if(cmd_free==4) settings_stak=free(settings_stak);
523
			else if(cmd_free==5) copy_stak=free(copy_stak);
524
			else if(cmd_free==6) delete_stak=free(delete_stak);
5591 pavelyakov 525
			cmd_free = false;
5576 pavelyakov 526
		}
527
	}
3363 leency 528
}
529
 
3444 leency 530
void draw_window()
531
{
6191 leency 532
	DefineAndDrawWindow(WinX+rand_n,WinY+rand_n,WinW,WinH,0x73,NULL,TITLE,0);
3444 leency 533
	GetProcessInfo(#Form, SelfInfo);
534
	if (Form.status_window>2) return;
5811 leency 535
	if (Form.height < 350) { MoveSize(OLD,OLD,OLD,350); return; }
536
	if (Form.width  < 480) { MoveSize(OLD,OLD,480,OLD); return; }
3444 leency 537
	GetProcessInfo(#Form, SelfInfo); //if win_size changed
3363 leency 538
	PutPaletteImage(#toolbar,246,34,0,0,8,#toolbar_pal);
6191 leency 539
	DrawBar(127, 8, 1, 25, col_graph);
540
	for (j=0; j<3; j++) DefineButton(toolbar_buttons_x[j]+2,5+2,31-5,29-5,21+j+BT_HIDE,NULL);
541
	for (j=3; j<6; j++) DefineButton(toolbar_buttons_x[j],5,31,29,21+j+BT_HIDE,NULL);
542
	DrawBar(246,0, Form.cwidth - 297,12, col_work); //upper editbox
543
	DrawBar(246,29,Form.cwidth - 297,5,  col_work); //lower editbox
544
	DrawRectangle(246,12,Form.cwidth - 303,16,col_graph);
5576 pavelyakov 545
	DefineButton(Form.cwidth - 32,6,27,28,51+BT_HIDE+BT_NOFRAME,0); //about
3363 leency 546
	PutPaletteImage(#goto_about,56,34,Form.width-65,0,8,#goto_about_pal);
3434 leency 547
	//main rectangles
6191 leency 548
	DrawRectangle(1,40,Form.cwidth-3,Form.cheight - 42,col_graph);
5698 leency 549
	DrawRectangle(0,39,Form.cwidth-1,Form.cheight - 40,col_palette[4]); //bg
5723 leency 550
	for (i=0; i<5; i++) DrawBar(0, 34+i, Form.cwidth, 1, col_palette[8-i]);
5733 leency 551
	llist_copy(#files_active, #files);
5723 leency 552
	strcpy(#active_path, #path);
553
	DrawFilePanels();
554
	if (del_active) Del_Form();
555
	if (new_element_active) NewElement_Form(new_element_active, #new_element_name);
556
}
557
 
558
void DrawList()
559
{
5733 leency 560
	word sorting_arrow_x;
6050 leency 561
	DrawFlatButton(files.x, files.y-17,     files.w - 141,16,31,T_FILE);
562
	DrawFlatButton(files.x + files.w - 141, files.y-17,73,16,32,T_TYPE);
563
	DrawFlatButton(files.x + files.w -  68, files.y-17,68,16,33,T_SIZE);
564
	DrawFlatButton(files.x + files.w,       files.y-17,16,16, 0,"\x18");
565
	DrawFlatButton(files.x + files.w,files.y+files.h-16,16,16,0,"\x19");
5733 leency 566
	if (sort_num==1) sorting_arrow_x = files.w - 141 / 2 + files.x + 18;
567
	if (sort_num==2) sorting_arrow_x = files.x + files.w - 90;
568
	if (sort_num==3) sorting_arrow_x = strlen(T_SIZE)*3-30+files.x+files.w;
6191 leency 569
	WriteText(sorting_arrow_x,files.y-12,0x80,col_graph,"\x19");
570
	DrawBar(files.x+files.w,files.y,1,files.h,col_graph);
571
	if (two_panels) && (files.x<5) DrawBar(files.x+files.w+16,files.y,1,files.h,col_graph);
5723 leency 572
}
573
 
574
void DrawFilePanels()
575
{
6034 leency 576
	int files_y;
5698 leency 577
	if (!two_panels)
578
	{
5723 leency 579
		DrawDeviceAndActionsLeftPanel();
5825 leency 580
		files.SetSizes(192, 57, Form.cwidth - 210, Form.cheight - 59, files.item_h);
5719 leency 581
		DrawList();
5733 leency 582
		Open_Dir(#path,ONLY_SHOW);
5698 leency 583
	}
584
	else
585
	{
6158 leency 586
		SystemDiscs.Get();
5733 leency 587
		llist_copy(#files, #files_inactive);
588
		strcpy(#path, #inactive_path);
589
		col_selec = 0xCCCccc;
6034 leency 590
		SystemDiscs.Draw();
591
		files_y = files.y;
5733 leency 592
 
5719 leency 593
		if (active_panel==1)
594
		{
5761 leency 595
			llist_copy(#files, #files_inactive);
596
			strcpy(#path, #inactive_path);
597
			col_selec = 0xCCCccc;
6039 leency 598
			files.SetSizes(Form.cwidth/2, files_y, Form.cwidth/2 -17, Form.cheight-files_y-2, files.item_h);
5719 leency 599
			DrawList();
5733 leency 600
			Open_Dir(#path,WITH_REDRAW);
601
			llist_copy(#files, #files_active);
5719 leency 602
			strcpy(#path, #active_path);
5733 leency 603
			col_selec = 0x94AECE;
6039 leency 604
			files.SetSizes(2, files_y, Form.cwidth/2-2-17, Form.cheight-files_y-2, files.item_h);
5719 leency 605
			DrawList();
5733 leency 606
			Open_Dir(#path,WITH_REDRAW);
5719 leency 607
		}
608
		if (active_panel==2)
609
		{
6039 leency 610
			files.SetSizes(2, files_y, Form.cwidth/2-2-17, Form.cheight-files_y-2, files.item_h);
5719 leency 611
			DrawList();
5733 leency 612
			Open_Dir(#path,WITH_REDRAW);
613
			llist_copy(#files, #files_active);
5719 leency 614
			strcpy(#path, #active_path);
5733 leency 615
			col_selec = 0x94AECE;
6039 leency 616
			files.SetSizes(Form.cwidth/2, files_y, Form.cwidth/2 -17, Form.cheight-files_y-2, files.item_h);
5719 leency 617
			DrawList();
5733 leency 618
			Open_Dir(#path,WITH_REDRAW);
5719 leency 619
		}
5698 leency 620
	}
3363 leency 621
}
622
 
623
 
5694 leency 624
void List_ReDraw()
3363 leency 625
{
5719 leency 626
	int all_lines_h;
5825 leency 627
	static int old_cur_y, old_first;
3363 leency 628
 
5694 leency 629
	files.CheckDoesValuesOkey(); //prevent some shit
3363 leency 630
 
5694 leency 631
	if (list_full_redraw) || (old_first != files.first)
3363 leency 632
	{
5825 leency 633
		old_cur_y = files.cur_y;
5694 leency 634
		old_first = files.first;
635
		list_full_redraw = false;
636
		goto _ALL_LIST_REDRAW;
3363 leency 637
	}
5825 leency 638
	if (old_cur_y != files.cur_y)
3363 leency 639
	{
5825 leency 640
		if (old_cur_y-files.first
641
		Line_ReDraw(col_selec, files.cur_y-files.first);
642
		old_cur_y = files.cur_y;
5694 leency 643
		return;
3363 leency 644
	}
645
 
5694 leency 646
	_ALL_LIST_REDRAW:
3363 leency 647
 
5825 leency 648
	for (j=0; j
3434 leency 649
	//in the bottom
5825 leency 650
	all_lines_h = j * files.item_h;
5719 leency 651
	DrawBar(files.x,all_lines_h + files.y,files.w,files.h - all_lines_h,0xFFFFFF);
652
	DrawBar(files.x+files.w-141,all_lines_h + files.y,1,files.h - all_lines_h,system.color.work);
653
	DrawBar(files.x+files.w-68,all_lines_h + files.y,1,files.h - all_lines_h,system.color.work);
3434 leency 654
	Scroll();
3363 leency 655
}
656
 
3444 leency 657
 
5761 leency 658
void Line_ReDraw(dword bgcol, filenum){
3467 leency 659
	dword text_col=0,
5991 leency 660
		  ext1, attr,
661
		  file_offet,
662
		  file_name_off,
663
		  y=filenum*files.item_h+files.y;
664
		  BDVK file;
5996 leency 665
	char label_file_name[4096];
4859 leency 666
	if (filenum==-1) return;
5825 leency 667
	DrawBar(files.x,y,3,files.item_h,bgcol);
668
	DrawBar(files.x+19,y,files.w-19,files.item_h,bgcol);
5761 leency 669
	DrawBar(files.x+3,y+17,16,1,bgcol);
5825 leency 670
	if (files.item_h>18) DrawBar(files.x+3,y+18,16,files.item_h-18,bgcol);
671
	if (files.item_h>15) DrawBar(files.x+3,y,16,files.item_h-15,bgcol);
3363 leency 672
 
4897 leency 673
	file_offet = file_mas[filenum+files.first]*304 + buf+32;
5487 leency 674
	attr = ESDWORD[file_offet];
4897 leency 675
	file.selected = ESBYTE[file_offet+7];
676
	file.sizelo   = ESDWORD[file_offet+32];
677
	file_name_off = file_offet+40;
3363 leency 678
 
5487 leency 679
	if (! TestBit(attr, 4) ) //file or folder?
3363 leency 680
	{
5698 leency 681
		ext1 = strrchr(file_name_off,'.') + file_name_off;
6278 leency 682
		if (ext1==file_name_off) ext1 = NULL; //if no extension then show nothing
683
		WriteText(7-strlen(ConvertSize(file.sizelo))*6+files.x+files.w - 58, files.text_y+y+1, files.font_type, 0, ConvertSize(file.sizelo));
684
		if (ext1) && (strlen(ext1)<9) WriteTextCenter(files.x+files.w-140, files.text_y+y+1, 72, 0, ext1);
3363 leency 685
	}
686
	else
4846 leency 687
	{
6278 leency 688
		if (!strncmp(file_name_off,"..",3))	ext1=".."; else {
689
			ext1="";
690
			WriteTextCenter(files.x+files.w-140, files.text_y+y+1, 72, 0, ext1);
691
		}
4846 leency 692
	}
6278 leency 693
	DrawIconByExtension(ext1, files.x+3, files.item_h/2-7+y, bgcol);
4846 leency 694
 
5487 leency 695
	if (TestBit(attr, 1)) || (TestBit(attr, 2)) text_col=0xA6A6B7; //system or hiden?
5761 leency 696
	if (bgcol!=0xFFFfff)
3363 leency 697
	{
5487 leency 698
		itdir = TestBit(attr, 4);
4897 leency 699
		strcpy(#file_name, file_name_off);
5606 pavelyakov 700
		sprintf(#file_path,"%s%s",#path,file_name_off);
3363 leency 701
		if (text_col==0xA6A6B7) text_col=0xFFFFFF;
702
	}
4897 leency 703
	if (file.selected) text_col=0xFF0000;
5987 leency 704
	if (label.size.pt==9) || (!label.font)
3434 leency 705
	{
5745 leency 706
		if (Form.width>=480)
707
		{
708
			FileShow.start_x = files.x + 23;
709
			FileShow.font_color = text_col;
710
			FileShow.area_size_x = files.w - 164;
711
			FileShow.text_pointer = file_name_off;
5776 leency 712
			FileShow.start_y = files.text_y + y + 1;
5745 leency 713
			PathShow_prepare stdcall(#FileShow);
714
			PathShow_draw stdcall(#FileShow);
715
		}
3434 leency 716
	}
5745 leency 717
	else
718
	{
5996 leency 719
		strcpy(#label_file_name, file_name_off);
720
		if (label.getsize(#label_file_name) + 141 + 26 > files.w)
721
		{
722
			while (label.getsize(#label_file_name) + 141 + 26 > files.w) {
723
				ESBYTE[#label_file_name+strlen(#label_file_name)-1] = NULL;
724
			}
725
			strcpy(#label_file_name+strlen(#label_file_name)-2, "...");
726
		}
727
		label.write(files.x + 23, files.item_h - label.height / 2 + y, bgcol, text_col, label.size.pt, #label_file_name);
5745 leency 728
	}
5825 leency 729
	DrawBar(files.x+files.w-141,y,1,files.item_h,system.color.work); //gray line 1
730
	DrawBar(files.x+files.w-68,y,1,files.item_h,system.color.work); //gray line 2
3363 leency 731
}
732
 
733
 
3444 leency 734
void Open_Dir(dword dir_path, redraw){
735
	int errornum, maxcount;
3434 leency 736
 
3444 leency 737
	if (redraw!=ONLY_SHOW)
3363 leency 738
	{
3444 leency 739
		if (ESBYTE[dir_path+1]!='\0') ESBYTE[dir_path+strlen(dir_path)-1] = '\0';
3363 leency 740
		if (buf) free(buf);
3444 leency 741
		errornum = GetDir(#buf, #files.count, dir_path, DIRS_NOROOT);
742
		if (ESBYTE[dir_path+1]!='\0') chrcat(dir_path, '/');
743
		if (errornum)
3363 leency 744
		{
6021 leency 745
			history.add(#path);
3363 leency 746
			GoBack();
747
			Write_Error(errornum);
748
			return;
749
		}
3444 leency 750
		maxcount = sizeof(file_mas)/sizeof(dword)-1;
4225 punk_joker 751
		if (files.count>maxcount) files.count = maxcount;
5825 leency 752
		if (files.count>0) && (files.cur_y-files.first==-1) files.cur_y=0;
3363 leency 753
	}
3444 leency 754
	if (files.count!=-1)
3363 leency 755
	{
5694 leency 756
		if(!_not_draw)
757
		{
758
			PathShow.area_size_x = Form.cwidth-306;
759
			DrawBar(PathShow.start_x-3, PathShow.start_y-4, PathShow.area_size_x+2, 15, 0xFFFfff);
760
			PathShow_prepare stdcall(#PathShow);
761
			PathShow_draw stdcall(#PathShow);
762
		}
6021 leency 763
		history.add(#path);
6034 leency 764
		SystemDiscs.Draw();
5825 leency 765
		files.visible = files.h / files.item_h;
5591 pavelyakov 766
		if (files.count < files.visible) files.visible = files.count;
767
		if (redraw!=ONLY_SHOW) Sorting();
5694 leency 768
		list_full_redraw = true;
5606 pavelyakov 769
		if (redraw!=ONLY_OPEN)&&(!_not_draw) List_ReDraw();
3363 leency 770
	}
5694 leency 771
	if (files.count==-1) && (redraw!=ONLY_OPEN)
772
	{
773
		files.KeyHome();
774
		if(!_not_draw) { list_full_redraw=true; List_ReDraw(); }
775
	}
3363 leency 776
}
777
 
778
 
779
inline Sorting()
780
{
781
	dword k=0, l=1;
4897 leency 782
	dword file_off;
5606 pavelyakov 783
	if (!strncmp(#path,"/",2)) //do not sort
3363 leency 784
	{
5591 pavelyakov 785
		for(k=1;k
3363 leency 786
		return;
787
	}
5591 pavelyakov 788
	for (j=files.count-1, file_off=files.count-1*304+buf+32; j>=0; j--, file_off-=304;)  //files | folders
3363 leency 789
	{
4897 leency 790
		if (!real_files_names_case) strttl(file_off+40);
791
		if (TestBit(ESDWORD[file_off],4)) //directory?
3363 leency 792
		{
793
			file_mas[k]=j;
794
			k++;
795
		}
796
		else
797
		{
3434 leency 798
			file_mas[files.count-l]=j;
3363 leency 799
			l++;
800
		}
801
	}
3434 leency 802
	//sorting: files first, then folders
3363 leency 803
	Sort_by_Name(0,k-1);
5591 pavelyakov 804
	if (sort_num==1) Sort_by_Name(k,files.count-1);
805
	if (sort_num==2) Sort_by_Type(k,files.count-1);
806
	if (sort_num==3) Sort_by_Size(k,files.count-1);
5581 leency 807
	//make ".." first item in list
5733 leency 808
	if (k>0) && (strncmp(file_mas[0]*304+buf+72,"..",2)!=0)
809
		for(k--; k>0; k--;) if (!strncmp(file_mas[k]*304+buf+72,"..",2)) {file_mas[k]>
3363 leency 810
}
811
 
812
 
813
void Del_Form()
814
{
5512 punk_joker 815
	dword selected_offset2;
6278 leency 816
	int selected_count = 0;
5512 punk_joker 817
	byte f_count[128];
5581 leency 818
	int dform_x = files.w - 220 / 2 + files.x;
5606 pavelyakov 819
	if (!strncmp(#file_name,".",2)) || (!strncmp(#file_name,"..",2)) return;
3991 leency 820
	else
821
	{
4002 leency 822
		if (!files.count) return;
6008 leency 823
		DrawEolitePopup(T_YES, T_NO);
5674 pavelyakov 824
		WriteText(-strlen(T_DELETE_FILE)*3+110+dform_x,175,0x80,system.color.work_text,T_DELETE_FILE);
5512 punk_joker 825
		for (i=0; i
4002 leency 826
		{
5512 punk_joker 827
			selected_offset2 = file_mas[i]*304 + buf+32 + 7;
6278 leency 828
			if (ESBYTE[selected_offset2]) selected_count++;
4002 leency 829
		}
6278 leency 830
		if (selected_count)
5512 punk_joker 831
		{
6278 leency 832
			sprintf(#f_count,"%s%d%s",DEL_MORE_FILES_1,selected_count,DEL_MORE_FILES_2);
5674 pavelyakov 833
			WriteText(-strlen(#f_count)*3+110+dform_x,190,0x80,system.color.work_text,#f_count);
5512 punk_joker 834
		}
4002 leency 835
		else
836
		{
5591 pavelyakov 837
			if (strlen(#file_name)<28)
5512 punk_joker 838
			{
5674 pavelyakov 839
				WriteText(strlen(#file_name)*3+110+dform_x+2,190,0x80,system.color.work_text,"?");
840
				WriteText(-strlen(#file_name)*3+110+dform_x,190,0x80,system.color.work_text,#file_name);
5512 punk_joker 841
			}
842
			else
843
			{
844
				WriteText(164+dform_x,190,0x80,0,"...?");
845
				ESI = 24;
846
				WriteText(dform_x+20,190,0,0,#file_name);
847
			}
6008 leency 848
		}
4002 leency 849
		del_active=1;
3991 leency 850
	}
3363 leency 851
}
852
 
5694 leency 853
void SelectFileByName(dword that_file)
3363 leency 854
{
5694 leency 855
	int ind;
856
	files.KeyHome();
5991 leency 857
	Open_Dir(#path,ONLY_OPEN);
4225 punk_joker 858
	if (!real_files_names_case) strttl(that_file);
5694 leency 859
	for (ind=files.count-1; ind>=0; ind--;) { if (!strcmp(file_mas[ind]*304+buf+72,that_file)) break; }
5825 leency 860
	files.cur_y = ind - 1;
5694 leency 861
	files.KeyDown();
3363 leency 862
	List_ReDraw();
863
}
864
 
865
 
866
void Dir_Up()
867
{
868
	char cur_folder[4096];
869
	i=strlen(#path)-1;
870
	if (i==0) return;
871
	path[i]=0x00;
872
	i = strrchr(#path, '/');
873
	strcpy(#cur_folder, #path+i);
874
	path[i]=0x00;
5694 leency 875
	SelectFileByName(#cur_folder);
3363 leency 876
}
877
 
5444 leency 878
void Open(byte rez)
3434 leency 879
{
5443 punk_joker 880
	byte temp[4096];
5513 punk_joker 881
	selected_count = 0;
5443 punk_joker 882
	if (rez)
883
	{
5606 pavelyakov 884
		if (!strncmp(#file_name,"..",3)) return;
5443 punk_joker 885
		strcpy(#temp, #file_path);
886
		if (path[strlen(#temp)-1]!='/') chrcat(#temp, '/'); //need "/" in the end
887
		RunProgram("/sys/File Managers/Eolite", #temp);
888
		return;
889
	}
3444 leency 890
	if (!files.count) return;
3441 leency 891
	if (!itdir)
3434 leency 892
	{
5401 leency 893
		if (strrchr(#file_name, '.')==0) RunProgram(#file_path, ""); else RunProgram("/sys/@open", #file_path);
3434 leency 894
	}
895
	else
896
	{
5606 pavelyakov 897
		if (!strncmp(#file_name,"..",3)) { Dir_Up(); return; }
3434 leency 898
		strcpy(#path, #file_path);
899
		if (path[strlen(#path)-1]!='/') chrcat(#path, '/'); //need "/" in the end
5825 leency 900
		files.first=files.cur_y=0;
3444 leency 901
		Open_Dir(#path,WITH_REDRAW);
3434 leency 902
	}
903
}
3363 leency 904
 
3434 leency 905
inline fastcall void GoBack()
3363 leency 906
{
907
	char cur_folder[4096];
5974 leency 908
	strcpy(#cur_folder, #path);
909
	cur_folder[strlen(#cur_folder)-1]=0x00; //delete last '/'
6021 leency 910
	if (history.back()) {
911
		strcpy(#path, history.current());
5977 leency 912
		SelectFileByName(#cur_folder+strrchr(#cur_folder,'/'));
913
	}
3363 leency 914
}
915
 
5397 punk_joker 916
void ShowOpenWithDialog()
917
{
918
	byte param[4097];
5591 pavelyakov 919
	sprintf(#param,"~%s",#file_path);
5397 punk_joker 920
	RunProgram("/sys/@open", #param);
921
}
922
 
5555 punk_joker 923
void NewElement(byte newf)
924
{
5557 punk_joker 925
	BDVK element_info;
5581 leency 926
	byte del_rezult, copy_rezult, info_result;
5555 punk_joker 927
	if (newf)
928
	{
5591 pavelyakov 929
		sprintf(#temp,"%s%s",#path,new_file_ed.text);
5581 leency 930
		info_result = GetFileInfo(#temp, #element_info);
5571 punk_joker 931
		switch(new_element_active)
5555 punk_joker 932
		{
5581 leency 933
			case CREATE_FILE:
934
				if (info_result==5)
5557 punk_joker 935
				{
5571 punk_joker 936
					WriteFile(0, 0, #temp);
937
					if (EAX)
938
					{
6008 leency 939
						if (EAX==5) notify(NOT_CREATE_FILE);
940
						else Write_Error(EAX);
5571 punk_joker 941
					}
5557 punk_joker 942
				}
5571 punk_joker 943
				else
5557 punk_joker 944
				{
5620 leency 945
					notify(FS_ITEM_ALREADY_EXISTS);
5557 punk_joker 946
				}
5581 leency 947
				break;
948
			case CREATE_FOLDER:
949
				if (info_result==5)
5571 punk_joker 950
				{
951
					CreateDir(#temp);
952
					if (EAX)
953
					{
6008 leency 954
						if (EAX==5) notify(NOT_CREATE_FOLDER);
955
						else Write_Error(EAX);
5571 punk_joker 956
					}
957
				}
958
				else
959
				{
5620 leency 960
					notify(FS_ITEM_ALREADY_EXISTS);
5571 punk_joker 961
				}
5581 leency 962
				break;
963
			case RENAME_ITEM:
964
				if (info_result==5)
5571 punk_joker 965
				{
966
					if (itdir)
967
					{
6038 leency 968
						//rename only empty folders
5571 punk_joker 969
						if (del_rezult = DeleteFile(#file_path))
970
						{
971
							Write_Error(del_rezult);
972
							return;
973
						}
974
						if (CreateDir(#temp)) CreateDir(#file_path);
975
						Open_Dir(#path,WITH_REDRAW);
5694 leency 976
						SelectFileByName(new_file_ed.text);
5571 punk_joker 977
					}
978
					else
979
					{
980
						if (copy_rezult = CopyFile(#file_path,#temp))
981
						{
982
							Write_Error(copy_rezult);
983
						}
984
						else
985
						{
6038 leency 986
							DeleteFile(#file_path);
5694 leency 987
							SelectFileByName(new_file_ed.text);
5571 punk_joker 988
						}
989
					}
990
				}
991
				else
992
				{
5620 leency 993
					notify(FS_ITEM_ALREADY_EXISTS);
5571 punk_joker 994
				}
5555 punk_joker 995
		}
5557 punk_joker 996
		new_element_active = 0;
997
		Open_Dir(#path,WITH_REDRAW);
5694 leency 998
		SelectFileByName(new_file_ed.text);
5555 punk_joker 999
	}
1000
	new_element_active = 0;
5557 punk_joker 1001
	Open_Dir(#path,WITH_REDRAW);
5555 punk_joker 1002
}
1003
 
5571 punk_joker 1004
void NewElement_Form(byte crt, dword strng)
5555 punk_joker 1005
{
1006
	int dform_x=files.w-220/2+files.x;
5557 punk_joker 1007
	if (!new_element_active)
5555 punk_joker 1008
	{
5557 punk_joker 1009
		new_element_active = crt;
5571 punk_joker 1010
		strcpy(#new_element_name, strng);
1011
		new_file_ed.size = new_file_ed.pos = strlen(strng);
5555 punk_joker 1012
	}
6008 leency 1013
	if (new_element_active==3) DrawEolitePopup(T_RENAME, T_CANCEL);
1014
	else DrawEolitePopup(T_CREATE, T_CANCEL);
5581 leency 1015
	new_file_ed.left = dform_x+24;
6278 leency 1016
	DrawEditBox(#new_file_ed);
5555 punk_joker 1017
}
1018
 
5576 pavelyakov 1019
void FnProcess(byte N)
3434 leency 1020
{
1021
	switch(N)
1022
	{
1023
		case 1:
4395 punk_joker 1024
			if (!active_about)
1025
			{
5576 pavelyakov 1026
				about_stak = malloc(4096);
1027
				about_window = CreateThread(#about_dialog,about_stak+4092);
4395 punk_joker 1028
				break;
1029
			}
1030
			else
1031
			{
1032
				ActivateWindow(GetProcessSlot(about_window));
1033
			}
3434 leency 1034
			break;
1035
		case 2:
1036
			if (!files.count) break;
5581 leency 1037
			NewElement_Form(RENAME_ITEM, #file_name);
3434 leency 1038
			break;
1039
		case 3:
5591 pavelyakov 1040
			if (!itdir) RunProgram("/sys/tinypad", #file_path);
3434 leency 1041
			break;
1042
		case 4:
5591 pavelyakov 1043
			if (!itdir) RunProgram("/sys/develop/heed", #file_path);
3434 leency 1044
			break;
3440 leency 1045
		case 5: //refresh cur dir & devs
5719 leency 1046
			if (two_panels)
1047
			{
5723 leency 1048
				DrawFilePanels();
5719 leency 1049
			}
1050
			else
1051
			{
1052
				Tip(56, T_DEVICES, 55, "-");
1053
				Open_Dir(#path,WITH_REDRAW);
1054
				pause(10);
6034 leency 1055
				SystemDiscs.Get();
5719 leency 1056
				Open_Dir(#path,WITH_REDRAW);
5723 leency 1057
				DrawDeviceAndActionsLeftPanel();
5719 leency 1058
			}
3434 leency 1059
			break;
1060
		case 6:
5581 leency 1061
			NewElement_Form(CREATE_FOLDER, T_NEW_FOLDER);
3434 leency 1062
			break;
1063
		case 7:
5581 leency 1064
			NewElement_Form(CREATE_FILE, T_NEW_FILE);
3434 leency 1065
			break;
5447 punk_joker 1066
		case 8:
5576 pavelyakov 1067
			properties_stak = malloc(8096);
1068
			CreateThread(#properties_dialog, properties_stak+8092);
5447 punk_joker 1069
			break;
3434 leency 1070
		case 10: //F10
5753 leency 1071
			if (!active_settings)
5416 punk_joker 1072
			{
5576 pavelyakov 1073
				settings_stak = malloc(4096);
1074
				settings_window = CreateThread(#settings_dialog, settings_stak+4092);
5416 punk_joker 1075
				break;
1076
			}
1077
			else
1078
			{
1079
				ActivateWindow(GetProcessSlot(settings_window));
1080
			}
3434 leency 1081
			break;
1082
	}
1083
}
1084
 
5738 leency 1085
void ChangeActivePanel()
1086
{
1087
	llist_copy(#files_active, #files_inactive);
1088
	llist_copy(#files_inactive, #files);
1089
	strcpy(#active_path, #inactive_path);
1090
	strcpy(#inactive_path, #path);
1091
	DrawFilePanels();
1092
}
1093
 
3434 leency 1094
 
3363 leency 1095
stop: