+/*
+ * N.B. these convenience functions must be separate from msgdlgg.cpp, textdlgg.cpp
+ * since otherwise the generic code may be pulled in unnecessarily.
+ */
+
+int wxMessageBox(const wxString& message, const wxString& caption, long style,
+ wxWindow *parent, int WXUNUSED(x), int WXUNUSED(y) )
+{
+ wxMessageDialog dialog(parent, message, caption, style);
+
+ int ans = dialog.ShowModal();
+ switch ( ans )
+ {
+ case wxID_OK:
+ return wxOK;
+ break;
+ case wxID_YES:
+ return wxYES;
+ break;
+ case wxID_NO:
+ return wxNO;
+ break;
+ default:
+ case wxID_CANCEL:
+ return wxCANCEL;
+ break;
+ }
+ return ans;
+}
+
+wxString wxGetTextFromUser(const wxString& message, const wxString& caption,
+ const wxString& defaultValue, wxWindow *parent,
+ int x, int y, bool WXUNUSED(centre) )
+{
+ wxTextEntryDialog dialog(parent, message, caption, defaultValue, wxOK|wxCANCEL, wxPoint(x, y));
+ if (dialog.ShowModal() == wxID_OK)
+ return dialog.GetValue();
+ else
+ return wxString("");
+}
+
+#ifdef __MWERKS__
+char *strdup(const char *s)
+{
+ return strcpy( (char*) malloc( strlen( s ) + 1 ) , s ) ;
+}
+
+int isascii( int c )
+{
+ return ( c >= 0 && c < 128 ) ;
+}
+#endif
+
+// Overloaded functions, taking a wxString
+bool wxGetHostName(wxString& name)
+{
+ bool success = wxGetHostName(wxBuffer, 500);
+ if (success)
+ {
+ name = wxBuffer;
+ return TRUE;
+ }
+ else
+ return FALSE;
+}
+
+bool wxGetUserId(wxString& buf)
+{
+ bool success = wxGetUserId(wxBuffer, 500);
+ if (success)
+ {
+ buf = wxBuffer;
+ return TRUE;
+ }
+ else
+ return FALSE;
+}
+
+bool wxGetUserName(wxString& buf)
+{
+ bool success = wxGetUserName(wxBuffer, 500);
+ if (success)
+ {
+ buf = wxBuffer;
+ return TRUE;
+ }
+ else
+ return FALSE;
+}
+