X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/eedc82f4e96c7f8f0b24addbfd6b4429c9587631..166bcebb8e87aefb42de52d22d567a8fa316928d:/src/msw/textctrl.cpp diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index c4c015a3df..b0d7135cc0 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -245,12 +245,9 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, #endif // base initialization - if ( !CreateBase(parent, id, pos, size, style, validator, name) ) + if ( !CreateControl(parent, id, pos, size, style, validator, name) ) return FALSE; - if ( parent ) - parent->AddChild(this); - // translate wxWin style flags to MSW ones WXDWORD msStyle = MSWGetCreateWindowFlags(); @@ -461,7 +458,12 @@ WXDWORD wxTextCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const if ( style & wxTE_DONTWRAP ) { // automatically scroll the control horizontally as necessary - msStyle |= WS_HSCROLL; + // + // NB: ES_AUTOHSCROLL is needed for richedit controls or they don't + // show horz scrollbar at all, even in spite of WS_HSCROLL, and as + // it doesn't seem to do any harm for plain edit controls, add it + // always + msStyle |= WS_HSCROLL | ES_AUTOHSCROLL; } if ( style & wxTE_READONLY ) @@ -1927,7 +1929,7 @@ bool wxTextCtrl::AcceptsFocus() const wxSize wxTextCtrl::DoGetBestSize() const { int cx, cy; - wxGetCharSize(GetHWND(), &cx, &cy, &GetFont()); + wxGetCharSize(GetHWND(), &cx, &cy, GetFont()); int wText = DEFAULT_ITEM_WIDTH;