Fixed preview drawing/refresh problem in sfc/ld/fbd graphical element creation dialogs on windows (introduced in 9c5f835b031e, continuation of 9622418ac28c)
authorEdouard Tisserant
Tue, 09 Apr 2019 14:08:44 +0200
changeset 2587 c67488bd8134
parent 2586 b89484560a97
child 2588 25f19b76c7b6
child 2589 d94d4f396bbf
Fixed preview drawing/refresh problem in sfc/ld/fbd graphical element creation dialogs on windows (introduced in 9c5f835b031e, continuation of 9622418ac28c)
dialogs/BlockPreviewDialog.py
dialogs/ConnectionDialog.py
dialogs/FBDBlockDialog.py
dialogs/FBDVariableDialog.py
dialogs/LDElementDialog.py
dialogs/LDPowerRailDialog.py
dialogs/SFCDivergenceDialog.py
dialogs/SFCStepDialog.py
dialogs/SFCTransitionDialog.py
--- a/dialogs/BlockPreviewDialog.py	Tue Apr 09 13:18:51 2019 +0200
+++ b/dialogs/BlockPreviewDialog.py	Tue Apr 09 14:08:44 2019 +0200
@@ -250,10 +250,6 @@
         # Close dialog
         self.EndModal(wx.ID_OK)
 
-    def RefreshPreview(self):
-        """Triggers EVT_PAINT event to refresh UI"""
-        self.Refresh()
-
     def DrawPreview(self):
         """
         Refresh preview panel of graphic element
--- a/dialogs/ConnectionDialog.py	Tue Apr 09 13:18:51 2019 +0200
+++ b/dialogs/ConnectionDialog.py	Tue Apr 09 14:08:44 2019 +0200
@@ -138,7 +138,7 @@
                 self.ConnectionName.SetValue(value)
 
         # Refresh preview panel
-        self.RefreshPreview()
+        self.DrawPreview()
 
     def GetValues(self):
         """
@@ -199,7 +199,7 @@
         Called when connection type changed
         @param event: wx.RadioButtonEvent
         """
-        self.RefreshPreview()
+        self.DrawPreview()
         event.Skip()
 
     def OnNameChanged(self, event):
@@ -207,10 +207,10 @@
         Called when connection name value changed
         @param event: wx.TextEvent
         """
-        self.RefreshPreview()
+        self.DrawPreview()
         event.Skip()
 
-    def RefreshPreview(self):
+    def DrawPreview(self):
         """
         Refresh preview panel of graphic element
         Override BlockPreviewDialog function
@@ -221,4 +221,4 @@
                                      self.ConnectionName.GetValue())
 
         # Call BlockPreviewDialog function
-        BlockPreviewDialog.RefreshPreview(self)
+        BlockPreviewDialog.DrawPreview(self)
--- a/dialogs/FBDBlockDialog.py	Tue Apr 09 13:18:51 2019 +0200
+++ b/dialogs/FBDBlockDialog.py	Tue Apr 09 14:08:44 2019 +0200
@@ -199,7 +199,7 @@
                     control.SetValue(value)
 
         # Refresh preview panel
-        self.RefreshPreview()
+        self.DrawPreview()
 
     def GetValues(self):
         """
@@ -293,7 +293,7 @@
             self.BlockName.ChangeValue("")
 
         # Refresh preview panel
-        self.RefreshPreview()
+        self.DrawPreview()
 
     def OnNameChanged(self, event):
         """
@@ -303,7 +303,7 @@
         if self.BlockName.IsEnabled():
             # Save block name typed by user
             self.CurrentBlockName = self.BlockName.GetValue()
-            self.RefreshPreview()
+            self.DrawPreview()
         event.Skip()
 
     def OnInputsChanged(self, event):
@@ -312,7 +312,7 @@
         @param event: wx.SpinEvent
         """
         if self.Inputs.IsEnabled():
-            self.RefreshPreview()
+            self.DrawPreview()
         event.Skip()
 
     def OnExecutionOrderChanged(self, event):
@@ -320,7 +320,7 @@
         Called when block execution order value changed
         @param event: wx.SpinEvent
         """
-        self.RefreshPreview()
+        self.DrawPreview()
         event.Skip()
 
     def OnExecutionControlChanged(self, event):
@@ -328,10 +328,10 @@
         Called when block execution control value changed
         @param event: wx.SpinEvent
         """
