]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/dc.mm
added wxTB_HORZ_TEXT (patch 713813); documented it; moved toolbar styles to toolbar.h
[wxWidgets.git] / src / cocoa / dc.mm
index 681663b4aa4e0f9c4b487540702f90681eb94362..b5270832974c7e93cc039eb9b8316e5f52803ece 100644 (file)
@@ -64,31 +64,21 @@ wxDC::~wxDC(void)
 
 void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
 {
-    NSGraphicsContext *context = [NSGraphicsContext currentContext];
-    [context saveGraphicsState];
-
     NSBezierPath *bezpath = [NSBezierPath bezierPathWithRect:NSMakeRect(x,y,width,height)];
     [m_textForegroundColour.GetNSColor() set];
     [bezpath stroke];
     [m_brush.GetNSColor() set];
     [bezpath fill];
-
-    [context restoreGraphicsState];
 }
 
 void wxDC::DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
 {
-    NSGraphicsContext *context = [NSGraphicsContext currentContext];
-    [context saveGraphicsState];
-
     NSBezierPath *bezpath = [NSBezierPath bezierPath];
     [bezpath moveToPoint:NSMakePoint(x1,y1)];
     [bezpath lineToPoint:NSMakePoint(x2,y2)];
 
     [m_textForegroundColour.GetNSColor() set];
     [bezpath stroke];
-
-    [context restoreGraphicsState];
 }
 
 void wxDC::DoGetTextExtent(const wxString& text, wxCoord *x, wxCoord *y, wxCoord *descent, wxCoord *externalLeading, wxFont *theFont) const
@@ -347,8 +337,9 @@ void wxDC::Clear()
 {
 }
 
-void wxDC::SetBackground(const wxBrush&)
+void wxDC::SetBackground(const wxBrush& brush)
 {
+    m_backgroundBrush = brush;
 }
 
 void wxDC::SetPalette(const wxPalette&)