From 89e202dd965d8f9cc94b965c804a31b7e01adb94 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 7 Oct 2015 14:48:27 +0100 Subject: [PATCH] Add message_dialog. --- src/wx/wx_util.cc | 14 +++++++++++++- src/wx/wx_util.h | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc index 3d37c373b..fb10eedc0 100644 --- a/src/wx/wx_util.cc +++ b/src/wx/wx_util.cc @@ -84,7 +84,19 @@ add_label_to_grid_bag_sizer (wxGridBagSizer* s, wxWindow* p, wxString t, bool, w void error_dialog (wxWindow* parent, wxString m) { - wxMessageDialog* d = new wxMessageDialog (parent, m, _("DCP-o-matic"), wxOK); + wxMessageDialog* d = new wxMessageDialog (parent, m, _("DCP-o-matic"), wxOK | wxICON_ERROR); + d->ShowModal (); + d->Destroy (); +} + +/** Pop up an error dialogue box. + * @param parent Parent. + * @param m Message. + */ +void +message_dialog (wxWindow* parent, wxString m) +{ + wxMessageDialog* d = new wxMessageDialog (parent, m, _("DCP-o-matic"), wxOK | wxICON_INFORMATION); d->ShowModal (); d->Destroy (); } diff --git a/src/wx/wx_util.h b/src/wx/wx_util.h index 5afb978b7..dcf137738 100644 --- a/src/wx/wx_util.h +++ b/src/wx/wx_util.h @@ -58,6 +58,7 @@ class wxGridBagSizer; #define S_(x) context_translation(x) extern void error_dialog (wxWindow *, wxString); +extern void message_dialog (wxWindow *, wxString); extern bool confirm_dialog (wxWindow *, wxString); extern wxStaticText* add_label_to_sizer (wxSizer *, wxWindow *, wxString, bool left, int prop = 0); extern wxStaticText* add_label_to_grid_bag_sizer (wxGridBagSizer *, wxWindow *, wxString, bool, wxGBPosition, wxGBSpan span = wxDefaultSpan); -- 2.30.2