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();
|
wxString id = dfarr[i].GetId();
|
||||||
|
|
||||||
while( ( retval = XmClipboardCopy( xdisplay, xwindow, itemId,
|
while( ( retval = XmClipboardCopy( xdisplay, xwindow, itemId,
|
||||||
wxConstCast(id.c_str(), char),
|
wxConstCast(id.mb_str(), char),
|
||||||
NULL, size, i, &data_id ) )
|
NULL, size, i, &data_id ) )
|
||||||
== XmClipboardLocked );
|
== XmClipboardLocked );
|
||||||
|
|
||||||
@@ -461,7 +461,7 @@ bool wxClipboard::GetData( wxDataObject& data )
|
|||||||
wxString id = chosenFormat.GetId();
|
wxString id = chosenFormat.GetId();
|
||||||
|
|
||||||
while( ( retval = XmClipboardInquireLength( xdisplay, xwindow,
|
while( ( retval = XmClipboardInquireLength( xdisplay, xwindow,
|
||||||
wxConstCast(id.c_str(), char),
|
wxConstCast(id.mb_str(), char),
|
||||||
&length ) )
|
&length ) )
|
||||||
== XmClipboardLocked );
|
== XmClipboardLocked );
|
||||||
if( retval != XmClipboardSuccess )
|
if( retval != XmClipboardSuccess )
|
||||||
@@ -470,7 +470,7 @@ bool wxClipboard::GetData( wxDataObject& data )
|
|||||||
wxCharBuffer buf(length);
|
wxCharBuffer buf(length);
|
||||||
|
|
||||||
while( ( retval = XmClipboardRetrieve( xdisplay, xwindow,
|
while( ( retval = XmClipboardRetrieve( xdisplay, xwindow,
|
||||||
wxConstCast(id.c_str(), char),
|
wxConstCast(id.mb_str(), char),
|
||||||
(XtPointer)buf.data(),
|
(XtPointer)buf.data(),
|
||||||
length, &dummy1, &dummy2 ) )
|
length, &dummy1, &dummy2 ) )
|
||||||
== XmClipboardLocked );
|
== XmClipboardLocked );
|
||||||
|
@@ -345,7 +345,7 @@ wxTextPos wxComboBox::GetLastPosition() const
|
|||||||
void wxComboBox::Replace(long from, long to, const wxString& value)
|
void wxComboBox::Replace(long from, long to, const wxString& value)
|
||||||
{
|
{
|
||||||
XmTextReplace( GetXmText(this), (XmTextPosition)from, (XmTextPosition)to,
|
XmTextReplace( GetXmText(this), (XmTextPosition)from, (XmTextPosition)to,
|
||||||
wxConstCast(value.c_str(), char) );
|
wxConstCast(value.mb_str(), char) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxComboBox::Remove(long from, long to)
|
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 screen_num = DefaultScreen (dpy);
|
||||||
|
|
||||||
int value = XReadBitmapFile (dpy, RootWindow (dpy, screen_num),
|
int value = XReadBitmapFile (dpy, RootWindow (dpy, screen_num),
|
||||||
wxConstCast(name.c_str(), char),
|
wxConstCast(name.mb_str(), char),
|
||||||
&w, &h, &pixmap, &hotX, &hotY);
|
&w, &h, &pixmap, &hotX, &hotY);
|
||||||
|
|
||||||
if (value == BitmapSuccess)
|
if (value == BitmapSuccess)
|
||||||
|
@@ -1126,11 +1126,11 @@ void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y )
|
|||||||
#if wxMOTIF_NEW_FONT_HANDLING
|
#if wxMOTIF_NEW_FONT_HANDLING
|
||||||
XmbDrawString((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(), fset, (GC) m_gcBacking,
|
XmbDrawString((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(), fset, (GC) m_gcBacking,
|
||||||
XLOG2DEV_2 (x), YLOG2DEV_2 (y) + ascent,
|
XLOG2DEV_2 (x), YLOG2DEV_2 (y) + ascent,
|
||||||
wxConstCast(text.c_str(), char), slen);
|
wxConstCast(text.mb_str(), char), slen);
|
||||||
#else
|
#else
|
||||||
XDrawString((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(), (GC) m_gcBacking,
|
XDrawString((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(), (GC) m_gcBacking,
|
||||||
XLOG2DEV_2 (x), YLOG2DEV_2 (y) + ascent,
|
XLOG2DEV_2 (x), YLOG2DEV_2 (y) + ascent,
|
||||||
wxConstCast(text.c_str(), char), slen);
|
wxConstCast(text.mb_str(), char), slen);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -162,7 +162,7 @@ bool wxDialog::XmDoCreateTLW(wxWindow* parent,
|
|||||||
XtSetArg (args[1], XmNautoUnmanage, False);
|
XtSetArg (args[1], XmNautoUnmanage, False);
|
||||||
Widget dialogShell =
|
Widget dialogShell =
|
||||||
XmCreateBulletinBoardDialog( parentWidget,
|
XmCreateBulletinBoardDialog( parentWidget,
|
||||||
wxConstCast(name.c_str(), char),
|
wxConstCast(name.mb_str(), char),
|
||||||
args, 2);
|
args, 2);
|
||||||
m_mainWidget = (WXWidget) dialogShell;
|
m_mainWidget = (WXWidget) dialogShell;
|
||||||
|
|
||||||
@@ -243,9 +243,9 @@ void wxDialog::SetTitle(const wxString& title)
|
|||||||
{
|
{
|
||||||
wxXmString str( title );
|
wxXmString str( title );
|
||||||
XtVaSetValues( (Widget)m_mainWidget,
|
XtVaSetValues( (Widget)m_mainWidget,
|
||||||
XmNtitle, title.c_str(),
|
XmNtitle, title.mb_str(),
|
||||||
XmNdialogTitle, str(), // Roberto Cocchi
|
XmNdialogTitle, str(),
|
||||||
XmNiconName, title.c_str(),
|
XmNiconName, title.mb_str(),
|
||||||
NULL );
|
NULL );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -234,7 +234,7 @@ int wxFileDialog::ShowModal()
|
|||||||
|
|
||||||
if (!m_message.IsNull())
|
if (!m_message.IsNull())
|
||||||
XtVaSetValues(shell,
|
XtVaSetValues(shell,
|
||||||
XmNtitle, wxConstCast(m_message.c_str(), char),
|
XmNtitle, wxConstCast(m_message.mb_str(), char),
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if (!m_wildCard.empty())
|
if (!m_wildCard.empty())
|
||||||
@@ -247,7 +247,7 @@ int wxFileDialog::ShowModal()
|
|||||||
else
|
else
|
||||||
filter = wildCard;
|
filter = wildCard;
|
||||||
|
|
||||||
XmTextSetString(filterWidget, wxConstCast(filter.c_str(), char));
|
XmTextSetString(filterWidget, wxConstCast(filter.mb_str(), char));
|
||||||
XmFileSelectionDoSearch(fileSel, NULL);
|
XmFileSelectionDoSearch(fileSel, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -276,7 +276,7 @@ int wxFileDialog::ShowModal()
|
|||||||
if (!entirePath.empty())
|
if (!entirePath.empty())
|
||||||
{
|
{
|
||||||
XmTextSetString(selectionWidget,
|
XmTextSetString(selectionWidget,
|
||||||
wxConstCast(entirePath.c_str(), char));
|
wxConstCast(entirePath.mb_str(), char));
|
||||||
}
|
}
|
||||||
|
|
||||||
XtAddCallback(fileSel, XmNcancelCallback,
|
XtAddCallback(fileSel, XmNcancelCallback,
|
||||||
|
@@ -280,7 +280,7 @@ bool wxFont::Create(const wxString& fontname, wxFontEncoding enc)
|
|||||||
tmp = tn.GetNextToken(); // pointsize
|
tmp = tn.GetNextToken(); // pointsize
|
||||||
if (tmp != wxT("*"))
|
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);
|
M_FONTDATA->m_pointSize = (int)(num / 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -550,7 +550,7 @@ wxXFont* wxFont::GetInternalFont(double scale, WXDisplay* display) const
|
|||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
#if wxMOTIF_NEW_FONT_HANDLING
|
#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], XmNfontName, fontSpec ); ++count;
|
||||||
XtSetArg( args[count], XmNfontType, XmFONT_IS_FONTSET ); ++count;
|
XtSetArg( args[count], XmNfontType, XmFONT_IS_FONTSET ); ++count;
|
||||||
#else
|
#else
|
||||||
@@ -659,7 +659,7 @@ void wxGetTextExtent(WXDisplay* display, const wxFont& font, double scale,
|
|||||||
XRectangle ink, logical;
|
XRectangle ink, logical;
|
||||||
WXFontSet fset = font.GetFontSet(scale, display);
|
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( width ) *width = logical.width;
|
||||||
if( height ) *height = logical.height;
|
if( height ) *height = logical.height;
|
||||||
@@ -679,7 +679,7 @@ void wxGetTextExtent(WXDisplay* display, const wxFont& font,
|
|||||||
XCharStruct overall;
|
XCharStruct overall;
|
||||||
int slen = str.length();
|
int slen = str.length();
|
||||||
|
|
||||||
XTextExtents((XFontStruct*) pFontStruct, (char*) str.c_str(), slen,
|
XTextExtents((XFontStruct*) pFontStruct, (char*) str.mb_str(), slen,
|
||||||
&direction, &ascent2, &descent2, &overall);
|
&direction, &ascent2, &descent2, &overall);
|
||||||
|
|
||||||
if ( width )
|
if ( width )
|
||||||
|
@@ -454,8 +454,8 @@ void wxFrame::SetTitle(const wxString& title)
|
|||||||
|
|
||||||
if( !title.empty() )
|
if( !title.empty() )
|
||||||
XtVaSetValues( (Widget)m_frameShell,
|
XtVaSetValues( (Widget)m_frameShell,
|
||||||
XmNtitle, title.c_str(),
|
XmNtitle, title.mb_str(),
|
||||||
XmNiconName, title.c_str(),
|
XmNiconName, title.mb_str(),
|
||||||
NULL );
|
NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -120,7 +120,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
|
|||||||
|
|
||||||
Widget listWidget =
|
Widget listWidget =
|
||||||
XmCreateScrolledList(parentWidget,
|
XmCreateScrolledList(parentWidget,
|
||||||
wxConstCast(name.c_str(), char), args, count);
|
wxConstCast(name.mb_str(), char), args, count);
|
||||||
|
|
||||||
m_mainWidget = (WXWidget) listWidget;
|
m_mainWidget = (WXWidget) listWidget;
|
||||||
|
|
||||||
|
@@ -82,7 +82,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title,
|
|||||||
{
|
{
|
||||||
wxXmString text(label1);
|
wxXmString text(label1);
|
||||||
m_labelWidget = (WXWidget)
|
m_labelWidget = (WXWidget)
|
||||||
XtVaCreateManagedWidget( label1.c_str(),
|
XtVaCreateManagedWidget( label1.mb_str(),
|
||||||
#if wxUSE_GADGETS
|
#if wxUSE_GADGETS
|
||||||
style & wxCOLOURED ? xmLabelWidgetClass
|
style & wxCOLOURED ? xmLabelWidgetClass
|
||||||
: xmLabelGadgetClass,
|
: xmLabelGadgetClass,
|
||||||
@@ -123,7 +123,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title,
|
|||||||
wxString str(GetLabelText(choices[i]));
|
wxString str(GetLabelText(choices[i]));
|
||||||
m_radioButtonLabels.push_back(str);
|
m_radioButtonLabels.push_back(str);
|
||||||
Widget radioItem = XtVaCreateManagedWidget (
|
Widget radioItem = XtVaCreateManagedWidget (
|
||||||
wxConstCast(str.c_str(), char),
|
wxConstCast(str.mb_str(), char),
|
||||||
#if wxUSE_GADGETS
|
#if wxUSE_GADGETS
|
||||||
xmToggleButtonGadgetClass, radioBoxWidget,
|
xmToggleButtonGadgetClass, radioBoxWidget,
|
||||||
#else
|
#else
|
||||||
|
@@ -50,7 +50,7 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id,
|
|||||||
wxXmString text( GetLabelText( label ) );
|
wxXmString text( GetLabelText( label ) );
|
||||||
|
|
||||||
m_labelWidget =
|
m_labelWidget =
|
||||||
XtVaCreateManagedWidget (wxConstCast(name.c_str(), char),
|
XtVaCreateManagedWidget (wxConstCast(name.mb_str(), char),
|
||||||
xmLabelWidgetClass,
|
xmLabelWidgetClass,
|
||||||
borderWidget ? borderWidget : parentWidget,
|
borderWidget ? borderWidget : parentWidget,
|
||||||
wxFont::GetFontTag(), m_font.GetFontTypeC(XtDisplay(parentWidget)),
|
wxFont::GetFontTag(), m_font.GetFontTypeC(XtDisplay(parentWidget)),
|
||||||
|
@@ -138,14 +138,14 @@ bool wxTextCtrl::Create(wxWindow *parent,
|
|||||||
XtSetArg (args[count], (String) wxFont::GetFontTag(),
|
XtSetArg (args[count], (String) wxFont::GetFontTag(),
|
||||||
m_font.GetFontType( XtDisplay(parentWidget) ) ); ++count;
|
m_font.GetFontType( XtDisplay(parentWidget) ) ); ++count;
|
||||||
XtSetArg (args[count], XmNwordWrap, wantWordWrap); ++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,
|
XtSetArg (args[count], XmNeditable,
|
||||||
style & wxTE_READONLY ? False : True); ++count;
|
style & wxTE_READONLY ? False : True); ++count;
|
||||||
XtSetArg (args[count], XmNeditMode, XmMULTI_LINE_EDIT ); ++count;
|
XtSetArg (args[count], XmNeditMode, XmMULTI_LINE_EDIT ); ++count;
|
||||||
|
|
||||||
m_mainWidget =
|
m_mainWidget =
|
||||||
(WXWidget) XmCreateScrolledText(parentWidget,
|
(WXWidget) XmCreateScrolledText(parentWidget,
|
||||||
wxConstCast(name.c_str(), char),
|
wxConstCast(name.mb_str(), char),
|
||||||
args, count);
|
args, count);
|
||||||
|
|
||||||
XtManageChild ((Widget) m_mainWidget);
|
XtManageChild ((Widget) m_mainWidget);
|
||||||
@@ -154,11 +154,11 @@ bool wxTextCtrl::Create(wxWindow *parent,
|
|||||||
{
|
{
|
||||||
m_mainWidget = (WXWidget)XtVaCreateManagedWidget
|
m_mainWidget = (WXWidget)XtVaCreateManagedWidget
|
||||||
(
|
(
|
||||||
wxConstCast(name.c_str(), char),
|
wxConstCast(name.mb_str(), char),
|
||||||
xmTextWidgetClass,
|
xmTextWidgetClass,
|
||||||
parentWidget,
|
parentWidget,
|
||||||
wxFont::GetFontTag(), m_font.GetFontType( XtDisplay(parentWidget) ),
|
wxFont::GetFontTag(), m_font.GetFontType( XtDisplay(parentWidget) ),
|
||||||
XmNvalue, value.c_str(),
|
XmNvalue, value.mb_str(),
|
||||||
XmNeditable, (style & wxTE_READONLY) ?
|
XmNeditable, (style & wxTE_READONLY) ?
|
||||||
False : True,
|
False : True,
|
||||||
NULL
|
NULL
|
||||||
@@ -244,7 +244,7 @@ void wxTextCtrl::DoSetValue(const wxString& text, int flags)
|
|||||||
{
|
{
|
||||||
m_inSetValue = true;
|
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,
|
XtVaSetValues ((Widget) m_mainWidget,
|
||||||
XmNcursorPosition, text.length(),
|
XmNcursorPosition, text.length(),
|
||||||
NULL);
|
NULL);
|
||||||
@@ -365,7 +365,7 @@ wxTextPos wxTextCtrl::GetLastPosition() const
|
|||||||
void wxTextCtrl::Replace(long from, long to, const wxString& value)
|
void wxTextCtrl::Replace(long from, long to, const wxString& value)
|
||||||
{
|
{
|
||||||
XmTextReplace ((Widget) m_mainWidget, (XmTextPosition) from, (XmTextPosition) to,
|
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)
|
void wxTextCtrl::Remove(long from, long to)
|
||||||
@@ -388,7 +388,7 @@ void wxTextCtrl::WriteText(const wxString& text)
|
|||||||
{
|
{
|
||||||
long textPosition = GetInsertionPoint() + text.length();
|
long textPosition = GetInsertionPoint() + text.length();
|
||||||
XmTextInsert ((Widget) m_mainWidget, GetInsertionPoint(),
|
XmTextInsert ((Widget) m_mainWidget, GetInsertionPoint(),
|
||||||
wxConstCast(text.c_str(), char));
|
wxConstCast(text.mb_str(), char));
|
||||||
XtVaSetValues ((Widget) m_mainWidget, XmNcursorPosition, textPosition, NULL);
|
XtVaSetValues ((Widget) m_mainWidget, XmNcursorPosition, textPosition, NULL);
|
||||||
SetInsertionPoint(textPosition);
|
SetInsertionPoint(textPosition);
|
||||||
XmTextShowPosition ((Widget) m_mainWidget, textPosition);
|
XmTextShowPosition ((Widget) m_mainWidget, textPosition);
|
||||||
@@ -399,7 +399,7 @@ void wxTextCtrl::AppendText(const wxString& text)
|
|||||||
{
|
{
|
||||||
wxTextPos textPosition = GetLastPosition() + text.length();
|
wxTextPos textPosition = GetLastPosition() + text.length();
|
||||||
XmTextInsert ((Widget) m_mainWidget, GetLastPosition(),
|
XmTextInsert ((Widget) m_mainWidget, GetLastPosition(),
|
||||||
wxConstCast(text.c_str(), char));
|
wxConstCast(text.mb_str(), char));
|
||||||
XtVaSetValues ((Widget) m_mainWidget, XmNcursorPosition, textPosition, NULL);
|
XtVaSetValues ((Widget) m_mainWidget, XmNcursorPosition, textPosition, NULL);
|
||||||
SetInsertionPoint(textPosition);
|
SetInsertionPoint(textPosition);
|
||||||
XmTextShowPosition ((Widget) m_mainWidget, textPosition);
|
XmTextShowPosition ((Widget) m_mainWidget, textPosition);
|
||||||
|
@@ -949,7 +949,7 @@ wxString wxXmStringToString( const XmString& xmString )
|
|||||||
|
|
||||||
XmString wxStringToXmString( const wxString& str )
|
XmString wxStringToXmString( const wxString& str )
|
||||||
{
|
{
|
||||||
return XmStringCreateLtoR((char *)str.c_str(), XmSTRING_DEFAULT_CHARSET);
|
return wxStringToXmString(str.mb_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
XmString wxStringToXmString( const char* str )
|
XmString wxStringToXmString( const char* str )
|
||||||
|
@@ -636,7 +636,7 @@ void wxWindow::Lower()
|
|||||||
|
|
||||||
void wxWindow::SetLabel(const wxString& label)
|
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
|
wxString wxWindow::GetLabel() const
|
||||||
|
Reference in New Issue
Block a user