X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/94e0018723919fe2ca2f5b5f0a42804c16dbf3a1..d05ff890b4e796f06e9de5829632b567e7219725:/src/msw/msgdlg.cpp diff --git a/src/msw/msgdlg.cpp b/src/msw/msgdlg.cpp index b0118ae243..08b91774ce 100644 --- a/src/msw/msgdlg.cpp +++ b/src/msw/msgdlg.cpp @@ -54,6 +54,12 @@ #include "wx/msw/wince/missing.h" #endif +// Interestingly, this symbol currently seems to be absent from Platform SDK +// headers but it is documented at MSDN. +#ifndef TDF_SIZE_TO_CONTENT + #define TDF_SIZE_TO_CONTENT 0x1000000 +#endif + using namespace wxMSWMessageDialog; IMPLEMENT_CLASS(wxMessageDialog, wxDialog) @@ -454,12 +460,16 @@ int wxMessageDialog::ShowMessageBox() #if wxUSE_INTL // native message box always uses the current user locale but the program // may be using a different one and in this case we need to manually - // translate the button labels to avoid mismatch between the language of - // the message box text and its buttons + // translate the default button labels (if they're non default we have no + // way to translate them and so we must assume they were already + // translated) to avoid mismatch between the language of the message box + // text and its buttons wxLocale * const loc = wxGetLocale(); if ( loc && loc->GetLanguage() != wxLocale::GetSystemLanguage() ) { - if ( m_dialogStyle & wxYES_NO ) + if ( m_dialogStyle & wxYES_NO && + (GetCustomYesLabel().empty() && GetCustomNoLabel().empty()) ) + { // use the strings with mnemonics here as the native message box // does @@ -475,7 +485,8 @@ int wxMessageDialog::ShowMessageBox() // native message box (which probably doesn't use them because // Enter/Esc keys can be already used to dismiss the message box // using keyboard) - SetOKCancelLabels(_("OK"), _("Cancel")); + if ( GetCustomOKLabel().empty() && GetCustomCancelLabel().empty() ) + SetOKCancelLabels(_("OK"), _("Cancel")); } #endif // wxUSE_INTL @@ -675,7 +686,15 @@ wxMSWTaskDialogConfig::wxMSWTaskDialogConfig(const wxMessageDialogBase& dlg) void wxMSWTaskDialogConfig::MSWCommonTaskDialogInit(TASKDIALOGCONFIG &tdc) { - tdc.dwFlags = TDF_EXPAND_FOOTER_AREA | TDF_POSITION_RELATIVE_TO_WINDOW; + // Use TDF_SIZE_TO_CONTENT to try to prevent Windows from truncating or + // ellipsizing the message text. This doesn't always work as Windows will + // still do it if the message contains too long "words" (i.e. runs of the + // text without spaces) but at least it ensures that the message text is + // fully shown for reasonably-sized words whereas without it using almost + // any file system path in a message box would result in truncation. + tdc.dwFlags = TDF_EXPAND_FOOTER_AREA | + TDF_POSITION_RELATIVE_TO_WINDOW | + TDF_SIZE_TO_CONTENT; tdc.hInstance = wxGetInstance(); tdc.pszWindowTitle = caption.wx_str();