From 7ce3c8e7a04b86163f3b9f0a206b135411e3293b Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Sat, 10 Apr 2021 19:55:48 +0200 Subject: output a warning in params if simulation cannot load (#1143) --- lib/gui/warnings.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 lib/gui/warnings.py (limited to 'lib/gui/warnings.py') diff --git a/lib/gui/warnings.py b/lib/gui/warnings.py new file mode 100644 index 00000000..48788652 --- /dev/null +++ b/lib/gui/warnings.py @@ -0,0 +1,28 @@ +# Authors: see git history +# +# Copyright (c) 2021 Authors +# Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details. + +import wx + +from ..i18n import _ + + +class WarningPanel(wx.Panel): + """A wx.Panel for to display warnings. + """ + + def __init__(self, parent, *args, **kwargs): + wx.Panel.__init__(self, parent, wx.ID_ANY, *args, **kwargs) + + self.warning_box = wx.StaticBox(self, wx.ID_ANY) + + self.warning = wx.StaticText(self) + self.warning.SetLabel(_("Cannot load simulator.\nClose Params to get full error message.")) + self.warning.SetForegroundColour(wx.Colour(255, 25, 25)) + + warning_sizer = wx.StaticBoxSizer(self.warning_box, wx.HORIZONTAL) + warning_sizer.Add(self.warning, 1, wx.LEFT | wx.BOTTOM | wx.EXPAND, 10) + + self.SetSizerAndFit(warning_sizer) + self.Layout() -- cgit v1.2.3