MCPcopy Create free account
hub / github.com/audacity/audacity / ErrorDialog

Method ErrorDialog

libraries/lib-wx-init/ErrorDialog.cpp:45–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43END_EVENT_TABLE()
44
45ErrorDialog::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

Callers

nothing calls this directly

Calls 11

wxStaticBitmapClass · 0.85
GetSizerFunction · 0.85
AddWindowMethod · 0.80
AddFixedTextMethod · 0.80
TranslationMethod · 0.80
AddTextWindowMethod · 0.80
SetInsertionPointEndMethod · 0.80
wxSizeClass · 0.50
emptyMethod · 0.45
GetParentMethod · 0.45
FitMethod · 0.45

Tested by

no test coverage detected