// Under Windows, wxClientDC, wxPaintDC and wxWindowDC are implemented differently.
// On many platforms, however, they will be the same.
-typedef wxPaintDC wxClientDC;
-typedef wxPaintDC wxWindowDC;
-
-//-----------------------------------------------------------------------------
-// wxPaintDC
-//-----------------------------------------------------------------------------
-
-class WXDLLEXPORT wxPaintDC: public wxDC
+class WXDLLEXPORT wxWindowDC: public wxDC
{
- DECLARE_DYNAMIC_CLASS(wxPaintDC)
+ DECLARE_DYNAMIC_CLASS(wxWindowDC)
public:
- wxPaintDC(void);
- wxPaintDC( wxWindow *win );
-
- ~wxPaintDC(void);
+ wxWindowDC(void);
+ wxWindowDC( wxWindow *win );
+
+ ~wxWindowDC(void);
virtual void FloodFill( long x1, long y1, wxColour* col, int style=wxFLOOD_SURFACE );
virtual bool GetPixel( long x1, long y1, wxColour *col ) const;
virtual void DrawSpline( wxList *points );
};
+//-----------------------------------------------------------------------------
+// wxPaintDC
+//-----------------------------------------------------------------------------
+
+class WXDLLEXPORT wxPaintDC: public wxWindowDC
+{
+ DECLARE_DYNAMIC_CLASS(wxPaintDC)
+
+ public:
+
+ wxPaintDC(void):wxWindowDC() {};
+ wxPaintDC( wxWindow *win ): wxWindowDC(win) {};
+
+};
+
+//-----------------------------------------------------------------------------
+// wxClientDC
+//-----------------------------------------------------------------------------
+
+class WXDLLEXPORT wxClientDC: public wxWindowDC
+{
+ DECLARE_DYNAMIC_CLASS(wxClientDC)
+
+ public:
+
+ wxClientDC(void):wxWindowDC() {};
+ wxClientDC( wxWindow *win ): wxWindowDC(win) {};
+
+};
+
#endif
// _WX_DCCLIENT_H_
#include <windows.h>
#if !USE_SHARED_LIBRARY
-IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxDC)
IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC)
-IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxDC)
+IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxWindowDC)
+IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxWindowDC)
#endif
-wxClientDC::wxClientDC(void)
+/*
+ * wxWindowDC
+ */
+
+wxWindowDC::wxWindowDC(void)
{
m_canvas = NULL;
}
-wxClientDC::wxClientDC(wxWindow *the_canvas)
+wxWindowDC::wxWindowDC(wxWindow *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;
}
+ m_hDCCount --;
}
-wxWindowDC::wxWindowDC(void)
+/*
+ * wxClientDC
+ */
+
+wxClientDC::wxClientDC(void)
{
m_canvas = NULL;
}
-wxWindowDC::wxWindowDC(wxWindow *the_canvas)
+wxClientDC::wxClientDC(wxWindow *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;
}
- m_hDCCount --;
}
+/*
+ * wxPaintDC
+ */
+
wxPaintDC::wxPaintDC(void)
{
m_canvas = NULL;
//-----------------------------------------------------------------------------
#if !USE_SHARED_LIBRARY
-//IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxDC)
-//IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC)
-IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxDC)
+IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC)
+IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxWindowDC)
+IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxWindowDC)
#endif
+/*
+ * wxWindowDC
+ */
-wxPaintDC::wxPaintDC(void)
+wxWindowDC::wxWindowDC(void)
{
};
-wxPaintDC::wxPaintDC( wxWindow *window )
+wxWindowDC::wxWindowDC( wxWindow *window )
{
};
-wxPaintDC::~wxPaintDC(void)
+wxWindowDC::~wxWindowDC(void)
{
};
-void wxPaintDC::FloodFill( long WXUNUSED(x1), long WXUNUSED(y1),
+void wxWindowDC::FloodFill( long WXUNUSED(x1), long WXUNUSED(y1),
wxColour* WXUNUSED(col), int WXUNUSED(style) )
{
};
-bool wxPaintDC::GetPixel( long WXUNUSED(x1), long WXUNUSED(y1), wxColour *WXUNUSED(col) ) const
+bool wxWindowDC::GetPixel( long WXUNUSED(x1), long WXUNUSED(y1), wxColour *WXUNUSED(col) ) const
{
return FALSE;
};
-void wxPaintDC::DrawLine( long x1, long y1, long x2, long y2 )
+void wxWindowDC::DrawLine( long x1, long y1, long x2, long y2 )
{
if (!Ok()) return;
};
-void wxPaintDC::CrossHair( long x, long y )
+void wxWindowDC::CrossHair( long x, long y )
{
if (!Ok()) return;
};
-void wxPaintDC::DrawArc( long x1, long y1, long x2, long y2, long xc, long yc )
+void wxWindowDC::DrawArc( long x1, long y1, long x2, long y2, long xc, long yc )
{
if (!Ok()) return;
};
-void wxPaintDC::DrawEllipticArc( long x, long y, long width, long height, double sa, double ea )
+void wxWindowDC::DrawEllipticArc( long x, long y, long width, long height, double sa, double ea )
{
if (!Ok()) return;
if (m_pen.GetStyle() != wxTRANSPARENT) {};
};
-void wxPaintDC::DrawPoint( long x, long y )
+void wxWindowDC::DrawPoint( long x, long y )
{
if (!Ok()) return;
if (m_pen.GetStyle() != wxTRANSPARENT) {};
};
-void wxPaintDC::DrawLines( int n, wxPoint points[], long xoffset, long yoffset )
+void wxWindowDC::DrawLines( int n, wxPoint points[], long xoffset, long yoffset )
{
if (!Ok()) return;
};
};
-void wxPaintDC::DrawLines( wxList *points, long xoffset, long yoffset )
+void wxWindowDC::DrawLines( wxList *points, long xoffset, long yoffset )
{
if (!Ok()) return;
};
};
-void wxPaintDC::DrawPolygon( int WXUNUSED(n), wxPoint WXUNUSED(points)[],
+void wxWindowDC::DrawPolygon( int WXUNUSED(n), wxPoint WXUNUSED(points)[],
long WXUNUSED(xoffset), long WXUNUSED(yoffset), int WXUNUSED(fillStyle) )
{
if (!Ok()) return;
};
-void wxPaintDC::DrawPolygon( wxList *WXUNUSED(lines), long WXUNUSED(xoffset),
+void wxWindowDC::DrawPolygon( wxList *WXUNUSED(lines), long WXUNUSED(xoffset),
long WXUNUSED(yoffset), int WXUNUSED(fillStyle) )
{
if (!Ok()) return;
};
-void wxPaintDC::DrawRectangle( long x, long y, long width, long height )
+void wxWindowDC::DrawRectangle( long x, long y, long width, long height )
{
if (!Ok()) return;
if (m_pen.GetStyle() != wxTRANSPARENT) {};
};
-void wxPaintDC::DrawRoundedRectangle( long x, long y, long width, long height, double radius )
+void wxWindowDC::DrawRoundedRectangle( long x, long y, long width, long height, double radius )
{
if (!Ok()) return;
};
};
-void wxPaintDC::DrawEllipse( long x, long y, long width, long height )
+void wxWindowDC::DrawEllipse( long x, long y, long width, long height )
{
if (!Ok()) return;
if (m_pen.GetStyle() != wxTRANSPARENT) {};
};
-bool wxPaintDC::CanDrawBitmap(void) const
+bool wxWindowDC::CanDrawBitmap(void) const
{
return TRUE;
};
-void wxPaintDC::DrawIcon( const wxIcon &icon, long x, long y, bool useMask )
+void wxWindowDC::DrawIcon( const wxIcon &icon, long x, long y, bool useMask )
{
if (!Ok()) return;
};
-bool wxPaintDC::Blit( long xdest, long ydest, long width, long height,
+bool wxWindowDC::Blit( long xdest, long ydest, long width, long height,
wxDC *source, long xsrc, long ysrc, int WXUNUSED(logical_func), bool WXUNUSED(useMask) )
{
if (!Ok()) return FALSE;
return TRUE;
};
-void wxPaintDC::DrawText( const wxString &text, long x, long y, bool
+void wxWindowDC::DrawText( const wxString &text, long x, long y, bool
WXUNUSED(use16) )
{
if (!Ok()) return;
-bool wxPaintDC::CanGetTextExtent(void) const
+bool wxWindowDC::CanGetTextExtent(void) const
{
return TRUE;
};
-void wxPaintDC::GetTextExtent( const wxString &string, long *width, long *height,
+void wxWindowDC::GetTextExtent( const wxString &string, long *width, long *height,
long *WXUNUSED(descent), long *WXUNUSED(externalLeading),
wxFont *WXUNUSED(theFont), bool WXUNUSED(use16) )
{
};
-long wxPaintDC::GetCharWidth(void)
+long wxWindowDC::GetCharWidth(void)
{
if (!Ok()) return 0;
return 0;
};
-long wxPaintDC::GetCharHeight(void)
+long wxWindowDC::GetCharHeight(void)
{
if (!Ok()) return 0;
return 0;
};
-void wxPaintDC::Clear(void)
+void wxWindowDC::Clear(void)
{
if (!Ok()) return;
};
-void wxPaintDC::SetFont( const wxFont &font )
+void wxWindowDC::SetFont( const wxFont &font )
{
if (!Ok()) return;
m_font = font;
};
-void wxPaintDC::SetPen( const wxPen &pen )
+void wxWindowDC::SetPen( const wxPen &pen )
{
if (!Ok()) return;
if (!m_pen.Ok()) return;
};
-void wxPaintDC::SetBrush( const wxBrush &brush )
+void wxWindowDC::SetBrush( const wxBrush &brush )
{
if (!Ok()) return;
};
-void wxPaintDC::SetBackground( const wxBrush &brush )
+void wxWindowDC::SetBackground( const wxBrush &brush )
{
if (!Ok()) return;
};
-void wxPaintDC::SetLogicalFunction( int function )
+void wxWindowDC::SetLogicalFunction( int function )
{
if (m_logicalFunction == function) return;
};
-void wxPaintDC::SetTextForeground( const wxColour &col )
+void wxWindowDC::SetTextForeground( const wxColour &col )
{
if (!Ok()) return;
if (!m_textForegroundColour.Ok()) return;
};
-void wxPaintDC::SetTextBackground( const wxColour &col )
+void wxWindowDC::SetTextBackground( const wxColour &col )
{
if (!Ok()) return;
if (!m_textBackgroundColour.Ok()) return;
};
-void wxPaintDC::SetBackgroundMode( int mode )
+void wxWindowDC::SetBackgroundMode( int mode )
{
m_backgroundMode = mode;
}
};
-void wxPaintDC::SetPalette( const wxPalette& WXUNUSED(palette) )
+void wxWindowDC::SetPalette( const wxPalette& WXUNUSED(palette) )
{
};
-void wxPaintDC::SetClippingRegion( long x, long y, long width, long height )
+void wxWindowDC::SetClippingRegion( long x, long y, long width, long height )
{
wxDC::SetClippingRegion( x, y, width, height );
};
-void wxPaintDC::DestroyClippingRegion(void)
+void wxWindowDC::DestroyClippingRegion(void)
{
wxDC::DestroyClippingRegion();
}
}
-void wxPaintDC::DrawSpline( wxList *points )
+void wxWindowDC::DrawSpline( wxList *points )
{
wxPoint *p;
double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;