Implement wxWindowDC::Clear()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21802 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Elliott 2003-07-09 18:38:44 +00:00
parent 7bc429ef0a
commit 9d180f3ad0
2 changed files with 19 additions and 0 deletions

View File

@ -26,6 +26,9 @@ public:
// Create a DC corresponding to a window
wxWindowDC(wxWindow *win);
~wxWindowDC(void);
// NSView specific functions
virtual void Clear();
protected:
wxWindow *m_window;
};

View File

@ -14,6 +14,9 @@
#import <AppKit/NSView.h>
#import <AppKit/NSAffineTransform.h>
#import <AppKit/NSColor.h>
#import <AppKit/NSGraphicsContext.h>
#import <AppKit/NSBezierPath.h>
/*
* wxWindowDC
@ -35,6 +38,19 @@ wxWindowDC::~wxWindowDC(void)
{
};
void wxWindowDC::Clear()
{
wxASSERT(m_window);
NSGraphicsContext *context = [NSGraphicsContext currentContext];
[context saveGraphicsState];
[m_backgroundBrush.GetNSColor() set];
[NSBezierPath fillRect:[m_window->GetNSView() bounds]];
[context restoreGraphicsState];
}
/*
* wxClientDC
*/