]> git.saurik.com Git - wxWidgets.git/commitdiff
Implement wxWindowDC::Clear()
authorDavid Elliott <dfe@tgwbd.org>
Wed, 9 Jul 2003 18:38:44 +0000 (18:38 +0000)
committerDavid Elliott <dfe@tgwbd.org>
Wed, 9 Jul 2003 18:38:44 +0000 (18:38 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21802 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/cocoa/dcclient.h
src/cocoa/dcclient.mm

index 0c6c3eee387f40cc023e1072e275f9689e17d824..481c3e672bbd1318431870cdb4da27ba1be77fb9 100644 (file)
@@ -26,6 +26,9 @@ public:
     // Create a DC corresponding to a window
     wxWindowDC(wxWindow *win);
     ~wxWindowDC(void);
     // Create a DC corresponding to a window
     wxWindowDC(wxWindow *win);
     ~wxWindowDC(void);
+
+    // NSView specific functions
+    virtual void Clear();
 protected:
     wxWindow *m_window;
 };
 protected:
     wxWindow *m_window;
 };
index 430f225b10b21ddd0031ddbe5dbe50b8b35c537b..b64c2ac01cf19fa984e33b53927b441796626801 100644 (file)
@@ -14,6 +14,9 @@
 
 #import <AppKit/NSView.h>
 #import <AppKit/NSAffineTransform.h>
 
 #import <AppKit/NSView.h>
 #import <AppKit/NSAffineTransform.h>
+#import <AppKit/NSColor.h>
+#import <AppKit/NSGraphicsContext.h>
+#import <AppKit/NSBezierPath.h>
 
 /*
  * wxWindowDC
 
 /*
  * 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
  */
 /*
  * wxClientDC
  */