X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c49245f8baabd69afd7302c43474d3bdd247fb89..7b9da2077d0975db6c965a85c91d5aca671ab5e3:/src/msw/textctrl.cpp?ds=inline diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 3ba5f18f0e..fc7e926e8c 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -57,7 +57,7 @@ # include #endif -#if wxUSE_RICHEDIT && !defined(__GNUWIN32__) +#if wxUSE_RICHEDIT && (!defined(__GNUWIN32__) || defined(wxUSE_NORLANDER_HEADERS)) #include #endif @@ -112,10 +112,11 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, const wxString& name) { // base initialization - if ( !CreateBase(parent, id, pos, size, style, name) ) + if ( !CreateBase(parent, id, pos, size, style, validator, name) ) return FALSE; - SetValidator(validator); + // Validator was set in CreateBase + //SetValidator(validator); if ( parent ) parent->AddChild(this); @@ -128,15 +129,20 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, if ( m_windowStyle & wxTE_MULTILINE ) { wxASSERT_MSG( !(m_windowStyle & wxTE_PROCESS_ENTER), - _T("wxTE_PROCESS_ENTER style is ignored for multiline " + wxT("wxTE_PROCESS_ENTER style is ignored for multiline " "text controls (they always process it)") ); - msStyle |= ES_MULTILINE | ES_WANTRETURN | WS_VSCROLL; + msStyle |= ES_MULTILINE | ES_WANTRETURN; + if ((m_windowStyle & wxTE_NO_VSCROLL) == 0) + msStyle |= WS_VSCROLL; m_windowStyle |= wxTE_PROCESS_ENTER; } else msStyle |= ES_AUTOHSCROLL; + if (m_windowStyle & wxHSCROLL) + msStyle |= (WS_HSCROLL | ES_AUTOHSCROLL); + if (m_windowStyle & wxTE_READONLY) msStyle |= ES_READONLY; @@ -161,14 +167,14 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, m_lDlgCode |= DLGC_WANTTAB; // do create the control - either an EDIT or RICHEDIT - const wxChar *windowClass = _T("EDIT"); + const wxChar *windowClass = wxT("EDIT"); #if wxUSE_RICHEDIT if ( m_windowStyle & wxTE_RICH ) { msStyle |= ES_AUTOVSCROLL; m_isRich = TRUE; - windowClass = _T("RICHEDIT"); + windowClass = wxT("RICHEDIT"); } else m_isRich = FALSE; @@ -195,7 +201,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, wxGetInstance(), NULL); - wxCHECK_MSG( m_hWnd, FALSE, _T("Failed to create text ctrl") ); + wxCHECK_MSG( m_hWnd, FALSE, wxT("Failed to create text ctrl") ); #if wxUSE_CTL3D if ( want3D ) @@ -254,7 +260,7 @@ void wxTextCtrl::AdoptAttributesFromHWND() GetClassName(hWnd, buf, WXSIZEOF(buf)); - if ( wxStricmp(buf, _T("EDIT")) == 0 ) + if ( wxStricmp(buf, wxT("EDIT")) == 0 ) m_isRich = FALSE; else m_isRich = TRUE; @@ -290,9 +296,12 @@ void wxTextCtrl::SetValue(const wxString& value) { wxString valueDos = wxTextFile::Translate(value, wxTextFileType_Dos); - SetWindowText(GetHwnd(), valueDos); + if ( valueDos != GetValue() ) + { + SetWindowText(GetHwnd(), valueDos); - AdjustSpaceLimit(); + AdjustSpaceLimit(); + } } void wxTextCtrl::WriteText(const wxString& value) @@ -312,7 +321,7 @@ void wxTextCtrl::AppendText(const wxString& text) void wxTextCtrl::Clear() { - SetWindowText(GetHwnd(), _T("")); + SetWindowText(GetHwnd(), wxT("")); } // ----------------------------------------------------------------------------