Subversion Repositories Kolibri OS

Rev

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

  1. void DrawRectangle(dword x,y,width,height,color1)
  2. {
  3.         DrawBar(x,y,width,1,color1);
  4.         DrawBar(x,y+height,width,1,color1);
  5.         DrawBar(x,y,1,height,color1);
  6.         DrawBar(x+width,y,1,height+1,color1);
  7. }
  8.  
  9. void DrawRectangle3D(dword x,y,width,height,color1,color2)
  10. {
  11.         DrawBar(x,y,width+1,1,color1);
  12.         DrawBar(x,y+1,1,height-1,color1);
  13.         DrawBar(x+width,y+1,1,height,color2);
  14.         DrawBar(x,y+height,width,1,color2);
  15. }
  16.  
  17. void DrawCaptButton(dword x,y,width,height,id,color,text,text_len)
  18. {
  19.         DefineButton(x,y,width,height,id+BT_HIDE,0xEFEBEF);
  20.         WriteText(-text_len*6+width/2+x+1,height/2-3+y,0x80,0,text,0);
  21. }
  22.  
  23. void DrawCircle(int x, y, r)
  24. {
  25.         int i;
  26.         float px=0, py=r, ii = r * 3.1415926 * 2;
  27.         FOR (i = 0; i < ii; i++)
  28.         {
  29.         PutPixel(px + x, y - py, 0);
  30.         px = py / r + px;
  31.         py = -px / r + py;
  32.         }
  33. }