# HG changeset patch
# User Edouard Tisserant <edouard.tisserant@gmail.com>
# Date 1724106900 -7200
# Node ID 5d46adf7bbbad245941c2bd40ef4fb749e46d8ab
# Parent  f1c673cddc1f7f36485cba16b85f87c8957aa9a5
IDE: Workaround some reported WxPython/MacOS problems.

SetSelection should be used instead of SetStringSelection , and FindString must use case_sensitive=True

diff -r f1c673cddc1f -r 5d46adf7bbba dialogs/FBDVariableDialog.py
--- a/dialogs/FBDVariableDialog.py	Tue Aug 20 00:31:45 2024 +0200
+++ b/dialogs/FBDVariableDialog.py	Tue Aug 20 00:35:00 2024 +0200
@@ -155,10 +155,8 @@
         # Get variable expression and select corresponding value in name list
         # box if it exists
         selected = self.Expression.GetValue()
-        if selected != "" and self.VariableName.FindString(selected) != wx.NOT_FOUND:
-            self.VariableName.SetStringSelection(selected)
-        else:
-            self.VariableName.SetSelection(wx.NOT_FOUND)
+        self.VariableName.SetSelection(
+            wx.NOT_FOUND if selected == "" else self.VariableName.FindString(selected, True))
 
         # Disable name list box if no name present inside
         self.VariableName.Enable(self.VariableName.GetCount() > 0)
@@ -185,10 +183,7 @@
                 # Set expression text control value
                 self.Expression.ChangeValue(value)
                 # Select corresponding text in name list box if it exists
-                if self.VariableName.FindString(value) != wx.NOT_FOUND:
-                    self.VariableName.SetStringSelection(value)
-                else:
-                    self.VariableName.SetSelection(wx.NOT_FOUND)
+                self.VariableName.SetSelection(self.VariableName.FindString(value, True))
 
             # Parameter is variable execution order
             elif name == "executionOrder":
@@ -265,7 +260,7 @@
         """
         # Select the corresponding value in name list box if it exists
         self.VariableName.SetSelection(
-            self.VariableName.FindString(self.Expression.GetValue()))
+            self.VariableName.FindString(self.Expression.GetValue(), True))
 
         self.Refresh()
         event.Skip()