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)
| 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 | """ |
no test coverage detected