X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e273151278d28cceefe6eee8c49bc6915306805d..a552d2c3f2bd15d76fb033b250050ef7c093b56d:/src/palmos/msgdlg.cpp diff --git a/src/palmos/msgdlg.cpp b/src/palmos/msgdlg.cpp index e06a12c126..48445b23c5 100644 --- a/src/palmos/msgdlg.cpp +++ b/src/palmos/msgdlg.cpp @@ -9,82 +9,67 @@ // 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 +#else // __WXPALMOS5__ +#include // alertRscType +#endif -wxMessageDialog::wxMessageDialog(wxWindow *parent, - const wxString& message, - const wxString& caption, - long style, - const wxPoint& WXUNUSED(pos)) -{ -#ifdef __WXDEBUG__ - // check for common programming errors - if ( (style & wxID_OK) == wxID_OK ) - { - // programmer probably confused wxID_OK with wxOK. Correct one is wxOK. - wxFAIL_MSG( _T("wxMessageBox: Did you mean wxOK (and not wxID_OK)?") ); - } -#endif // __WXDEBUG__ +#include - m_caption = caption; - m_message = message; - m_dialogStyle = style; - m_parent = parent; -} +IMPLEMENT_CLASS(wxMessageDialog, wxDialog) int wxMessageDialog::ShowModal() { int AlertID=1000; int Result=0; 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 (m_dialogStyle & wxYES_NO) + if (style & wxYES_NO) { - if (m_dialogStyle & wxCANCEL) + if (style & wxCANCEL) AlertID=1300; // Yes No Cancel else AlertID=1200; // Yes No } - if (m_dialogStyle & wxOK) + if (style & wxOK) { - if (m_dialogStyle & wxCANCEL) + if (style & wxCANCEL) AlertID=1100; // Ok Cancel else AlertID=1000; // Ok } // Add the icon styles - if (m_dialogStyle & wxICON_EXCLAMATION) + if (style & wxICON_EXCLAMATION) AlertID=AlertID+0; // Warning - else if (m_dialogStyle & wxICON_HAND) + else if (style & wxICON_HAND) AlertID=AlertID+1; // Error - else if (m_dialogStyle & wxICON_INFORMATION) + else if (style & wxICON_INFORMATION) AlertID=AlertID+2; // Information - else if (m_dialogStyle & wxICON_QUESTION) + else if (style & wxICON_QUESTION) AlertID=AlertID+3; // Confirmation // The Palm OS Dialog API does not support custom titles in a dialog box. @@ -93,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; @@ -121,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) @@ -158,4 +143,3 @@ int wxMessageDialog::ShowModal() return wxResult; } -