From: David Elliott Date: Wed, 9 Jul 2003 18:38:44 +0000 (+0000) Subject: Implement wxWindowDC::Clear() X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/9d180f3ad0459709707ca591295c7c885d09c614?hp=7bc429ef0a060fdf0cdd5023098cdbb9d55ea123 Implement wxWindowDC::Clear() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21802 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/cocoa/dcclient.h b/include/wx/cocoa/dcclient.h index 0c6c3eee38..481c3e672b 100644 --- a/include/wx/cocoa/dcclient.h +++ b/include/wx/cocoa/dcclient.h @@ -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; }; diff --git a/src/cocoa/dcclient.mm b/src/cocoa/dcclient.mm index 430f225b10..b64c2ac01c 100644 --- a/src/cocoa/dcclient.mm +++ b/src/cocoa/dcclient.mm @@ -14,6 +14,9 @@ #import #import +#import +#import +#import /* * 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 */