-        self.RefreshPreview()
+        self.DrawPreview()
         event.Skip()
 
-    def RefreshPreview(self):
+    def DrawPreview(self):
         """
         Refresh preview panel of graphic element
         Override BlockPreviewDialog function
@@ -355,4 +355,4 @@
             self.Element = None
 
         # Call BlockPreviewDialog function
-        BlockPreviewDialog.RefreshPreview(self)
+        BlockPreviewDialog.DrawPreview(self)
--- a/dialogs/FBDVariableDialog.py	Tue Apr 09 13:18:51 2019 +0200
+++ b/dialogs/FBDVariableDialog.py	Tue Apr 09 14:08:44 2019 +0200
@@ -195,7 +195,7 @@
                 self.ExecutionOrder.SetValue(value)
 
         # Refresh preview panel
-        self.RefreshPreview()
+        self.DrawPreview()
         self.Fit()
 
     def GetValues(self):
@@ -242,7 +242,7 @@
         # Refresh name list box values
         self.RefreshNameList()
 
-        self.RefreshPreview()
+        self.DrawPreview()
         event.Skip()
 
     def OnNameChanged(self, event):
@@ -255,7 +255,7 @@
         if self.VariableName.GetSelection() != wx.NOT_FOUND:
             self.Expression.ChangeValue(self.VariableName.GetStringSelection())
 
-        self.RefreshPreview()
+        self.DrawPreview()
         event.Skip()
 
     def OnExpressionChanged(self, event):
@@ -267,7 +267,7 @@
         self.VariableName.SetSelection(
             self.VariableName.FindString(self.Expression.GetValue()))
 
-        self.RefreshPreview()
+        self.DrawPreview()
         event.Skip()
 
     def OnExecutionOrderChanged(self, event):
@@ -275,10 +275,10 @@
         Called when block execution control value changed
         @param event: wx.SpinEvent
         """
-        self.RefreshPreview()
-        event.Skip()
-
-    def RefreshPreview(self):
+        self.DrawPreview()
+        event.Skip()
+
+    def DrawPreview(self):
         """
         Refresh preview panel of graphic element
         Override BlockPreviewDialog function
@@ -295,4 +295,4 @@
             executionOrder=self.ExecutionOrder.GetValue())
 
         # Call BlockPreviewDialog function
-        BlockPreviewDialog.RefreshPreview(self)
+        BlockPreviewDialog.DrawPreview(self)
--- a/dialogs/LDElementDialog.py	Tue Apr 09 13:18:51 2019 +0200
+++ b/dialogs/LDElementDialog.py	Tue Apr 09 14:08:44 2019 +0200
@@ -156,7 +156,7 @@
                 self.ModifierRadioButtons[value].SetValue(True)
 
         # Refresh preview panel
-        self.RefreshPreview()
+        self.DrawPreview()
 
     def GetValues(self):
         """
@@ -174,7 +174,7 @@
         Called when LD element modifier changed
         @param event: wx.RadioButtonEvent
         """
-        self.RefreshPreview()
+        self.DrawPreview()
         event.Skip()
 
     def OnVariableChanged(self, event):
@@ -182,10 +182,10 @@
         Called when LD element associated variable changed
         @param event: wx.ComboBoxEvent
         """
-        self.RefreshPreview()
+        self.DrawPreview()
         event.Skip()
 
-    def RefreshPreview(self):
+    def DrawPreview(self):
         """
         Refresh preview panel of graphic element
         Override BlockPreviewDialog function
@@ -202,7 +202,7 @@
         button.Enable(value != "")
 
         # Call BlockPreviewDialog function
-        BlockPreviewDialog.RefreshPreview(self)
+        BlockPreviewDialog.DrawPreview(self)
 
     def OnOK(self, event):
         if self.ElementVariable.GetValue() != "":
--- a/dialogs/LDPowerRailDialog.py	Tue Apr 09 13:18:51 2019 +0200
+++ b/dialogs/LDPowerRailDialog.py	Tue Apr 09 14:08:44 2019 +0200
@@ -144,7 +144,7 @@
         Called when power rail type changed
         @param event: wx.RadioButtonEvent
         """
-        self.RefreshPreview()
+        self.DrawPreview()
         event.Skip()
 
     def OnPinNumberChanged(self, event):
