Subversion Repositories Kolibri OS

Rev

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

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