Fixed nb setselection

This commit is contained in:
HomeWorld
2010-11-18 11:52:46 +02:00
parent 778d4e30cb
commit 815c31aaa1
2 changed files with 7 additions and 0 deletions

View File

@@ -52,6 +52,7 @@ class AdditionsPane(TogglePanel):
self.projectedPage = ProjectedView(self.notebook)
self.notebook.AddPage(self.projectedPage, "Projected", showClose = False)
self.notebook.SetSelection(0)
PANES = ["Drones", "Implants", "Boosters"]

View File

@@ -155,6 +155,7 @@ class PFNotebook(wx.Panel):
if oldsel != page:
self.activePage.Hide()
self.activePage = self.pages[page]
self.tabsContainer.SetSelected(page)
self.ShowActive()
def DeletePage(self, n, internal = False):
@@ -740,6 +741,11 @@ class PFTabsContainer(wx.Panel):
return self.tabs.index(tab)
return None
def SetSelected(self, tabIndex):
oldSelTab = self.GetSelectedTab()
oldSelTab.SetSelected(False)
self.tabs[tabIndex].SetSelected(True)
def CheckTabSelected(self,tab, mposx, mposy):
oldSelTab = self.GetSelectedTab()
if oldSelTab == tab: