fix wxTextCtrl::operator<<('\n') in Unicode build (should use char overload, not int); corrected mangled documentation of these operators

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53398 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2008-04-28 12:32:32 +00:00
parent 952ff7bc3c
commit 9e50ed28d9
3 changed files with 15 additions and 35 deletions

View File

@ -615,9 +615,10 @@ public:
wxTextCtrl& operator<<(const wxString& s);
wxTextCtrl& operator<<(int i);
wxTextCtrl& operator<<(long i);
wxTextCtrl& operator<<(float f);
wxTextCtrl& operator<<(float f) { return *this << double(f); }
wxTextCtrl& operator<<(double d);
wxTextCtrl& operator<<(const wxChar c);
wxTextCtrl& operator<<(char c) { return *this << wxString(c); }
wxTextCtrl& operator<<(wchar_t c) { return *this << wxString(c); }
// insert the character which would have resulted from this key event,
// return true if anything has been inserted

View File

@ -1319,14 +1319,15 @@ public:
//@{
/**
Operator definitions for appending to a text control, for example:
Operator definitions for appending to a text control.
*/
wxTextCtrl operator(const wxString& s);
wxTextCtrl operator(int i);
wxTextCtrl operator(long i);
wxTextCtrl operator(float f);
wxTextCtrl operator(double d);
wxTextCtrl operator(char c);
wxTextCtrl& operator<<(const wxString& s);
wxTextCtrl& operator<<(int i);
wxTextCtrl& operator<<(long i);
wxTextCtrl& operator<<(float f);
wxTextCtrl& operator<<(double d);
wxTextCtrl& operator<<(char c);
wxTextCtrl& operator<<(wchar_t c);
//@}
};

View File

@ -772,41 +772,19 @@ wxTextCtrl& wxTextCtrlBase::operator<<(const wxString& s)
return *TEXTCTRL(this);
}
wxTextCtrl& wxTextCtrlBase::operator<<(float f)
{
wxString str;
str.Printf(wxT("%.2f"), f);
AppendText(str);
return *TEXTCTRL(this);
}
wxTextCtrl& wxTextCtrlBase::operator<<(double d)
{
wxString str;
str.Printf(wxT("%.2f"), d);
AppendText(str);
return *TEXTCTRL(this);
return *this << wxString::Format("%.2f", d);
}
wxTextCtrl& wxTextCtrlBase::operator<<(int i)
{
wxString str;
str.Printf(wxT("%d"), i);
AppendText(str);
return *TEXTCTRL(this);
return *this << wxString::Format("%d", i);
}
wxTextCtrl& wxTextCtrlBase::operator<<(long i)
wxTextCtrl& wxTextCtrlBase::operator<<(long l)
{
wxString str;
str.Printf(wxT("%ld"), i);
AppendText(str);
return *TEXTCTRL(this);
}
wxTextCtrl& wxTextCtrlBase::operator<<(const wxChar c)
{
return operator<<(wxString(c));
return *this << wxString::Format("%ld", l);
}
// ----------------------------------------------------------------------------