Subversion Repositories Kolibri OS

Rev

Rev 5581 | Rev 5606 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5581 Rev 5591
Line 154... Line 154...
154
dword file_mas[6898];
154
dword file_mas[6898];
155
int j, i;
155
int j, i;
156
int action_buf;
156
int action_buf;
157
int rand_n;
157
int rand_n;
158
int selected_count;
158
int selected_count;
-
 
159
byte CMD_REFRESH;
Line 159... Line 160...
159
 
160
 
160
mouse gestures;
161
mouse gestures;
161
signed x_old, y_old, dif_x, dif_y, adif_x, adif_y;
162
signed x_old, y_old, dif_x, dif_y, adif_x, adif_y;
Line 181... Line 182...
181
 
182
 
182
void main() 
183
void main() 
183
{
184
{
184
	word key, id, can_show, can_select, m_selected;
185
	word key, id, can_show, can_select, m_selected;
-
 
186
	dword selected_offset;
-
 
187
	dword IPC_LEN,IPC_ID;
-
 
188
	char IPC_BUF[10];
185
	dword selected_offset;
189
	dword tmp;
186
	rand_n = random(40);
190
	rand_n = random(40);
187
	gestures.get();
191
	gestures.get();
188
	mem_Init();
192
	mem_Init();
189
	if (load_dll2(boxlib, #box_lib_init,0)!=0) notify(ERROR_1);
193
	if (load_dll2(boxlib, #box_lib_init,0)!=0) notify(ERROR_1);
Line 192... Line 196...
192
	LoadIniSettings();
196
	LoadIniSettings();
193
	GetSystemDiscs();
197
	GetSystemDiscs();
194
	SetAppColors();
198
	SetAppColors();
195
	if (param)
199
	if (param)
196
	{
200
	{
-
 
201
		tmp = strlen(#path);
197
		strcpy(#path, #param);
202
		strncpy(#path, #param, tmp);
-
 
203
		$dec tmp
198
		if (path[strlen(#path)-1]!='/') chrcat(#path, '/'); //add "/" to the end of the string
204
		if (path[tmp]!='/') DSBYTE[#path+tmp] = '/'; //add "/" to the end of the string
199
	}
205
	}
200
	else
206
	else
201
	{
207
	{
202
		strcpy(#path, "/rd/1/");		
208
		strncpy(#path, "/rd/1/", 6);		
203
	}
209
	}
204
	Open_Dir(#path,ONLY_OPEN);
210
	Open_Dir(#path,ONLY_OPEN);
205
	SetEventMask(0x27);
211
	SetEventMask(0x27);
-
 
212
	loop(){
206
	loop(){ switch(WaitEvent())
213
		switch(WaitEvent())
207
	{
214
		{
208
		case evMouse:
215
			case evMouse:
209
			if (del_active) || (!CheckActiveProcess(Form.ID)) || (Form.status_window>2) break;
216
				if (del_active) || (!CheckActiveProcess(Form.ID)) || (Form.status_window>2) break;
210
			if (new_element_active) || (!CheckActiveProcess(Form.ID)) || (Form.status_window>2)
217
				if (new_element_active) || (!CheckActiveProcess(Form.ID)) || (Form.status_window>2)
211
			{
218
				{
Line 298... Line 305...
298
				break;
305
					break;
299
			}
306
				}
Line 300... Line 307...
300
 
307
 
301
			if (m.x>=Form.width-26) && (m.x<=Form.width-6) && (m.y>40) && (m.y
308
				if (m.x>=Form.width-26) && (m.x<=Form.width-6) && (m.y>40) && (m.y
302
			{
309
				{
303
				IF (m.lkm==1) DrawRectangle3D(Form.cwidth - 17,41,14,14,0xC7C7C7,0xFFFFFF);
310
					if (m.lkm==1) DrawRectangle3D(Form.cwidth - 17,41,14,14,0xC7C7C7,0xFFFFFF);
304
				WHILE (m.lkm==1) && (files.first>0)
311
					WHILE (m.lkm==1) && (files.first>0)
305
				{
312
					{
306
					pause(8);
313
						pause(8);
307
					files.first--;
314
						files.first--;
Line 311... Line 318...
311
				DrawRectangle3D(Form.cwidth - 17,41,14,14,0xFFFFFF,0xC7C7C7);
318
					DrawRectangle3D(Form.cwidth - 17,41,14,14,0xFFFFFF,0xC7C7C7);
312
			}
319
				}
Line 313... Line 320...
313
 
320
 
314
			if (m.x>=Form.width-26) && (m.x<=Form.width-6) && (m.y>onTop(22,0)+1) && (m.y
321
				if (m.x>=Form.width-26) && (m.x<=Form.width-6) && (m.y>onTop(22,0)+1) && (m.y
315
			{
322
				{
316
				IF (m.lkm==1) DrawRectangle3D(Form.cwidth - 17,onTop(21,0),14,14,0xC7C7C7,0xFFFFFF);
323
					if (m.lkm==1) DrawRectangle3D(Form.cwidth - 17,onTop(21,0),14,14,0xC7C7C7,0xFFFFFF);
317
				while (m.lkm==1) && (files.first
324
					while (m.lkm==1) && (files.first
318
				{
325
					{
319
					pause(8);
326
						pause(8);
320
					files.first++;
327
						files.first++;
Line 328... Line 335...
328
			if (!m.lkm) && (scroll_used) { scroll_used=NULL; Scroll(); }
335
				if (!m.lkm) && (scroll_used) { scroll_used=NULL; Scroll(); }
329
			if (m.x>=Form.width-26) && (m.x<=Form.width-6) && (m.y>56) && (m.y
336
				if (m.x>=Form.width-26) && (m.x<=Form.width-6) && (m.y>56) && (m.y
Line 330... Line 337...
330
			
337
				
331
			if (scroll_used)
338
				if (scroll_used)
332
			{
339
				{
333
				IF (sc_slider_h/2+files.y>m.y) || (m.y<0) || (m.y>4000) m.y=sc_slider_h/2+files.y; //anee eo?ni? iaa ieiii
340
					if (sc_slider_h/2+files.y>m.y) || (m.y<0) || (m.y>4000) m.y=sc_slider_h/2+files.y; //anee eo?ni? iaa ieiii
334
				id=files.first;
341
					id=files.first;
335
				j= sc_slider_h/2;
342
					j= sc_slider_h/2;
336
				files.first = m.y -j -files.y * files.count;
343
					files.first = m.y -j -files.y * files.count;
337
				files.first /= onTop(22,files.y);
344
					files.first /= onTop(22,files.y);
338
				IF (files.visible+files.first>files.count) files.first=files.count-files.visible;
345
					if (files.visible+files.first>files.count) files.first=files.count-files.visible;
339
				IF (id!=files.first) List_ReDraw();
346
					if (id!=files.first) List_ReDraw();
340
			}
347
				}
341
			break;  
348
				break;  
342
//Button pressed-----------------------------------------------------------------------------
349
	//Button pressed-----------------------------------------------------------------------------
343
		case evButton:
350
			case evButton:
Line 347... Line 354...
347
				KillProcess(about_window);
354
					KillProcess(about_window);
348
				ExitProcess();
355
					ExitProcess();
349
			}
356
				}
350
			if (del_active)
357
				if (del_active)
351
			{
358
				{
352
				IF (id==301) || (id==302) Del_File(302-id);
359
					if (id==301) || (id==302) Del_File(302-id);
353
				break;
360
					break;
354
			}
361
				}
355
			if (new_element_active)
362
				if (new_element_active)
356
			{
363
				{
357
				IF (id==301) || (id==302) NewElement(302-id);
364
					if (id==301) || (id==302) NewElement(302-id);
358
				break;
365
					break;
359
			}
366
				}
Line 360... Line 367...
360
			
367
				
361
			switch(id) 
368
				switch(id) 
Line 382... Line 389...
382
				case 26: //paste
389
					case 26: //paste
383
						copy_stak = malloc(4096);
390
							copy_stak = malloc(4096);
384
						CreateThread(#Paste,copy_stak+4092);
391
							CreateThread(#Paste,copy_stak+4092);
385
						break;
392
							break;
386
				case 31...33: //sort
393
					case 31...33: //sort
387
						IF(sort_num==1) DrawFilledBar(sorting_arrow_x,42,6,10);
394
							if(sort_num==1) DrawFilledBar(sorting_arrow_x,42,6,10);
388
						IF(sort_num==2) DrawFilledBar(sorting_arrow_x,42,6,10);
395
							if(sort_num==2) DrawFilledBar(sorting_arrow_x,42,6,10);
389
						IF(sort_num==3) DrawFilledBar(sorting_arrow_x,42,6,10);
396
							if(sort_num==3) DrawFilledBar(sorting_arrow_x,42,6,10);
390
						sort_num=id-30;
397
							sort_num=id-30;
391
						Open_Dir(#path,WITH_REDRAW);
398
							Open_Dir(#path,WITH_REDRAW);
392
						break;
399
							break;
393
				case 50...60: //Actions
400
					case 50...60: //Actions
394
						FnProcess(id-50);
401
							FnProcess(id-50);
Line 406... Line 413...
406
			break;
413
				break;
407
//Key pressed-----------------------------------------------------------------------------
414
	//Key pressed-----------------------------------------------------------------------------
408
		case evKey:
415
			case evKey:
409
			key = GetKey();
416
				key = GetKey();
410
			if (Form.status_window>2) break;
417
				if (Form.status_window>2) break;
411
			IF (del_active)
418
				if (del_active)
412
			{
419
				{
413
				IF (key==013) Del_File(true);
420
					if (key==013) Del_File(true);
414
				IF (key==027) Del_File(false);
421
					if (key==027) Del_File(false);
415
				break;
422
					break;
416
			}
423
				}
417
			IF (new_element_active)
424
				if (new_element_active)
418
			{
425
				{
419
				IF (key==027) NewElement(0);
426
					if (key==027) NewElement(0);
420
				IF (key==013) NewElement(1);
427
					if (key==013) NewElement(1);
421
				EAX=key<<8;
428
					EAX=key<<8;
422
				edit_box_key stdcall (#new_file_ed);
429
					edit_box_key stdcall (#new_file_ed);
423
				break;
430
					break;
424
			}
431
				}
425
			IF (edit2.flags!=64) && (key!=13) && (key!=27)
432
				if (edit2.flags!=64) && (key!=13) && (key!=27)
426
			{
433
				{
427
				EAX=key<<8;
434
					EAX=key<<8;
428
				edit_box_key stdcall (#edit2);
435
					edit_box_key stdcall (#edit2);
429
				break;
436
					break;
430
			}
437
				}
431
			switch (key)
438
				switch (key)
432
			{
439
				{
433
					case 209...217:
440
						case 209...217:
434
							id=key-110;
441
								id=key-110;
435
							IF (id-100>=disc_num) break;
442
								if (id-100>=disc_num) break;
436
							GOTO DEVICE_MARK;
443
								GOTO DEVICE_MARK;
437
					case ASCII_KEY_BS:
444
						case ASCII_KEY_BS:
438
							//GoBack();
445
								//GoBack();
439
							Dir_Up();
446
								Dir_Up();
440
							break; 
447
								break; 
441
					case 004: //Ctrl+D set as bg
448
						case 004: //Ctrl+D set as bg
442
							strcpy(#temp, "\\S__");
449
								strncpy(#temp, "\\S__",4);
443
							strcat(#temp, #file_path);
450
								strcat(#temp, #file_path);
444
							RunProgram("/sys/media/kiv", #temp);
451
								RunProgram("/sys/media/kiv", #temp);
445
							break;
452
								break;
446
					case 014: //Ctrl+N new window
453
						case 014: //Ctrl+N new window
447
							IF (Form.left==98) MoveSize(Form.left-20,Form.top-20,OLD,OLD);
454
								if (Form.left==98) MoveSize(Form.left-20,Form.top-20,OLD,OLD);
448
							RunProgram("/sys/File Managers/Eolite", #path);
455
								RunProgram("/sys/File Managers/Eolite", #path);
449
							break; 
456
								break; 
450
					case 024: //Ctrl+X
457
						case 024: //Ctrl+X
451
							Copy(#file_path, CUT);
458
								Copy(#file_path, CUT);
452
							break;
459
								break;
Line 532... Line 539...
532
							break; 
539
								break; 
533
					default:    
540
						default:    
534
							for (i=files.current+files.first+1; i
541
								for (i=files.current+files.first+1; i
535
							{
542
								{
536
								strcpy(#temp, file_mas[i]*304+buf+72);
543
									strcpy(#temp, file_mas[i]*304+buf+72);
537
								IF (temp[0]==key) || (temp[0]==key-32)
544
									if (temp[0]==key) || (temp[0]==key-32)
538
								{
545
									{
539
									List_Current(i-files.current-files.first);
546
										List_Current(i-files.current-files.first);
540
									break;
547
										break;
541
								}
548
									}
542
							}
549
								}
543
			}                         
550
				}                         
544
			break;
551
			break;
545
		case evReDraw:
552
			case evReDraw:
-
 
553
				DRAW_WINDOW:
546
			draw_window();
554
				draw_window();
-
 
555
				if (action_buf) 
-
 
556
				{
547
			if (action_buf) { menu_action(action_buf); action_buf=0;}
557
					menu_action(action_buf); 
-
 
558
					action_buf=0;
-
 
559
				}
-
 
560
			break;
-
 
561
			/*default:
-
 
562
				if(CMD_REFRESH)
-
 
563
				{
-
 
564
					CMD_REFRESH = false;
-
 
565
					goto DRAW_WINDOW;
-
 
566
				}
-
 
567
			*/
548
	}
568
		}
-
 
569
		
549
		if(cmd_free){
570
		if(cmd_free)
-
 
571
		{
550
			if(cmd_free==1)     free(menu_stak);
572
			if(cmd_free==1)     free(menu_stak);
551
			else if(cmd_free==2)free(about_stak);
573
			else if(cmd_free==2)free(about_stak);
552
			else if(cmd_free==3)free(properties_stak);
574
			else if(cmd_free==3)free(properties_stak);
553
			else if(cmd_free==4)free(settings_stak);
575
			else if(cmd_free==4)free(settings_stak);
554
			else if(cmd_free==5)free(copy_stak);
576
			else if(cmd_free==5)free(copy_stak);
555
			cmd_free = 0;
577
			cmd_free = false;
556
		}
578
		}
557
	}
579
	}
558
}
580
}
Line 562... Line 584...
562
{
584
{
563
	int jj=0, last=strlen(ESI);
585
	int jj=0, last=strlen(ESI);
564
	do{
586
	do {
565
		jj++;
587
		jj++;
566
		$lodsb
588
		$lodsb
567
		IF(AL==BL) last=jj;
589
		if(AL==BL) last=jj;
568
	} while(AL!=0);
590
	} while(AL!=0);
569
	return last;
591
	return last;
570
}
592
}
Line 581... Line 603...
581
	if (id==201) ShowOpenWithDialog();
603
	if (id==201) ShowOpenWithDialog();
582
	if (id==202) FnProcess(3); //F3
604
	if (id==202) FnProcess(3); //F3
583
	if (id==203) FnProcess(4); //F4
605
	if (id==203) FnProcess(4); //F4
584
	if (id==104) Copy(#file_path, NOCUT);
606
	if (id==104) Copy(#file_path, NOCUT);
585
	if (id==105) Copy(#file_path, CUT);
607
	if (id==105) Copy(#file_path, CUT);
-
 
608
	if (id==106)
-
 
609
	{
-
 
610
		copy_stak = malloc(4096); 
586
	if (id==106) { copy_stak = malloc(4096); CreateThread(#Paste,copy_stak+4092);}
611
		CreateThread(#Paste,copy_stak+4092);
-
 
612
	}
587
	if (id==207) FnProcess(2);
613
	if (id==207) FnProcess(2);
588
	if (id==108) Del_Form();
614
	if (id==108) Del_Form();
589
	if (id==109) FnProcess(5);
615
	if (id==109) FnProcess(5);
590
	if (id==110) FnProcess(8);
616
	if (id==110) FnProcess(8);
-
 
617
	if (id==300)
-
 
618
	{ 
-
 
619
		FnProcess(5); 
591
	if (id==300) { FnProcess(5); List_ReDraw(); }
620
		List_ReDraw(); 
-
 
621
	}
592
}
622
}
Line 593... Line 623...
593
 
623
 
594
 
624
 
Line 641... Line 671...
641
 
671
 
642
void List_Current(signed int cur)
672
void List_Current(signed int cur)
643
{
673
{
644
	if (cur<=0) //up
674
	if (cur<=0) //up
645
	{
675
	{
646
		IF (files.first==0) && (files.current<=0) return;
676
		if (files.first==0) && (files.current<=0) return;
647
		IF (-cur-1
677
		if (-cur-1
648
		{
678
		{
649
			Line_ReDraw(0xFFFFFF, files.current);
679
			Line_ReDraw(0xFFFFFF, files.current);
650
			files.current+=cur;
680
			files.current+=cur;
651
			Line_ReDraw(col_selec, files.current);
681
			Line_ReDraw(col_selec, files.current);
652
			return;
682
			return;
653
		}
683
		}
654
		ELSE
684
		else
655
		{
685
		{
656
			IF (-cur
686
			if (-cur
657
			files.current=0;
687
			files.current=0;
658
			List_ReDraw();
688
			List_ReDraw();
659
			return;
689
			return;
660
		}
690
		}
661
	}
691
	}
662
	else  //down
692
	else  //down
663
	{
693
	{
664
		IF (files.first==files.count-files.visible) && (files.current==files.visible-1) 
694
		if (files.first==files.count-files.visible) && (files.current==files.visible-1) 
665
		{
695
		{
666
			Line_ReDraw(col_selec, files.current);
696
			Line_ReDraw(col_selec, files.current);
667
			return;
697
			return;
668
		}
698
		}
669
		IF (files.visible-files.current>cur)
699
		if (files.visible-files.current>cur)
670
		{
700
		{
671
			Line_ReDraw(0xFFFFFF, files.current);
701
			Line_ReDraw(0xFFFFFF, files.current);
672
			files.current+=cur;
702
			files.current+=cur;
673
			Line_ReDraw(col_selec, files.current);
703
			Line_ReDraw(col_selec, files.current);
674
			return;
704
			return;
675
		}
705
		}
676
		else
706
		else
677
		{
707
		{
678
			IF(files.first+files.current+cur>=files.count)
708
			if(files.first+files.current+cur>=files.count)
679
			{
709
			{
680
				files.first=files.count-files.visible;
710
				files.first=files.count-files.visible;
681
				files.current=cur-files.first+files.current;
711
				files.current=cur-files.first+files.current;
682
				}
712
				}
683
			ELSE
713
			else
684
			{
714
			{
685
				files.first+=cur+files.current-files.visible+1;
715
				files.first+=cur+files.current-files.visible+1;
686
				files.current=files.visible-1;
716
				files.current=files.visible-1;
Line 687... Line 717...
687
			}
717
			}
688
			
718
			
689
			IF (files.current<0) || (files.current>files.visible)
719
			if (files.current<0) || (files.current>files.visible)
690
			{
720
			{
691
				files.current=files.visible-1;
721
				files.current=files.visible-1;
692
			}
722
			}
Line 791... Line 821...
791
	if (files.count!=-1)
821
	if (files.count!=-1)
792
	{
822
	{
793
		KEdit();
823
		KEdit();
794
		HistoryPath(ADD_NEW_PATH);
824
		HistoryPath(ADD_NEW_PATH);
795
		files.visible = files.h / files.line_h;
825
		files.visible = files.h / files.line_h;
796
		IF (files.count < files.visible) files.visible = files.count;
826
		if (files.count < files.visible) files.visible = files.count;
797
		IF (sort_num==1) sorting_arrow_x = Form.width+60/2;
827
		if (sort_num==1) sorting_arrow_x = Form.width+60/2;
798
		IF (sort_num==2) sorting_arrow_x = Form.width-115;
828
		if (sort_num==2) sorting_arrow_x = Form.width-115;
799
		IF (sort_num==3) sorting_arrow_x = strlen(T_SIZE)*3-30+files.x+files.w;
829
		if (sort_num==3) sorting_arrow_x = strlen(T_SIZE)*3-30+files.x+files.w;
800
		WriteText(sorting_arrow_x,45,0x80,sc.work_graph,"\x19");
830
		WriteText(sorting_arrow_x,45,0x80,sc.work_graph,"\x19");
801
		IF (redraw!=ONLY_SHOW) Sorting();
831
		if (redraw!=ONLY_SHOW) Sorting();
802
		IF (redraw!=ONLY_OPEN) List_ReDraw();
832
		if (redraw!=ONLY_OPEN) List_ReDraw();
803
	}
833
	}
804
	IF (files.count==-1) && (redraw!=ONLY_OPEN) {files.visible=files.count=0; List_ReDraw();}
834
	if (files.count==-1) && (redraw!=ONLY_OPEN) {files.visible=files.count=0; List_ReDraw();}
805
}
835
}
Line 806... Line 836...
806
 
836
 
807
 
837
 
808
inline Sorting()
838
inline Sorting()
809
{
839
{
810
	dword k=0, l=1;
840
	dword k=0, l=1;
811
	dword file_off;
841
	dword file_off;
812
	int i;
842
	int i;
813
	if (!strcmp(#path,"/")) //do not sort
843
	if (!strcmp(#path,"/")) //do not sort
814
	{
844
	{
815
		FOR(k=1;k
845
		for(k=1;k
816
		return;
846
		return;
817
	}
847
	}
818
	FOR (j=files.count-1, file_off=files.count-1*304+buf+32; j>=0; j--, file_off-=304;)  //files | folders
848
	for (j=files.count-1, file_off=files.count-1*304+buf+32; j>=0; j--, file_off-=304;)  //files | folders
819
	{
849
	{
820
		if (!real_files_names_case) strttl(file_off+40);
850
		if (!real_files_names_case) strttl(file_off+40);
821
		if (TestBit(ESDWORD[file_off],4)) //directory?
851
		if (TestBit(ESDWORD[file_off],4)) //directory?
Line 829... Line 859...
829
			l++;
859
			l++;
830
		}
860
		}
831
	}
861
	}
832
	//sorting: files first, then folders
862
	//sorting: files first, then folders
833
	Sort_by_Name(0,k-1);
863
	Sort_by_Name(0,k-1);
834
	IF (sort_num==1) Sort_by_Name(k,files.count-1);
864
	if (sort_num==1) Sort_by_Name(k,files.count-1);
835
	IF (sort_num==2) Sort_by_Type(k,files.count-1);
865
	if (sort_num==2) Sort_by_Type(k,files.count-1);
836
	IF (sort_num==3) Sort_by_Size(k,files.count-1);
866
	if (sort_num==3) Sort_by_Size(k,files.count-1);
837
	//make ".." first item in list
867
	//make ".." first item in list
838
	IF (k>0) && (strcmp(file_mas[0]*304+buf+72,"..")!=0)
868
	if (k>0) && (strcmp(file_mas[0]*304+buf+72,"..")!=0)
839
		FOR(k--; k>0; k--;) IF (!strcmp(file_mas[k]*304+buf+72,"..")) {file_mas[k]>
869
		for(k--; k>0; k--;) if (!strcmp(file_mas[k]*304+buf+72,"..")) {file_mas[k]>
840
}
870
}
Line 841... Line 871...
841
 
871
 
842
 
872
 
843
void Del_Form()
873
void Del_Form()
844
{
874
{
845
	dword selected_offset2;
875
	dword selected_offset2;
846
	int cont = 0;
876
	int cont = 0;
847
	byte f_count[128];
877
	byte f_count[128];
848
	int dform_x = files.w - 220 / 2 + files.x;
878
	int dform_x = files.w - 220 / 2 + files.x;
849
	if (strcmp(#file_name,".")==0) || (strcmp(#file_name,"..")==0) return;
879
	if (!strncmp(#file_name,".",1)) || (!strncmp(#file_name,"..",2)) return;
850
	if (del_active==2)
880
	if (del_active==2)
851
	{
881
	{
852
		if (itdir) ShowMessage(WAIT_DELETING_FOLDER, 0);
882
		if (itdir) ShowMessage(WAIT_DELETING_FOLDER, 0);
Line 866... Line 896...
866
			sprintf(#f_count,"%s%d%s",DEL_MORE_FILES_1,cont,DEL_MORE_FILES_2);
896
			sprintf(#f_count,"%s%d%s",DEL_MORE_FILES_1,cont,DEL_MORE_FILES_2);
867
			WriteText(-strlen(#f_count)*3+110+dform_x,190,0x80,sc.work_text,#f_count);
897
			WriteText(-strlen(#f_count)*3+110+dform_x,190,0x80,sc.work_text,#f_count);
868
		}
898
		}
869
		else
899
		else
870
		{
900
		{
871
			IF (strlen(#file_name)<28) 
901
			if (strlen(#file_name)<28) 
872
			{
902
			{
873
				WriteText(strlen(#file_name)*3+110+dform_x+2,190,0x80,sc.work_text,"?");
903
				WriteText(strlen(#file_name)*3+110+dform_x+2,190,0x80,sc.work_text,"?");
874
				WriteText(-strlen(#file_name)*3+110+dform_x,190,0x80,sc.work_text,#file_name);
904
				WriteText(-strlen(#file_name)*3+110+dform_x,190,0x80,sc.work_text,#file_name);
875
			}
905
			}
876
			else
906
			else
Line 897... Line 927...
897
		if (error = GetDir(#dirbuf, #fcount, way, DIRS_ONLYREAL)) del_error = error;
927
		if (error = GetDir(#dirbuf, #fcount, way, DIRS_ONLYREAL)) del_error = error;
898
		for (i=0; i
928
		for (i=0; i
899
		{
929
		{
900
			if (CheckEvent()==evReDraw) draw_window();
930
			if (CheckEvent()==evReDraw) draw_window();
901
			filename = i*304+dirbuf+72;
931
			filename = i*304+dirbuf+72;
902
			strcpy(#del_from, way);
932
			/*strcpy(#del_from, way);
903
			chrcat(#del_from, '/');
933
			chrcat(#del_from, '/');
904
			strcat(#del_from, filename);
934
			strcat(#del_from, filename);*/
-
 
935
			sprintf(#del_from,"%s/%s",way,filename);
905
			if ( TestBit(ESDWORD[filename-40], 4) )
936
			if ( TestBit(ESDWORD[filename-40], 4) )
906
			{
937
			{
907
				Del_File2(#del_from);
938
				Del_File2(#del_from);
908
			}
939
			}
909
			else
940
			else
Line 932... Line 963...
932
		{
963
		{
933
   		   for (i=0; i
964
   		   for (i=0; i
934
           {
965
           {
935
                selected_offset2 = file_mas[i]*304 + buf+32 + 7;
966
                selected_offset2 = file_mas[i]*304 + buf+32 + 7;
936
                if (ESBYTE[selected_offset2]) {
967
                if (ESBYTE[selected_offset2]) {
937
                    strcpy(#del_from, #path);
968
                    /*strcpy(#del_from, #path);
938
                    strcat(#del_from, file_mas[i]*304+buf+72);
969
                    strcat(#del_from, file_mas[i]*304+buf+72);*/
-
 
970
					sprintf(#del_from,"%s%s",#path,file_mas[i]*304+buf+72);
939
                    Del_File2(#del_from);
971
                    Del_File2(#del_from);
940
                }
972
                }
941
            }
973
            }
942
		}
974
		}
943
		else
975
		else
Line 981... Line 1013...
981
{
1013
{
982
	byte temp[4096];
1014
	byte temp[4096];
983
	selected_count = 0;
1015
	selected_count = 0;
984
	if (rez)
1016
	if (rez)
985
	{
1017
	{
986
		if (!strcmp(#file_name,"..")) return;
1018
		if (!strncmp(#file_name,"..",2)) return;
987
		strcpy(#temp, #file_path);
1019
		strcpy(#temp, #file_path);
988
		if (path[strlen(#temp)-1]!='/') chrcat(#temp, '/'); //need "/" in the end
1020
		if (path[strlen(#temp)-1]!='/') chrcat(#temp, '/'); //need "/" in the end
989
		RunProgram("/sys/File Managers/Eolite", #temp);
1021
		RunProgram("/sys/File Managers/Eolite", #temp);
990
		return;
1022
		return;
991
	}
1023
	}
Line 994... Line 1026...
994
	{
1026
	{
995
		if (strrchr(#file_name, '.')==0) RunProgram(#file_path, ""); else RunProgram("/sys/@open", #file_path);
1027
		if (strrchr(#file_name, '.')==0) RunProgram(#file_path, ""); else RunProgram("/sys/@open", #file_path);
996
	} 
1028
	} 
997
	else
1029
	else
998
	{
1030
	{
999
		if (!strcmp(#file_name,"..")) { Dir_Up(); return; }
1031
		if (!strncmp(#file_name,"..",2)) { Dir_Up(); return; }
1000
		strcpy(#path, #file_path);
1032
		strcpy(#path, #file_path);
1001
		if (path[strlen(#path)-1]!='/') chrcat(#path, '/'); //need "/" in the end
1033
		if (path[strlen(#path)-1]!='/') chrcat(#path, '/'); //need "/" in the end
1002
		files.first=files.current=0;
1034
		files.first=files.current=0;
1003
		Open_Dir(#path,WITH_REDRAW);
1035
		Open_Dir(#path,WITH_REDRAW);
1004
	}
1036
	}
Line 1013... Line 1045...
1013
}
1045
}
Line 1014... Line 1046...
1014
 
1046
 
1015
void ShowOpenWithDialog()
1047
void ShowOpenWithDialog()
1016
{
1048
{
1017
	byte param[4097];
1049
	byte param[4097];
1018
	param[0] = '~';
1050
	/*param[0] = '~';
1019
	param[1] = '\0';
1051
	param[1] = '\0';
-
 
1052
	strcat(#param, #file_path);*/
1020
	strcat(#param, #file_path);
1053
	sprintf(#param,"~%s",#file_path);
1021
	RunProgram("/sys/@open", #param);
1054
	RunProgram("/sys/@open", #param);
Line 1022... Line 1055...
1022
}
1055
}
1023
 
1056
 
1024
void NewElement(byte newf)
1057
void NewElement(byte newf)
1025
{
1058
{
1026
	BDVK element_info;
1059
	BDVK element_info;
1027
	byte del_rezult, copy_rezult, info_result;
1060
	byte del_rezult, copy_rezult, info_result;
1028
	if (newf)
1061
	if (newf)
1029
	{
1062
	{
-
 
1063
		/*strcpy(#temp, #path);
1030
		strcpy(#temp, #path);
1064
		strcat(#temp, new_file_ed.text);*/
1031
		strcat(#temp, new_file_ed.text);
1065
		sprintf(#temp,"%s%s",#path,new_file_ed.text);
1032
		info_result = GetFileInfo(#temp, #element_info);
1066
		info_result = GetFileInfo(#temp, #element_info);
1033
		switch(new_element_active)
1067
		switch(new_element_active)
1034
		{
1068
		{
Line 1115... Line 1149...
1115
	DrawPopup(dform_x,160,220,85,1,sc.work,sc.work_graph);
1149
	DrawPopup(dform_x,160,220,85,1,sc.work,sc.work_graph);
1116
	new_file_ed.left = dform_x+24;
1150
	new_file_ed.left = dform_x+24;
1117
	edit_box_draw  stdcall (#new_file_ed);
1151
	edit_box_draw  stdcall (#new_file_ed);
1118
	DrawRectangle(new_file_ed.left-1, new_file_ed.top-1, new_file_ed.width+2, 16, 0xFFFfff);
1152
	DrawRectangle(new_file_ed.left-1, new_file_ed.top-1, new_file_ed.width+2, 16, 0xFFFfff);
1119
	DrawRectangle(new_file_ed.left-2, new_file_ed.top-2, new_file_ed.width+4, 18, sc.work_graph);
1153
	DrawRectangle(new_file_ed.left-2, new_file_ed.top-2, new_file_ed.width+4, 18, sc.work_graph);
1120
	IF (new_element_active==3) DrawFlatButton(dform_x+22,208,85,22,301,0xFFB6B5,T_RENAME);
1154
	if (new_element_active==3) DrawFlatButton(dform_x+22,208,85,22,301,0xFFB6B5,T_RENAME);
1121
	ELSE DrawFlatButton(dform_x+27,208,70,22,301,0xFFB6B5,T_CREATE);
1155
	else DrawFlatButton(dform_x+27,208,70,22,301,0xFFB6B5,T_CREATE);
1122
	DrawFlatButton(dform_x+120,208,70,22,302,0xC6DFC6,T_CANCEL);
1156
	DrawFlatButton(dform_x+120,208,70,22,302,0xC6DFC6,T_CANCEL);
1123
}
1157
}
Line 1124... Line 1158...
1124
 
1158
 
1125
void FnProcess(byte N)
1159
void FnProcess(byte N)
Line 1142... Line 1176...
1142
		case 2:
1176
		case 2:
1143
			if (!files.count) break;
1177
			if (!files.count) break;
1144
			NewElement_Form(RENAME_ITEM, #file_name);
1178
			NewElement_Form(RENAME_ITEM, #file_name);
1145
			break;
1179
			break;
1146
		case 3:
1180
		case 3:
1147
			IF (!itdir) RunProgram("/sys/tinypad", #file_path);
1181
			if (!itdir) RunProgram("/sys/tinypad", #file_path);
1148
			break;
1182
			break;
1149
		case 4:
1183
		case 4:
1150
			IF (!itdir) RunProgram("/sys/develop/heed", #file_path);
1184
			if (!itdir) RunProgram("/sys/develop/heed", #file_path);
1151
			break;
1185
			break;
1152
		case 5: //refresh cur dir & devs
1186
		case 5: //refresh cur dir & devs
1153
			Tip(56, T_DEVICES, 55, "-");
1187
			Tip(56, T_DEVICES, 55, "-");
1154
			Open_Dir(#path,WITH_REDRAW);
1188
			Open_Dir(#path,WITH_REDRAW);
1155
			pause(10);
1189
			pause(10);