Subversion Repositories Kolibri OS

Rev

Rev 7285 | Blame | Last modification | View Log | Download | RSS feed

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