Tentative fix for character editor issues.
This commit is contained in:
@@ -29,18 +29,16 @@ from gui.contextMenu import ContextMenu
|
|||||||
from wx.lib.buttons import GenBitmapButton
|
from wx.lib.buttons import GenBitmapButton
|
||||||
import gui.globalEvents as GE
|
import gui.globalEvents as GE
|
||||||
|
|
||||||
class CharacterEditor(wx.Frame):
|
class CharacterEditor(wx.Dialog):
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
wx.Frame.__init__ (self, parent, id=wx.ID_ANY, title=u"pyfa: Character Editor", pos=wx.DefaultPosition,
|
wx.Dialog.__init__ (self, parent, id=wx.ID_ANY, title=u"pyfa: Character Editor", pos=wx.DefaultPosition,
|
||||||
size=wx.Size(641, 600), style=wx.DEFAULT_FRAME_STYLE|wx.FRAME_FLOAT_ON_PARENT|wx.TAB_TRAVERSAL)
|
size=wx.Size(640, 600), style=wx.DEFAULT_DIALOG_STYLE)
|
||||||
|
|
||||||
i = wx.IconFromBitmap(BitmapLoader.getBitmap("character_small", "gui"))
|
i = wx.IconFromBitmap(BitmapLoader.getBitmap("character_small", "gui"))
|
||||||
self.SetIcon(i)
|
self.SetIcon(i)
|
||||||
|
|
||||||
self.mainFrame = parent
|
self.mainFrame = parent
|
||||||
|
|
||||||
#self.disableWin = wx.WindowDisabler(self)
|
|
||||||
self.SetSizeHintsSz(wx.Size(640, 600), wx.DefaultSize)
|
|
||||||
self.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_BTNFACE ) )
|
self.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_BTNFACE ) )
|
||||||
|
|
||||||
mainSizer = wx.BoxSizer(wx.VERTICAL)
|
mainSizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
@@ -170,12 +168,11 @@ class CharacterEditor(wx.Frame):
|
|||||||
self.btnRestrict()
|
self.btnRestrict()
|
||||||
|
|
||||||
def editingFinished(self, event):
|
def editingFinished(self, event):
|
||||||
#del self.disableWin
|
|
||||||
wx.PostEvent(self.mainFrame, GE.CharListUpdated())
|
wx.PostEvent(self.mainFrame, GE.CharListUpdated())
|
||||||
self.Destroy()
|
self.Close()
|
||||||
|
|
||||||
def registerEvents(self):
|
def registerEvents(self):
|
||||||
self.Bind(wx.EVT_CLOSE, self.closeEvent)
|
self.Bind(wx.EVT_CLOSE, self.OnClose)
|
||||||
self.Bind(GE.CHAR_LIST_UPDATED, self.refreshCharacterList)
|
self.Bind(GE.CHAR_LIST_UPDATED, self.refreshCharacterList)
|
||||||
self.charChoice.Bind(wx.EVT_CHOICE, self.charChanged)
|
self.charChoice.Bind(wx.EVT_CHOICE, self.charChanged)
|
||||||
|
|
||||||
@@ -199,11 +196,6 @@ class CharacterEditor(wx.Frame):
|
|||||||
self.sview.populateSkillTree()
|
self.sview.populateSkillTree()
|
||||||
wx.PostEvent(self, GE.CharListUpdated())
|
wx.PostEvent(self, GE.CharListUpdated())
|
||||||
|
|
||||||
def closeEvent(self, event):
|
|
||||||
#del self.disableWin
|
|
||||||
wx.PostEvent(self.mainFrame, GE.CharListUpdated())
|
|
||||||
self.Destroy()
|
|
||||||
|
|
||||||
def restrict(self):
|
def restrict(self):
|
||||||
self.btnRename.Enable(False)
|
self.btnRename.Enable(False)
|
||||||
self.btnDelete.Enable(False)
|
self.btnDelete.Enable(False)
|
||||||
@@ -319,14 +311,15 @@ class CharacterEditor(wx.Frame):
|
|||||||
|
|
||||||
wx.PostEvent(self, GE.CharChanged())
|
wx.PostEvent(self, GE.CharChanged())
|
||||||
|
|
||||||
def Destroy(self):
|
def OnClose(self, event):
|
||||||
|
wx.PostEvent(self.mainFrame, GE.CharListUpdated())
|
||||||
sFit = service.Fit.getInstance()
|
sFit = service.Fit.getInstance()
|
||||||
fitID = self.mainFrame.getActiveFit()
|
fitID = self.mainFrame.getActiveFit()
|
||||||
if fitID is not None:
|
if fitID is not None:
|
||||||
sFit.clearFit(fitID)
|
sFit.clearFit(fitID)
|
||||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))
|
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))
|
||||||
|
|
||||||
wx.Frame.Destroy(self)
|
self.Destroy()
|
||||||
|
|
||||||
class SkillTreeView (wx.Panel):
|
class SkillTreeView (wx.Panel):
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
|
|||||||
@@ -350,7 +350,7 @@ class MainFrame(wx.Frame):
|
|||||||
|
|
||||||
def showCharacterEditor(self, event):
|
def showCharacterEditor(self, event):
|
||||||
dlg=CharacterEditor(self)
|
dlg=CharacterEditor(self)
|
||||||
dlg.Show()
|
dlg.ShowModal()
|
||||||
|
|
||||||
def showAttrEditor(self, event):
|
def showAttrEditor(self, event):
|
||||||
dlg=AttributeEditor(self)
|
dlg=AttributeEditor(self)
|
||||||
|
|||||||
Reference in New Issue
Block a user