Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
2031 leency 1
//Leency - 2011
1415 leency 2
 
975 leency 3
#include "imgs\logo.txt"
4
 
2031 leency 5
#define REDRAW	1
6
#define ANIM	2
7
#define NOTIP	3
984 leency 8
 
2031 leency 9
#define BROWSER_PATH	"/sys/htmlv"
2134 leency 10
#define BROWSER_LINK	"http://www.kolibri-os.narod.ru"
975 leency 11
 
2031 leency 12
 
975 leency 13
void authors()
14
{
2134 leency 15
	byte p;
975 leency 16
	mouse mm;
2031 leency 17
	byte id, letitclose=0;
975 leency 18
	SetEventMask(100111b);
19
	loop() switch(WaitEvent())
20
	{
21
		case evMouse:
22
				mm.get();
23
				//êóëüíî
24
				IF (mm.x>85) && (mm.x<155) && (mm.y>190) && (mm.y<190+22)
25
				IF (mm.lkm) {DrawRegion_3D(86,191,68,20,0xC7C7C7,0xFFFFFF); letitclose=1;}
26
				ELSE {IF (letitclose) {DrawRegion_3D(86,191,68,20,0xFFFFFF,0xC7C7C7); Pause(7); ExitProcess();}}
27
				ELSE IF (letitclose) {letitclose=0; DrawRegion_3D(86,191,68,20,0xFFFFFF,0xC7C7C7);}
2134 leency 28
 
29
				/*WHILE (mm.lkm==1) //àíèìàöûÿ Ûûûû)))
30
				{
31
					PutPaletteImage(p*16*15+#ficons,16,15,30,192,#ficons_pal);
32
					IF (p>23) p=0; ELSE p++;
33
					Pause(25);
34
					mm.get();
35
				}*/
36
 
975 leency 37
				break;
2031 leency 38
		case evButton:
39
				id=GetButtonID();
40
				IF (id==1) ExitProcess();
41
				IF (id==23) RunProgram(BROWSER_PATH, BROWSER_LINK);
42
				break;
43
		case evKey:
44
				IF (GetKey()==27) ExitProcess();
45
				break;
975 leency 46
		case evReDraw:
2134 leency 47
				DefineAndDrawWindow(500,200,181,256,0x34,0x10EFEBEF,0,0,"About Eolite");
48
				DrawBar(0,0,172,50,0x8494C4); //ãîëóáîå ñçàäè
49
				PutPaletteImage(#logo,85,85,43,7,#logo_pal);
50
				WriteText(33,100,0x80,0xBF40BF,"Eolite v0.99.8 RC3",0);
51
				WriteText(55,120,0x80,0,"Developers:",0);
52
				WriteText(39,130,0x80,0,"Leency & Veliant",0);
53
				WriteText(30,140,0x80,0,"Diamond, Lrz, Nable",0);
54
				WriteText(55,150,0x80,0," 2008-2011 ",0);
55
				WriteText(12,170,0x80,0,"Visit",0);
56
				DrawLink(48,170,23, "kolibri-os.narod.ru"); //ññûëêa
57
				DrawFlatButton(85,190,70,22,0,0xE4DFE1, "Close");
975 leency 58
	}
59
}
60
 
2031 leency 61
void DrawLink(dword x,y,btn_id, inscription)
62
{
63
	WriteText(x,y,0x80,0x4E00E7,inscription,0);
64
	DrawBar(x,y+8,strlen(inscription)*6,1,0x4E00E7); //ïîä÷åðêíóòü ññûëêó
65
	DefineButton(x-1,y-1,strlen(inscription)*6,10,btn_id+BT_HIDE,0);
66
}
975 leency 67
 
1415 leency 68
 
2134 leency 69
#define add_new_path 1
70
#define go_back 2
1415 leency 71
 
976 leency 72
void HistoryPath(byte action)
73
{
977 leency 74
	if (action==add_new_path)
976 leency 75
	{
76
		IF (strcmp(#PathHistory+find_symbol(#PathHistory,'|'),#path)==0) return;
1415 leency 77
		IF (strlen(#PathHistory)+strlen(#path)>2560)
78
		{
79
			copystr(#PathHistory+1024,#PathHistory);
80
			copystr("/",#PathHistory+strlen(#PathHistory));
81
		}
976 leency 82
		copystr("|",#PathHistory+strlen(#PathHistory));
83
		copystr(#path,#PathHistory+strlen(#PathHistory));
84
	}
977 leency 85
	if (action==go_back)
976 leency 86
	{
977 leency 87
		i=strlen(#PathHistory)-1;
976 leency 88
		WHILE (PathHistory[i]<>'|') { i--; };
89
		IF (i>0) PathHistory[i]=0x00;
90
		WHILE (PathHistory[i]<>'|')	{ copystr(#PathHistory[i],#path); i--;	}
91
		IF (i>0) PathHistory[i]=0x00;
92
	}
93
}
94
 
95
 
975 leency 96
dword onLeft(dword right,left) {EAX=Form.width-right-left;}
984 leency 97
dword onTop(dword down,up) {EAX=Form.height-GetSkinWidth()-down-up;}
975 leency 98
 
99
 
2031 leency 100
void ShowMessage(dword message)
101
{
102
	DrawFlatButton(Form.width/2-13,160,200,80,0,0xFFB6B5, message);
103
	Pause(150);
104
	List_ReDraw();
105
}
106
 
107
 
975 leency 108
dword ConvertSize(dword bytes)
109
{
984 leency 110
	byte size_prefix[8], temp[3];
975 leency 111
	IF (bytes>=1073741824) copystr(" Gb",#temp);
112
	ELSE IF (bytes>=1048576) copystr(" Mb",#temp);
113
	ELSE IF (bytes>=1024) copystr(" Kb",#temp);
114
	ELSE copystr(" b ",#temp);
115
	WHILE (bytes>1023) bytes/=1024;
116
	copystr(IntToStr(bytes),#size_prefix);
117
	copystr(#temp,#size_prefix+strlen(#size_prefix));
118
	EAX=#size_prefix;
119
}