Fix setting the fonts for wxMSW wxTextCtrl with wxTE_RICH(2) style.

Using WM_SETFONT seemed to work with rich edit controls but in fact it
doesn't, it only changes the font used by the control initially apparently but
it can be reset later.

Use EM_SETCHARFORMAT which is more reliable.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64394 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-05-25 21:15:24 +00:00
parent b8ea299a7e
commit 81fb185e4f
2 changed files with 23 additions and 2 deletions

View File

@@ -125,10 +125,11 @@ public:
int GetRichVersion() const { return m_verRichEdit; }
bool IsRich() const { return m_verRichEdit != 0; }
// rich edit controls are not compatible with normal ones and wem ust set
// the colours for them otherwise
// rich edit controls are not compatible with normal ones and we must set
// the colours and font for them otherwise
virtual bool SetBackgroundColour(const wxColour& colour);
virtual bool SetForegroundColour(const wxColour& colour);
virtual bool SetFont(const wxFont& font);
#else
bool IsRich() const { return false; }
#endif // wxUSE_RICHEDIT