From: Vadim Zeitlin Date: Tue, 5 Mar 2002 00:52:01 +0000 (+0000) Subject: fix for wxScreenDC::GetSize X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/41ff8313b82afe2e874a17fd3db9d4a86342f070 fix for wxScreenDC::GetSize git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14449 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/msw/dcscreen.h b/include/wx/msw/dcscreen.h index f46d636481..3517e78b61 100644 --- a/include/wx/msw/dcscreen.h +++ b/include/wx/msw/dcscreen.h @@ -27,7 +27,10 @@ public: // Compatibility with X's requirements for drawing on top of all windows static bool StartDrawingOnTop(wxWindow* WXUNUSED(window)) { return TRUE; } static bool StartDrawingOnTop(wxRect* WXUNUSED(rect) = NULL) { return TRUE; } - static bool EndDrawingOnTop(void) { return TRUE; } + static bool EndDrawingOnTop() { return TRUE; } + +protected: + virtual void DoGetSize(int *width, int *height) const; private: DECLARE_DYNAMIC_CLASS(wxScreenDC) diff --git a/src/msw/dcscreen.cpp b/src/msw/dcscreen.cpp index b1d7d3deae..4a2aa9ed8b 100644 --- a/src/msw/dcscreen.cpp +++ b/src/msw/dcscreen.cpp @@ -29,7 +29,6 @@ #include "wx/dcscreen.h" - IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxWindowDC) // Create a DC representing the whole screen @@ -42,3 +41,10 @@ wxScreenDC::wxScreenDC() ::SetBkMode( GetHdc(), TRANSPARENT ); } +void wxScreenDC::DoGetSize(int *width, int *height) const +{ + // skip wxWindowDC version because it doesn't work without a valid m_canvas + // (which we don't have) + wxDC::DoGetSize(width, height); +} +