Subversion Repositories Kolibri OS

Rev

Rev 7806 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1.  
  2. #define MIN_PB_BLOCK_W 19
  3. #define LOAD_CPU 0x2460C8
  4. #define PROGRESS_ACTIVE 0x489FE4
  5. #define PROGRESS_BG 0xFFFfff
  6. #define PROGRESS_BG_TEXT 0x696969
  7.  
  8. :struct sensor {
  9.         int x,y,w,h;
  10.         void set_size();
  11.         void draw_wrapper();
  12.         void draw_progress();
  13. };
  14.  
  15. :void sensor::set_size(dword _x, _y, _w, _h)
  16. {
  17.         x=_x+2;
  18.         y=_y;
  19.         w=_w;
  20.         h=_h;
  21.         draw_wrapper();
  22. }
  23.  
  24. :void sensor::draw_wrapper()
  25. {
  26.         DrawRectangle(x-1, y-1, w+1, h+1, sc.work_graph);
  27.         DrawRectangle3D(x-2, y-2, w+3, h+3, sc.work, sc.work_light);
  28. }
  29.  
  30. :void sensor::draw_progress(dword progress_w)
  31. {
  32.         char textp[16];
  33.         DrawBar(x, y,     w-progress_w, 1,   MixColors(PROGRESS_ACTIVE, PROGRESS_BG, 200));
  34.         DrawBar(x, y+1,   w-progress_w, h-2, PROGRESS_ACTIVE);
  35.         DrawBar(x, y+h-1, w-progress_w, 1,   MixColors(PROGRESS_ACTIVE, sc.work_graph, 200));
  36.         DrawBar(x+w-progress_w, y, progress_w, h, PROGRESS_BG);
  37.  
  38.         strcpy(#textp, itoa(w-progress_w*100/w));
  39.         chrcat(#textp, '%');
  40.         WriteText(-strlen(#textp)*8 + w / 2 + x, h/2-7+y, 0x90, 0x000000, #textp);
  41. }