Subversion Repositories Kolibri OS

Rev

Rev 7226 | Rev 7806 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

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