// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "msgdlg.h"
#endif
+#include "wx/wxprec.h"
+
#include "wx/app.h"
#include "wx/msgdlg.h"
#include "wx/intl.h"
IMPLEMENT_CLASS(wxMessageDialog, wxDialog)
#endif
-short language = 0 ;
-
-void wxMacConvertNewlines( const char *source , char * destination ) ;
-void wxMacConvertNewlines( const char *source , char * destination )
-{
- const char *s = source ;
- char *d = destination ;
-
- while( *s )
- {
- switch( *s )
- {
- case 0x0a :
- *d++ = 0x0d ;
- ++s ;
- break ;
- case 0x0d :
- *d++ = 0x0d ;
- ++s ;
- if ( *s == 0x0a )
- ++s ;
- break ;
- default :
- *d++ = *s++ ;
- break ;
- }
- }
- *d = 0 ;
-}
-
wxMessageDialog::wxMessageDialog(wxWindow *parent, const wxString& message, const wxString& caption,
long style, const wxPoint& pos)
{
if ( UMAGetSystemVersion() >= 0x1000 )
{
AlertStdCFStringAlertParamRec param ;
- wxMacCFStringHolder cfNoString(_("No")) ;
- wxMacCFStringHolder cfYesString( _("Yes")) ;
+ wxMacCFStringHolder cfNoString(_("No") , m_font.GetEncoding()) ;
+ wxMacCFStringHolder cfYesString( _("Yes") , m_font.GetEncoding()) ;
- wxMacCFStringHolder cfTitle(m_caption);
- wxMacCFStringHolder cfText(m_message);
+ wxMacCFStringHolder cfTitle(m_caption , m_font.GetEncoding());
+ wxMacCFStringHolder cfText(m_message , m_font.GetEncoding());
param.movable = true;
param.flags = 0 ;
+ param.version = kStdCFStringAlertVersionOne ;
bool skipDialog = false ;
param.cancelText = (CFStringRef) kAlertDefaultCancelText;
param.otherText = cfNoString ;
param.helpButton = false ;
- param.defaultButton = kAlertStdAlertOKButton;
+ param.defaultButton = m_dialogStyle & wxNO_DEFAULT ? kAlertStdAlertOtherButton : kAlertStdAlertOKButton;
param.cancelButton = kAlertStdAlertCancelButton;
}
else
param.cancelText = NULL;
param.otherText = cfNoString ;
param.helpButton = false ;
- param.defaultButton = kAlertStdAlertOKButton;
+ param.defaultButton = m_dialogStyle & wxNO_DEFAULT ? kAlertStdAlertOtherButton : kAlertStdAlertOKButton;
param.cancelButton = 0;
}
}
{
// thats a cancel missing
param.defaultText = (CFStringRef) kAlertDefaultOKText ;
- param.cancelText = NULL;
+ param.cancelText = (CFStringRef) kAlertDefaultCancelText ;
param.otherText = NULL;
param.helpButton = false ;
param.defaultButton = kAlertStdAlertOKButton;
{
if (m_dialogStyle & wxCANCEL)
{
- // thats a cancel missing
param.defaultText = (StringPtr) kAlertDefaultOKText ;
- param.cancelText = NULL;
+ param.cancelText = (StringPtr) kAlertDefaultCancelText ;
param.otherText = NULL;
param.helpButton = false ;
param.defaultButton = kAlertStdAlertOKButton;