msStyle |= WS_VSCROLL;
m_windowStyle |= wxTE_PROCESS_ENTER;
}
- else
+ else // !multiline
+ {
+ // there is really no reason to not have this style for single line
+ // text controls
msStyle |= ES_AUTOHSCROLL;
+ }
- if (m_windowStyle & wxHSCROLL)
- msStyle |= (WS_HSCROLL | ES_AUTOHSCROLL);
+ if ( m_windowStyle & wxHSCROLL )
+ msStyle |= WS_HSCROLL | ES_AUTOHSCROLL;
- if (m_windowStyle & wxTE_READONLY)
+ if ( m_windowStyle & wxTE_READONLY )
msStyle |= ES_READONLY;
- if (m_windowStyle & wxTE_PASSWORD) // hidden input
+ if ( m_windowStyle & wxTE_PASSWORD )
msStyle |= ES_PASSWORD;
- if (m_windowStyle & wxTE_AUTO_SCROLL)
- msStyle |= ES_AUTOHSCROLL;
+ if ( m_windowStyle & wxTE_AUTO_SCROLL )
+ msStyle |= ES_AUTOHSCROLL;
+ if ( m_windowStyle & wxTE_NOHIDESEL )
+ msStyle |= ES_NOHIDESEL;
// we always want the characters and the arrows
m_lDlgCode = DLGC_WANTCHARS | DLGC_WANTARROWS;
else
{
msStyle |= ES_AUTOVSCROLL;
+ // Experimental: this seems to help with the scroll problem. See messages from Jekabs Andrushaitis <j.andrusaitis@konts.lv>
+ // wx-dev list, entitled "[wx-dev] wxMSW-EVT_KEY_DOWN and wxMSW-wxTextCtrl" and "[wx-dev] TextCtrl (RichEdit)"
+ // Unfortunately, showing the selection in blue when the control doesn't have
+ // the focus is non-standard behaviour, and we need to find another workaround.
+ //msStyle |= ES_NOHIDESEL ;
m_isRich = TRUE;
int ver = wxRichEditModule::GetLoadedVersion();
SendMessage(hWnd, EM_SETSEL, 0, MAKELPARAM(pos, pos));
#endif // Win32/16
- static const wxChar *nothing = _T("");
- SendMessage(hWnd, EM_REPLACESEL, 0, (LPARAM)nothing);
+#if wxUSE_RICHEDIT
+ if ( !m_isRich)
+#endif
+ {
+ static const wxChar *nothing = _T("");
+ SendMessage(hWnd, EM_REPLACESEL, 0, (LPARAM)nothing);
+ }
}
void wxTextCtrl::SetInsertionPointEnd()