]> git.saurik.com Git - wxWidgets.git/blobdiff - src/palmos/msgdlg.cpp
compilation after last commit: semicolon after wxDELETE() is now required; also remov...
[wxWidgets.git] / src / palmos / msgdlg.cpp
index 63aa1bdd04a96d182dcc3bb20f9b9d2f1ceecd82..48445b23c5dc7a9a8bc62a4b65f3f8e97918b322 100644 (file)
@@ -9,38 +9,29 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "msgdlg.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
 #ifdef __BORLANDC__
-#pragma hdrstop
+    #pragma hdrstop
 #endif
 
 #ifndef WX_PRECOMP
     #include "wx/app.h"
-    #include "wx/defs.h"
     #include "wx/utils.h"
     #include "wx/dialog.h"
     #include "wx/msgdlg.h"
 #endif
 
-IMPLEMENT_CLASS(wxMessageDialog, wxDialog)
+#ifdef __WXPALMOS6__
+#include <Loader.h>
+#else // __WXPALMOS5__
+#include <UIResources.h> // alertRscType
+#endif
 
-wxMessageDialog::wxMessageDialog(wxWindow *parent,
-                                 const wxString& message,
-                                 const wxString& caption,
-                                 long style,
-                                 const wxPoint& WXUNUSED(pos))
-{
-    m_caption = caption;
-    m_message = message;
-    m_parent = parent;
-    SetMessageDialogStyle(style);
-}
+#include <Form.h>
+
+IMPLEMENT_CLASS(wxMessageDialog, wxDialog)
 
 int wxMessageDialog::ShowModal()
 {
@@ -49,9 +40,11 @@ int wxMessageDialog::ShowModal()
     int wxResult=wxID_OK;
     const long style = GetMessageDialogStyle();
 
+#ifdef __WXPALMOS6__
     // Handle to the currently running application database
     DmOpenRef    AppDB;
     SysGetModuleDatabase(SysGetRefNum(), NULL, &AppDB);
+#endif // __WXPALMOS6__
 
     // Translate wx styles into Palm OS styles
     if (style & wxYES_NO)
@@ -85,7 +78,7 @@ int wxMessageDialog::ShowModal()
     // Get the alert resource
     char *AlertPtr;
     MemHandle AlertHandle;
-    AlertHandle=DmGetResource(AppDB,'Talt',AlertID);
+    AlertHandle = POS_DmGetResource (AppDB, alertRscType, AlertID);
 
     AlertPtr=(char *)MemHandleLock(AlertHandle);
     AlertPtr+=8;
@@ -113,7 +106,7 @@ int wxMessageDialog::ShowModal()
     DmReleaseResource(AlertHandle);
 
     // Display the dialog
-    Result=FrmCustomAlert(AppDB,AlertID,m_message.c_str(),"","");
+    Result = POS_FrmCustomAlert (AppDB, AlertID, m_message.c_str(), "", "");
 
     // Convert the Palm OS result to wxResult
     if(AlertID<1100)
@@ -150,4 +143,3 @@ int wxMessageDialog::ShowModal()
 
     return wxResult;
 }
-