MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / CheckTabSelected

Method CheckTabSelected

gui/chrome_tabs.py:968–996  ·  view source on GitHub ↗

Selects the tab at x, y. If the tab at x, y is already selected, simply return true. Otherwise, perform TabHitTest and set tab at position to selected

(self, tab, x, y)

Source from the content-addressed store, hash-verified

966 self.Refresh()
967
968 def CheckTabSelected(self, tab, x, y):
969 """
970 Selects the tab at x, y. If the tab at x, y is already selected, simply
971 return true. Otherwise, perform TabHitTest and set tab at position to
972 selected
973 """
974 old_sel_tab = self.GetSelectedTab()
975 if old_sel_tab == tab:
976 return True
977
978 if self.TabHitTest(tab, x, y):
979 if tab.disabled:
980 return
981 tab.SetSelected(True)
982 old_sel_tab.SetSelected(False)
983
984 ev = PageChanging(self.tabs.index(old_sel_tab), self.tabs.index(tab))
985 wx.PostEvent(self.Parent, ev)
986
987 if ev.isVetoed():
988 return False
989
990 self.Refresh()
991 sel_tab = self.tabs.index(tab)
992 self.Parent.SetSelection(sel_tab)
993
994 return True
995
996 return False
997
998 def CheckTabClose(self, tab, x, y):
999 """

Callers 1

OnLeftDownMethod · 0.95

Calls 7

GetSelectedTabMethod · 0.95
TabHitTestMethod · 0.95
PageChangingClass · 0.85
isVetoedMethod · 0.80
SetSelectionMethod · 0.80
SetSelectedMethod · 0.45
RefreshMethod · 0.45

Tested by

no test coverage detected