]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/dcbase.cpp
floating pane now respects IsFixed pane status; indirect fix for #4044
[wxWidgets.git] / src / common / dcbase.cpp
index 45cb64b5c635b5068326bf723093ddf30f644064..168ea59a211720df41edfed4e8374575006c04eb 100644 (file)
@@ -53,9 +53,9 @@
 #endif
 
 #ifdef __WXMAC__
-    #include "wx/mac/dcclient.h"
-    #include "wx/mac/dcmemory.h"
-    #include "wx/mac/dcscreen.h"
+    #include "wx/osx/dcclient.h"
+    #include "wx/osx/dcmemory.h"
+    #include "wx/osx/dcscreen.h"
 #endif
 
 #ifdef __WXPM__
@@ -131,34 +131,25 @@ IMPLEMENT_DYNAMIC_CLASS(wxDCFactoryCleanupModule, wxModule)
 // wxNativeDCFactory
 //-----------------------------------------------------------------------------
 
-wxDCImpl* wxNativeDCFactory::CreateWindowDC( wxWindowDC *owner )
-{
-    return new wxWindowDCImpl( owner );
-}
-
 wxDCImpl* wxNativeDCFactory::CreateWindowDC( wxWindowDC *owner, wxWindow *window )
 {
-    return new wxWindowDCImpl( owner, window );
-}
-
-wxDCImpl* wxNativeDCFactory::CreateClientDC( wxClientDC *owner )
-{
-    return new wxClientDCImpl( owner );
+    wxDCImpl * const impl = new wxWindowDCImpl( owner, window );
+    impl->InheritAttributes(window);
+    return impl;
 }
 
 wxDCImpl* wxNativeDCFactory::CreateClientDC( wxClientDC *owner, wxWindow *window )
 {
-    return new wxClientDCImpl( owner, window );
-}
-
-wxDCImpl* wxNativeDCFactory::CreatePaintDC( wxPaintDC *owner )
-{
-    return new wxPaintDCImpl( owner );
+    wxDCImpl * const impl = new wxClientDCImpl( owner, window );
+    impl->InheritAttributes(window);
+    return impl;
 }
 
 wxDCImpl* wxNativeDCFactory::CreatePaintDC( wxPaintDC *owner, wxWindow *window )
 {
-    return new wxPaintDCImpl( owner, window );
+    wxDCImpl * const impl = new wxPaintDCImpl( owner, window );
+    impl->InheritAttributes(window);
+    return impl;
 }
 
 wxDCImpl* wxNativeDCFactory::CreateMemoryDC( wxMemoryDC *owner )
@@ -1107,6 +1098,16 @@ void wxDCImpl::DoGradientFillConcentric(const wxRect& rect,
     m_pen.SetColour(oldPenColour);
 }
 
+void wxDCImpl::InheritAttributes(wxWindow *win)
+{
+    wxCHECK_RET( win, "window can't be NULL" );
+
+    SetFont(win->GetFont());
+    SetTextForeground(win->GetForegroundColour());
+    SetTextBackground(win->GetBackgroundColour());
+    SetBackground(wxBrush(win->GetBackgroundColour()));
+}
+
 //-----------------------------------------------------------------------------
 // wxDC
 //-----------------------------------------------------------------------------