summaryrefslogtreecommitdiff
path: root/lib/gui/warnings.py
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2021-04-10 19:55:48 +0200
committerGitHub <noreply@github.com>2021-04-10 19:55:48 +0200
commit7ce3c8e7a04b86163f3b9f0a206b135411e3293b (patch)
treefb9ead1ac9c2d00bede6945b28c44a23d7bed3bc /lib/gui/warnings.py
parent22f1bc5cb007fe44ed5b238d197e5ce83180d33b (diff)
output a warning in params if simulation cannot load (#1143)
Diffstat (limited to 'lib/gui/warnings.py')
-rw-r--r--lib/gui/warnings.py28
1 files changed, 28 insertions, 0 deletions
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()