Subversion Repositories Kolibri OS

Rev

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

Rev 3319 Rev 3363
Line 63... Line 63...
63
:void DrawProgressBar(dword st_x, st_y, st_w, st_h, col_fon, col_border, col_fill, col_text, progress_percent, status_text)
63
:void DrawProgressBar(dword st_x, st_y, st_w, st_h, col_fon, col_border, col_fill, col_text, progress_percent, status_text)
64
{
64
{
65
	int progress_w;
65
	int progress_w;
66
	static int fill_old;
66
	static int fill_old;
Line 67... Line 67...
67
	    
67
	    
-
 
68
	//if (progress_percent<=0) {DrawBar(st_x,st_y, st_x + st_w + fill_old + 15,st_h+1, col_fon); fill_old=0; return;}
Line 68... Line 69...
68
	if (progress_percent<=0) {DrawBar(st_x,st_y, st_x + st_w + fill_old + 15,st_h+1, col_fon); fill_old=0; return;}
69
	if (progress_percent<=0) || (progress_percent>=100) return;
69
	
70
	
Line 70... Line 71...
70
	DrawRectangle(st_x, st_y, st_w,st_h, col_border);
71
	DrawRectangle(st_x, st_y, st_w,st_h, col_border);
Line 82... Line 83...
82
		DrawBar(st_x+st_w+15, st_h/2-4+st_y, fill_old, 9, col_fon);
83
		DrawBar(st_x+st_w+15, st_h/2-4+st_y, fill_old, 9, col_fon);
83
		WriteText(st_x+st_w+15, st_h/2-4+st_y, 0x80, col_text, status_text);
84
		WriteText(st_x+st_w+15, st_h/2-4+st_y, 0x80, col_text, status_text);
84
		fill_old = strlen(status_text) * 6;
85
		fill_old = strlen(status_text) * 6;
85
	}
86
	}
86
}
87
}
87
>
88
 
-
 
89
:void DrawLink(dword x,y,font_type,btn_id, inscription)
-
 
90
{
-
 
91
	int w;
-
 
92
	WriteText(x,y,font_type,0x4E00E7,inscription);
-
 
93
	if (font_type==0x80) w = strlen(inscription)*6; else w = strlen(inscription)*7;
-
 
94
	DefineButton(x-1,y-1,w,10,btn_id+BT_HIDE,0);
-
 
95
	DrawBar(x,y+8,w,1,0x4E00E7);
-
 
96
}
-
 
97
 
-
 
98
 
-
 
99
:void PutShadow(dword x,y,w,h,border,strength)
-
 
100
{
-
 
101
	proc_info wForm;
-
 
102
	dword shadow_buf, skin_height;
-
 
103
	shadow_buf = mem_Alloc(w*h*3);
-
 
104
 	//skin_height = GetSkinHeight();
-
 
105
 	GetProcessInfo(#wForm, SelfInfo);
-
 
106
	CopyScreen(shadow_buf, x+wForm.left, y+wForm.top, w, h);
-
 
107
	ShadowImage(shadow_buf, w, h, strength);
-
 
108
	_PutImage(x,y,w,h,shadow_buf);
-
 
109
	mem_Free(shadow_buf);
-
 
110
}
-
 
111
 
-
 
112
:void GrayScaleImage(dword color_image, w, h)
-
 
113
{
-
 
114
	dword i,j, gray,rr,gg,bb;
-
 
115
	for (i = 0; i < w*h*3; i+=3)
-
 
116
	{
-
 
117
		rr = DSBYTE[i+color_image];
-
 
118
		gg = DSBYTE[i+1+color_image];
-
 
119
		bb = DSBYTE[i+2+color_image];
-
 
120
		gray = rr*rr;
-
 
121
		gray += gg*gg;
-
 
122
		gray += bb*bb;
-
 
123
		gray = sqrt(gray) / 3;
-
 
124
		DSBYTE[i  +color_image] = DSBYTE[i+1+color_image] = DSBYTE[i+2+color_image] = gray;
-
 
125
	}
-
 
126
}
-
 
127
 
-
 
128
:void ShadowImage(dword color_image, w, h, strength)
-
 
129
{
-
 
130
	dword col, to;
-
 
131
	strength = 10 - strength;
-
 
132
	to = w*h*3 + color_image;
-
 
133
	for ( ; color_image < to; color_image++)
-
 
134
	{
-
 
135
		col = strength * DSBYTE[color_image] / 10;
-
 
136
		DSBYTE[color_image] = col;
-
 
137
	}
-
 
138
}
-
 
139
>
88
140