Exemplo n.º 1
0
void Hole::draw ( wxBufferedDC& dc ) {
	dc.SetBrush( wxBrush( *wxBLACK ) );
	#if NATIVEZOOMING
	double z = 1.0;
	#else
	double z = Billiard::zoom;
	#endif
	
	dc.DrawCircle( pos.x * z, pos.y * z, HOLE * z );
}
Exemplo n.º 2
0
void Ball::draw ( wxBufferedDC& dc ) {
	wxSize size ( dc.GetTextExtent( n ) );
	
	#if NATIVEZOOMING
	double z = 1.0;
	#else
	double z = Billiard::zoom;
	#endif
	
	dc.SetBrush( wxBrush( color ) );
	//cout << "Disegno la pallina numero " << balls[i].num << ".\n";
	
	dc.DrawCircle ( pos.x * z, pos.y * z, RADIUS * z );
	
	if ( num ) {
		dc.SetBrush( wxBrush( *wxWHITE ) );
		dc.DrawCircle ( pos.x * z, pos.y * z, INNER * z );
		dc.DrawText ( n, pos.x * z - 0.5 * size.GetWidth(), pos.y * z - 0.5 * size.GetHeight() );
	}
}
void ddPolyLineHandle::draw(wxBufferedDC& context, ddDrawingView *view)
{
    //DD-TODO: set graphic style
    ddRect copy = getDisplayBox();
    view->CalcScrolledPosition(copy.x,copy.y,&copy.x,&copy.y);

    double middle=copy.width/2;
    context.DrawCircle(
        wxPoint(copy.x+middle,copy.y+middle),
        wxCoord(middle)
    );
    //DD-TODO: improve this draw
}
Exemplo n.º 4
0
void hdPolyLineHandle::draw(wxBufferedDC &context, hdDrawingView *view)
{
	//A Handle at polyline figure without a respetive flexibility point at line
	//Hack to allow handles of polylines reuse between different versions of same line.
	if(getOwner() && indx < (((hdPolyLineFigure *) getOwner())->countPointsAt(view->getIdx()) - 1) ) //indx 0 is first, count first is 1
	{
		hdRect copy = getDisplayBox(view->getIdx());
		view->CalcScrolledPosition(copy.x, copy.y, &copy.x, &copy.y);

		/* Uncomment this for testing purposes of handles in a polyline figure
		wxString pos = wxString::Format(_("%d"),indx);
		double middle2 = copy.width / 2;
		context.DrawText(pos,copy.x + middle2+3, copy.y + middle2);
		*/

		double middle = copy.width / 2;
		context.DrawCircle(
		    wxPoint(copy.x + middle, copy.y + middle),
		    wxCoord(middle)
		);
	}
}