]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dcclient.cpp
VC++ compilation correction; doc file corrections
[wxWidgets.git] / src / msw / dcclient.cpp
index 48f1c0345cecef067c37fb9245b1c99aa56793bf..e1cd97a1ada06bf8ec37eef6bf7cb2734a342f6d 100644 (file)
 #pragma implementation "dcclient.h"
 #endif
 
 #pragma implementation "dcclient.h"
 #endif
 
-#ifdef __GNUG__
-#pragma implementation
-#pragma implementation "dcclient.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
 #include <windows.h>
 
 #if !USE_SHARED_LIBRARY
 #include <windows.h>
 
 #if !USE_SHARED_LIBRARY
-IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxDC)
 IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC)
 IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC)
-IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxDC)
+IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxWindowDC)
+IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxWindowDC)
 #endif
 
 #endif
 
-wxClientDC::wxClientDC(void)
+/*
+ * wxWindowDC
+ */
+
+wxWindowDC::wxWindowDC(void)
 {
   m_canvas = NULL;
 }
 
 {
   m_canvas = NULL;
 }
 
-wxClientDC::wxClientDC(wxWindow *the_canvas)
+wxWindowDC::wxWindowDC(wxWindow *the_canvas)
 {
   m_canvas = the_canvas;
 {
   m_canvas = the_canvas;
-//  BeginDrawing();
-  m_hDC = (WXHDC) ::GetDC((HWND) the_canvas->GetHWND());
+//  m_hDC = (WXHDC) ::GetDCEx((HWND) the_canvas->GetHWND(), NULL, DCX_WINDOW);
+  m_hDC = (WXHDC) ::GetWindowDC((HWND) the_canvas->GetHWND() );
+  m_hDCCount ++;
 }
 
 }
 
-wxClientDC::~wxClientDC(void)
+wxWindowDC::~wxWindowDC(void)
 {
 {
-//  EndDrawing();
-
-  if (m_canvas && (HDC) m_hDC)
+  if (m_canvas && m_hDC)
   {
     SelectOldObjects(m_hDC);
 
     ::ReleaseDC((HWND) m_canvas->GetHWND(), (HDC) m_hDC);
        m_hDC = 0;
   }
   {
     SelectOldObjects(m_hDC);
 
     ::ReleaseDC((HWND) m_canvas->GetHWND(), (HDC) m_hDC);
        m_hDC = 0;
   }
+  m_hDCCount --;
 }
 
 }
 
-wxWindowDC::wxWindowDC(void)
+/*
+ * wxClientDC
+ */
+
+wxClientDC::wxClientDC(void)
 {
   m_canvas = NULL;
 }
 
 {
   m_canvas = NULL;
 }
 
-wxWindowDC::wxWindowDC(wxWindow *the_canvas)
+wxClientDC::wxClientDC(wxWindow *the_canvas)
 {
   m_canvas = the_canvas;
 {
   m_canvas = the_canvas;
-//  m_hDC = (WXHDC) ::GetDCEx((HWND) the_canvas->GetHWND(), NULL, DCX_WINDOW);
-  m_hDC = (WXHDC) ::GetWindowDC((HWND) the_canvas->GetHWND() );
-  m_hDCCount ++;
+//  BeginDrawing();
+  m_hDC = (WXHDC) ::GetDC((HWND) the_canvas->GetHWND());
 }
 
 }
 
-wxWindowDC::~wxWindowDC(void)
+wxClientDC::~wxClientDC(void)
 {
 {
-  if (m_canvas && m_hDC)
+//  EndDrawing();
+
+  if (m_canvas && (HDC) m_hDC)
   {
     SelectOldObjects(m_hDC);
 
     ::ReleaseDC((HWND) m_canvas->GetHWND(), (HDC) m_hDC);
        m_hDC = 0;
   }
   {
     SelectOldObjects(m_hDC);
 
     ::ReleaseDC((HWND) m_canvas->GetHWND(), (HDC) m_hDC);
        m_hDC = 0;
   }
-  m_hDCCount --;
 }
 
 }
 
+/*
+ * wxPaintDC
+ */
+
 wxPaintDC::wxPaintDC(void)
 {
   m_canvas = NULL;
 wxPaintDC::wxPaintDC(void)
 {
   m_canvas = NULL;
@@ -99,8 +106,8 @@ static PAINTSTRUCT g_paintStruct;
 // Don't call Begin/EndPaint if it's already been called:
 // for example, if calling a base class OnPaint.
 
 // Don't call Begin/EndPaint if it's already been called:
 // for example, if calling a base class OnPaint.
 
-WXHDC wxPaintDC::ms_PaintHDC = 0;
-size_t  wxPaintDC::ms_PaintCount = 0; // count of ms_PaintHDC usage
+WXHDC  wxPaintDC::ms_PaintHDC = 0;
+size_t wxPaintDC::ms_PaintCount = 0; // count of ms_PaintHDC usage
 
 wxPaintDC::wxPaintDC(wxWindow *canvas)
 {
 
 wxPaintDC::wxPaintDC(wxWindow *canvas)
 {
@@ -129,10 +136,10 @@ wxPaintDC::~wxPaintDC()
     if ( !--ms_PaintCount ) {
       ::EndPaint((HWND)m_canvas->GetHWND(), &g_paintStruct);
       m_hDCCount--;
     if ( !--ms_PaintCount ) {
       ::EndPaint((HWND)m_canvas->GetHWND(), &g_paintStruct);
       m_hDCCount--;
-      m_hDC = NULL;
-      ms_PaintHDC = NULL;
+      m_hDC = (WXHDC) NULL;
+      ms_PaintHDC = (WXHDC) NULL;
     }
     }
-    //else: ms_PaintHDC still in use
+    else { }//: ms_PaintHDC still in use
   }
 }
 
   }
 }