X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/996994c7143b7a487f3db7a53780097dc5cf2ddd..88c139da4639cd25e4ad1298062e1e8b19ee29f1:/src/motif/textctrl.cpp diff --git a/src/motif/textctrl.cpp b/src/motif/textctrl.cpp index f3c688fd4c..ef011a5056 100644 --- a/src/motif/textctrl.cpp +++ b/src/motif/textctrl.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: textctrl.cpp +// Name: src/motif/textctrl.cpp // Purpose: wxTextCtrl // Author: Julian Smart // Modified by: @@ -17,10 +17,6 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "textctrl.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -140,7 +136,7 @@ bool wxTextCtrl::Create(wxWindow *parent, XtSetArg (args[count], (String) wxFont::GetFontTag(), m_font.GetFontType( XtDisplay(parentWidget) ) ); ++count; XtSetArg (args[count], XmNwordWrap, wantWordWrap); ++count; - XtSetArg (args[count], XmNvalue, value.c_str()); ++count; + XtSetArg (args[count], XmNvalue, value.c_str()); ++count; XtSetArg (args[count], XmNeditable, style & wxTE_READONLY ? False : True); ++count; XtSetArg (args[count], XmNeditMode, XmMULTI_LINE_EDIT ); ++count; @@ -253,7 +249,7 @@ void wxTextCtrl::SetValue(const wxString& text) SetInsertionPoint(text.length()); XmTextShowPosition ((Widget) m_mainWidget, text.length()); - m_modified = TRUE; + m_modified = true; m_inSetValue = false; } @@ -407,7 +403,7 @@ void wxTextCtrl::AppendText(const wxString& text) void wxTextCtrl::Clear() { - XmTextSetString ((Widget) m_mainWidget, ""); + XmTextSetString ((Widget) m_mainWidget, wxMOTIF_STR("")); m_modified = false; } @@ -502,7 +498,7 @@ wxString wxTextCtrl::GetLineText(long lineNo) const if (s) { - wxString buf(""); + wxString buf; long i; int currentLine = 0; for (i = 0; currentLine != lineNo && s[i]; i++ ) @@ -553,7 +549,7 @@ void wxTextCtrl::OnChar(wxKeyEvent& event) textStruct->doit = True; if (isascii(event.m_keyCode) && (textStruct->text->length == 1)) { - textStruct->text->ptr[0] = ((event.m_keyCode == WXK_RETURN) ? 10 : event.m_keyCode); + textStruct->text->ptr[0] = (char)((event.m_keyCode == WXK_RETURN) ? 10 : event.m_keyCode); } } } @@ -661,12 +657,13 @@ wxSize wxDoGetSingleTextCtrlBestSize( Widget textWidget, NULL ); if( !value ) - value = "|"; + value = wxMOTIF_STR("|"); int x, y; window->GetTextExtent( value, &x, &y ); - if( x < 100 ) x = 100; + if( x < 100 ) + x = 100; return wxSize( x + 2 * xmargin + 2 * highlight + 2 * shadow, // MBN: +2 necessary: Lesstif bug or mine?