Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1.  
  2. struct _canvas
  3. {
  4.         void write_text();
  5.         void draw_bar();
  6. };
  7.  
  8. void _canvas::write_text(int _x, _y; dword _text_col, _text_off)
  9. {
  10.         char error_message[128];
  11.         if (_x > list.w) {
  12.                 sprintf(#error_message, "ERROR: canvas.x overflow: H %d X %d", kfont.size.height, _x);
  13.                 debugln(#error_message);
  14.         }
  15.         if (_y+kfont.size.pt > kfont.size.height) {
  16.                 sprintf(#error_message, "ERROR: canvas.y overflow: H %d Y %d", kfont.size.height, _y);
  17.                 debugln(#error_message);
  18.                 return;
  19.         }
  20.         kfont.WriteIntoBuffer(_x, _y, list.w, kfont.size.height, 0xFFFFFF, _text_col, kfont.size.pt, _text_off);
  21.         if (_y/list.item_h-list.first==list.visible) DrawPage();
  22. }
  23.  
  24.  
  25. void _canvas::draw_bar(dword _x, _y, _w, _color)
  26. {
  27.         int i;
  28.         for (i = _y*list.w+_x*KFONT_BPP+kfont.raw ; i<_y*list.w+_x+_w*KFONT_BPP+kfont.raw ; i+=KFONT_BPP)
  29.         {
  30.                 ESDWORD[i] = _color;
  31.         }
  32. }
  33.  
  34.