X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e170515a9b895080d683dc73b2fdc6299eaae2f6..779e28da630ef9fba6441fb0bab01cd538a7e7bb:/src/msw/textctrl.cpp diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index c963a170b3..4f02fbaf85 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -30,6 +30,7 @@ #include "wx/textctrl.h" #include "wx/settings.h" #include "wx/brush.h" + #include "wx/dcclient.h" #include "wx/utils.h" #include "wx/intl.h" #include "wx/log.h" @@ -2054,7 +2055,7 @@ bool wxTextCtrl::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) WXHBRUSH wxTextCtrl::MSWControlColor(WXHDC hDC, WXHWND hWnd) { - if ( !IsEnabled() && !HasFlag(wxTE_MULTILINE) ) + if ( !IsThisEnabled() && !HasFlag(wxTE_MULTILINE) ) return MSWControlColorDisabled(hDC); return wxTextCtrlBase::MSWControlColor(hDC, hWnd); @@ -2396,9 +2397,7 @@ bool wxTextCtrl::SetForegroundColour(const wxColour& colour) if ( IsRich() ) { // change the colour of everything - CHARFORMAT cf; - wxZeroMemory(cf); - cf.cbSize = sizeof(cf); + WinStruct cf; cf.dwMask = CFM_COLOR; cf.crTextColor = wxColourToRGB(colour); ::SendMessage(GetHwnd(), EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&cf); @@ -2743,7 +2742,7 @@ bool wxTextCtrl::GetStyle(long position, wxTextAttr& style) // Convert the height from the units of 1/20th of the point in which // CHARFORMAT stores it to pixel-based units used by LOGFONT. const wxCoord ppi = wxClientDC(this).GetPPI().y; - lf.lfHeight = -MulDiv(cf.yHeight/2, ppi, 72); + lf.lfHeight = -MulDiv(cf.yHeight/20, ppi, 72); lf.lfWidth = 0; lf.lfCharSet = ANSI_CHARSET; // FIXME: how to get correct charset? lf.lfClipPrecision = 0;