From: Vadim Zeitlin Date: Sat, 20 Mar 2004 12:39:04 +0000 (+0000) Subject: added wxSetCCUnicodeFormat() and use it in wxTreeCtrl/wxToolBar; also replaced SendMe... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/9a63feff3a93d9d9dc36f155d3a5c3a36cb922f0 added wxSetCCUnicodeFormat() and use it in wxTreeCtrl/wxToolBar; also replaced SendMessage(LVM_SETUNICODEFORMAT) with a call to it in wxListCtrl git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26280 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/msw/wrapcctl.h b/include/wx/msw/wrapcctl.h index fb26166ee0..188377baca 100644 --- a/include/wx/msw/wrapcctl.h +++ b/include/wx/msw/wrapcctl.h @@ -43,5 +43,17 @@ // define things which might be missing from our commctrl.h #include "wx/msw/missing.h" +// Set Unicode format for a common control +inline void wxSetCCUnicodeFormat(HWND hwnd) +{ + SendMessage(hwnd, CCM_SETUNICODEFORMAT, +#if wxUSE_UNICODE + TRUE +#else + FALSE +#endif + , 0); +} + #endif // _WX_MSW_WRAPCCTL_H_ diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index d0e958ffc3..693df7dc4f 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -353,9 +353,7 @@ bool wxListCtrl::Create(wxWindow *parent, // explicitly say that we want to use Unicode because otherwise we get ANSI // versions of _some_ messages (notably LVN_GETDISPINFOA) in MSLU build -#if wxUSE_UNICODE - ::SendMessage(GetHwnd(), LVM_SETUNICODEFORMAT, TRUE, 0); -#endif + wxSetCCUnicodeFormat(GetHwnd()); // for comctl32.dll v 4.70+ we want to have this attribute because it's // prettier (and also because wxGTK does it like this) diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index d782709dd2..ab987ad5a3 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -240,6 +240,8 @@ bool wxToolBar::Create(wxWindow *parent, if ( !MSWCreateToolbar(pos, size) ) return FALSE; + wxSetCCUnicodeFormat(GetHwnd()); + // set up the colors and fonts SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_MENUBAR)); SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 56ac64cba6..cd18d9d3f3 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -757,6 +757,8 @@ bool wxTreeCtrl::Create(wxWindow *parent, SetSize(pos.x, pos.y, size.x, size.y); + wxSetCCUnicodeFormat(GetHwnd()); + return true; }