Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
7906 leency 1
#ifndef TAB_PADDING
2
#define TAB_PADDING 15
3
#endif
7225 leency 4
 
5
#define TAB_HEIGHT 28
6
 
7
:struct _tabs
8
{
7614 leency 9
	int active_tab;
7225 leency 10
	int x,y,w,h;
7906 leency 11
	dword draw_button();
7225 leency 12
	int click();
13
	void draw_wrapper();
14
};
15
 
16
:void _tabs::draw_wrapper()
17
{
7806 leency 18
	DrawRectangle(x,y+TAB_HEIGHT,w-1,h-TAB_HEIGHT, sc.work_graph);
7906 leency 19
	DrawBar(x+1,y+1+TAB_HEIGHT,w-3,1, sc.work_light);
7225 leency 20
}
21
 
7906 leency 22
:dword _tabs::draw_button(dword xx, but_id, text)
7225 leency 23
{
24
	dword col_bg, col_text;
25
	dword ww=strlen(text)*8, hh=TAB_HEIGHT;
26
 
27
	if (but_id==active_tab)
28
	{
29
		col_bg=0xE44C9C;
7806 leency 30
		col_text=sc.work_text;
7225 leency 31
	}
32
	else
33
	{
34
		col_bg=0xC3A1B7;
7806 leency 35
		col_text= MixColors(sc.work, sc.work_text, 120);
7225 leency 36
	}
7614 leency 37
	DefineHiddenButton(xx-2,y, ww-1+4,hh-1, but_id);
7226 leency 38
	WriteText(xx, y+6, 0x90, col_text, text);
39
	DrawBar(xx, y+hh-3, ww, 3, col_bg);
7614 leency 40
	//DrawStandartCaptButton(xx, y, but_id, text); //GetFreeButtonId()
7906 leency 41
	return xx;
7225 leency 42
}
43
 
44
:int _tabs::click(int N)
45
{
46
	if (N==active_tab) return false;
47
	active_tab = N;
48
	return true;
49
}