Added helper functions for string -> XmString conversion.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19539 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -94,6 +94,10 @@ extern XColor itemColors[5] ;
|
||||
// utility classes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxString wxXmStringToString( const XmString& xmString );
|
||||
XmString wxStringToXmString( const wxString& string );
|
||||
XmString wxStringToXmString( const char* string );
|
||||
|
||||
// XmString made easy to use in wxWindows (and has an added benefit of
|
||||
// cleaning up automatically)
|
||||
class wxXmString
|
||||
@@ -123,8 +127,6 @@ private:
|
||||
XmString m_string;
|
||||
};
|
||||
|
||||
wxString wxXmStringToString( const XmString& xmString );
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Routines used in both wxTextCtrl/wxListBox and nativa wxComboBox
|
||||
// (defined in src/motif/listbox.cpp or src/motif/textctrl.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,
|
||||
@@ -1283,3 +1283,12 @@ wxString wxXmStringToString( const XmString& xmString )
|
||||
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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user