#pragma hdrstop
#endif
-#if wxUSE_MSGDLG && (!defined(__WXGTK20__) || defined(__WXUNIVERSAL__) || defined(__WXGPE__))
+#if wxUSE_MSGDLG
#ifndef WX_PRECOMP
#include "wx/utils.h"
#define __WX_COMPILING_MSGDLGG_CPP__ 1
#include "wx/msgdlg.h"
#include "wx/artprov.h"
+#include "wx/textwrapper.h"
#if wxUSE_STATLINE
#include "wx/statline.h"
#endif
+// ----------------------------------------------------------------------------
+// wxTitleTextWrapper: simple class to create wrapped text in "title font"
+// ----------------------------------------------------------------------------
+
+class wxTitleTextWrapper : public wxTextSizerWrapper
+{
+public:
+ wxTitleTextWrapper(wxWindow *win)
+ : wxTextSizerWrapper(win)
+ {
+ }
+
+protected:
+ virtual wxWindow *OnCreateLine(const wxString& s)
+ {
+ wxWindow * const win = wxTextSizerWrapper::OnCreateLine(s);
+
+ win->SetFont(win->GetFont().Larger().MakeBold());
+
+ return win;
+ }
+};
+
// ----------------------------------------------------------------------------
// icons
// ----------------------------------------------------------------------------
const wxString& caption,
long style,
const wxPoint& pos)
- : wxMessageDialogBase(GetParentForModalDialog(parent),
+ : wxMessageDialogBase(GetParentForModalDialog(parent, style),
message,
caption,
style),
if (is_pda)
topsizer->Add( icon, 0, wxTOP|wxLEFT|wxRIGHT | wxALIGN_LEFT, 10 );
else
- icon_text->Add( icon, 0, wxCENTER );
+ icon_text->Add(icon, wxSizerFlags().Top().Border(wxRIGHT, 20));
}
#endif // wxUSE_STATBMP
#if wxUSE_STATTEXT
// 2) text
- icon_text->Add( CreateTextSizer( GetFullMessage() ), 0, wxALIGN_CENTER | wxLEFT, 10 );
+ wxBoxSizer * const textsizer = new wxBoxSizer(wxVERTICAL);
+
+ // We want to show the main message in a different font to make it stand
+ // out if the extended message is used as well. This looks better and is
+ // more consistent with the native dialogs under MSW and GTK.
+ wxString lowerMessage;
+ if ( !m_extendedMessage.empty() )
+ {
+ wxTitleTextWrapper titleWrapper(this);
+ textsizer->Add(CreateTextSizer(GetMessage(), titleWrapper),
+ wxSizerFlags().Border(wxBOTTOM, 20));
+
+ lowerMessage = GetExtendedMessage();
+ }
+ else // no extended message
+ {
+ lowerMessage = GetMessage();
+ }
+
+ textsizer->Add(CreateTextSizer(lowerMessage));
+
+ icon_text->Add(textsizer, 0, wxALIGN_CENTER, 10);
topsizer->Add( icon_text, 1, wxCENTER | wxLEFT|wxRIGHT|wxTOP, 10 );
#endif // wxUSE_STATTEXT
- // 3) buttons
+ // 3) optional checkbox and detailed text
+ AddMessageDialogCheckBox( topsizer );
+ AddMessageDialogDetails( topsizer );
+
+ // 4) buttons
int center_flag = wxEXPAND;
if (m_dialogStyle & wxYES_NO)
center_flag = wxALIGN_CENTRE;
return wxMessageDialogBase::ShowModal();
}
-#endif // wxUSE_MSGDLG && !defined(__WXGTK20__)
+#endif // wxUSE_MSGDLG