+//-----------------------------------------------------------------------------
+// wxClientDC
+//-----------------------------------------------------------------------------
+
+IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxWindowDC)
+
+wxClientDC::wxClientDC( wxWindow *window )
+ : wxWindowDC( window )
+{
+ wxCHECK_RET( window, _T("NULL window in wxClientDC::wxClientDC") );
+
+ m_window = (WXWindow*) window->GetClientAreaWindow();
+
+ // Adjust the client area when the wxWindow is not using 2 X windows.
+ if (m_window == (WXWindow*) window->GetMainWindow())
+ {
+ wxPoint ptOrigin = window->GetClientAreaOrigin();
+ SetDeviceOrigin(ptOrigin.x, ptOrigin.y);
+ wxSize size = window->GetClientSize();
+ SetClippingRegion(wxPoint(0, 0), size);
+ }
+}
+
+void wxClientDC::DoGetSize(int *width, int *height) const
+{
+ wxCHECK_RET( m_owner, _T("GetSize() doesn't work without window") );
+
+ m_owner->GetClientSize( width, height );
+}
+