git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31302
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
~wxMemoryDC(void);
virtual void SelectObject(const wxBitmap& bitmap);
virtual void DoGetSize(int *width, int *height) const;
~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;
protected:
wxBitmap m_selectedBitmap;
WX_NSImage m_cocoaNSImage;
#import <AppKit/NSImage.h>
#import <AppKit/NSAffineTransform.h>
#import <AppKit/NSGraphicsContext.h>
#import <AppKit/NSImage.h>
#import <AppKit/NSAffineTransform.h>
#import <AppKit/NSGraphicsContext.h>
+#import <AppKit/NSColor.h>
+#import <AppKit/NSBezierPath.h>
//-----------------------------------------------------------------------------
// wxMemoryDC
//-----------------------------------------------------------------------------
// wxMemoryDC
+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];
+}
+