| 43 | END_EVENT_TABLE() |
| 44 | |
| 45 | ErrorDialog::ErrorDialog( |
| 46 | wxWindow *parent, |
| 47 | const TranslatableString & dlogTitle, |
| 48 | const TranslatableString & message, |
| 49 | const ManualPageID & helpPage, |
| 50 | const std::wstring & log, |
| 51 | const bool Close, const bool modal) |
| 52 | : wxDialogWrapper(parent, wxID_ANY, dlogTitle, |
| 53 | wxDefaultPosition, wxDefaultSize, |
| 54 | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) |
| 55 | { |
| 56 | SetName(); |
| 57 | |
| 58 | long buttonMask; |
| 59 | |
| 60 | // only add the help button if we have a URL |
| 61 | buttonMask = (helpPage.empty()) ? eOkButton : (eHelpButton | eOkButton); |
| 62 | dhelpPage = helpPage; |
| 63 | dClose = Close; |
| 64 | dModal = modal; |
| 65 | |
| 66 | ShuttleGui S(this, eIsCreating); |
| 67 | |
| 68 | S.SetBorder(2); |
| 69 | S.StartHorizontalLay(wxEXPAND, 0); |
| 70 | { |
| 71 | S.SetBorder(20); |
| 72 | wxBitmap bitmap = wxArtProvider::GetBitmap(wxART_WARNING); |
| 73 | S.AddWindow(safenew wxStaticBitmap(S.GetParent(), -1, bitmap)); |
| 74 | |
| 75 | S.SetBorder(20); |
| 76 | S.AddFixedText(message, false, 500); |
| 77 | } |
| 78 | S.EndHorizontalLay(); |
| 79 | |
| 80 | S.SetBorder(2); |
| 81 | if (!log.empty()) |
| 82 | { |
| 83 | S.StartHorizontalLay(wxEXPAND, 1); |
| 84 | { |
| 85 | S.SetBorder(5); |
| 86 | |
| 87 | auto pane = safenew wxCollapsiblePane(S.GetParent(), |
| 88 | wxID_ANY, |
| 89 | XO("Show &Log...").Translation()); |
| 90 | S.Style(wxEXPAND | wxALIGN_LEFT); |
| 91 | S.Prop(1); |
| 92 | S.AddWindow(pane); |
| 93 | |
| 94 | ShuttleGui SI(pane->GetPane(), eIsCreating); |
| 95 | auto text = SI.AddTextWindow(log); |
| 96 | text->SetInsertionPointEnd(); |
| 97 | text->ShowPosition(text->GetLastPosition()); |
| 98 | text->SetMinSize(wxSize(700, 250)); |
| 99 | } |
| 100 | S.EndHorizontalLay(); |
| 101 | } |
| 102 |
nothing calls this directly
no test coverage detected