Subversion Repositories Kolibri OS

Rev

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