X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5adad46628e545a6d4172ecf3a0cb848934f5cd0..6cc687bfee071b5328f9e48d1708795287006bb7:/src/msw/dcclient.cpp diff --git a/src/msw/dcclient.cpp b/src/msw/dcclient.cpp index 8cef83d45b..720398ea5d 100644 --- a/src/msw/dcclient.cpp +++ b/src/msw/dcclient.cpp @@ -113,6 +113,18 @@ void wxWindowDC::InitDC() // default bg colour is pne of the window SetBackground(wxBrush(m_canvas->GetBackgroundColour(), wxSOLID)); + + // since we are a window dc we need to grab the palette from the window +#if wxUSE_PALETTE + InitializePalette(); +#endif +} + +void wxWindowDC::DoGetSize(int *width, int *height) const +{ + wxCHECK_RET( m_canvas, _T("wxWindowDC without a window?") ); + + m_canvas->GetSize(width, height); } // ---------------------------------------------------------------------------- @@ -160,6 +172,13 @@ wxClientDC::~wxClientDC() { } +void wxClientDC::DoGetSize(int *width, int *height) const +{ + wxCHECK_RET( m_canvas, _T("wxClientDC without a window?") ); + + m_canvas->GetClientSize(width, height); +} + // ---------------------------------------------------------------------------- // wxPaintDC // ---------------------------------------------------------------------------- @@ -237,7 +256,7 @@ wxPaintDC::~wxPaintDC() { ::EndPaint(GetHwndOf(m_canvas), &g_paintStruct); - ms_cache.Remove(index); + ms_cache.RemoveAt(index); // Reduce the number of bogus reports of non-freed memory // at app exit