diff --git a/src/generic/msgdlgg.cpp b/src/generic/msgdlgg.cpp index da77e4ec5a..4e256c8587 100644 --- a/src/generic/msgdlgg.cpp +++ b/src/generic/msgdlgg.cpp @@ -184,6 +184,12 @@ void wxGenericMessageDialog::DoCreateMsgdialog() wxBoxSizer * const textsizer = new wxBoxSizer(wxVERTICAL); + // To prevent clipping + int maxWidth = wxSystemSettings::GetMetric(wxSYS_SCREEN_X, this) - FromDIP(25); + + // To enhance readability + maxWidth = wxMin( maxWidth, GetCharWidth() * 70 ); + // 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. @@ -191,7 +197,7 @@ void wxGenericMessageDialog::DoCreateMsgdialog() if ( !m_extendedMessage.empty() ) { wxTitleTextWrapper titleWrapper(this); - textsizer->Add(CreateTextSizer(GetMessage(), titleWrapper), + textsizer->Add(CreateTextSizer(GetMessage(), titleWrapper, maxWidth), wxSizerFlags().Border(wxBOTTOM, 20)); lowerMessage = GetExtendedMessage(); @@ -201,7 +207,7 @@ void wxGenericMessageDialog::DoCreateMsgdialog() lowerMessage = GetMessage(); } - textsizer->Add(CreateTextSizer(lowerMessage)); + textsizer->Add(CreateTextSizer(lowerMessage, maxWidth)); icon_text->Add(textsizer, 0, wxALIGN_CENTER, 10); topsizer->Add( icon_text, 1, wxLEFT|wxRIGHT|wxTOP, 10 );