X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7520f3da332d64a676b6f7d27a56004fabf2db36..815f65bd0f673965230ed915d794497a8818dd35:/src/palmos/msgdlg.cpp diff --git a/src/palmos/msgdlg.cpp b/src/palmos/msgdlg.cpp index 4c1f7732b5..29bbb0e56a 100644 --- a/src/palmos/msgdlg.cpp +++ b/src/palmos/msgdlg.cpp @@ -23,23 +23,16 @@ #include "wx/msgdlg.h" #endif +#ifdef __WXPALMOS6__ #include +#else // __WXPALMOS5__ +#include // alertRscType +#endif + #include IMPLEMENT_CLASS(wxMessageDialog, wxDialog) -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); -} - int wxMessageDialog::ShowModal() { int AlertID=1000; @@ -47,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) @@ -68,14 +63,25 @@ int wxMessageDialog::ShowModal() } // Add the icon styles - if (style & wxICON_EXCLAMATION) - AlertID=AlertID+0; // Warning - else if (style & wxICON_HAND) - AlertID=AlertID+1; // Error - else if (style & wxICON_INFORMATION) - AlertID=AlertID+2; // Information - else if (style & wxICON_QUESTION) - AlertID=AlertID+3; // Confirmation + switch ( GetEffectiveIcon() ) + { + case wxICON_ERROR: + AlertID = AlertID + 1; + break; + + case wxICON_WARNING: + AlertID = AlertID + 0; + break; + + case wxICON_QUESTION: + AlertID = AlertID + 3; + break; + + case wxICON_NONE: + case wxICON_INFORMATION: + AlertID = AlertID + 2; + break; + } // The Palm OS Dialog API does not support custom titles in a dialog box. // So we have to set the title by manipulating the resource. @@ -83,7 +89,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; @@ -111,7 +117,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)