Subversion Repositories Kolibri OS

Rev

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

Rev 3045 Rev 3050
Line 18... Line 18...
18
#define ONLY_SHOW	0
18
#define ONLY_SHOW	0
19
#define WITH_REDRAW	1
19
#define WITH_REDRAW	1
20
#define ONLY_OPEN	2
20
#define ONLY_OPEN	2
Line 21... Line 21...
21
 
21
 
22
//ïåðåìåííûå
22
//ïåðåìåííûå
23
#define title "Eolite File Manager v1.38"
23
#define title "Eolite File Manager v1.4"
24
dword selection_col = 0x94AECE;
24
dword selection_col = 0x94AECE;
Line 25... Line 25...
25
dword lpanel_col = 0x00699C;
25
dword lpanel_col = 0x00699C;
Line 54... Line 54...
54
int scroll_size;
54
int scroll_size;
Line 55... Line 55...
55
 
55
 
-
 
56
 
Line 56... Line 57...
56
 
57
 
57
 
58
int toolbar_buttons_x[6]={9,46,85,134,167,203};
Line 58... Line 59...
58
int toolbar_buttons_x[6]={9,46,85,134,167,203};
59
char tmp_disk_del_param[]="d0";
Line 227... Line 228...
227
					case 78: //rescan devices
228
					case 78: //rescan devices
228
							Tip(56, "Devices", 78, "-");
229
							Tip(56, "Devices", 78, "-");
229
							Pause(10);
230
							Pause(10);
230
							GetSystemDiscs();
231
							GetSystemDiscs();
