Subversion Repositories Kolibri OS

Rev

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

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