misc fixes

This commit is contained in:
Ryan Holmes
2017-06-12 21:09:50 -04:00
parent 951b35a345
commit 361f7fc5bb
9 changed files with 28 additions and 28 deletions

View File

@@ -36,10 +36,10 @@ from gui.toggle_panel import TogglePanel
class AdditionsPane(TogglePanel):
def __init__(self, parent):
TogglePanel.__init__(self, parent, forceLayout=1)
TogglePanel.__init__(self, parent, force_layout=1)
self.SetLabel("Additions")
pane = self.GetContentPane()
pane = self.GetContentPanel()
baseSizer = wx.BoxSizer(wx.HORIZONTAL)
pane.SetSizer(baseSizer)
@@ -59,28 +59,28 @@ class AdditionsPane(TogglePanel):
notesImg = BitmapLoader.getImage("skill_small", "gui")
self.drone = DroneView(self.notebook)
self.notebook.AddPage(self.drone, "Drones", tabImage=droneImg, showClose=False)
self.notebook.AddPage(self.drone, "Drones", image=droneImg, closeable=False)
self.fighter = FighterView(self.notebook)
self.notebook.AddPage(self.fighter, "Fighters", tabImage=fighterImg, showClose=False)
self.notebook.AddPage(self.fighter, "Fighters", image=fighterImg, closeable=False)
self.cargo = CargoView(self.notebook)
self.notebook.AddPage(self.cargo, "Cargo", tabImage=cargoImg, showClose=False)
self.notebook.AddPage(self.cargo, "Cargo", image=cargoImg, closeable=False)
self.implant = ImplantView(self.notebook)
self.notebook.AddPage(self.implant, "Implants", tabImage=implantImg, showClose=False)
self.notebook.AddPage(self.implant, "Implants", image=implantImg, closeable=False)
self.booster = BoosterView(self.notebook)
self.notebook.AddPage(self.booster, "Boosters", tabImage=boosterImg, showClose=False)
self.notebook.AddPage(self.booster, "Boosters", image=boosterImg, closeable=False)
self.projectedPage = ProjectedView(self.notebook)
self.notebook.AddPage(self.projectedPage, "Projected", tabImage=projectedImg, showClose=False)
self.notebook.AddPage(self.projectedPage, "Projected", image=projectedImg, closeable=False)
self.gangPage = CommandView(self.notebook)
self.notebook.AddPage(self.gangPage, "Command", tabImage=gangImg, showClose=False)
self.notebook.AddPage(self.gangPage, "Command", image=gangImg, closeable=False)
self.notes = NotesView(self.notebook)
self.notebook.AddPage(self.notes, "Notes", tabImage=notesImg, showClose=False)
self.notebook.AddPage(self.notes, "Notes", image=notesImg, closeable=False)
self.notebook.SetSelection(0)

View File

