partially revert 55488: don't use message box with copy button as it doesn't behave correctly unfortunately (Esc doesn't work, copying the text unexpectedly closes the dialog)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55545 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -364,27 +364,7 @@ void wxLogGui::Flush()
|
|||||||
// situation without it
|
// situation without it
|
||||||
if ( !str.empty() )
|
if ( !str.empty() )
|
||||||
{
|
{
|
||||||
// we use a message dialog with 2 buttons to be able to use one of them
|
wxMessageBox(str, title, wxOK | style);
|
||||||
// for copying the message text to clipboard
|
|
||||||
#if wxUSE_CLIPBOARD
|
|
||||||
wxMessageDialog dlg(NULL, str, title, style | wxYES_NO);
|
|
||||||
if ( !dlg.SetYesNoLabels(wxID_COPY, wxID_OK) )
|
|
||||||
#endif // wxUSE_CLIPBOARD
|
|
||||||
{
|
|
||||||
// but if custom labels are not supported it makes no sense to keep
|
|
||||||
// two buttons so revert to a single one
|
|
||||||
dlg.SetMessageDialogStyle(style | wxOK);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if wxUSE_CLIPBOARD
|
|
||||||
if ( dlg.ShowModal() == wxID_YES )
|
|
||||||
{
|
|
||||||
// this means the wxID_COPY button was selected
|
|
||||||
wxClipboardLocker clip;
|
|
||||||
if ( !clip || !wxTheClipboard->AddData(new wxTextDataObject(str)) )
|
|
||||||
wxLogError(_("Failed to copy dialog contents to the clipboard."));
|
|
||||||
}
|
|
||||||
#endif // wxUSE_CLIPBOARD
|
|
||||||
|
|
||||||
// no undisplayed messages whatsoever
|
// no undisplayed messages whatsoever
|
||||||
Clear();
|
Clear();
|
||||||
|
Reference in New Issue
Block a user