Mostly we use this so that we have the code for resizability in one place. Other considerations like screen readers are also handled by having the code in one place.
| 81 | /// in one place. Other considerations like screen readers are also |
| 82 | /// handled by having the code in one place. |
| 83 | void HelpSystem::ShowInfoDialog( wxWindow *parent, |
| 84 | const TranslatableString &dlogTitle, |
| 85 | const TranslatableString &shortMsg, |
| 86 | const wxString &message, |
| 87 | const int xSize, const int ySize) |
| 88 | { |
| 89 | wxDialogWrapper dlog(parent, wxID_ANY, |
| 90 | dlogTitle, |
| 91 | wxDefaultPosition, wxDefaultSize, |
| 92 | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMAXIMIZE_BOX /*| wxDEFAULT_FRAME_STYLE */); |
| 93 | |
| 94 | dlog.SetName(); |
| 95 | ShuttleGui S(&dlog, eIsCreating); |
| 96 | |
| 97 | S.StartVerticalLay(1); |
| 98 | { |
| 99 | S.AddTitle( shortMsg ); |
| 100 | S.Style( wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH | wxTE_RICH2 | |
| 101 | wxTE_AUTO_URL | wxTE_NOHIDESEL | wxHSCROLL | wxTE_PROCESS_ENTER) |
| 102 | .AddTextWindow(message) |
| 103 | ->Bind(wxEVT_TEXT_ENTER, [&dlog](auto&) { |
| 104 | dlog.EndModal(wxID_OK); |
| 105 | }); |
| 106 | |
| 107 | S.SetBorder( 0 ); |
| 108 | S.StartHorizontalLay(wxALIGN_CENTER_HORIZONTAL, 0); |
| 109 | S.AddStandardButtons(eOkButton); |
| 110 | S.EndHorizontalLay(); |
| 111 | } |
| 112 | S.EndVerticalLay(); |
| 113 | |
| 114 | // Smallest size is half default size. Seems reasonable. |
| 115 | dlog.SetMinSize( wxSize(xSize/2, ySize/2) ); |
| 116 | dlog.SetSize( wxSize(xSize, ySize) ); |
| 117 | dlog.Center(); |
| 118 | dlog.ShowModal(); |
| 119 | } |
| 120 | |
| 121 | void HelpSystem::ShowHtmlText(wxWindow *pParent, |
| 122 | const TranslatableString &Title, |