X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/519cb848a8f4c91c73421bb75314754284e593a4..c48926e149739055b0ed978d9e893f7898a51a73:/src/mac/carbon/dcclient.cpp

diff --git a/src/mac/carbon/dcclient.cpp b/src/mac/carbon/dcclient.cpp
index 08aeff0504..99ee68a0fb 100644
--- a/src/mac/carbon/dcclient.cpp
+++ b/src/mac/carbon/dcclient.cpp
@@ -16,6 +16,7 @@
 #include "wx/dcclient.h"
 #include "wx/dcmemory.h"
 #include "wx/region.h"
+#include "wx/window.h"
 #include <math.h>
 
 //-----------------------------------------------------------------------------
@@ -40,24 +41,29 @@ IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxWindowDC)
 
 #include <wx/mac/uma.h>
 
-wxWindowDC::wxWindowDC(void)
+wxWindowDC::wxWindowDC() 
 {
 }
 
-wxWindowDC::wxWindowDC(wxWindow *the_canvas)
+wxWindowDC::wxWindowDC(wxWindow *the_canvas) 
 {
 	WindowRef windowref ;
-	wxWindow* rootwindow ;
+	wxWindowMac* rootwindow ;
 	
 	// this time it is really the full window
 	
 	the_canvas->MacGetPortParams(&m_macLocalOrigin, &m_macClipRect , &windowref , &rootwindow );
 	m_macPort = UMAGetWindowPort( windowref ) ;
-	MacSetupPort() ;
+	m_minY = m_minX =  0;
+	wxSize size = the_canvas->GetSize() ;
+	m_maxX = size.x  ;
+	m_maxY = size.y ; 
+
  	m_ok = TRUE ;
+  SetBackground(wxBrush(the_canvas->GetBackgroundColour(), wxSOLID));
 }
 
-wxWindowDC::~wxWindowDC(void)
+wxWindowDC::~wxWindowDC()
 {
 }
 
@@ -65,24 +71,27 @@ wxWindowDC::~wxWindowDC(void)
  * wxClientDC
  */
 
-wxClientDC::wxClientDC(void)
+wxClientDC::wxClientDC()
 {
 }
 
 wxClientDC::wxClientDC(wxWindow *window)
 {
 	WindowRef windowref ;
-	wxWindow* rootwindow ;
+	wxWindowMac* rootwindow ;
 	
 	window->MacGetPortClientParams(&m_macLocalOrigin, &m_macClipRect , &windowref , &rootwindow );
 	m_macPort = UMAGetWindowPort( windowref ) ;
-	MacSetupPort() ;
+	m_minY = m_minX =  0;
+	wxSize size = window->GetSize() ;
+	m_maxX = size.x  ;
+	m_maxY = size.y ; 
  	m_ok = TRUE ;
-  SetBackground(wxBrush(window->GetBackgroundColour(), wxSOLID));
-
+  	SetBackground(wxBrush(window->GetBackgroundColour(), wxSOLID));
+	SetFont( window->GetFont() ) ;
 }
 
-wxClientDC::~wxClientDC(void)
+wxClientDC::~wxClientDC()
 {
 }
 
@@ -90,24 +99,30 @@ wxClientDC::~wxClientDC(void)
  * wxPaintDC
  */
 
-wxPaintDC::wxPaintDC(void)
+wxPaintDC::wxPaintDC()
 {
 }
 
 wxPaintDC::wxPaintDC(wxWindow *window)
 {
 	WindowRef windowref ;
-	wxWindow* rootwindow ;
+	wxWindowMac* rootwindow ;
 	
 	window->MacGetPortClientParams(&m_macLocalOrigin, &m_macClipRect , &windowref , &rootwindow );
 
 	m_macPort = UMAGetWindowPort( windowref ) ;
-	MacSetupPort() ;
  	m_ok = TRUE ;
-	long x , y ,w , h ;
+	/*
+	wxCoord x , y ,w , h ;
 	window->GetUpdateRegion().GetBox( x , y , w , h ) ;
+	m_minY = m_minX =  0;
+	wxSize size = window->GetSize() ;
+	m_maxX = size.x  ;
+	m_maxY = size.y ; 
 	SetClippingRegion( x , y , w , h ) ;
+  	*/
   	SetBackground(wxBrush(window->GetBackgroundColour(), wxSOLID));
+  	SetFont(window->GetFont() ) ;
 }
 
 wxPaintDC::~wxPaintDC()