| 67 | END_EVENT_TABLE() |
| 68 | |
| 69 | MultiDialog::MultiDialog(wxWindow * pParent, |
| 70 | const TranslatableString &message, |
| 71 | const TranslatableString &title, |
| 72 | const TranslatableStrings &buttons, |
| 73 | const ManualPageID &helpPage, |
| 74 | const TranslatableString &boxMsg, |
| 75 | bool log |
| 76 | ) |
| 77 | : wxDialogWrapper(pParent, wxID_ANY, title, |
| 78 | wxDefaultPosition, wxDefaultSize, |
| 79 | wxCAPTION), // not wxDEFAULT_DIALOG_STYLE because we don't want wxCLOSE_BOX and wxSYSTEM_MENU |
| 80 | mHelpPage( helpPage) |
| 81 | { |
| 82 | SetName(); |
| 83 | |
| 84 | ShuttleGui S{ this, eIsCreating }; |
| 85 | { |
| 86 | S.SetBorder( 5 ); |
| 87 | S.StartVerticalLay( 0 ); |
| 88 | { |
| 89 | S.StartHorizontalLay(wxALIGN_LEFT | wxALL, 0); |
| 90 | { |
| 91 | S.SetBorder( 0 ); |
| 92 | wxBitmap bitmap = wxArtProvider::GetIcon(wxART_WARNING, |
| 93 | wxART_MESSAGE_BOX); |
| 94 | auto icon = safenew wxStaticBitmap(S.GetParent(), -1, bitmap); |
| 95 | S |
| 96 | .Position( wxCENTER ) |
| 97 | .AddWindow( icon ); |
| 98 | |
| 99 | S.SetBorder( 15 ); |
| 100 | S.Prop(1).AddVariableText( message, false, wxCENTER | wxLEFT ); |
| 101 | } |
| 102 | S.EndHorizontalLay(); |
| 103 | |
| 104 | const auto buttonLabels = transform_container<wxArrayStringEx>( |
| 105 | buttons, std::mem_fn( &TranslatableString::Translation ) ); |
| 106 | |
| 107 | const auto count = buttons.size(); |
| 108 | |
| 109 | const auto boxStr = boxMsg.Translation(); |
| 110 | |
| 111 | S.SetBorder( 5 ); |
| 112 | |
| 113 | mRadioBox = safenew wxRadioBox(S.GetParent(), -1, |
| 114 | boxStr, |
| 115 | wxDefaultPosition, wxDefaultSize, |
| 116 | count, count ? &buttonLabels[0] : nullptr, |
| 117 | 1, wxRA_SPECIFY_COLS); |
| 118 | mRadioBox->SetSelection(0); |
| 119 | S.Prop( 1 ) |
| 120 | .Name( boxMsg ) |
| 121 | .Position(wxEXPAND | wxALL) |
| 122 | .AddWindow( mRadioBox ); |
| 123 | |
| 124 | |
| 125 | S.StartHorizontalLay(wxALIGN_CENTER | wxALL, 0); |
| 126 | { |
nothing calls this directly
no test coverage detected