231
							Open_Dir(#path,WITH_REDRAW);
232
							Open_Dir(#path,WITH_REDRAW);
232
							DrawSystemDiscs();
233
							DrawLeftPanel();
233
							Actions();
-
 
234
							break;
234
							break;
235
					case 80: //rename
235
					case 80: //rename
236
							goto REN_MARK; 
236
							goto REN_MARK; 
237
					case 81: //Delete file
237
					case 81: //Delete file
238
							Del_Form();
238
							Del_Form();
Line 259... Line 259...
259
							za_kadrom=curbtn=0;
259
							za_kadrom=curbtn=0;
260
							Open_Dir(#path,1);
260
							Open_Dir(#path,1);
261
							Pause(5);
261
							Pause(5);
262
							DrawRegion_3D(17,id-100*16+74,159,16, 0xFFFFFF, 0xFFFFFF);
262
							DrawRegion_3D(17,id-100*16+74,159,16, 0xFFFFFF, 0xFFFFFF);
263
							break;
263
							break;
-
 
264
					case 130...160:
-
 
265
							tmp_disk_del_param[1]=disk_list[id-130].Item[4];
-
 
266
							RunProgram("/sys/tmpdisk", #tmp_disk_del_param);
-
 
267
							Pause(10);
-
 
268
							GetSystemDiscs();
-
 
269
							Open_Dir(#path,WITH_REDRAW);
-
 
270
							DrawLeftPanel();
-
 
271
							break;
264
					default:
272
					default:
265
							if (id<200) break; //êíîïêè èç ñïèñêà ôàéëîâ
273
							if (id<200) break; //êíîïêè èç ñïèñêà ôàéëîâ
266
							if (curbtn!=id-201)	{FileList_ReDraw(id-201-curbtn); break;}
274
							if (curbtn!=id-201)	{FileList_ReDraw(id-201-curbtn); break;}
267
							else
275
							else
268
						OPEN_MARK:
276
						OPEN_MARK:
Line 431... Line 439...
431
	DefineButton(onLeft(66,0),12,18,16,27+BT_HIDE,0xE4DFE1); //êíîïêà ïåðåõîäà
439
	DefineButton(onLeft(66,0),12,18,16,27+BT_HIDE,0xE4DFE1); //êíîïêà ïåðåõîäà
432
	PutPaletteImage(#goto_about,56,40,Form.width-65,0,#goto_about_pal);
440
	PutPaletteImage(#goto_about,56,40,Form.width-65,0,#goto_about_pal);
433
	//ïðÿìîóãîëüíèêè âíóòðè
441
	//ïðÿìîóãîëüíèêè âíóòðè
434
	DrawRegion_3D(1,40,Form.width-12,onTop(46,0),0x94AECE,0x94AECE); //ñèíèé îáîäîê
442
	DrawRegion_3D(1,40,Form.width-12,onTop(46,0),0x94AECE,0x94AECE); //ñèíèé îáîäîê
435
	DrawRegion_3D(0,39,Form.width-10,onTop(44,0),0xE4DFE1,0xE4DFE1); //ôîí
443
	DrawRegion_3D(0,39,Form.width-10,onTop(44,0),0xE4DFE1,0xE4DFE1); //ôîí
436
	DrawSystemDiscs();
444
	DrawLeftPanel();
437
	Actions();
-
 
438
	//SortButtons
445
	//SortButtons
439
	DrawFlatButton(192,40,onLeft(192,168),16,31,0xE4DFE1,"File");
446
	DrawFlatButton(192,40,onLeft(192,168),16,31,0xE4DFE1,"File");
440
	DrawFlatButton(onLeft(168,0),40,73,16,32,0xE4DFE1,"Type");
447
	DrawFlatButton(onLeft(168,0),40,73,16,32,0xE4DFE1,"Type");
441
	DrawFlatButton(onLeft(95,0),40,68,16,33,0xE4DFE1,"Size");
448
	DrawFlatButton(onLeft(95,0),40,68,16,33,0xE4DFE1,"Size");
442
	//Ïåðåðèñîâûâàåì ñïèñîê
449
	//Ïåðåðèñîâûâàåì ñïèñîê
Line 591... Line 598...
591
			GoBack();
598
			GoBack();
592
			Write_Error(errornum);
599
			Write_Error(errornum);
593
			return;
600
			return;
594
		}
601
		}
595
    	count = ESDWORD[buf+8];
602
    	count = ESDWORD[buf+8];
596
    	buf = realloc(count * 304 + 32, buf);
603
    	buf = realloc(count * 304 + 32, buf); //ïî÷åìó 32?
597
		ReadDir(count, buf, #path_);
604
		ReadDir(count, buf, #path_);
598
		IF (EBX>6897) && (EBX<>-1) EBX=6897; //1 íà óäà÷ó ;)
605
		IF (EBX>6897) && (EBX<>-1) EBX=6897; //1 íà óäà÷ó ;)
599
		count=EBX;
606
		count=EBX;
600
	}
607
	}
601
	if (count<>-1)
608
	if (count<>-1)
Line 724... Line 731...
724
		}
731
		}
725
	SelectFile(#new_copy_path+strchr(#new_copy_path,'/'));
732
	SelectFile(#new_copy_path+strchr(#new_copy_path,'/'));
726
}
733
}
Line 727... Line -...
727
 
-
 
728
 
-
 
729
void Tip(int y, dword caption, id, arrow)
-
 
730
{
-
 
731
	DrawBar(17,y,160,17,0xE4DFE1); //ñåðîå ñâåðõó
-
 
732
	WriteText(25,y+5,0x80,0,caption,0);
-
 
733
	IF (id<>0) DefineButton(159,y+1,16,16,id+BT_HIDE+BT_NOFRAME,0xE4DFE1); //êíîïà äëÿ ñòðåëêè
-
 
734
	WriteText(165,y+5,0x80,0,arrow,0); //ñòðåëêà âíèç
-
 
735
	DrawBar(17,y+17,160,1,0x94AECE);		//ïîä÷¸ðêèâàíèå
-
 
736
}
-
 
737
 
-
 
738
 
734
 
739
 
735
 
740
void ReName(byte rename)
736
void ReName(byte rename)
741
{
737
{
742
	int del_file_rez;
738
	int del_file_rez;
Line 771... Line 767...
771
	}
767
	}
772
	Line_ReDraw(selection_col,curbtn);
768
	Line_ReDraw(selection_col,curbtn);
773
}
769
}
Line 774... Line -...
774
 
-
 
775
 
-
 
776
void Actions()
-
 
777
{
-
 
778
	int actions_y=disc_num*16;
-
 
779
	
-
 
780
	DeleteButton(80);
-
 
781
	DeleteButton(81);
-
 
782
	DeleteButton(82);
-
 
783
	
-
 
784
	if (!show_actions)
-
 
785
		Tip(actions_y+90, "Actions", 77, "\x18");
-
 
786
	else
-
 
787
	{
-
 
788
		Tip(actions_y+90, "Actions", 77, "\x19"); //çàãîëîâîê
-
 
789
		DrawBar(17,actions_y+108,160,51,0xFFFFFF); //áåëîå
-
 
790
		PutImage(#factions,16,44,21,actions_y+113); //èêîíêè
-
 
791
		//rename file 
-
 
792
		DefineButton(17,actions_y+108,159,16,80+BT_HIDE,0xE4DFE1);
-
 
793
		WriteText(42,actions_y+113,0x80,0,"Rename file",0);
-
 
794
		WriteText(150,actions_y+113,0x80,0x999999,"[F2]",0);
-
 
795
		//delete file
-
 
796
		DefineButton(17,actions_y+125,159,16,81+BT_HIDE,0xE4DFE1);
-
 
797
		WriteText(42,actions_y+130,0x80,0,"Delete file",0);
-
 
798
		WriteText(144,actions_y+130,0x80,0x999999,"[Del]",0);
-
 
799
		//create folder
-
 
800
		DefineButton(17,actions_y+142,159,16,82+BT_HIDE,0xE4DFE1);
-
 
801
		WriteText(42,actions_y+147,0x80,0,"Create folder",0);
-
 
802
		WriteText(150,actions_y+147,0x80,0x999999,"[F6]",0);
-
 
803
	}
-
 
804
	LeftPanel();
-
 
805
}
-
 
806
 
-
 
807
 
-
 
808
void LeftPanel()
-
 
809
{
-
 
810
	int actions_y=disc_num*16;
-
 
811
	int start_y = show_actions*51+actions_y+108;
-
 
812
	DrawBar(2,41,190,15,lpanel_col);		      //ñèíèé ïðÿìîóãîëüíèê - íàä äåâàéñàìè
-
 
813
	DrawBar(17,actions_y+75,160,15,lpanel_col); //ñèíèé ïðÿìîóãîëüíèê - ïîä äåâàéñàìè
-
 
814
	DrawBar(2,56,15,actions_y+103,lpanel_col);	          //ñèíèé ïðÿìîóãîëüíèê - ñëåâà       
-
 
815
	DrawBar(177,56,15,actions_y+103,lpanel_col);            //ñèíèé ïðÿìîóãîëüíèê - ñïðàâà
-
 
816
	if (onTop(start_y, 6) < 268)
-
 
817
		PutPaletteImage(#blue_hl, 190, onTop(start_y, 6), 2, start_y, #blue_hl_pal);
-
 
818
	else
-
 
819
	{
-
 
820
		DrawBar(2,start_y,190,onTop(start_y,6+268),lpanel_col);
-
 
821
		PutPaletteImage(#blue_hl, 190, 268, 2, onTop(268,6), #blue_hl_pal);
-
 
822
	}
-
 
823
}
-
 
Line 824... Line 770...
824
 
770
 
825
 
771
 
826
 
772
 
827
void Goto_edit_path()
773
void Goto_edit_path()