2020-05-10 03:44:40 +02:00
|
|
|
#ifndef TAB_PADDING
|
2018-04-11 19:46:08 +02:00
|
|
|
#define TAB_PADDING 15
|
2020-05-10 03:44:40 +02:00
|
|
|
#endif
|
|
|
|
|
2018-04-11 19:46:08 +02:00
|
|
|
#define TAB_HEIGHT 28
|
|
|
|
|
|
|
|
:struct _tabs
|
|
|
|
{
|
|
|
|
int active_tab;
|
2019-03-18 23:31:13 +01:00
|
|
|
int x,y,w,h;
|
2020-05-10 03:44:40 +02:00
|
|
|
dword draw_button();
|
2018-04-11 19:46:08 +02:00
|
|
|
int click();
|
|
|
|
void draw_wrapper();
|
|
|
|
};
|
|
|
|
|
|
|
|
:void _tabs::draw_wrapper()
|
|
|
|
{
|
2020-04-18 01:52:24 +02:00
|
|
|
DrawRectangle(x,y+TAB_HEIGHT,w-1,h-TAB_HEIGHT, sc.work_graph);
|
2020-05-10 03:44:40 +02:00
|
|
|
DrawBar(x+1,y+1+TAB_HEIGHT,w-3,1, sc.work_light);
|
2018-04-11 19:46:08 +02:00
|
|
|
}
|
|
|
|
|
2020-05-10 03:44:40 +02:00
|
|
|
:dword _tabs::draw_button(dword xx, but_id, text)
|
2018-04-11 19:46:08 +02:00
|
|
|
{
|
|
|
|
dword col_bg, col_text;
|
|
|
|
dword ww=strlen(text)*8, hh=TAB_HEIGHT;
|
|
|
|
|
|
|
|
if (but_id==active_tab)
|
|
|
|
{
|
|
|
|
col_bg=0xE44C9C;
|
2020-04-18 01:52:24 +02:00
|
|
|
col_text=sc.work_text;
|
2018-04-11 19:46:08 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
col_bg=0xC3A1B7;
|
2020-04-18 01:52:24 +02:00
|
|
|
col_text= MixColors(sc.work, sc.work_text, 120);
|
2018-04-11 19:46:08 +02:00
|
|
|
}
|
2019-03-18 23:31:13 +01:00
|
|
|
DefineHiddenButton(xx-2,y, ww-1+4,hh-1, but_id);
|
2018-04-11 20:32:00 +02:00
|
|
|
WriteText(xx, y+6, 0x90, col_text, text);
|
|
|
|
DrawBar(xx, y+hh-3, ww, 3, col_bg);
|
2019-03-18 23:31:13 +01:00
|
|
|
//DrawStandartCaptButton(xx, y, but_id, text); //GetFreeButtonId()
|
2020-05-10 03:44:40 +02:00
|
|
|
return xx;
|
2018-04-11 19:46:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
:int _tabs::click(int N)
|
|
|
|
{
|
|
|
|
if (N==active_tab) return false;
|
|
|
|
active_tab = N;
|
|
|
|
return true;
|
|
|
|
}
|