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
This commit is contained in:
@@ -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 );
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
@@ -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
|
||||
}
|
||||
|
||||
|
@@ -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 );
|
||||
}
|
||||
}
|
||||
|
@@ -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,
|
||||
|
@@ -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 )
|
||||
|
@@ -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 );
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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)),
|
||||
|
@@ -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);
|
||||
|
@@ -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 )
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user