From b9f0812b38bc1bef68f501b24f248246a2bfaacb Mon Sep 17 00:00:00 2001 From: blitzmann Date: Tue, 28 Jun 2016 23:24:01 -0400 Subject: [PATCH] Fix issue with entity editor and wxPython 2.8 --- gui/builtinViews/entityEditor.py | 7 ++++--- gui/characterEditor.py | 4 ++-- gui/patternEditor.py | 4 ++-- gui/resistsEditor.py | 4 ++-- gui/setEditor.py | 4 ++-- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/gui/builtinViews/entityEditor.py b/gui/builtinViews/entityEditor.py index 112c1c63e..b62060357 100644 --- a/gui/builtinViews/entityEditor.py +++ b/gui/builtinViews/entityEditor.py @@ -98,7 +98,8 @@ class EntityEditor (wx.Panel): dlg.CenterOnParent() if dlg.ShowModal() == wx.ID_OK: - new = self.DoNew(dlg.GetValue().strip()) + # using dlg.textctrl.GetValue instead of simply dlg.GetValue because the proper way does not work in wxPython 2.8 + new = self.DoNew(dlg.txtctrl.GetValue().strip()) self.refreshEntityList(new) wx.PostEvent(self.entityChoices, wx.CommandEvent(wx.wxEVT_COMMAND_CHOICE_SELECTED)) else: @@ -114,7 +115,7 @@ class EntityEditor (wx.Panel): dlg.CenterOnParent() if dlg.ShowModal() == wx.ID_OK: - copy = self.DoCopy(active, dlg.GetValue().strip()) + copy = self.DoCopy(active, dlg.txtctrl.GetValue().strip()) self.refreshEntityList(copy) wx.PostEvent(self.entityChoices, wx.CommandEvent(wx.wxEVT_COMMAND_CHOICE_SELECTED)) @@ -128,7 +129,7 @@ class EntityEditor (wx.Panel): dlg.CenterOnParent() if dlg.ShowModal() == wx.ID_OK: - self.DoRename(active, dlg.GetValue().strip()) + self.DoRename(active, dlg.txtctrl.GetValue().strip()) self.refreshEntityList(active) wx.PostEvent(self.entityChoices, wx.CommandEvent(wx.wxEVT_COMMAND_CHOICE_SELECTED)) diff --git a/gui/characterEditor.py b/gui/characterEditor.py index 862660fbb..bf7db18bf 100644 --- a/gui/characterEditor.py +++ b/gui/characterEditor.py @@ -37,14 +37,14 @@ class CharacterTextValidor(BaseValidator): return CharacterTextValidor() def Validate(self, win): - profileEditor = win.Parent + entityEditor = win.parent textCtrl = self.GetWindow() text = textCtrl.GetValue().strip() try: if len(text) == 0: raise ValueError("You must supply a name for the Character!") - elif text in [x.name for x in profileEditor.entityEditor.choices]: + elif text in [x.name for x in entityEditor.choices]: raise ValueError("Character name already in use, please choose another.") return True diff --git a/gui/patternEditor.py b/gui/patternEditor.py index c36a1e80c..171eed7a5 100644 --- a/gui/patternEditor.py +++ b/gui/patternEditor.py @@ -36,14 +36,14 @@ class DmgPatternTextValidor(BaseValidator): return DmgPatternTextValidor() def Validate(self, win): - profileEditor = win.Parent + entityEditor = win.parent textCtrl = self.GetWindow() text = textCtrl.GetValue().strip() try: if len(text) == 0: raise ValueError("You must supply a name for your Damage Profile!") - elif text in [x.name for x in profileEditor.entityEditor.choices]: + elif text in [x.name for x in entityEditor.choices]: raise ValueError("Damage Profile name already in use, please choose another.") return True diff --git a/gui/resistsEditor.py b/gui/resistsEditor.py index 097b8ad9d..37d04b032 100644 --- a/gui/resistsEditor.py +++ b/gui/resistsEditor.py @@ -33,14 +33,14 @@ class TargetResistsTextValidor(BaseValidator): return TargetResistsTextValidor() def Validate(self, win): - profileEditor = win.parent.Parent + entityEditor = win.parent textCtrl = self.GetWindow() text = textCtrl.GetValue().strip() try: if len(text) == 0: raise ValueError("You must supply a name for your Target Resist Profile!") - elif text in [x.name for x in profileEditor.entityEditor.choices]: + elif text in [x.name for x in entityEditor.choices]: raise ValueError("Target Resist Profile name already in use, please choose another.") return True diff --git a/gui/setEditor.py b/gui/setEditor.py index 4e8baa9ed..84090f6ff 100644 --- a/gui/setEditor.py +++ b/gui/setEditor.py @@ -36,14 +36,14 @@ class ImplantTextValidor(BaseValidator): return ImplantTextValidor() def Validate(self, win): - profileEditor = win.parent.Parent + entityEditor = win.parent textCtrl = self.GetWindow() text = textCtrl.GetValue().strip() try: if len(text) == 0: raise ValueError("You must supply a name for the Implant Set!") - elif text in [x.name for x in profileEditor.entityEditor.choices]: + elif text in [x.name for x in entityEditor.choices]: raise ValueError("Imlplant Set name already in use, please choose another.") return True