X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5b2f31eb30be576374064413b9d0f63a1bf8c110..a7c8e710e944fc12a81a19d06fe415a92e86bb13:/src/msw/textctrl.cpp diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 4ecf1d2019..e9bbcc1ad5 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -357,6 +357,12 @@ void wxTextCtrl::AdoptAttributesFromHWND() WXDWORD wxTextCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const { + // default border for the text controls is the sunken one + if ( (style & wxBORDER_MASK) == wxBORDER_DEFAULT ) + { + style |= wxBORDER_SUNKEN; + } + long msStyle = wxControl::MSWGetStyle(style, exstyle); // default styles @@ -838,6 +844,12 @@ void wxTextCtrl::GetSelection(long* from, long* to) const bool wxTextCtrl::IsEditable() const { + // strangely enough, we may be called before the control is created: our + // own Create() calls MSWGetStyle() which calls AcceptsFocus() which calls + // us + if ( !m_hWnd ) + return TRUE; + long style = ::GetWindowLong(GetHwnd(), GWL_STYLE); return (style & ES_READONLY) == 0;