@@ -152,7 +152,7 @@
         Called when power rail pin number value changed
         @param event: wx.SpinEvent
         """
-        self.RefreshPreview()
+        self.DrawPreview()
         event.Skip()
 
     def DrawPreview(self):
--- a/dialogs/SFCDivergenceDialog.py	Tue Apr 09 13:18:51 2019 +0200
+++ b/dialogs/SFCDivergenceDialog.py	Tue Apr 09 14:08:44 2019 +0200
@@ -144,7 +144,7 @@
         Called when SFC divergence type changed
         @param event: wx.RadioButtonEvent
         """
-        self.RefreshPreview()
+        self.DrawPreview()
         event.Skip()
 
     def OnSequencesChanged(self, event):
@@ -152,10 +152,10 @@
         Called when SFC divergence number of sequences changed
         @param event: wx.SpinEvent
         """
-        self.RefreshPreview()
+        self.DrawPreview()
         event.Skip()
 
-    def RefreshPreview(self):
+    def DrawPreview(self):
         """
         Refresh preview panel of graphic element
         Override BlockPreviewDialog function
@@ -166,4 +166,4 @@
                                       self.Sequences.GetValue())
 
         # Call BlockPreviewDialog function
-        BlockPreviewDialog.RefreshPreview(self)
+        BlockPreviewDialog.DrawPreview(self)
--- a/dialogs/SFCStepDialog.py	Tue Apr 09 13:18:51 2019 +0200
+++ b/dialogs/SFCStepDialog.py	Tue Apr 09 14:08:44 2019 +0200
@@ -120,7 +120,7 @@
                     control.SetValue(value)
 
         # Refresh preview panel
-        self.RefreshPreview()
+        self.DrawPreview()
 
     def GetValues(self):
         """
@@ -163,7 +163,7 @@
         Called when a step connector value changed
         @param event: wx.CheckBoxEvent
         """
-        self.RefreshPreview()
+        self.DrawPreview()
         event.Skip()
 
     def OnNameChanged(self, event):
@@ -171,10 +171,10 @@
         Called when step name value changed
         @param event: wx.TextEvent
         """
-        self.RefreshPreview()
+        self.DrawPreview()
         event.Skip()
 
-    def RefreshPreview(self):
+    def DrawPreview(self):
         """
         Refresh preview panel of graphic element
         Override BlockPreviewDialog function
@@ -192,4 +192,4 @@
                 getattr(self.Element, "Remove" + name.capitalize())()
 
         # Call BlockPreviewDialog function
-        BlockPreviewDialog.RefreshPreview(self)
+        BlockPreviewDialog.DrawPreview(self)
--- a/dialogs/SFCTransitionDialog.py	Tue Apr 09 13:18:51 2019 +0200
+++ b/dialogs/SFCTransitionDialog.py	Tue Apr 09 14:08:44 2019 +0200
@@ -156,7 +156,7 @@
                                 control.ChangeValue(type_value)
 
         # Refresh preview panel
-        self.RefreshPreview()
+        self.DrawPreview()
 
     def GetValues(self):
         """
@@ -202,7 +202,7 @@
                 control.Enable(radio.GetValue())
 
         # Refresh preview panel
-        self.RefreshPreview()
+        self.DrawPreview()
         event.Skip()
 
     def OnReferenceChanged(self, event):
@@ -210,7 +210,7 @@
         Called when SFC transition reference value changed
         @param event: wx.ComboBoxEvent
         """
-        self.RefreshPreview()
+        self.DrawPreview()
         event.Skip()
 
     def OnInlineChanged(self, event):
@@ -218,7 +218,7 @@
         Called when SFC transition inline value changed
         @param event: wx.TextEvent
         """
-        self.RefreshPreview()
+        self.DrawPreview()
         event.Skip()
 
     def OnPriorityChanged(self, event):
@@ -226,10 +226,10 @@
         Called when block inputs number changed
         @param event: wx.SpinEvent
         """
-        self.RefreshPreview()
-        event.Skip()
-
-    def RefreshPreview(self):
+        self.DrawPreview()
+        event.Skip()
+
+    def DrawPreview(self):
         """
         Refresh preview panel of graphic element
         Override BlockPreviewDialog function
@@ -240,4 +240,4 @@
         self.Element.SetPriority(self.Priority.GetValue())
 
         # Call BlockPreviewDialog function
-        BlockPreviewDialog.RefreshPreview(self)
+        BlockPreviewDialog.DrawPreview(self)