From 9b135950383287e57c465f19879238fb7150a2fa Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 19 Mar 2007 00:59:08 +0000 Subject: [PATCH] fix compilation after c_str() changes, mainly by replacing c_str() with mb_str() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44911 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/motif/clipbrd.cpp | 6 +++--- src/motif/combobox_native.cpp | 2 +- src/motif/cursor.cpp | 2 +- src/motif/dcclient.cpp | 4 ++-- src/motif/dialog.cpp | 8 ++++---- src/motif/filedlg.cpp | 6 +++--- src/motif/font.cpp | 8 ++++---- src/motif/frame.cpp | 4 ++-- src/motif/listbox.cpp | 2 +- src/motif/radiobox.cpp | 4 ++-- src/motif/stattext.cpp | 2 +- src/motif/textctrl.cpp | 16 ++++++++-------- src/motif/utils.cpp | 2 +- src/motif/window.cpp | 2 +- 14 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/motif/clipbrd.cpp b/src/motif/clipbrd.cpp index 6a54882d93..d52fca5d5f 100644 --- a/src/motif/clipbrd.cpp +++ b/src/motif/clipbrd.cpp @@ -312,7 +312,7 @@ bool wxClipboard::AddData( wxDataObject *data ) wxString id = dfarr[i].GetId(); while( ( retval = XmClipboardCopy( xdisplay, xwindow, itemId, - wxConstCast(id.c_str(), char), + wxConstCast(id.mb_str(), char), NULL, size, i, &data_id ) ) == XmClipboardLocked ); @@ -461,7 +461,7 @@ bool wxClipboard::GetData( wxDataObject& data ) wxString id = chosenFormat.GetId(); while( ( retval = XmClipboardInquireLength( xdisplay, xwindow, - wxConstCast(id.c_str(), char), + wxConstCast(id.mb_str(), char), &length ) ) == XmClipboardLocked ); if( retval != XmClipboardSuccess ) @@ -470,7 +470,7 @@ bool wxClipboard::GetData( wxDataObject& data ) wxCharBuffer buf(length); while( ( retval = XmClipboardRetrieve( xdisplay, xwindow, - wxConstCast(id.c_str(), char), + wxConstCast(id.mb_str(), char), (XtPointer)buf.data(), length, &dummy1, &dummy2 ) ) == XmClipboardLocked ); diff --git a/src/motif/combobox_native.cpp b/src/motif/combobox_native.cpp index 107df40f0b..1b2305ca82 100644 --- a/src/motif/combobox_native.cpp +++ b/src/motif/combobox_native.cpp @@ -345,7 +345,7 @@ wxTextPos wxComboBox::GetLastPosition() const void wxComboBox::Replace(long from, long to, const wxString& value) { XmTextReplace( GetXmText(this), (XmTextPosition)from, (XmTextPosition)to, - wxConstCast(value.c_str(), char) ); + wxConstCast(value.mb_str(), char) ); } void wxComboBox::Remove(long from, long to) diff --git a/src/motif/cursor.cpp b/src/motif/cursor.cpp index 6bfc0ab441..0e70f27bcf 100644 --- a/src/motif/cursor.cpp +++ b/src/motif/cursor.cpp @@ -259,7 +259,7 @@ wxCursor::wxCursor(const wxString& name, long flags, int hotSpotX, int hotSpotY) int screen_num = DefaultScreen (dpy); int value = XReadBitmapFile (dpy, RootWindow (dpy, screen_num), - wxConstCast(name.c_str(), char), + wxConstCast(name.mb_str(), char), &w, &h, &pixmap, &hotX, &hotY); if (value == BitmapSuccess) diff --git a/src/motif/dcclient.cpp b/src/motif/dcclient.cpp index 8620c5ef70..f6cdfe5801 100644 --- a/src/motif/dcclient.cpp +++ b/src/motif/dcclient.cpp @@ -1126,11 +1126,11 @@ void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y ) #if wxMOTIF_NEW_FONT_HANDLING XmbDrawString((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(), fset, (GC) m_gcBacking, XLOG2DEV_2 (x), YLOG2DEV_2 (y) + ascent, - wxConstCast(text.c_str(), char), slen); + wxConstCast(text.mb_str(), char), slen); #else XDrawString((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(), (GC) m_gcBacking, XLOG2DEV_2 (x), YLOG2DEV_2 (y) + ascent, - wxConstCast(text.c_str(), char), slen); + wxConstCast(text.mb_str(), char), slen); #endif } diff --git a/src/motif/dialog.cpp b/src/motif/dialog.cpp index dceb887490..9eceb43581 100644 --- a/src/motif/dialog.cpp +++ b/src/motif/dialog.cpp @@ -162,7 +162,7 @@ bool wxDialog::XmDoCreateTLW(wxWindow* parent, XtSetArg (args[1], XmNautoUnmanage, False); Widget dialogShell = XmCreateBulletinBoardDialog( parentWidget, - wxConstCast(name.c_str(), char), + wxConstCast(name.mb_str(), char), args, 2); m_mainWidget = (WXWidget) dialogShell; @@ -243,9 +243,9 @@ void wxDialog::SetTitle(const wxString& title) { wxXmString str( title ); XtVaSetValues( (Widget)m_mainWidget, - XmNtitle, title.c_str(), - XmNdialogTitle, str(), // Roberto Cocchi - XmNiconName, title.c_str(), + XmNtitle, title.mb_str(), + XmNdialogTitle, str(), + XmNiconName, title.mb_str(), NULL ); } } diff --git a/src/motif/filedlg.cpp b/src/motif/filedlg.cpp index 9e481db223..1684607914 100644 --- a/src/motif/filedlg.cpp +++ b/src/motif/filedlg.cpp @@ -234,7 +234,7 @@ int wxFileDialog::ShowModal() if (!m_message.IsNull()) XtVaSetValues(shell, - XmNtitle, wxConstCast(m_message.c_str(), char), + XmNtitle, wxConstCast(m_message.mb_str(), char), NULL); if (!m_wildCard.empty()) @@ -247,7 +247,7 @@ int wxFileDialog::ShowModal() else filter = wildCard; - XmTextSetString(filterWidget, wxConstCast(filter.c_str(), char)); + XmTextSetString(filterWidget, wxConstCast(filter.mb_str(), char)); XmFileSelectionDoSearch(fileSel, NULL); } @@ -276,7 +276,7 @@ int wxFileDialog::ShowModal() if (!entirePath.empty()) { XmTextSetString(selectionWidget, - wxConstCast(entirePath.c_str(), char)); + wxConstCast(entirePath.mb_str(), char)); } XtAddCallback(fileSel, XmNcancelCallback, diff --git a/src/motif/font.cpp b/src/motif/font.cpp index a9c0b0ac48..db64aa47da 100644 --- a/src/motif/font.cpp +++ b/src/motif/font.cpp @@ -280,7 +280,7 @@ bool wxFont::Create(const wxString& fontname, wxFontEncoding enc) tmp = tn.GetNextToken(); // pointsize if (tmp != wxT("*")) { - long num = wxStrtol (tmp.c_str(), (wxChar **) NULL, 10); + long num = wxStrtol (tmp.mb_str(), (wxChar **) NULL, 10); M_FONTDATA->m_pointSize = (int)(num / 10); } @@ -550,7 +550,7 @@ wxXFont* wxFont::GetInternalFont(double scale, WXDisplay* display) const int count = 0; #if wxMOTIF_NEW_FONT_HANDLING - wxChar* fontSpec = wxStrdup( xFontSpec.c_str() ); + wxChar* fontSpec = wxStrdup( xFontSpec.mb_str() ); XtSetArg( args[count], XmNfontName, fontSpec ); ++count; XtSetArg( args[count], XmNfontType, XmFONT_IS_FONTSET ); ++count; #else @@ -659,7 +659,7 @@ void wxGetTextExtent(WXDisplay* display, const wxFont& font, double scale, XRectangle ink, logical; WXFontSet fset = font.GetFontSet(scale, display); - XmbTextExtents( (XFontSet)fset, str.c_str(), str.length(), &ink, &logical); + XmbTextExtents( (XFontSet)fset, str.mb_str(), str.length(), &ink, &logical); if( width ) *width = logical.width; if( height ) *height = logical.height; @@ -679,7 +679,7 @@ void wxGetTextExtent(WXDisplay* display, const wxFont& font, XCharStruct overall; int slen = str.length(); - XTextExtents((XFontStruct*) pFontStruct, (char*) str.c_str(), slen, + XTextExtents((XFontStruct*) pFontStruct, (char*) str.mb_str(), slen, &direction, &ascent2, &descent2, &overall); if ( width ) diff --git a/src/motif/frame.cpp b/src/motif/frame.cpp index e734afa910..8de4757af2 100644 --- a/src/motif/frame.cpp +++ b/src/motif/frame.cpp @@ -454,8 +454,8 @@ void wxFrame::SetTitle(const wxString& title) if( !title.empty() ) XtVaSetValues( (Widget)m_frameShell, - XmNtitle, title.c_str(), - XmNiconName, title.c_str(), + XmNtitle, title.mb_str(), + XmNiconName, title.mb_str(), NULL ); } diff --git a/src/motif/listbox.cpp b/src/motif/listbox.cpp index 07670065d8..fc4ea95718 100644 --- a/src/motif/listbox.cpp +++ b/src/motif/listbox.cpp @@ -120,7 +120,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id, Widget listWidget = XmCreateScrolledList(parentWidget, - wxConstCast(name.c_str(), char), args, count); + wxConstCast(name.mb_str(), char), args, count); m_mainWidget = (WXWidget) listWidget; diff --git a/src/motif/radiobox.cpp b/src/motif/radiobox.cpp index fa7aba0fa4..fa0f0dbfca 100644 --- a/src/motif/radiobox.cpp +++ b/src/motif/radiobox.cpp @@ -82,7 +82,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title, { wxXmString text(label1); m_labelWidget = (WXWidget) - XtVaCreateManagedWidget( label1.c_str(), + XtVaCreateManagedWidget( label1.mb_str(), #if wxUSE_GADGETS style & wxCOLOURED ? xmLabelWidgetClass : xmLabelGadgetClass, @@ -123,7 +123,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title, wxString str(GetLabelText(choices[i])); m_radioButtonLabels.push_back(str); Widget radioItem = XtVaCreateManagedWidget ( - wxConstCast(str.c_str(), char), + wxConstCast(str.mb_str(), char), #if wxUSE_GADGETS xmToggleButtonGadgetClass, radioBoxWidget, #else diff --git a/src/motif/stattext.cpp b/src/motif/stattext.cpp index e109caae2d..38b95a5538 100644 --- a/src/motif/stattext.cpp +++ b/src/motif/stattext.cpp @@ -50,7 +50,7 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id, wxXmString text( GetLabelText( label ) ); m_labelWidget = - XtVaCreateManagedWidget (wxConstCast(name.c_str(), char), + XtVaCreateManagedWidget (wxConstCast(name.mb_str(), char), xmLabelWidgetClass, borderWidget ? borderWidget : parentWidget, wxFont::GetFontTag(), m_font.GetFontTypeC(XtDisplay(parentWidget)), diff --git a/src/motif/textctrl.cpp b/src/motif/textctrl.cpp index 8213b6b8cd..20d462eabe 100644 --- a/src/motif/textctrl.cpp +++ b/src/motif/textctrl.cpp @@ -138,14 +138,14 @@ 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.mb_str()); ++count; XtSetArg (args[count], XmNeditable, style & wxTE_READONLY ? False : True); ++count; XtSetArg (args[count], XmNeditMode, XmMULTI_LINE_EDIT ); ++count; m_mainWidget = (WXWidget) XmCreateScrolledText(parentWidget, - wxConstCast(name.c_str(), char), + wxConstCast(name.mb_str(), char), args, count); XtManageChild ((Widget) m_mainWidget); @@ -154,11 +154,11 @@ bool wxTextCtrl::Create(wxWindow *parent, { m_mainWidget = (WXWidget)XtVaCreateManagedWidget ( - wxConstCast(name.c_str(), char), + wxConstCast(name.mb_str(), char), xmTextWidgetClass, parentWidget, wxFont::GetFontTag(), m_font.GetFontType( XtDisplay(parentWidget) ), - XmNvalue, value.c_str(), + XmNvalue, value.mb_str(), XmNeditable, (style & wxTE_READONLY) ? False : True, NULL @@ -244,7 +244,7 @@ void wxTextCtrl::DoSetValue(const wxString& text, int flags) { m_inSetValue = true; - XmTextSetString ((Widget) m_mainWidget, wxConstCast(text.c_str(), char)); + XmTextSetString ((Widget) m_mainWidget, wxConstCast(text.mb_str(), char)); XtVaSetValues ((Widget) m_mainWidget, XmNcursorPosition, text.length(), NULL); @@ -365,7 +365,7 @@ wxTextPos wxTextCtrl::GetLastPosition() const void wxTextCtrl::Replace(long from, long to, const wxString& value) { XmTextReplace ((Widget) m_mainWidget, (XmTextPosition) from, (XmTextPosition) to, - wxConstCast(value.c_str(), char)); + wxConstCast(value.mb_str(), char)); } void wxTextCtrl::Remove(long from, long to) @@ -388,7 +388,7 @@ void wxTextCtrl::WriteText(const wxString& text) { long textPosition = GetInsertionPoint() + text.length(); XmTextInsert ((Widget) m_mainWidget, GetInsertionPoint(), - wxConstCast(text.c_str(), char)); + wxConstCast(text.mb_str(), char)); XtVaSetValues ((Widget) m_mainWidget, XmNcursorPosition, textPosition, NULL); SetInsertionPoint(textPosition); XmTextShowPosition ((Widget) m_mainWidget, textPosition); @@ -399,7 +399,7 @@ void wxTextCtrl::AppendText(const wxString& text) { wxTextPos textPosition = GetLastPosition() + text.length(); XmTextInsert ((Widget) m_mainWidget, GetLastPosition(), - wxConstCast(text.c_str(), char)); + wxConstCast(text.mb_str(), char)); XtVaSetValues ((Widget) m_mainWidget, XmNcursorPosition, textPosition, NULL); SetInsertionPoint(textPosition); XmTextShowPosition ((Widget) m_mainWidget, textPosition); diff --git a/src/motif/utils.cpp b/src/motif/utils.cpp index c3b452d42b..ed12f87e22 100644 --- a/src/motif/utils.cpp +++ b/src/motif/utils.cpp @@ -949,7 +949,7 @@ wxString wxXmStringToString( const XmString& xmString ) XmString wxStringToXmString( const wxString& str ) { - return XmStringCreateLtoR((char *)str.c_str(), XmSTRING_DEFAULT_CHARSET); + return wxStringToXmString(str.mb_str()); } XmString wxStringToXmString( const char* str ) diff --git a/src/motif/window.cpp b/src/motif/window.cpp index 5f84cf1442..1f7b234e60 100644 --- a/src/motif/window.cpp +++ b/src/motif/window.cpp @@ -636,7 +636,7 @@ void wxWindow::Lower() void wxWindow::SetLabel(const wxString& label) { - XtVaSetValues((Widget)GetMainWidget(), XmNtitle, label.c_str(), NULL); + XtVaSetValues((Widget)GetMainWidget(), XmNtitle, label.mb_str(), NULL); } wxString wxWindow::GetLabel() const -- 2.47.2