void wxDC::SetUserScale( double x, double y ) { // allow negative ? -> no m_userScaleX = x; m_userScaleY = y; ComputeScaleAndOrigin(); }
void wxSVGFileDC::SetDeviceOrigin( wxCoord x, wxCoord y ) { // only wxPostScripDC has m_signX = -1, m_deviceOriginX = x; m_deviceOriginY = y; ComputeScaleAndOrigin(); }
void wxDC::SetLogicalScale( double x, double y ) { // allow negative ? m_logicalScaleX = x; m_logicalScaleY = y; ComputeScaleAndOrigin(); }
void wxDC::SetDeviceOrigin( wxCoord x, wxCoord y ) { // only wxPostScripDC has m_signX = -1, we override SetDeviceOrigin there m_deviceOriginX = x; m_deviceOriginY = y; ComputeScaleAndOrigin(); }
void wxDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp ) { // only wxPostScripDC has m_signX = -1, we override SetAxisOrientation there m_signX = (xLeftRight ? 1 : -1); m_signY = (yBottomUp ? -1 : 1); ComputeScaleAndOrigin(); }
void wxSVGFileDC::SetLogicalOrigin( wxCoord x, wxCoord y ) { // is this still correct ? m_logicalOriginX = x * m_signX; m_logicalOriginY = y * m_signY; ComputeScaleAndOrigin(); }
void wxDC::SetLogicalOrigin( wxCoord x, wxCoord y ) { #warning "move this to common code?" m_logicalOriginX = x * m_signX; // is this still correct ? m_logicalOriginY = y * m_signY; ComputeScaleAndOrigin(); }
void wxGCDCImpl::SetMapMode( wxMappingMode mode ) { switch (mode) { case wxMM_TWIPS: SetLogicalScale( twips2mm * m_mm_to_pix_x, twips2mm * m_mm_to_pix_y ); break; case wxMM_POINTS: SetLogicalScale( pt2mm * m_mm_to_pix_x, pt2mm * m_mm_to_pix_y ); break; case wxMM_METRIC: SetLogicalScale( m_mm_to_pix_x, m_mm_to_pix_y ); break; case wxMM_LOMETRIC: SetLogicalScale( m_mm_to_pix_x / 10.0, m_mm_to_pix_y / 10.0 ); break; case wxMM_TEXT: default: SetLogicalScale( 1.0, 1.0 ); break; } ComputeScaleAndOrigin(); }
void wxDC::SetUserScale(double x, double y) { #warning "move this to common code?" // allow negative ? -> no m_userScaleX = x; m_userScaleY = y; ComputeScaleAndOrigin(); }
void wxDC::SetDeviceOrigin( wxCoord x, wxCoord y ) { #warning "move this to common code?" // only wxPostScripDC has m_signX = -1, we override SetDeviceOrigin there m_deviceOriginX = x; m_deviceOriginY = y; ComputeScaleAndOrigin(); }
void wxDC::SetLogicalScale(double x, double y) { #warning "move this to common code?" // allow negative ? m_logicalScaleX = x; m_logicalScaleY = y; ComputeScaleAndOrigin(); }
void wxGCDCImpl::SetGraphicsContext( wxGraphicsContext* ctx ) { delete m_graphicContext; m_graphicContext = ctx; if ( m_graphicContext ) { m_matrixOriginal = m_graphicContext->GetTransform(); m_ok = true; // apply the stored transformations to the passed in context ComputeScaleAndOrigin(); m_graphicContext->SetFont( m_font , m_textForegroundColour ); m_graphicContext->SetPen( m_pen ); m_graphicContext->SetBrush( m_brush); } }
void wxQtDCImpl::DoDrawPolygon(int n, const wxPoint points[], wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode fillStyle ) { QPolygon qtPoints; for (int i = 0; i < n; i++) { qtPoints << wxQtConvertPoint(points[i]); } Qt::FillRule fill = (fillStyle == wxWINDING_RULE) ? Qt::WindingFill : Qt::OddEvenFill; m_qtPainter->translate(xoffset, yoffset); m_qtPainter->drawPolygon(qtPoints, fill); // Reset transform ComputeScaleAndOrigin(); }
void wxQtDCImpl::DoDrawLines(int n, const wxPoint points[], wxCoord xoffset, wxCoord yoffset ) { if (n > 0) { QPainterPath path(wxQtConvertPoint(points[0])); for (int i = 1; i < n; i++) { path.lineTo(wxQtConvertPoint(points[i])); } m_qtPainter->translate(xoffset, yoffset); m_qtPainter->drawPath(path); // Reset transform ComputeScaleAndOrigin(); } }
void wxQtDCImpl::DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle) { if (m_backgroundMode == wxSOLID) m_qtPainter->setBackgroundMode(Qt::OpaqueMode); //Move and rotate (reverse angle direction in Qt and wx) m_qtPainter->translate(x, y); m_qtPainter->rotate(-angle); QPen savedPen = m_qtPainter->pen(); m_qtPainter->setPen(QPen(m_textForegroundColour.GetHandle())); // Disable logical function QPainter::CompositionMode savedOp = m_qtPainter->compositionMode(); m_qtPainter->setCompositionMode( QPainter::CompositionMode_SourceOver ); if (m_backgroundMode == wxSOLID) { m_qtPainter->setBackgroundMode(Qt::OpaqueMode); //Save pen/brush QBrush savedBrush = m_qtPainter->background(); //Use text colors m_qtPainter->setBackground(QBrush(m_textBackgroundColour.GetHandle())); //Draw m_qtPainter->drawText(x, y, 1, 1, Qt::TextDontClip, wxQtConvertString(text)); //Restore saved settings m_qtPainter->setBackground(savedBrush); m_qtPainter->setBackgroundMode(Qt::TransparentMode); } else m_qtPainter->drawText(x, y, 1, 1, Qt::TextDontClip, wxQtConvertString(text)); //Reset to default ComputeScaleAndOrigin(); m_qtPainter->setPen(savedPen); m_qtPainter->setCompositionMode( savedOp ); }
void wxDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp ) { m_signX = xLeftRight ? 1 : -1; m_signY = yBottomUp ? -1 : 1; ComputeScaleAndOrigin(); }
void wxGCDC::SetDeviceOrigin( wxCoord x, wxCoord y ) { m_deviceOriginX = x; m_deviceOriginY = y; ComputeScaleAndOrigin(); }
void wxGCDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp ) { m_signX = (xLeftRight ? 1 : -1); m_signY = (yBottomUp ? -1 : 1); ComputeScaleAndOrigin(); }