void ddAbstractFigure::basicDrawSelected(wxBufferedDC& context, ddDrawingView *view){ ddRect copy = displayBox(); view->CalcScrolledPosition(copy.x,copy.y,©.x,©.y); context.SetPen(*wxRED_PEN); context.SetBrush(wxBrush (wxColour(133, 133, 133),wxSOLID)); context.DrawRectangle(copy); }
void TangramDlg::PaintTans(wxBufferedDC& dc){ for(int i=0;i<TANS_NO;i++){ if(tans[i] != NULL) { dc.SetPen(wxPen(wxColour(0,0,0), 3 )); dc.SetBrush(wxBrush(wxColour(255*i/8,50,25))); dc.DrawPolygon(tans[i]->GetSize(),tans[i]->GetPoints()); } } }
void hdAbstractFigure::basicDraw(wxBufferedDC &context, hdDrawingView *view) { hdRect copy = displayBox().gethdRect(view->getIdx()); view->CalcScrolledPosition(copy.x, copy.y, ©.x, ©.y); context.SetPen(*wxGREEN_PEN); context.SetBrush(wxBrush (wxColour(208, 208, 208), wxSOLID)); context.DrawRectangle(copy); }
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 ); }
void Side::draw ( wxBufferedDC& dc ) { #if NATIVEZOOMING double z = 1.0; #else double z = Billiard::zoom; #endif dc.SetBrush( wxBrush( *wxWHITE ) ); dc.DrawRoundedRectangle( ( beg.x - ( !type ? RADIUS : 0.0 ) ) * z, ( beg.y - ( type ? RADIUS : 0.0 ) ) * z, ( !type ? end.x - beg.x + 2.0 * RADIUS : dir * 100.0 ) * z, ( type ? end.y - beg.y + 2.0 * RADIUS : dir * 100.0 ) * z, RADIUS * z ); }
void hdButtonHandle::draw(wxBufferedDC &context, hdDrawingView *view) { wxPoint copy = getDisplayBox(view->getIdx()).GetPosition(); view->CalcScrolledPosition(copy.x, copy.y, ©.x, ©.y); if(buttonIcon.IsOk()) context.DrawBitmap(buttonIcon, copy.x, copy.y, true); }
void ddColumnOptionIcon::basicDraw(wxBufferedDC &context, hdDrawingView *view) { if(iconToDraw) { hdRect copy = displayBox().gethdRect(view->getIdx()); view->CalcScrolledPosition(copy.x, copy.y, ©.x, ©.y); context.DrawBitmap(*iconToDraw, copy.GetPosition(), true); } }
void hdPolyLineFigure::basicDraw(wxBufferedDC &context, hdDrawingView *view) { int posIdx = view->getIdx(); if(points[posIdx]->count() < 2) { return; } hdPoint start, end; if(startTerminal) { startTerminal->setLinePen(linePen); start = startTerminal->draw(context, getStartPoint(posIdx), pointAt(posIdx, 1), view); } else { start = getStartPoint(posIdx); } if(endTerminal) { endTerminal->setLinePen(linePen); end = endTerminal->draw(context, getEndPoint(posIdx), pointAt(posIdx, pointCount(posIdx) - 2), view); } else { end = getEndPoint(posIdx); } context.SetPen(linePen); for(int i = 0; i < points[posIdx]->count() - 1; i++) { hdPoint *p1 = (hdPoint *) points[posIdx]->getItemAt(i); hdPoint *p2 = (hdPoint *) points[posIdx]->getItemAt(i + 1); hdPoint copyP1 = hdPoint (*p1); view->CalcScrolledPosition(copyP1.x, copyP1.y, ©P1.x, ©P1.y); hdPoint copyP2 = hdPoint (*p2); view->CalcScrolledPosition(copyP2.x, copyP2.y, ©P2.x, ©P2.y); context.DrawLine(copyP1, copyP2); } }
void ddPolyLineHandle::draw(wxBufferedDC& context, ddDrawingView *view) { //DD-TODO: set graphic style ddRect copy = getDisplayBox(); view->CalcScrolledPosition(copy.x,copy.y,©.x,©.y); double middle=copy.width/2; context.DrawCircle( wxPoint(copy.x+middle,copy.y+middle), wxCoord(middle) ); //DD-TODO: improve this draw }
void ddScrollBarHandle::draw(wxBufferedDC &context, hdDrawingView *view) { int idx = view->getIdx(); context.SetBrush(*wxWHITE_BRUSH); wxPoint copy = getDisplayBox(idx).GetPosition(); view->CalcScrolledPosition(copy.x, copy.y, ©.x, ©.y); context.DrawRectangle(copy.x, copy.y, getDisplayBox(idx).width, getDisplayBox(idx).height); context.DrawBitmap(upBitmap, copy.x + 1, copy.y + 2, true); context.DrawBitmap(downBitmap, copy.x + 1, copy.y + getDisplayBox(idx).height - 2 - downBitmap.GetHeight(), true); barSize.SetHeight((getDisplayBox(idx).height - 12) * 0.45); barSize.SetWidth(getDisplayBox(idx).width - 4); int divBy = (table->getTotalColumns() - table->getColumnsWindow()); if(divBy <= 0) divBy = table->getColumnsWindow(); int colOffset = barSize.GetHeight() / divBy; int verticalPosBar = 3 + copy.y + downBitmap.GetHeight() + colOffset * table->getTopColWindowIndex(); if(table->getColumnsWindow() > 1) context.DrawRectangle(wxPoint(copy.x + 2, verticalPosBar), barSize); }
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, ©.x, ©.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) ); } }
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 ddIFigure::drawSelected (wxBufferedDC& context, ddDrawingView *view){ context.SetPen(defaultSelectedPen); context.SetBrush(defaultSelectedBrush); }
void hdSimpleTextFigure::basicDrawSelected(wxBufferedDC &context, hdDrawingView *view) { hdRect copy = displayBox().gethdRect(view->getIdx()); view->CalcScrolledPosition(copy.x, copy.y, ©.x, ©.y); context.DrawText(getText(true), copy.GetPosition()); }
void ddRectangleFigure::basicDraw(wxBufferedDC& context, ddDrawingView *view) { ddRect copy = displayBox(); view->CalcScrolledPosition(copy.x,copy.y,©.x,©.y); context.DrawRectangle(copy); }
void hdFontAttribute::apply(wxBufferedDC &context) { context.SetFont(fontAttributes); }
void hdLineAttribute::apply(wxBufferedDC &context) { context.SetPen(penAttributes); }
void ddBitmapFigure::basicDraw(wxBufferedDC& context, ddDrawingView *view) { ddRect copy = displayBox(); view->CalcScrolledPosition(copy.x,copy.y,©.x,©.y); context.DrawBitmap(imageToDraw,copy.GetPosition(),true); }
void hdRectangleFigure::basicDrawSelected(wxBufferedDC &context, hdDrawingView *view) { hdRect copy = displayBox().gethdRect(view->getIdx()); view->CalcScrolledPosition(copy.x, copy.y, ©.x, ©.y); context.DrawRectangle(copy); }
void hdFillAttribute::apply(wxBufferedDC &context) { context.SetBrush(fillAttributes); }
void hdFontColorAttribute::apply(wxBufferedDC &context) { context.SetTextForeground(fontColor); }