Subversion Repositories Kolibri OS

Rev

Rev 2031 | 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 ONLY_SHOW	0
6
#define WITH_REDRAW	1
7
#define ONLY_OPEN	2
984 leency 8
 
2031 leency 9
#define REDRAW	1
10
#define ANIM	2
11
#define NOTIP	3
984 leency 12
 
2031 leency 13
#define BROWSER_PATH	"/sys/htmlv"
14
#define BROWSER_LINK	"http://www.kolibrios.org"
975 leency 15
 
2031 leency 16
 
975 leency 17
void authors()
18
{
19
	mouse mm;
2031 leency 20
	byte id, letitclose=0;
975 leency 21
	SetEventMask(100111b);
22
	loop() switch(WaitEvent())
23
	{
24
		case evMouse:
25
				mm.get();
26
				//кульно
27
				IF (mm.x>85) && (mm.x<155) && (mm.y>190) && (mm.y<190+22)
28
				IF (mm.lkm) {DrawRegion_3D(86,191,68,20,0xC7C7C7,0xFFFFFF); letitclose=1;}
29
				ELSE {IF (letitclose) {DrawRegion_3D(86,191,68,20,0xFFFFFF,0xC7C7C7); Pause(7); ExitProcess();}}
30
				ELSE IF (letitclose) {letitclose=0; DrawRegion_3D(86,191,68,20,0xFFFFFF,0xC7C7C7);}
31
				break;
2031 leency 32
		case evButton:
33
				id=GetButtonID();
34
				IF (id==1) ExitProcess();
35
				IF (id==23) RunProgram(BROWSER_PATH, BROWSER_LINK);
36
				break;
37
		case evKey:
38
				IF (GetKey()==27) ExitProcess();
39
				break;
975 leency 40
		case evReDraw:
41
			WindowRedrawStatus(1);
42
			DefineAndDrawWindow(500,200,181,256,0x34,0x10EFEBEF,0,0,"About Eolite");
43
			DrawBar(0,0,172,50,0x8494C4); //голубое сзади
1415 leency 44
			PutPaletteImage(#logo,85,85,43,7,#logo_pal);
2098 leency 45
			WriteText(33+6,100,0x80,0xBF40BF,"Eolite v0.99 RC2",0);
975 leency 46
			WriteText(55,120,0x80,0,"Developers:",0);
47
			WriteText(39,130,0x80,0,"Leency & Veliant",0);
48
			WriteText(30,140,0x80,0,"Diamond, Lrz, Nable",0);
2031 leency 49
			WriteText(55,150,0x80,0," 2008-2011 ",0);
50
			WriteText(18,170,0x80,0,"Visit",0);
51
			DrawLink(54,170,23, "www.kolibrios.org"); //ссылкa
975 leency 52
			DrawFlatButton(85,190,70,22,0,0xE4DFE1, "Close");
53
			WindowRedrawStatus(2);
54
	}
55
}
56
 
2031 leency 57
void DrawLink(dword x,y,btn_id, inscription)
58
{
59
	WriteText(x,y,0x80,0x4E00E7,inscription,0);
60
	DrawBar(x,y+8,strlen(inscription)*6,1,0x4E00E7); //подчеркнуть ссылку
61
	DefineButton(x-1,y-1,strlen(inscription)*6,10,btn_id+BT_HIDE,0);
62
}
975 leency 63
 
1415 leency 64
 
65
?define add_new_path 1
66
?define go_back 2
67
 
976 leency 68
void HistoryPath(byte action)
69
{
977 leency 70
	if (action==add_new_path)
976 leency 71
	{
72
		IF (strcmp(#PathHistory+find_symbol(#PathHistory,'|'),#path)==0) return;
1415 leency 73
		IF (strlen(#PathHistory)+strlen(#path)>2560)
74
		{
75
			copystr(#PathHistory+1024,#PathHistory);
76
			copystr("/",#PathHistory+strlen(#PathHistory));
77
		}
976 leency 78
		copystr("|",#PathHistory+strlen(#PathHistory));
79
		copystr(#path,#PathHistory+strlen(#PathHistory));
80
	}
977 leency 81
	if (action==go_back)
976 leency 82
	{
977 leency 83
		i=strlen(#PathHistory)-1;
976 leency 84
		WHILE (PathHistory[i]<>'|') { i--; };
85
		IF (i>0) PathHistory[i]=0x00;
86
		WHILE (PathHistory[i]<>'|')	{ copystr(#PathHistory[i],#path); i--;	}
87
		IF (i>0) PathHistory[i]=0x00;
88
	}
89
}
90
 
91
 
975 leency 92
dword onLeft(dword right,left) {EAX=Form.width-right-left;}
984 leency 93
dword onTop(dword down,up) {EAX=Form.height-GetSkinWidth()-down-up;}
975 leency 94
 
95
 
2031 leency 96
void ShowMessage(dword message)
97
{
98
	DrawFlatButton(Form.width/2-13,160,200,80,0,0xFFB6B5, message);
99
	Pause(150);
100
	List_ReDraw();
101
}
102
 
103
 
975 leency 104
dword ConvertSize(dword bytes)
105
{
984 leency 106
	byte size_prefix[8], temp[3];
975 leency 107
	IF (bytes>=1073741824) copystr(" Gb",#temp);
108
	ELSE IF (bytes>=1048576) copystr(" Mb",#temp);
109
	ELSE IF (bytes>=1024) copystr(" Kb",#temp);
110
	ELSE copystr(" b ",#temp);
111
	WHILE (bytes>1023) bytes/=1024;
112
	copystr(IntToStr(bytes),#size_prefix);
113
	copystr(#temp,#size_prefix+strlen(#size_prefix));
114
	EAX=#size_prefix;
115
}