From 5c9d9745fef51025196de74cc7092b08941a5d7f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 31 Oct 2006 00:59:06 +0000 Subject: [PATCH] partly successful (i.e. previously it didn't work at all and spewed Pango warnings and now it just doesn't work) attempts to fix drawing text on wxMemoryDC in Unicode build git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42802 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/x11/dcclient.h | 4 +++- src/x11/dcclient.cpp | 16 ++++------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/include/wx/x11/dcclient.h b/include/wx/x11/dcclient.h index 7fa64da873..0d9ffbcb6b 100644 --- a/include/wx/x11/dcclient.h +++ b/include/wx/x11/dcclient.h @@ -32,7 +32,7 @@ class WXDLLIMPEXP_CORE wxClientDC; class WXDLLIMPEXP_CORE wxWindowDC : public wxDC { public: - wxWindowDC(); + wxWindowDC() { Init(); } wxWindowDC( wxWindow *win ); virtual ~wxWindowDC(); @@ -118,6 +118,8 @@ protected: wxCoord *externalLeading = NULL, wxFont *theFont = NULL) const; + void Init(); + WXDisplay *m_display; WXWindow m_window; WXGC m_penGC; diff --git a/src/x11/dcclient.cpp b/src/x11/dcclient.cpp index c799f1fbed..d5832711b8 100644 --- a/src/x11/dcclient.cpp +++ b/src/x11/dcclient.cpp @@ -165,7 +165,7 @@ static void wxFreePoolGC( GC gc ) IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC) -wxWindowDC::wxWindowDC() +void wxWindowDC::Init() { m_display = (WXDisplay *) NULL; m_penGC = (WXGC *) NULL; @@ -178,7 +178,7 @@ wxWindowDC::wxWindowDC() m_owner = (wxWindow *)NULL; #if wxUSE_UNICODE - m_context = (PangoContext *)NULL; + m_context = wxTheApp->GetPangoContext(); m_fontdesc = (PangoFontDescription *)NULL; #endif } @@ -187,15 +187,8 @@ wxWindowDC::wxWindowDC( wxWindow *window ) { wxASSERT_MSG( window, wxT("DC needs a window") ); - m_display = (WXDisplay *) NULL; - m_penGC = (WXGC *) NULL; - m_brushGC = (WXGC *) NULL; - m_textGC = (WXGC *) NULL; - m_bgGC = (WXGC *) NULL; - m_cmap = (WXColormap *) NULL; - m_owner = (wxWindow *)NULL; - m_isMemDC = false; - m_isScreenDC = false; + Init(); + m_font = window->GetFont(); m_window = (WXWindow*) window->GetMainWindow(); @@ -212,7 +205,6 @@ wxWindowDC::wxWindowDC( wxWindow *window ) m_display = (WXDisplay *) wxGlobalDisplay(); #if wxUSE_UNICODE - m_context = wxTheApp->GetPangoContext(); m_fontdesc = window->GetFont().GetNativeFontInfo()->description; #endif -- 2.45.2