Merge branch 'master' of evefit.org:pyfa
This commit is contained in:
@@ -162,20 +162,22 @@ class PFNotebook(wx.Panel):
|
|||||||
def SetPageText(self, i, text, refresh=False):
|
def SetPageText(self, i, text, refresh=False):
|
||||||
tab = self.tabsContainer.tabs[i]
|
tab = self.tabsContainer.tabs[i]
|
||||||
tab.text = text
|
tab.text = text
|
||||||
tab._Render()
|
# tab._Render()
|
||||||
if refresh:
|
# if refresh:
|
||||||
self.Refresh()
|
# self.Refresh()
|
||||||
|
|
||||||
def SetPageIcon(self, i, icon, refresh=False):
|
def SetPageIcon(self, i, icon, refresh=False):
|
||||||
tab = self.tabsContainer.tabs[i]
|
tab = self.tabsContainer.tabs[i]
|
||||||
tab.img = icon
|
tab.tabImg = icon
|
||||||
tab._Render()
|
# tab._Render()
|
||||||
if refresh:
|
# if refresh:
|
||||||
self.Refresh()
|
# self.Refresh()
|
||||||
|
|
||||||
def SetPageTextIcon(self, i, text=wx.EmptyString, icon=None):
|
def SetPageTextIcon(self, i, text=wx.EmptyString, icon=None):
|
||||||
self.SetPageText(i, text)
|
self.SetPageText(i, text)
|
||||||
self.SetPageIcon(i, icon)
|
self.SetPageIcon(i, icon)
|
||||||
|
print icon
|
||||||
|
self.tabsContainer.AdjustTabsSize()
|
||||||
self.Refresh()
|
self.Refresh()
|
||||||
|
|
||||||
def Refresh(self):
|
def Refresh(self):
|
||||||
@@ -214,7 +216,6 @@ class PFTabRenderer:
|
|||||||
|
|
||||||
self.inclination = inclination
|
self.inclination = inclination
|
||||||
self.text = text
|
self.text = text
|
||||||
self.img = img
|
|
||||||
self.tabSize = (width, height)
|
self.tabSize = (width, height)
|
||||||
self.closeButton = closeButton
|
self.closeButton = closeButton
|
||||||
self.fontSize = fontSize
|
self.fontSize = fontSize
|
||||||
@@ -430,7 +431,6 @@ class PFTabRenderer:
|
|||||||
r.height = height
|
r.height = height
|
||||||
mdc.DrawBitmap(self.tabBackBitmap, 0, 0, True)
|
mdc.DrawBitmap(self.tabBackBitmap, 0, 0, True)
|
||||||
|
|
||||||
|
|
||||||
if self.tabImg:
|
if self.tabImg:
|
||||||
bmp = wx.BitmapFromImage(self.tabImg)
|
bmp = wx.BitmapFromImage(self.tabImg)
|
||||||
if self.contentWidth > 16:
|
if self.contentWidth > 16:
|
||||||
@@ -577,12 +577,12 @@ class PFAddRenderer:
|
|||||||
|
|
||||||
|
|
||||||
class PFTabsContainer(wx.Panel):
|
class PFTabsContainer(wx.Panel):
|
||||||
def __init__(self, parent, pos = (0,0), size = (100,27), id = wx.ID_ANY):
|
def __init__(self, parent, pos = (0,0), size = (100,24), id = wx.ID_ANY):
|
||||||
wx.Panel.__init__(self, parent, id , pos, size)
|
wx.Panel.__init__(self, parent, id , pos, size)
|
||||||
self.tabs = []
|
self.tabs = []
|
||||||
width, height = size
|
width, height = size
|
||||||
self.width = width
|
self.width = width
|
||||||
self.height = height - 3
|
self.height = height
|
||||||
self.containerHeight = height
|
self.containerHeight = height
|
||||||
self.startDrag = False
|
self.startDrag = False
|
||||||
self.dragging = False
|
self.dragging = False
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ class FittingView(d.Display):
|
|||||||
def updateTab(self):
|
def updateTab(self):
|
||||||
cFit = service.Fit.getInstance()
|
cFit = service.Fit.getInstance()
|
||||||
fit = cFit.getFit(self.getActiveFit())
|
fit = cFit.getFit(self.getActiveFit())
|
||||||
bitmap = bitmapLoader.getBitmap("race_%s_small", "icons")
|
bitmap = bitmapLoader.getImage("race_%s_small" % fit.ship.item.race, "icons")
|
||||||
text = "%s: %s" % (fit.ship.item.name, fit.name)
|
text = "%s: %s" % (fit.ship.item.name, fit.name)
|
||||||
self.parent.SetPageTextIcon(self.parent.GetSelection(), text, bitmap)
|
self.parent.SetPageTextIcon(self.parent.GetSelection(), text, bitmap)
|
||||||
|
|
||||||
@@ -251,19 +251,17 @@ class FittingView(d.Display):
|
|||||||
cFit = service.Fit.getInstance()
|
cFit = service.Fit.getInstance()
|
||||||
selection = []
|
selection = []
|
||||||
sel = self.GetFirstSelected()
|
sel = self.GetFirstSelected()
|
||||||
contexts = set()
|
contexts = []
|
||||||
while sel != -1:
|
if sel != -1:
|
||||||
mod = self.mods[self.GetItemData(sel)]
|
mod = self.mods[self.GetItemData(sel)]
|
||||||
if not mod.isEmpty:
|
if not mod.isEmpty:
|
||||||
contexts.add("module")
|
contexts.append("module")
|
||||||
if mod.charge is not None and "ammo" not in contexts:
|
if mod.charge is not None and "ammo" not in contexts:
|
||||||
contexts.add("ammo")
|
contexts.append("ammo")
|
||||||
|
|
||||||
selection.append(mod)
|
selection.append(mod)
|
||||||
|
|
||||||
sel = self.GetNextSelected(sel)
|
contexts.append("ship")
|
||||||
|
|
||||||
contexts.add("ship")
|
|
||||||
|
|
||||||
menu = ContextMenu.getMenu(selection, *contexts)
|
menu = ContextMenu.getMenu(selection, *contexts)
|
||||||
self.PopupMenu(menu)
|
self.PopupMenu(menu)
|
||||||
|
|||||||
Reference in New Issue
Block a user