@@ -60,7 +60,8 @@ class FighterView(wx.Panel):
mainSizer.Add(self.fighterDisplay, 1, wx.EXPAND, 0)
textSizer = wx.BoxSizer(wx.HORIZONTAL)
textSizer.AddSpacer((0, 0), 1, wx.EXPAND, 5)
# @todo pheonix: Add spacer doesn't take a tuple anymore, using int of 0, and other parameters are killed off
textSizer.AddSpacer(0)
for x in self.labels:
lbl = wx.StaticText(self, wx.ID_ANY, x.capitalize())
@@ -75,7 +76,7 @@ class FighterView(wx.Panel):
lbl = wx.StaticText(self, wx.ID_ANY, "0")
setattr(self, "label%sTotal" % (x.capitalize()), lbl)
textSizer.Add(lbl, 0, wx.ALIGN_CENTER)
textSizer.AddSpacer((0, 0), 1, wx.EXPAND, 5)
textSizer.AddSpacer(0)
mainSizer.Add(textSizer, 0, wx.EXPAND, 5)
@@ -94,7 +95,7 @@ class FighterView(wx.Panel):
slot = getattr(Slot, "F_{}".format(x.upper()))
used = fit.getSlotsUsed(slot)
total = fit.getNumSlots(slot)
color = wx.Colour(204, 51, 51) if used > total else wx.SystemSettings_GetColour(
color = wx.Colour(204, 51, 51) if used > total else wx.SystemSettings.GetColour(
wx.SYS_COLOUR_WINDOWTEXT)
lbl = getattr(self, "label%sUsed" % x.capitalize())

View File

@@ -41,12 +41,12 @@ class ImplantView(wx.Panel):
mainSizer.Add(self.implantDisplay, 1, wx.EXPAND, 0)
radioSizer = wx.BoxSizer(wx.HORIZONTAL)
radioSizer.AddSpacer((0, 0), 1, wx.EXPAND, 5)
radioSizer.AddSpacer(0)
self.rbFit = wx.RadioButton(self, id=wx.ID_ANY, label="Use Fit-specific Implants", style=wx.RB_GROUP)
self.rbChar = wx.RadioButton(self, id=wx.ID_ANY, label="Use Character Implants")
radioSizer.Add(self.rbFit, 0, wx.ALL, 5)
radioSizer.Add(self.rbChar, 0, wx.ALL, 5)
radioSizer.AddSpacer((0, 0), 1, wx.EXPAND, 5)
radioSizer.AddSpacer(0)
mainSizer.Add(radioSizer, 0, wx.EXPAND, 5)

View File

@@ -51,7 +51,7 @@ class FitSpawner(gui.multiSwitch.TabSpawner):
self.multiSwitch = multiSwitch
self.mainFrame = mainFrame = gui.mainFrame.MainFrame.getInstance()
mainFrame.Bind(EVT_FIT_SELECTED, self.fitSelected)
self.multiSwitch.tabsContainer.handleDrag = self.handleDrag
self.multiSwitch.tabs_container.handleDrag = self.handleDrag
def fitSelected(self, event):
count = -1

View File

@@ -24,7 +24,7 @@ from .utils.floatspin import FloatSpin
# noinspection PyPackageRequirements
import wx.lib.newevent
# noinspection PyPackageRequirements
import wx.gizmos
from wx.dataview import TreeListCtrl
from gui.bitmap_loader import BitmapLoader
from gui.contextMenu import ContextMenu
import gui.globalEvents as GE
@@ -306,7 +306,7 @@ class SkillTreeView(wx.Panel):
self.searchTimer = wx.Timer(self)
self.Bind(wx.EVT_TIMER, self.populateSkillTreeSkillSearch, self.searchTimer)
tree = self.skillTreeListCtrl = wx.gizmos.TreeListCtrl(self, wx.ID_ANY, style=wx.TR_DEFAULT_STYLE | wx.TR_HIDE_ROOT)
tree = self.skillTreeListCtrl = TreeListCtrl(self, wx.ID_ANY, style=wx.TR_DEFAULT_STYLE | wx.TR_HIDE_ROOT)
pmainSizer.Add(tree, 1, wx.EXPAND | wx.ALL, 5)
self.imageList = wx.ImageList(16, 16)

View File

@@ -205,8 +205,7 @@ class ChromeNotebook(wx.Panel):
wx.PostEvent(self, PageChanged(current_page, new_page))
def AddPage(self, win=None, title="Empty Tab", image: wx.Image=None,
closeable=True):
def AddPage(self, win=None, title="Empty Tab", image: wx.Image=None, closeable=True):
if self._active_page:
self._active_page.Hide()

View File

@@ -69,7 +69,7 @@ class Display(wx.ListCtrl):
info = wx.ListItem()
# noinspection PyPropertyAccess
info.m_mask = wx.LIST_MASK_WIDTH
self.InsertColumnInfo(i, info)
self.InsertColumn(i, info)
self.SetColumnWidth(i, 0)
self.imageListBase = self.imageList.ImageCount
@@ -156,7 +156,7 @@ class Display(wx.ListCtrl):
info.m_text = col.columnText
info.m_width = -1
info.m_format = wx.LIST_FORMAT_LEFT
self.InsertColumnInfo(i, info)
self.InsertColumn(i, info)
col.resized = False
if i == 0 and col.size != wx.LIST_AUTOSIZE_USEHEADER:
col.size += 4

View File

@@ -136,8 +136,8 @@ class OpenFitsThread(threading.Thread):
wx.PostEvent(self.mainFrame, FitSelected(fitID=self.fits[-1], startup=2))
wx.CallAfter(self.callback)
class MainFrame(wx.Frame, IPortUser):
# todo: include IPortUser again
class MainFrame(wx.Frame):
__instance = None
@classmethod
@@ -161,7 +161,7 @@ class MainFrame(wx.Frame, IPortUser):
self.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNFACE))
# Load and set the icon for pyfa main window
i = wx.IconFromBitmap(BitmapLoader.getBitmap("pyfa", "gui"))
i = wx.Icon(BitmapLoader.getBitmap("pyfa", "gui"))
self.SetIcon(i)
# Create the layout and windows
@@ -181,11 +181,11 @@ class MainFrame(wx.Frame, IPortUser):
shipBrowserImg = BitmapLoader.getImage("ship_small", "gui")
self.marketBrowser = MarketBrowser(self.notebookBrowsers)
self.notebookBrowsers.AddPage(self.marketBrowser, "Market", tabImage=marketImg, showClose=False)
self.notebookBrowsers.AddPage(self.marketBrowser, "Market", image=marketImg, closeable=False)
self.marketBrowser.splitter.SetSashPosition(self.marketHeight)
self.shipBrowser = ShipBrowser(self.notebookBrowsers)
self.notebookBrowsers.AddPage(self.shipBrowser, "Fittings", tabImage=shipBrowserImg, showClose=False)
self.notebookBrowsers.AddPage(self.shipBrowser, "Fittings", image=shipBrowserImg, closeable=False)
self.notebookBrowsers.SetSelection(1)

View File

@@ -96,7 +96,7 @@ class StatsPane(wx.Panel):
i = 0
for viewName in self.DEFAULT_VIEWS:
tp = TogglePanel(self)
contentPanel = tp.GetContentPane()
contentPanel = tp.GetContentPanel()
contentPanel.viewName = viewName
try: