Subversion Repositories Kolibri OS

Rev

Rev 9062 | Rev 9275 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9062 Rev 9269
Line 6... Line 6...
6
- F1 in KFM (move Properties to an external app)
6
- F1 in KFM (move Properties to an external app)
7
TODO:
7
TODO:
8
- 70.5 - get volume info and label
8
- 70.5 - get volume info and label
9
*/
9
*/
Line 10... Line 10...
10
 
10
 
11
#define ABOUT_TITLE "EOLITE 5.04 Gold"
11
#define ABOUT_TITLE "EOLITE 5.05 Gold"
12
#define TITLE_EOLITE "Eolite File Manager 5.04 Gold"
12
#define TITLE_EOLITE "Eolite File Manager 5.05 Gold"
Line 13... Line 13...
13
#define TITLE_KFM "Kolibri File Manager 2.04 Gold";
13
#define TITLE_KFM "Kolibri File Manager 2.05 Gold";
14
 
14
 
15
#define MEMSIZE 1024 * 250
15
#define MEMSIZE 1024 * 250
16
#include "../lib/clipboard.h"
16
#include "../lib/clipboard.h"
Line 140... Line 140...
140
	}
140
	}
141
	path = location[0];
141
	path = location[0];
Line 142... Line 142...
142
 
142
 
Line 143... Line 143...
143
	if (ESBYTE[p]=='\0') return;
143
	if (ESBYTE[p]=='\0') return;
144
 
144
 
145
	if (ESBYTE[p]=='-') switch (ESBYTE[p+1]) 
145
	if (ESBYTE[p]=='-') switch (ESBYTE[p+1])
146
	{
146
	{
147
		case 'p':
147
		case 'p':
148
			strcpy(#file_path, p + 3);
148
			strcpy(#file_path, p + 3);
Line 173... Line 173...
173
			strcpy(path, p);
173
			strcpy(path, p);
174
			SelectFileByName(p+strlen(path)+1);
174
			SelectFileByName(p+strlen(path)+1);
175
		} else {
175
		} else {
176
			notify(T_NOTIFY_APP_PARAM_WRONG);
176
			notify(T_NOTIFY_APP_PARAM_WRONG);
177
		}
177
		}
178
	}	
178
	}
179
}
179
}
Line 180... Line 180...
180
 
180
 
181
void main() 
181
void main()
182
{
182
{
183
	dword id;
183
	dword id;
Line 184... Line 184...
184
	int old_cur_y;
184
	int old_cur_y;
Line 201... Line 201...
201
 
201
 
202
			if (active_popin) {
202
			if (active_popin) {
203
				if (popin_string[0]!=-1) edit_box_mouse stdcall(#popin_text);
203
				if (popin_string[0]!=-1) edit_box_mouse stdcall(#popin_text);
204
				break;
204
				break;
205
			}
205
			}
206
			
206
 
Line 207... Line 207...
207
			mouse.get();
207
			mouse.get();
Line 208... Line 208...
208
 
208
 
Line 237... Line 237...
237
				}
237
				}
238
				//file menu
238
				//file menu
239
				if (mouse.key&MOUSE_RIGHT) && (mouse.up)
239
				if (mouse.key&MOUSE_RIGHT) && (mouse.up)
240
				{
240
				{
241
					if (files.ProcessMouse(mouse.x, mouse.y)) List_ReDraw();
241
					if (files.ProcessMouse(mouse.x, mouse.y)) List_ReDraw();
242
					if (getElementSelectedFlag(files.cur_y) == false) unselectAll(); //on redraw selection would be flashed, see [L001] 
242
					if (getElementSelectedFlag(files.cur_y) == false) unselectAll(); //on redraw selection would be flashed, see [L001]
243
					EventShowListMenu();
243
					EventShowListMenu();
244
				}
244
				}
245
			}
245
			}
Line 246... Line 246...
246
 
246
 
Line 269... Line 269...
269
				}
269
				}
270
				DrawRectangle3D(files.x+files.w+1,files.y+files.h-15,14,14,sc.work_light,sc.work_dark);
270
				DrawRectangle3D(files.x+files.w+1,files.y+files.h-15,14,14,sc.work_light,sc.work_dark);
271
			}
271
			}
Line 272... Line 272...
272
 
272
 
273
			//Scrooll
273
			//Scrooll
274
			if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+18) && (mouse.y>files.y) 
274
			if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+18) && (mouse.y>files.y)
275
				&& (mouse.y
275
				&& (mouse.y
276
			if (scroll_used) && (!mouse.key&MOUSE_LEFT) { scroll_used=false; DrawScroll(scroll_used); }
276
			if (scroll_used) && (!mouse.key&MOUSE_LEFT) { scroll_used=false; DrawScroll(scroll_used); }
277
			
277
 
278
			if (scroll_used)
278
			if (scroll_used)
279
			{
279
			{
280
				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
280
				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
281
				id = files.first;
281
				id = files.first;
Line 292... Line 292...
292
					SetActivePanel(0);
292
					SetActivePanel(0);
293
				} else {
293
				} else {
294
					SetActivePanel(1);
294
					SetActivePanel(1);
295
				}
295
				}
296
			}
296
			}
297
			break;  
297
			break;
298
//Button pressed-----------------------------------------------------------------------------
298
//Button pressed-----------------------------------------------------------------------------
299
		case evButton:
299
		case evButton:
300
			id = GetButtonID();
300
			id = GetButtonID();
Line 301... Line 301...
301
 
301
 
Line 317... Line 317...
317
				if (POPIN_BREADCR==active_popin) {
317
				if (POPIN_BREADCR==active_popin) {
318
					EventClosePopinForm();
318
					EventClosePopinForm();
319
					ClickOnBreadCrumb(id-BREADCRUMB_ID);
319
					ClickOnBreadCrumb(id-BREADCRUMB_ID);
320
				}
320
				}
Line 321... Line 321...
321
 
321
 
322
				break;					
322
				break;
Line 323... Line 323...
323
			}
323
			}
324
 
324
 
325
			switch(id) 
325
			switch(id)
326
			{
326
			{
327
				case KFM_DEV_DROPDOWN_1:
327
				case KFM_DEV_DROPDOWN_1:
328
				case KFM_DEV_DROPDOWN_2:
328
				case KFM_DEV_DROPDOWN_2:
Line 354... Line 354...
354
				case KFM_FUNC_ID...KFM_FUNC_ID+10:
354
				case KFM_FUNC_ID...KFM_FUNC_ID+10:
355
						FnProcess(id-KFM_FUNC_ID);
355
						FnProcess(id-KFM_FUNC_ID);
356
						break;
356
						break;
357
			}
357
			}
358
			break;
358
			break;
359
			
359
 
360
//Key pressed-----------------------------------------------------------------------------
360
//Key pressed-----------------------------------------------------------------------------
361
		case evKey:
361
		case evKey:
362
			GetKeys();
362
			GetKeys();
Line 363... Line 363...
363
 
363
 
Line 366... Line 366...
366
			if (active_popin)
366
			if (active_popin)
