Skip to content

Commit

Permalink
misc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
blitzmann committed Jun 13, 2017
1 parent 951b35a commit 361f7fc
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 28 deletions.
20 changes: 10 additions & 10 deletions gui/additionsPane.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
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)
Expand All @@ -59,28 +59,28 @@ def __init__(self, parent):
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)

Expand Down
7 changes: 4 additions & 3 deletions gui/builtinAdditionPanes/fighterView.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ def __init__(self, parent):
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())
Expand All @@ -75,7 +76,7 @@ def __init__(self, parent):
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)

Expand All @@ -94,7 +95,7 @@ def fitChanged(self, event):
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())
Expand Down
4 changes: 2 additions & 2 deletions gui/builtinAdditionPanes/implantView.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ def __init__(self, parent):
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)

Expand Down
2 changes: 1 addition & 1 deletion gui/builtinViews/fittingView.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __init__(self, multiSwitch):
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
Expand Down
4 changes: 2 additions & 2 deletions gui/characterEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# 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
Expand Down Expand Up @@ -306,7 +306,7 @@ def __init__(self, parent):
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)
Expand Down
3 changes: 1 addition & 2 deletions gui/chrome_tabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,7 @@ def PrevPage(self):

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()

Expand Down
4 changes: 2 additions & 2 deletions gui/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def __init__(self, parent, size=wx.DefaultSize, style=0):
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
Expand Down Expand Up @@ -156,7 +156,7 @@ def addColumn(self, i, col):
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
Expand Down
10 changes: 5 additions & 5 deletions gui/mainFrame.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ def run(self):
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
Expand All @@ -161,7 +161,7 @@ def __init__(self, title="pyfa"):
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
Expand All @@ -181,11 +181,11 @@ def __init__(self, title="pyfa"):
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)

Expand Down
2 changes: 1 addition & 1 deletion gui/statsPane.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def __init__(self, parent):
i = 0
for viewName in self.DEFAULT_VIEWS:
tp = TogglePanel(self)
contentPanel = tp.GetContentPane()
contentPanel = tp.GetContentPanel()
contentPanel.viewName = viewName

try:
Expand Down

0 comments on commit 361f7fc

Please sign in to comment.