wxPython4 sequels: fix exception in connection dialog, force black text in FBD.
authorEdouard Tisserant <edouard.tisserant@gmail.com>
Mon, 11 Jul 2022 22:21:20 +0200
changeset 3537 cb7db021280c
parent 3534 7f62da4362fd
child 3538 d6c9da8d594e
wxPython4 sequels: fix exception in connection dialog, force black text in FBD.

- wxPython4 does not have RemoveSizer in API anymore.
- On GTK3 with dark theme default text colour is white, making it unreadable.
dialogs/ConnectionDialog.py
graphics/FBD_Objects.py
--- a/dialogs/ConnectionDialog.py	Thu Jul 07 21:41:35 2022 +0200
+++ b/dialogs/ConnectionDialog.py	Mon Jul 11 22:21:20 2022 +0200
@@ -93,7 +93,7 @@
         self.MainSizer.Add(
             self.ButtonSizer, border=20,
             flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT)
-        self.ColumnSizer.RemoveSizer(self.RightGridSizer)
+        self.ColumnSizer.Remove(self.RightGridSizer)
 
         # Add button for applying connection name modification to all connection
         # of POU
--- a/graphics/FBD_Objects.py	Thu Jul 07 21:41:35 2022 +0200
+++ b/graphics/FBD_Objects.py	Mon Jul 11 22:21:20 2022 +0200
@@ -771,6 +771,7 @@
         Graphic_Element.Draw(self, dc)
         dc.SetPen(MiterPen(wx.BLACK))
         dc.SetBrush(wx.WHITE_BRUSH)
+        dc.SetTextForeground(wx.BLACK)
 
         if getattr(dc, "printing", False):
             name_size = dc.GetTextExtent(self.Name)
@@ -1011,6 +1012,7 @@
         Graphic_Element.Draw(self, dc)
         dc.SetPen(MiterPen(wx.BLACK))
         dc.SetBrush(wx.WHITE_BRUSH)
+        dc.SetTextForeground(wx.BLACK)
 
         if getattr(dc, "printing", False):
             name_size = dc.GetTextExtent(self.Name)