示例#1
0
VOID TableClass::Render (struct RenderMessage &rmsg)
{
  if(Flags & FLG_Layouted)
  {
    struct RastPort *rp = rmsg.RPort;
    BOOL oldborder = rmsg.TableBorder, target;

    LONG old_backgroundcol = rmsg.Colours[Col_Background];
    class SuperClass *oldbackground = rmsg.BackgroundObj;
    if(BackgroundRGB != -1 || Picture)
    {
      SetCol(rmsg.Colours[Col_Background], BackgroundCol);
      rmsg.BackgroundObj = this;
    }

    if((target = (rmsg.TargetObj == (class SuperClass *)this)))
      rmsg.TargetObj = NULL;

    if(!rmsg.TargetObj)
    {
      if(rmsg.BackgroundObj == (class BackFillClass *)this)
        DrawBackground(rmsg, Left+BorderSize-rmsg.OffsetX, Top+BorderSize-rmsg.OffsetY, Left+BorderSize+Width-1+((Columns+1)*Spacing)-rmsg.OffsetX, Bottom-BorderSize-rmsg.OffsetY, 0, 0);

      if(BorderSize)
      {
        ULONG width = Width+((Columns+1)*Spacing)+2*BorderSize;
        LONG  x1 = Left-rmsg.OffsetX, x2 = Left+width-rmsg.OffsetX-1,
            y1 = Top-rmsg.OffsetY, y2 = Bottom-rmsg.OffsetY;

        SetAPen(rp, rmsg.Colours[Col_Halfshadow]);
        RectFill(rp, x1+BorderSize, y2-BorderSize+1, x2, y2);
        RectFill(rp, x2-BorderSize+1, y1+BorderSize, x2, y2);
        SetAPen(rp, rmsg.Colours[Col_Halfshine]);
        RectFill(rp, x1, y1, x2-BorderSize, y1+BorderSize-1);
        RectFill(rp, x1, y1+BorderSize, x1+BorderSize-1, y2-BorderSize);

        DrawCorner(rp, x1, y2-BorderSize+1, BorderSize, rmsg.Colours[Col_Halfshine], rmsg.Colours[Col_Halfshadow]);
        DrawCorner(rp, x2-BorderSize+1, y1, BorderSize, rmsg.Colours[Col_Halfshine], rmsg.Colours[Col_Halfshadow]);
      }
    }

    rmsg.TableBorder = BorderSize;

    struct ChildsList *first = FirstChild;
    while(first)
    {
      ((class TRClass *)first->Obj)->TRRender(rmsg);
      first = first->Next;
    }

    rmsg.TableBorder = oldborder;
    rmsg.BackgroundObj = (class BackFillClass *)oldbackground;
    rmsg.Colours[Col_Background] = old_backgroundcol;

    if(target)
      rmsg.TargetObj = this;
  }
}
示例#2
0
static void DrawFieldBorder(
    Tk_Window tkwin, Drawable d, Tk_3DBorder border, XColor *borderColor,
    Ttk_Box b)
{
    GC borderGC = Tk_GCForColor(borderColor, d);
    DrawCorner(tkwin, d, border, borderGC,
	b.x, b.y, b.width, b.height, 0,fieldShadowColors[0]);
    DrawCorner(tkwin, d, border, borderGC,
	b.x+1, b.y+1, b.width-2, b.height-2, 0,fieldShadowColors[1]);
    DrawCorner(tkwin, d, border, borderGC,
	b.x+1, b.y+1, b.width-2, b.height-2, 1,fieldShadowColors[2]);
    DrawCorner(tkwin, d, border, borderGC,
	b.x, b.y, b.width, b.height, 1,fieldShadowColors[3]);
    return;
}
示例#3
0
static void DrawBorder(
    Tk_Window tkwin, Drawable d, Tk_3DBorder border, XColor *borderColor,
    Ttk_Box b, int borderWidth, int relief)
{
    GC borderGC = Tk_GCForColor(borderColor, d);

    switch (borderWidth) {
	case 2: /* "thick" border */
	    DrawCorner(tkwin, d, border, borderGC,
		b.x, b.y, b.width, b.height, 0,shadowColors[relief][0]);
	    DrawCorner(tkwin, d, border, borderGC,
		b.x+1, b.y+1, b.width-2, b.height-2, 0,shadowColors[relief][1]);
	    DrawCorner(tkwin, d, border, borderGC,
		b.x+1, b.y+1, b.width-2, b.height-2, 1,shadowColors[relief][2]);
	    DrawCorner(tkwin, d, border, borderGC,
		b.x, b.y, b.width, b.height, 1,shadowColors[relief][3]);
	    break;
	case 1: /* "thin" border */
	    DrawCorner(tkwin, d, border, borderGC,
		b.x, b.y, b.width, b.height, 0, thinShadowColors[relief][0]);
	    DrawCorner(tkwin, d, border, borderGC,
		b.x, b.y, b.width, b.height, 1, thinShadowColors[relief][1]);
	    break;
	case 0:	/* no border -- do nothing */
	    break;
	default: /* Fall back to Motif-style borders: */
	    Tk_Draw3DRectangle(tkwin, d, border,
		b.x, b.y, b.width, b.height, borderWidth,relief);
	    break;
    }
}
void __fastcall TOpenGLFootBall::Draw3D1Paint(TObject *Sender,
      const TRect &ARect)
{
  int R = 40;
  // green color
  TCanvas3D *c = Draw3D1->Canvas;
  c->Brush->Color = FGreen;
  c->Pen->Color = TColor(RGB(0x0,0x80,0x0));

  // bottom base
  int tmp = Draw3D1->ChartXCenter;
  c->Cube(tmp-230,tmp+230,Draw3D1->ChartYCenter-2,Draw3D1->ChartYCenter+4,-100,200,false);

  // bottom carpet
  int y = Draw3D1->ChartYCenter-8;

  // light gray color to draw lines
  c->Pen->Style = psSolid;
  c->Pen->Color = FLines;
  c->Brush->Style = bsClear;

  // big rectangle
  c->RectangleY(tmp-W+20,y,tmp+W-20,-80,180);

  // center line
  c->MoveTo3D(tmp,y,-80);
  c->LineTo3D(tmp,y,180);

  // middle circle }
  DrawArc(c,tmp,y,50,R,0,36);

  // left gate area lines
  DrawGateArea(c,tmp-W+20,y,60,70);
  DrawArc(c,tmp-W+20+35,y,50,40,22,32);
  DrawGateArea(c,tmp-W+20,y,20,30);
  //  left gate and net
  DrawGate(c,tmp-W+20,y,18,50,20);
  DrawGate(c,tmp-W+10,y,12,50,18);
  DrawGateNet(c,tmp-W+20,10,y);

  // right gate area lines
  DrawGateArea(c,tmp+W-20,y,-60,70);
  DrawArc(c,tmp+W-20-35,y,50,40,4,14);
  DrawGateArea(c,tmp+W-20,y,-20,30);

  // right gate and net
  DrawGate(c,tmp+W-20,y,18,50,20);
  DrawGate(c,tmp+W-10,y,12,50,18);
  DrawGateNet(c,tmp+W-20,-10,y);

  // the four corners
  DrawCorner(c,tmp-W+20,y,-80,27,36);
  DrawCorner(c,tmp+W-20,y,-80,0,9);
  DrawCorner(c,tmp-W+20,y,180,18,27);
  DrawCorner(c,tmp+W-20,y,180,9,18);

  // the two penalties and center point
  DrawArc(c,tmp-W+20+45,y,50,1,0,36);
  DrawArc(c,tmp+W-20-45,y,50,1,0,36);
  DrawArc(c,tmp,y,50,1,0,36);

  // the ball
  c->Brush->Color = FBall;
  c->Sphere(Draw3D1->ChartXCenter+Ball.x,y-TrackBar1->Position+1,50+Ball.y,TrackBar1->Position);

  // the back public seats
  if (CheckBox2->Checked) DrawSeats(c,y,tmp,W);
   // Draw players
  if (CheckBox3->Checked)
  {
    y = Draw3D1->ChartYCenter-17;
    for (int t=0;t<5;t++)
    {
      if (t>=4) DrawPlayer2(c,Draw3D1->ChartXCenter+Players[t].x,y,50+Players[t].y);
      else DrawPlayer1(c,Draw3D1->ChartXCenter+Players[t].x,y,50+Players[t].y);
    }
  }
}