Rework item stats to use new auxiliary frame class
This commit is contained in:
42
gui/auxFrame.py
Normal file
42
gui/auxFrame.py
Normal file
@@ -0,0 +1,42 @@
|
||||
# =============================================================================
|
||||
# Copyright (C) 2010 Diego Duclos
|
||||
#
|
||||
# This file is part of pyfa.
|
||||
#
|
||||
# pyfa is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# pyfa is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with pyfa. If not, see <http://www.gnu.org/licenses/>.
|
||||
# =============================================================================
|
||||
|
||||
|
||||
# noinspection PyPackageRequirements
|
||||
import wx
|
||||
|
||||
|
||||
class AuxiliaryFrame(wx.Frame):
|
||||
|
||||
def __init__(self, parent, id=None, title=None, pos=None, size=None, style=None, name=None):
|
||||
baseStyle = wx.FRAME_NO_TASKBAR | wx.FRAME_FLOAT_ON_PARENT | wx.RESIZE_BORDER | wx.CAPTION | wx.CLOSE_BOX | wx.SYSTEM_MENU
|
||||
kwargs = {
|
||||
'parent': parent,
|
||||
'style': baseStyle if style is None else baseStyle | style}
|
||||
if id is not None:
|
||||
kwargs['id'] = id
|
||||
if title is not None:
|
||||
kwargs['title'] = title
|
||||
if pos is not None:
|
||||
kwargs['pos'] = pos
|
||||
if size is not None:
|
||||
kwargs['size'] = size
|
||||
if name is not None:
|
||||
kwargs['name'] = name
|
||||
super().__init__(**kwargs)
|
||||
@@ -21,25 +21,25 @@
|
||||
import wx
|
||||
|
||||
import config
|
||||
from service.market import Market
|
||||
import gui.mainFrame
|
||||
from eos.saveddata.module import Module
|
||||
from gui.auxFrame import AuxiliaryFrame
|
||||
from gui.bitmap_loader import BitmapLoader
|
||||
|
||||
from gui.builtinItemStatsViews.itemTraits import ItemTraits
|
||||
from gui.builtinItemStatsViews.itemDescription import ItemDescription
|
||||
from gui.builtinItemStatsViews.itemAffectedBy import ItemAffectedBy
|
||||
from gui.builtinItemStatsViews.itemAttributes import ItemParams
|
||||
from gui.builtinItemStatsViews.itemCompare import ItemCompare
|
||||
from gui.builtinItemStatsViews.itemRequirements import ItemRequirements
|
||||
from gui.builtinItemStatsViews.itemDependants import ItemDependents
|
||||
from gui.builtinItemStatsViews.itemDescription import ItemDescription
|
||||
from gui.builtinItemStatsViews.itemEffects import ItemEffects
|
||||
from gui.builtinItemStatsViews.itemAffectedBy import ItemAffectedBy
|
||||
from gui.builtinItemStatsViews.itemProperties import ItemProperties
|
||||
from gui.builtinItemStatsViews.itemMutator import ItemMutatorPanel
|
||||
|
||||
from eos.saveddata.module import Module
|
||||
from gui.builtinItemStatsViews.itemProperties import ItemProperties
|
||||
from gui.builtinItemStatsViews.itemRequirements import ItemRequirements
|
||||
from gui.builtinItemStatsViews.itemTraits import ItemTraits
|
||||
from service.market import Market
|
||||
|
||||
|
||||
class ItemStatsFrame(wx.Frame):
|
||||
class ItemStatsFrame(AuxiliaryFrame):
|
||||
|
||||
counter = 0
|
||||
|
||||
def __init__(
|
||||
@@ -50,15 +50,13 @@ class ItemStatsFrame(wx.Frame):
|
||||
size=wx.DefaultSize,
|
||||
maximized=False
|
||||
):
|
||||
wx.Frame.__init__(
|
||||
self,
|
||||
gui.mainFrame.MainFrame.getInstance(),
|
||||
wx.ID_ANY,
|
||||
super().__init__(
|
||||
parent=gui.mainFrame.MainFrame.getInstance(),
|
||||
id=wx.ID_ANY,
|
||||
title="Item stats",
|
||||
pos=pos,
|
||||
size=size,
|
||||
style=wx.DEFAULT_FRAME_STYLE | wx.FRAME_FLOAT_ON_PARENT
|
||||
)
|
||||
style=wx.RESIZE_BORDER)
|
||||
|
||||
empty = getattr(victim, "isEmpty", False)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user