Solved bug which was breaking richedit ctrls for non-unicode builds on some compilers.

Fixed some small non-fatal bugs like missing c_str() and the like.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6152 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Guillermo Rodriguez Garcia
2000-02-20 01:03:15 +00:00
parent 6d5ca46c65
commit 5fb2f4ba7e

View File

@@ -175,8 +175,6 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
if (m_windowStyle & wxTE_READONLY) if (m_windowStyle & wxTE_READONLY)
msStyle |= ES_READONLY; msStyle |= ES_READONLY;
if (m_windowStyle & wxHSCROLL)
msStyle |= (WS_HSCROLL | ES_AUTOHSCROLL);
if (m_windowStyle & wxTE_PASSWORD) // hidden input if (m_windowStyle & wxTE_PASSWORD) // hidden input
msStyle |= ES_PASSWORD; msStyle |= ES_PASSWORD;
@@ -237,7 +235,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
#ifndef RICHEDIT_CLASS #ifndef RICHEDIT_CLASS
wxString RICHEDIT_CLASS; wxString RICHEDIT_CLASS;
RICHEDIT_CLASS.Printf(_T("RichEdit%d0"), ver); RICHEDIT_CLASS.Printf(_T("RichEdit%d0"), ver);
#ifdef wxUSE_UNICODE #if wxUSE_UNICODE
RICHEDIT_CLASS += _T('W'); RICHEDIT_CLASS += _T('W');
#else // ANSI #else // ANSI
RICHEDIT_CLASS += _T('A'); RICHEDIT_CLASS += _T('A');
@@ -264,7 +262,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
// might be -1 in which case we should use the default values (and // might be -1 in which case we should use the default values (and
// SetSize called below takes care of it) // SetSize called below takes care of it)
m_hWnd = (WXHWND)::CreateWindowEx(exStyle, m_hWnd = (WXHWND)::CreateWindowEx(exStyle,
windowClass, windowClass.c_str(),
NULL, NULL,
msStyle, msStyle,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -374,9 +372,9 @@ wxString wxTextCtrl::GetValue() const
#if wxUSE_RICHEDIT #if wxUSE_RICHEDIT
if ( m_isRich ) if ( m_isRich )
{ {
wxString str;
int len = GetWindowTextLength(GetHwnd()) + 1; int len = GetWindowTextLength(GetHwnd()) + 1;
wxString str;
wxChar *p = str.GetWriteBuf(len); wxChar *p = str.GetWriteBuf(len);
TEXTRANGE textRange; TEXTRANGE textRange;
@@ -418,8 +416,8 @@ void wxTextCtrl::SetValue(const wxString& value)
if ( (value.length() > 0x400) || (value != GetValue()) ) if ( (value.length() > 0x400) || (value != GetValue()) )
{ {
wxString valueDos = wxTextFile::Translate(value, wxTextFileType_Dos); wxString valueDos = wxTextFile::Translate(value, wxTextFileType_Dos);
SetWindowText(GetHwnd(), valueDos); SetWindowText(GetHwnd(), valueDos.c_str());
AdjustSpaceLimit(); AdjustSpaceLimit();
} }
@@ -857,11 +855,13 @@ bool wxTextCtrl::CanRedo() const
// implemenation details // implemenation details
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
/*
void wxTextCtrl::Command(wxCommandEvent & event) void wxTextCtrl::Command(wxCommandEvent & event)
{ {
SetValue(event.GetString()); SetValue(event.GetString());
ProcessCommand (event); ProcessCommand (event);
} }
*/
void wxTextCtrl::OnDropFiles(wxDropFilesEvent& event) void wxTextCtrl::OnDropFiles(wxDropFilesEvent& event)
{ {
@@ -927,11 +927,9 @@ bool wxTextCtrl::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
case EN_CHANGE: case EN_CHANGE:
{ {
wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, m_windowId); wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, m_windowId);
wxString val(GetValue());
if ( !val.IsNull() )
event.m_commandString = WXSTRINGCAST val;
event.SetEventObject( this ); event.SetEventObject( this );
ProcessCommand(event); event.SetString( GetValue() );
ProcessCommand( event );
} }
break; break;