Subversion Repositories Kolibri OS

Rev

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

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