~wxMemoryDC(void);
virtual void SelectObject(const wxBitmap& bitmap);
virtual void DoGetSize(int *width, int *height) const;
+
+ virtual void Clear();
protected:
wxBitmap m_selectedBitmap;
WX_NSImage m_cocoaNSImage;
#import <AppKit/NSImage.h>
#import <AppKit/NSAffineTransform.h>
#import <AppKit/NSGraphicsContext.h>
+#import <AppKit/NSColor.h>
+#import <AppKit/NSBezierPath.h>
//-----------------------------------------------------------------------------
// wxMemoryDC
return false;
}
+void wxMemoryDC::Clear()
+{
+ if(!CocoaTakeFocus()) return;
+
+ NSGraphicsContext *context = [NSGraphicsContext currentContext];
+ [context saveGraphicsState];
+
+ [m_backgroundBrush.GetNSColor() set];
+ NSRect rect;
+ rect.origin.x = 0;
+ rect.origin.y = 0;
+ rect.size = [m_cocoaNSImage size];
+ [NSBezierPath fillRect:rect];
+
+ [context restoreGraphicsState];
+}
+