wxGraphicsContext::wxGraphicsContext(wxGraphicsRenderer* renderer) :
wxGraphicsObject(renderer),
m_antialias(wxANTIALIAS_DEFAULT),
- m_composition(wxCOMPOSITION_OVER)
+ m_composition(wxCOMPOSITION_OVER),
+ m_enableOffset(false)
{
}
{
}
+void wxGraphicsContext::EnableOffset(bool enable)
+{
+ m_enableOffset = enable;
+}
+
#if 0
void wxGraphicsContext::SetAlpha( wxDouble WXUNUSED(alpha) )
{
}
#endif
-void wxGraphicsContext::GetSize( wxDouble* width, wxDouble* height)
-{
- *width = 10000.0;
- *height = 10000.0;
-}
-
void wxGraphicsContext::GetDPI( wxDouble* dpiX, wxDouble* dpiY)
{
*dpiX = 72.0;
void wxGraphicsContext::SetPen( const wxPen& pen )
{
- if ( !pen.Ok() || pen.GetStyle() == wxPENSTYLE_TRANSPARENT )
+ if ( !pen.IsOk() || pen.GetStyle() == wxPENSTYLE_TRANSPARENT )
SetPen( wxNullGraphicsPen );
else
SetPen( CreatePen( pen ) );
void wxGraphicsContext::SetBrush( const wxBrush& brush )
{
- if ( !brush.Ok() || brush.GetStyle() == wxBRUSHSTYLE_TRANSPARENT )
+ if ( !brush.IsOk() || brush.GetStyle() == wxBRUSHSTYLE_TRANSPARENT )
SetBrush( wxNullGraphicsBrush );
else
SetBrush( CreateBrush( brush ) );
void wxGraphicsContext::SetFont( const wxFont& font, const wxColour& colour )
{
- if ( font.Ok() )
+ if ( font.IsOk() )
SetFont( CreateFont( font, colour ) );
else
SetFont( wxNullGraphicsFont );
// to make sure our 'OffsetToPixelBoundaries' doesn't move the fill shape
SetPen( wxNullGraphicsPen );
- wxGraphicsPath path = CreatePath();
- path.AddRectangle( x , y, width, height );
- FillPath( path );
+ DrawRectangle(x , y, width, height);
DrawText( str, x ,y);
SetBrush( formerBrush );
{
return wxGraphicsRenderer::GetDefaultRenderer()->CreateContext(dc);
}
+#endif
#ifdef __WXMSW__
+#if wxUSE_ENH_METAFILE
/* static */ wxGraphicsContext* wxGraphicsContext::Create( const wxEnhMetaFileDC& dc)
{
return wxGraphicsRenderer::GetDefaultRenderer()->CreateContext(dc);
}
#endif
-
-#endif // wxUSE_PRINTING_ARCHITECTURE
+#endif
wxGraphicsContext* wxGraphicsContext::CreateFromNative( void * context )
{