367
			{
367
			{
368
				if (key_scancode == SCAN_CODE_ESC) EventClosePopinForm();
368
				if (key_scancode == SCAN_CODE_ESC) EventClosePopinForm();
Line 369... Line 369...
369
 
369
 
370
				if (POPIN_DISK == active_popin) {
370
				if (POPIN_DISK == active_popin) {
371
					if (key_scancode >= SCAN_CODE_1) 
371
					if (key_scancode >= SCAN_CODE_1)
372
						&& (key_scancode <= SCAN_CODE_10) {
372
						&& (key_scancode <= SCAN_CODE_10) {
373
							EventDriveClick(key_scancode-2);
373
							EventDriveClick(key_scancode-2);
374
						}
374
						}
375
				} else {
375
				} else {
376
					if (key_scancode == SCAN_CODE_ENTER) EventPopinClickOkay();
376
					if (key_scancode == SCAN_CODE_ENTER) EventPopinClickOkay();
377
					if (popin_string[0] != -1) {
377
					if (popin_string[0] != -1) {
378
						EAX = key_editbox;
378
						EAX = key_editbox;
379
						edit_box_key stdcall (#popin_text);
379
						edit_box_key stdcall (#popin_text);
380
					}					
380
					}
381
				}
381
				}
382
				break;
382
				break;
Line 383... Line 383...
383
			}
383
			}
Line 384... Line 384...
384
 
384
 
385
			if (key_modifier&KEY_LSHIFT) || (key_modifier&KEY_RSHIFT) {
385
			if (key_modifier&KEY_LSHIFT) || (key_modifier&KEY_RSHIFT) {
386
 
386
 
387
				if (key_scancode == SCAN_CODE_ENTER) {
387
				if (key_scancode == SCAN_CODE_ENTER) {
Line 388... Line 388...
388
					EventOpenSelected(); 
388
					EventOpenSelected();
389
					break;
389
					break;
Line 417... Line 417...
417
					case SCAN_CODE_3...SCAN_CODE_10:
417
					case SCAN_CODE_3...SCAN_CODE_10:
418
							key_scancode-=2;
418
							key_scancode-=2;
419
							if (key_scancode >= SystemDiscs.list.count) break;
419
							if (key_scancode >= SystemDiscs.list.count) break;
420
							if (!efm) {
420
							if (!efm) {
421
								DrawRectangle(17,key_scancode*17+74,159,17, 0); //display click
421
								DrawRectangle(17,key_scancode*17+74,159,17, 0); //display click
422
								pause(7);										
422
								pause(7);
423
							}
423
							}
424
							EventDriveClick(key_scancode);
424
							EventDriveClick(key_scancode);
425
							break;
425
							break;
426
					case SCAN_CODE_KEY_X:
426
					case SCAN_CODE_KEY_X:
427
							CopyFilesListToClipboard(CUT);
427
							CopyFilesListToClipboard(CUT);
428
							break;						
428
							break;
429
					case SCAN_CODE_KEY_C:
429
					case SCAN_CODE_KEY_C:
430
							CopyFilesListToClipboard(COPY);
430
							CopyFilesListToClipboard(COPY);
431
							break;
431
							break;
432
					case SCAN_CODE_KEY_G:
432
					case SCAN_CODE_KEY_G:
433
							EventOpenConsoleHere();
433
							EventOpenConsoleHere();
Line 440... Line 440...
440
							strcat(#temp, #file_path);
440
							strcat(#temp, #file_path);
441
							RunProgram("/sys/media/kiv", #temp);
441
							RunProgram("/sys/media/kiv", #temp);
442
							break;
442
							break;
443
					case SCAN_CODE_KEY_N:
443
					case SCAN_CODE_KEY_N:
444
							EventOpenNewEolite();
444
							EventOpenNewEolite();
445
							break; 
445
							break;
446
					case SCAN_CODE_KEY_R:
446
					case SCAN_CODE_KEY_R:
447
							EventManualFolderRefresh();
447
							EventManualFolderRefresh();
448
							break;
448
							break;
449
					case SCAN_CODE_ENTER:
449
					case SCAN_CODE_ENTER:
450
							if (!itdir) ShowOpenWithDialog();
450
							if (!itdir) ShowOpenWithDialog();
Line 462... Line 462...
462
 
462
 
463
			switch (key_scancode)
463
			switch (key_scancode)
464
			{
464
			{
465
					case SCAN_CODE_BS:
465
					case SCAN_CODE_BS:
466
							Dir_Up();
466
							Dir_Up();
467
							break; 
467
							break;
468
					case SCAN_CODE_ENTER:
468
					case SCAN_CODE_ENTER:
469
							EventOpen(0);
469
							EventOpen(0);
470
							break; 
470
							break;
471
					case SCAN_CODE_TAB:
471
					case SCAN_CODE_TAB:
472
							if (!efm) break;
472
							if (!efm) break;
473
							SetActivePanel(active_panel^1);
473
							SetActivePanel(active_panel^1);
474
							break;
474
							break;
Line 491... Line 491...
491
							DrawStatusBar();
491
							DrawStatusBar();
492
							List_ReDraw();
492
							List_ReDraw();
493
							break;
493
							break;
494
					case SCAN_CODE_F1...SCAN_CODE_F10:
494
					case SCAN_CODE_F1...SCAN_CODE_F10:
495
							FnProcess(key_scancode-58);
495
							FnProcess(key_scancode-58);
496
							break; 
496
							break;
497
					default:
497
					default:
498
							EventSelectFileByKeyPress();
498
							EventSelectFileByKeyPress();
499
			}                         
499
			}
500
			break;
500
			break;
501
		case evIPC:
501
		case evIPC:
502
		case evReDraw:
502
		case evReDraw:
503
			draw_window();
503
			draw_window();
504
			if (CheckActiveProcess(Form.ID)) && (GetMenuClick()) break;
504
			if (CheckActiveProcess(Form.ID)) && (GetMenuClick()) break;
505
			break;
505
			break;
506
		default:
506
		default:
507
			if (!Form.status_window&ROLLED_UP) EventRefreshDisksAndFolders();
507
			if (!Form.status_window&ROLLED_UP) EventRefreshDisksAndFolders();
508
	}
508
	}
509
	
509
 
510
	if(cmd_free)
510
	if(cmd_free)
511
	{
511
	{
512
		if(cmd_free==2) about_stak=free(about_stak);
512
		if(cmd_free==2) about_stak=free(about_stak);
513
		else if(cmd_free==3) properties_stak=free(properties_stak);
513
		else if(cmd_free==3) properties_stak=free(properties_stak);
514
		else if(cmd_free==4) settings_stak=free(settings_stak);
514
		else if(cmd_free==4) settings_stak=free(settings_stak);
Line 520... Line 520...
520
{
520
{
521
	dword i=0;
521
	dword i=0;
522
	incn x;
522
	incn x;
523
	dword title;
523
	dword title;
524
	static int rand_n;
524
	static int rand_n;
525
	if (rand_n) rand_n = random(80);
525
	if (!rand_n) rand_n = random(80);
Line 526... Line 526...
526
 
526
 
527
	if (show_status_bar.checked) {
527
	if (show_status_bar.checked) {
528
		#define STBAR_EOLITE_H 16
528
		#define STBAR_EOLITE_H 16
529
		#define STBAR_KFM_H 21
529
		#define STBAR_KFM_H 21
Line 565... Line 565...
565
		*/
565
		*/
566
	} else {
566
	} else {
567
		if (Form.width < 480) { MoveSize(OLD,OLD,480,OLD); return; }
567
		if (Form.width < 480) { MoveSize(OLD,OLD,480,OLD); return; }
568
		ESDWORD[#toolbar_pal] = sc.work;
568
		ESDWORD[#toolbar_pal] = sc.work;
569
		ESDWORD[#toolbar_pal+4] = MixColors(0, sc.work, 35);
569
		ESDWORD[#toolbar_pal+4] = MixColors(0, sc.work, 35);
570
		PutPaletteImage(#toolbar, 246, 34, 0, 0, 8, #toolbar_pal);		
570
		PutPaletteImage(#toolbar, 246, 34, 0, 0, 8, #toolbar_pal);
571
		for (i=0; i<3; i++) DefineHiddenButton(toolbar_buttons_x[i]+2,7,31-5,29-5,BACK_BTN+i);
571
		for (i=0; i<3; i++) DefineHiddenButton(toolbar_buttons_x[i]+2,7,31-5,29-5,BACK_BTN+i);
572
		for (i=3; i<6; i++) DefineHiddenButton(toolbar_buttons_x[i],  5,31,  29,  BACK_BTN+i);
572
		for (i=3; i<6; i++) DefineHiddenButton(toolbar_buttons_x[i],  5,31,  29,  BACK_BTN+i);
573
		DrawBar(127, 8, 1, 25, sc.work_graph);
573
		DrawBar(127, 8, 1, 25, sc.work_graph);
574
		DrawBar(246,0, Form.cwidth - 246, 34, sc.work);
574
		DrawBar(246,0, Form.cwidth - 246, 34, sc.work);
575
		DrawDot(Form.cwidth-17,12);
575
		DrawDot(Form.cwidth-17,12);
Line 583... Line 583...
583
	for (i=0; i<6; i++) DrawBar(0, 34+i, Form.cwidth, 1, MixColors(sc.work_dark, sc.work, i*10));
583
	for (i=0; i<6; i++) DrawBar(0, 34+i, Form.cwidth, 1, MixColors(sc.work_dark, sc.work, i*10));
584
	for (i=0; i<6; i++) DrawBar(0, 5-i, Form.cwidth, 1, MixColors(sc.work_light, sc.work, i*10));
584
	for (i=0; i<6; i++) DrawBar(0, 5-i, Form.cwidth, 1, MixColors(sc.work_light, sc.work, i*10));
585
	llist_copy(#files_active, #files);
585
	llist_copy(#files_active, #files);
586
	DrawStatusBar();
586
	DrawStatusBar();
587
	if (!getSelectedCount()) {
587
	if (!getSelectedCount()) {
588
		OpenDir(ONLY_OPEN); //if there are no selected files -> refresh folder [L001] 
588
		OpenDir(ONLY_OPEN); //if there are no selected files -> refresh folder [L001]
589
	}
589
	}
590
	DrawFilePanels();
590
	DrawFilePanels();
Line 591... Line 591...
591
 
591
 
592
	if (files.x!=files_inactive.x) {
592
	if (files.x!=files_inactive.x) {
593
		if (active_popin) ShowPopinForm(active_popin);
593
		if (active_popin) ShowPopinForm(active_popin);
594
	}
594
	}
Line 595... Line 595...
595
}
595
}
596
 
596
 
597
void DrawButtonsAroundList() 
597
void DrawButtonsAroundList()
598
{
598
{
599
	word sorting_arrow_x;
599
	word sorting_arrow_x;
600
	dword sorting_arrow_t = "\x19";
600
	dword sorting_arrow_t = "\x19";
Line 631... Line 631...
631
void DrawStatusBar()
631
void DrawStatusBar()
632
{
632
{
633
	char status_bar_str[80];
633
	char status_bar_str[80];
634
	int go_up_folder_exists=0;
634
	int go_up_folder_exists=0;
Line 635... Line 635...
635
 
635
 
636
	if (efm) { 
636
	if (efm) {
637
		DrawBar(0, Form.cheight - status_bar_h, Form.cwidth, 2, sc.work);
637
		DrawBar(0, Form.cheight - status_bar_h, Form.cwidth, 2, sc.work);
638
		DrawBar(0, Form.cheight - 2, Form.cwidth,  2, sc.work);
638
		DrawBar(0, Form.cheight - 2, Form.cwidth,  2, sc.work);
639
		DrawBar(Form.cwidth-1, Form.cheight - 19, 1,  17, sc.work);
639
		DrawBar(Form.cwidth-1, Form.cheight - 19, 1,  17, sc.work);
640
		DrawFuncButtonsInKfm();
640
		DrawFuncButtonsInKfm();
Line 706... Line 706...
706
		return;
706
		return;
707
	}
707
	}
708
	SetCurDir(path);
708
	SetCurDir(path);
709
	if (files.count>0) && (files.cur_y-files.first==-1) files.cur_y=0;
709
	if (files.count>0) && (files.cur_y-files.first==-1) files.cur_y=0;
710
	files.visible = math.min(files.h / files.item_h, files.count);
710
	files.visible = math.min(files.h / files.item_h, files.count);
711
	if (!strncmp(path, "/rd/1",5)) || (!strncmp(path, "/sys/",4)) 
711
	if (!strncmp(path, "/rd/1",5)) || (!strncmp(path, "/sys/",4))
712
		dir_at_fat16 = true; else dir_at_fat16 = false; 
712
		dir_at_fat16 = true; else dir_at_fat16 = false;
713
	Sorting();
713
	Sorting();
714
	SystemDiscs.Draw();
714
	SystemDiscs.Draw();
715
	list_full_redraw = true;
715
	list_full_redraw = true;
716
	List_ReDraw();
716
	List_ReDraw();
717
	DrawPathBar();
717
	DrawPathBar();
Line 722... Line 722...
722
	int errornum;
722
	int errornum;
723
	unselectAll();
723
	unselectAll();
724
	if (buf) free(buf);
724
	if (buf) free(buf);
725
	if (errornum = GetDir(#buf, #files.count, path, DIRS_NOROOT)) {
725
	if (errornum = GetDir(#buf, #files.count, path, DIRS_NOROOT)) {
726
		history.add(path);
726
		history.add(path);
727
		EventHistoryGoBack();
727
		//EventHistoryGoBack();
-
 
728
		Dir_Up();
728
		Write_Error(errornum);
729
		Write_Error(errornum);
729
		return;
730
		return;
730
	}
731
	}
731
	if (files.count>0) && (files.cur_y-files.first==-1) files.cur_y=0;
732
	if (files.count>0) && (files.cur_y-files.first==-1) files.cur_y=0;
732
	history.add(path);
733
	history.add(path);
733
	SystemDiscs.Draw();
734
	SystemDiscs.Draw();
734
	files.visible = math.min(files.h / files.item_h, files.count);
735
	files.visible = math.min(files.h / files.item_h, files.count);
735
	if (!strncmp(path, "/rd/1",5)) || (!strncmp(path, "/sys/",4)) 
736
	if (!strncmp(path, "/rd/1",5)) || (!strncmp(path, "/sys/",4))
736
		dir_at_fat16 = true; else dir_at_fat16 = false; 
737
		dir_at_fat16 = true; else dir_at_fat16 = false;
737
	Sorting();
738
	Sorting();
738
	list_full_redraw = true;
739
	list_full_redraw = true;
739
	SetCurDir(path);
740
	SetCurDir(path);
740
	if (redraw!=ONLY_OPEN) {
741
	if (redraw!=ONLY_OPEN) {
741
		List_ReDraw();
742
		List_ReDraw();
Line 771... Line 772...
771
	}
772
	}
Line 772... Line 773...
772
 
773
 
Line 773... Line 774...
773
	_ALL_LIST_REDRAW:
774
	_ALL_LIST_REDRAW:
774
 
775
 
775
	for (j=0; j
776
	for (j=0; j
776
		if (files.cur_y-files.first!=j) Line_ReDraw(col.list_bg, j); 
777
		if (files.cur_y-files.first!=j) Line_ReDraw(col.list_bg, j);
777
		else Line_ReDraw(col.selec, files.cur_y-files.first);		
778
		else Line_ReDraw(col.selec, files.cur_y-files.first);
778
	}
779
	}
779
	//in the bottom
780
	//in the bottom
780
	all_lines_h = j * files.item_h;
781
	all_lines_h = j * files.item_h;
Line 823... Line 824...
823
	file.sizehi   = ESDWORD[ESI+36];
824
	file.sizehi   = ESDWORD[ESI+36];
824
	file_name_off = ESI+40;
825
	file_name_off = ESI+40;
825
	sprintf(#full_path,"%s/%s",path,file_name_off);
826
	sprintf(#full_path,"%s/%s",path,file_name_off);
Line 826... Line 827...
826
 
827
 
827
	if (attr&ATR_FOLDER)
828
	if (attr&ATR_FOLDER)
828
	{	
829
	{
829
		if (!strcmp(file_name_off,"..")) ext1=""; else {
830
		if (!strcmp(file_name_off,"..")) ext1=""; else {
830
			ext1="";
831
			ext1="";
831
			WriteTextCenter(files.x+files.w-140, files.text_y+y+1, 72, col.list_gb_text, ext1);
832
			WriteTextCenter(files.x+files.w-140, files.text_y+y+1, 72, col.list_gb_text, ext1);
832
		}
833
		}
833
		if (chrnum(path, '/')==1) && (streq(path, "/kolibrios")==false) 
834
		if (chrnum(path, '/')==1) && (streq(path, "/kolibrios")==false)
834
		&& (streq(path, "/sys")==false) file_size = GetDeviceSize(#full_path);
835
		&& (streq(path, "/sys")==false) file_size = GetDeviceSize(#full_path);
835
	}
836
	}
836
	else
837
	else
837
	{
838
	{
838
		ext1 = strrchr(file_name_off,'.') + file_name_off;
839
		ext1 = strrchr(file_name_off,'.') + file_name_off;
839
		if (ext1==file_name_off) ext1 = NULL; //if no extension then show nothing
840
		if (ext1==file_name_off) ext1 = NULL; //if no extension then show nothing
840
		file_size = ConvertSize64(file.sizelo, file.sizehi);
841
		file_size = ConvertSize64(file.sizelo, file.sizehi);
841
		if (ext1) && (strlen(ext1)<9) WriteTextCenter(files.x+files.w-140, files.text_y+y+1, 72, col.list_gb_text, ext1);
842
		if (ext1) && (strlen(ext1)<9) WriteTextCenter(files.x+files.w-140, files.text_y+y+1, 72, col.list_gb_text, ext1);
842
	}
843
	}
843
	if (file_size) WriteText(7-strlen(file_size)*6+files.x+files.w-58, 
844
	if (file_size) WriteText(7-strlen(file_size)*6+files.x+files.w-58,
Line 844... Line 845...
844
			files.text_y+y+1, files.font_type, col.list_gb_text, file_size);
845
			files.text_y+y+1, files.font_type, col.list_gb_text, file_size);
845
 
846
 
846
	if (attr&ATR_HIDDEN) || (attr&ATR_SYSTEM) text_col=col.list_text_hidden;
847
	if (attr&ATR_HIDDEN) || (attr&ATR_SYSTEM) text_col=col.list_text_hidden;
Line 850... Line 851...
850
		itdir = attr & ATR_FOLDER;
851
		itdir = attr & ATR_FOLDER;
851
		strcpy(#file_name, file_name_off);
852
		strcpy(#file_name, file_name_off);
852
		if (streq(path,"/")) sprintf(#file_path,"%s%s",path,file_name_off);
853
		if (streq(path,"/")) sprintf(#file_path,"%s%s",path,file_name_off);
853
			else sprintf(#file_path,"%s/%s",path,file_name_off);
854
			else sprintf(#file_path,"%s/%s",path,file_name_off);
854
		if (text_col==col.list_text_hidden) {
855
		if (text_col==col.list_text_hidden) {
855
			text_col=MixColors(col.selec_text, col.list_text_hidden, 65); 
856
			text_col=MixColors(col.selec_text, col.list_text_hidden, 65);
856
		} else text_col=col.selec_text;
857
		} else text_col=col.selec_text;
857
	}
858
	}
858
	if (getElementSelectedFlag(filenum+files.first)) text_col=0xFF0000;
859
	if (getElementSelectedFlag(filenum+files.first)) text_col=0xFF0000;
859
	if (kfont.size.pt==9) || (!kfont.font)
860
	if (kfont.size.pt==9) || (!kfont.font)
860
	{
861
	{
Line 865... Line 866...
865
			FileShow.area_size_x = files.w - 164;
866
			FileShow.area_size_x = files.w - 164;
866
			FileShow.text_pointer = file_name_off;
867
			FileShow.text_pointer = file_name_off;
867
			FileShow.start_y = files.text_y + y - 3;
868
			FileShow.start_y = files.text_y + y - 3;
868
			PathShow_prepare stdcall(#FileShow);
869
			PathShow_prepare stdcall(#FileShow);
869
			PathShow_draw stdcall(#FileShow);
870
			PathShow_draw stdcall(#FileShow);
870
		}		
871
		}
871
	}
872
	}
872
	else
873
	else
873
	{
874
	{
874
		//that shit must be it a library
875
		//that shit must be it a library
875
		strcpy(#label_file_name, file_name_off);
876
		strcpy(#label_file_name, file_name_off);
876
		if (kfont.getsize(kfont.size.pt, #label_file_name) + 141 + 26 > files.w)
877
		if (kfont.getsize(kfont.size.pt, #label_file_name) + 141 + 26 > files.w)
877
		{
878
		{
878
			while (kfont.getsize(kfont.size.pt, #label_file_name) + 141 + 26 > files.w) {
879
			while (kfont.getsize(kfont.size.pt, #label_file_name) + 141 + 26 > files.w) {
879
				ESBYTE[#label_file_name+strlen(#label_file_name)-1] = NULL;
880
				ESBYTE[#label_file_name+strlen(#label_file_name)-1] = NULL;
880
			}
881
			}
881
			strcpy(#label_file_name+strlen(#label_file_name)-2, "...");			
882
			strcpy(#label_file_name+strlen(#label_file_name)-2, "...");
882
		}
883
		}
883
		kfont.WriteIntoWindow(files.x + icon_size+7, files.item_h - kfont.height / 2 + y, 
884
		kfont.WriteIntoWindow(files.x + icon_size+7, files.item_h - kfont.height / 2 + y,
884
			bgcol, text_col, kfont.size.pt, #label_file_name);
885
			bgcol, text_col, kfont.size.pt, #label_file_name);
885
	}
886
	}
886
	DrawIconByExtension(#full_path, ext1, files.x+4, icon_y, bgcol);
887
	DrawIconByExtension(#full_path, ext1, files.x+4, icon_y, bgcol);
887
	if (current_inactive) DrawWideRectangle(files.x+2, y, files.w-4, files.item_h, 2, col.selec);
888
	if (current_inactive) DrawWideRectangle(files.x+2, y, files.w-4, files.item_h, 2, col.selec);
888
}
889
}
Line 959... Line 960...
959
}
960
}
Line 960... Line 961...
960
 
961
 
961
void EventOpenSelected()
962
void EventOpenSelected()
962
{
963
{
963
	int i;
964
	int i;
964
	for (i=0; i
965
	for (i=0; i
965
		EDX = items.get(i)*304 + buf+32;
966
		EDX = items.get(i)*304 + buf+32;
966
		if (ESDWORD[EDX]&ATR_FOLDER) continue; //is foder
967
		if (ESDWORD[EDX]&ATR_FOLDER) continue; //is foder
967
		sprintf(#param,"%s/%s",path, EDX+40);
968
		sprintf(#param,"%s/%s",path, EDX+40);
968
		RunProgram("/sys/@open", #param);
969
		RunProgram("/sys/@open", #param);
Line 980... Line 981...
980
	}
981
	}
981
	if (!files.count) return;
982
	if (!files.count) return;
982
	if (!itdir)
983
	if (!itdir)
983
	{
984
	{
984
		if (strrchr(#file_name, '.')==0) RunProgram(#file_path, ""); else RunProgram("/sys/@open", #file_path);
985
		if (strrchr(#file_name, '.')==0) RunProgram(#file_path, ""); else RunProgram("/sys/@open", #file_path);
985
	} 
986
	}
986
	else
987
	else
987
	{
988
	{
988
		if (!strncmp(#file_name,"..",3)) { Dir_Up(); return; }
989
		if (!strncmp(#file_name,"..",3)) { Dir_Up(); return; }
989
		strcpy(path, #file_path);
990
		strcpy(path, #file_path);
990
		files.first=files.cur_y=0;
991
		files.first=files.cur_y=0;
Line 1026... Line 1027...
1026
	sprintf(#temp,"%s/%s",path,popin_text.text);
1027
	sprintf(#temp,"%s/%s",path,popin_text.text);
1027
	if (file_exists(#temp)) {
1028
	if (file_exists(#temp)) {
1028
		notify(FS_ITEM_ALREADY_EXISTS);
1029
		notify(FS_ITEM_ALREADY_EXISTS);
1029
		return false;
1030
		return false;
1030
	}
1031
	}
1031
	switch(active_popin) 
1032
	switch(active_popin)
1032
	{
1033
	{
1033
		case POPIN_NEW_FILE:
1034
		case POPIN_NEW_FILE:
1034
				if (CreateFile(0, 0, #temp)) goto __FAIL;
1035
				if (CreateFile(0, 0, #temp)) goto __FAIL;
1035
				break;
1036
				break;
1036
		case POPIN_NEW_FOLDER:
1037
		case POPIN_NEW_FOLDER:
Line 1052... Line 1053...
1052
	}
1053
	}
1053
	SelectFileByName(popin_text.text);
1054
	SelectFileByName(popin_text.text);
1054
	return true;
1055
	return true;
1055
	__FAIL:
1056
	__FAIL:
1056
	Write_Error(EAX);
1057
	Write_Error(EAX);
1057
	return false;	
1058
	return false;
1058
}
1059
}
Line 1059... Line 1060...
1059
 
1060
 
1060
void EventPopinClickOkay()
1061
void EventPopinClickOkay()
1061
{
1062
{
Line 1067... Line 1068...
1067
		case POPIN_DELETE:
1068
		case POPIN_DELETE:
1068
			CopyFilesListToClipboard(DELETE);
1069
			CopyFilesListToClipboard(DELETE);
1069
			EventChooseAllFiles(false);
1070
			EventChooseAllFiles(false);
1070
			sprintf(#param, "-d %s", #file_path);
1071
			sprintf(#param, "-d %s", #file_path);
1071
			RunProgram(#program_path, #param);
1072
			RunProgram(#program_path, #param);
1072
			break;	
1073
			break;
1073
		case POPIN_RENAME:
1074
		case POPIN_RENAME:
1074
		case POPIN_NEW_FILE:
1075
		case POPIN_NEW_FILE:
1075
		case POPIN_NEW_FOLDER:
1076
		case POPIN_NEW_FOLDER:
1076
			if (!EventCreateAndRename()) return;
1077
			if (!EventCreateAndRename()) return;
1077
	}
1078
	}
Line 1199... Line 1200...
1199
	}
1200
	}
1200
}
1201
}
Line 1201... Line 1202...
1201
 
1202
 
1202
void SetActivePanel(int _active)
1203
void SetActivePanel(int _active)
1203
{
1204
{
1204
	if (active_panel != _active) {	
1205
	if (active_panel != _active) {
1205
		active_panel = _active;
1206
		active_panel = _active;
1206
		llist_copy(#files_active, #files_inactive);
1207
		llist_copy(#files_active, #files_inactive);
1207
		llist_copy(#files_inactive, #files);
1208
		llist_copy(#files_inactive, #files);
1208
		llist_copy(#files, #files_active);
1209
		llist_copy(#files, #files_active);
Line 1311... Line 1312...
1311
	{
1312
	{
1312
		dif_x = mouse.x-x_old;
1313
		dif_x = mouse.x-x_old;
1313
		dif_y = mouse.y-y_old;
1314
		dif_y = mouse.y-y_old;
1314
		adif_x = fabs(dif_x);
1315
		adif_x = fabs(dif_x);
1315
		adif_y = fabs(dif_y);
1316
		adif_y = fabs(dif_y);
1316
		
1317
 
1317
		if (adif_x>adif_y) {
1318
		if (adif_x>adif_y) {
1318
			if (dif_x > 150) {
1319
			if (dif_x > 150) {
1319
				EventHistoryGoForward();
1320
				EventHistoryGoForward();
1320
				stats = 0;
1321
				stats = 0;
1321
			}
1322
			}
Line 1363... Line 1364...
1363
void EventChooseFilesRange(int _start, _end)
1364
void EventChooseFilesRange(int _start, _end)
1364
{
1365
{
1365
	if (_start > _end) _start >< _end;
1366
	if (_start > _end) _start >< _end;
1366
	if (_end - _start > 1) list_full_redraw = true;
1367
	if (_end - _start > 1) list_full_redraw = true;
1367
	while (_start < _end) {
1368
	while (_start < _end) {
1368
		EventChooseFile(_start); 
1369
		EventChooseFile(_start);
1369
		_start++;
1370
		_start++;
1370
	}
1371
	}
1371
	DrawStatusBar();
1372
	DrawStatusBar();
1372
	List_ReDraw();
1373
	List_ReDraw();
1373
}
1374
}
Line 1386... Line 1387...
1386
		case BACK_BTN: EventHistoryGoBack(); break;
1387
		case BACK_BTN: EventHistoryGoBack(); break;
1387
		case FWRD_BTN: EventHistoryGoForward(); break;
1388
		case FWRD_BTN: EventHistoryGoForward(); break;
1388
		case GOUP_BTN: Dir_Up(); break;
1389
		case GOUP_BTN: Dir_Up(); break;
1389
		case COPY_BTN: CopyFilesListToClipboard(CUT); break;
1390
		case COPY_BTN: CopyFilesListToClipboard(CUT); break;
1390
		case CUT_BTN:  CopyFilesListToClipboard(COPY); break;
1391
		case CUT_BTN:  CopyFilesListToClipboard(COPY); break;
1391
		case PASTE_BTN:EventPaste(path); break;		
1392
		case PASTE_BTN:EventPaste(path); break;
1392
	}
1393
	}
1393
}
1394
}
Line 1394... Line 1395...
1394
 
1395
 
1395
void EventDriveClick(int __id)
1396
void EventDriveClick(int __id)
Line 1399... Line 1400...
1399
		EventClosePopinForm();
1400
		EventClosePopinForm();
1400
		draw_window();
1401
		draw_window();
1401
	}
1402
	}
1402
	strcpy(path, SystemDiscs.list.get(__id));
1403
	strcpy(path, SystemDiscs.list.get(__id));
1403
	files.KeyHome();
1404
	files.KeyHome();
1404
	OpenDir(WITH_REDRAW);	
1405
	OpenDir(WITH_REDRAW);
1405
}
1406
}
Line 1406... Line 1407...
1406
 
1407