X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fd304d989b2c5c35ac1a849d508cb21f4d54609e..5a618a14c627c87a2ea642bd8395b74d72e614ba:/src/motif/utils.cpp diff --git a/src/motif/utils.cpp b/src/motif/utils.cpp index 36df02e7fc..fcb590abba 100644 --- a/src/motif/utils.cpp +++ b/src/motif/utils.cpp @@ -273,7 +273,7 @@ static char *GetResourcePath(char *buf, const char *name, bool create = FALSE) // Put in standard place for resource files if not absolute strcpy (buf, DEFAULT_XRESOURCE_DIR); strcat (buf, "/"); - strcat (buf, (const char*) wxFileNameFromPath (name)); + strcat (buf, wxFileNameFromPath (name).c_str()); } if (create) { @@ -335,9 +335,9 @@ bool wxWriteResource(const wxString& section, const wxString& entry, const wxStr } char resName[300]; - strcpy (resName, (const char*) section); + strcpy (resName, section.c_str()); strcat (resName, "."); - strcat (resName, (const char*) entry); + strcat (resName, entry.c_str()); XrmPutStringResource (&database, resName, value); return TRUE; @@ -481,7 +481,7 @@ void wxXMergeDatabases (wxApp * theApp, Display * display) wxString classname = theApp->GetClassName(); char name[256]; (void) strcpy (name, "/usr/lib/X11/app-defaults/"); - (void) strcat (name, (const char*) classname); + (void) strcat (name, classname.c_str()); /* Get application defaults file, if any */ applicationDB = XrmGetFileDatabase (name); @@ -674,9 +674,9 @@ bool wxSetDisplay(const wxString& display_name) Cardinal argc = 0; Display *display = XtOpenDisplay((XtAppContext) wxTheApp->GetAppContext(), - (const char*) display_name, - (const char*) wxTheApp->GetAppName(), - (const char*) wxTheApp->GetClassName(), + display_name.c_str(), + wxTheApp->GetAppName().c_str(), + wxTheApp->GetClassName().c_str(), NULL, #if XtSpecificationRelease < 5 0, &argc, @@ -1247,6 +1247,18 @@ void wxDoChangeBackgroundColour(WXWidget widget, wxColour& backgroundColour, boo NULL); } +extern void wxDoChangeFont(WXWidget widget, wxFont& font) +{ + // Lesstif 0.87 hangs here, but 0.93 does not +#if !wxCHECK_LESSTIF() || wxCHECK_LESSTIF_VERSION( 0, 93 ) + Widget w = (Widget)widget; + XtVaSetValues( w, + wxFont::GetFontTag(), font.GetFontType( XtDisplay(w) ), + NULL ); +#endif + +} + #endif // __WXMOTIF__ @@ -1257,3 +1269,26 @@ bool wxWindowIsVisible(Window win) return (wa.map_state == IsViewable); } + +wxString wxXmStringToString( const XmString& xmString ) +{ + char *txt; + if( XmStringGetLtoR( xmString, XmSTRING_DEFAULT_CHARSET, &txt ) ) + { + wxString str(txt); + XtFree (txt); + return str; + } + + return wxEmptyString; +} + +XmString wxStringToXmString( const wxString& str ) +{ + return XmStringCreateLtoR((char *)str.c_str(), XmSTRING_DEFAULT_CHARSET); +} + +XmString wxStringToXmString( const char* str ) +{ + return XmStringCreateLtoR((char *)str, XmSTRING_DEFAULT_CHARSET); +}