RichMessageDialog on non-MSW platforms: Set escape ID to wxID_CANCEL

+ Fixed behavior of the "Open hyperlink" dialog when "cross"(close window button) is clicked.
This commit is contained in:
YuSanka 2021-12-09 16:00:12 +01:00
parent 27883caa08
commit f1429f026c
2 changed files with 5 additions and 1 deletions

View File

@ -293,7 +293,9 @@ public:
const wxString& message,
const wxString& caption = wxEmptyString,
long style = wxOK)
: wxRichMessageDialog(parent, message, caption, style) {}
: wxRichMessageDialog(parent, message, caption, style) {
this->SetEscapeId(wxID_CANCEL);
}
~RichMessageDialog() {}
};
#endif

View File

@ -984,6 +984,8 @@ bool OptionsGroup::launch_browser(const std::string& path_end)
RichMessageDialog dialog(parent, _L("Open hyperlink in default browser?"), _L("PrusaSlicer: Open hyperlink"), wxYES_NO);
dialog.ShowCheckBox(_L("Remember my choice"));
int answer = dialog.ShowModal();
if (answer == wxID_CANCEL)
return false;
if (dialog.IsCheckBoxChecked()) {
wxString preferences_item = _L("Suppress to open hyperlink in browser");