Migrate more windows to new window control scheme
This commit is contained in:
@@ -17,14 +17,16 @@
|
||||
# along with pyfa. If not, see <http://www.gnu.org/licenses/>.
|
||||
# =============================================================================
|
||||
|
||||
from logbook import Logger
|
||||
# noinspection PyPackageRequirements
|
||||
import wx
|
||||
from logbook import Logger
|
||||
|
||||
from service.implantSet import ImplantSets
|
||||
from gui.auxFrame import AuxiliaryFrame
|
||||
from gui.builtinViews.entityEditor import BaseValidator, EntityEditor
|
||||
from gui.builtinViews.implantEditor import BaseImplantEditorView
|
||||
from gui.utils.clipboard import toClipboard, fromClipboard
|
||||
from gui.builtinViews.entityEditor import EntityEditor, BaseValidator
|
||||
from gui.utils.clipboard import fromClipboard, toClipboard
|
||||
from service.implantSet import ImplantSets
|
||||
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
@@ -83,7 +85,8 @@ class ImplantSetEntityEditor(EntityEditor):
|
||||
sIS.deleteSet(entity)
|
||||
|
||||
|
||||
class ImplantSetEditor(BaseImplantEditorView):
|
||||
class ImplantSetEditorView(BaseImplantEditorView):
|
||||
|
||||
def __init__(self, parent):
|
||||
BaseImplantEditorView.__init__(self, parent)
|
||||
if 'wxMSW' in wx.PlatformInfo:
|
||||
@@ -112,12 +115,11 @@ class ImplantSetEditor(BaseImplantEditorView):
|
||||
sIS.removeImplant(set_.ID, implant)
|
||||
|
||||
|
||||
class ImplantSetEditorDlg(wx.Dialog):
|
||||
class ImplantSetEditor(AuxiliaryFrame):
|
||||
|
||||
def __init__(self, parent):
|
||||
wx.Dialog.__init__(
|
||||
self, parent, id=wx.ID_ANY,
|
||||
title="Implant Set Editor",
|
||||
super().__init__(
|
||||
parent, id=wx.ID_ANY, title="Implant Set Editor", style=wx.RESIZE_BORDER,
|
||||
size=wx.Size(950, 500) if "wxGTK" in wx.PlatformInfo else wx.Size(850, 420))
|
||||
|
||||
self.block = False
|
||||
@@ -131,7 +133,7 @@ class ImplantSetEditorDlg(wx.Dialog):
|
||||
self.sl = wx.StaticLine(self)
|
||||
mainSizer.Add(self.sl, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
|
||||
|
||||
self.iview = ImplantSetEditor(self)
|
||||
self.iview = ImplantSetEditorView(self)
|
||||
mainSizer.Add(self.iview, 1, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.slfooter = wx.StaticLine(self)
|
||||
@@ -165,7 +167,7 @@ class ImplantSetEditorDlg(wx.Dialog):
|
||||
self.Layout()
|
||||
|
||||
if not self.entityEditor.checkEntitiesExist():
|
||||
self.Destroy()
|
||||
self.Close()
|
||||
return
|
||||
|
||||
self.Bind(wx.EVT_CHOICE, self.entityChanged)
|
||||
@@ -174,11 +176,12 @@ class ImplantSetEditorDlg(wx.Dialog):
|
||||
self.Import.Bind(wx.EVT_BUTTON, self.importPatterns)
|
||||
self.Export.Bind(wx.EVT_BUTTON, self.exportPatterns)
|
||||
|
||||
self.SetMinSize(self.GetSize())
|
||||
self.CenterOnParent()
|
||||
|
||||
def entityChanged(self, event):
|
||||
if not self.entityEditor.checkEntitiesExist():
|
||||
self.Destroy()
|
||||
self.Close()
|
||||
return
|
||||
|
||||
def kbEvent(self, event):
|
||||
|
||||
Reference in New Issue
Block a user