diff options
| author | Lex Neva <lexelby@users.noreply.github.com> | 2023-09-07 13:25:47 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-07 19:25:47 +0200 |
| commit | af96d720e9340e02b1ec6dafe10bf9a47e045804 (patch) | |
| tree | a49d9b1570050db02ff8f17b754e54ec7b9a6e1a /lib/gui/warnings.py | |
| parent | 3db335b0f41ebfcc694914bba5bf81aed9ae98d4 (diff) | |
improve params errors (#2437)
Diffstat (limited to 'lib/gui/warnings.py')
| -rw-r--r-- | lib/gui/warnings.py | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/lib/gui/warnings.py b/lib/gui/warnings.py index 48788652..eda1ca2e 100644 --- a/lib/gui/warnings.py +++ b/lib/gui/warnings.py @@ -15,14 +15,25 @@ class WarningPanel(wx.Panel): 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.main_sizer = wx.BoxSizer(wx.VERTICAL) self.warning = wx.StaticText(self) - self.warning.SetLabel(_("Cannot load simulator.\nClose Params to get full error message.")) + self.warning.SetLabel(_("An error occurred while rendering the stitch plan:")) self.warning.SetForegroundColour(wx.Colour(255, 25, 25)) + self.main_sizer.Add(self.warning, 1, wx.LEFT | wx.BOTTOM | wx.EXPAND, 10) - warning_sizer = wx.StaticBoxSizer(self.warning_box, wx.HORIZONTAL) - warning_sizer.Add(self.warning, 1, wx.LEFT | wx.BOTTOM | wx.EXPAND, 10) + tc_style = wx.TE_MULTILINE | wx.TE_READONLY | wx.VSCROLL | wx.TE_RICH2 + self.warning_text = wx.TextCtrl(self, size=(300, 100), style=tc_style) + font = self.warning_text.GetFont() + font.SetFamily(wx.FONTFAMILY_TELETYPE) + self.warning_text.SetFont(font) + self.main_sizer.Add(self.warning_text, 3, wx.LEFT | wx.BOTTOM | wx.EXPAND, 10) - self.SetSizerAndFit(warning_sizer) + self.SetSizerAndFit(self.main_sizer) self.Layout() + + def set_warning_text(self, text): + self.warning_text.SetValue(text) + + def clear(self): + self.warning_text.SetValue("") |
