Subversion Repositories Kolibri OS

Rev

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