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

Method CheckAddButton

gui/chrome_tabs.py:1029–1049  ·  view source on GitHub ↗

Determines if add button was selected by comparing x and y position with add button region

(self, x, y)

Source from the content-addressed store, hash-verified

1027 return False
1028
1029 def CheckAddButton(self, x, y):
1030 """
1031 Determines if add button was selected by comparing x and y position with
1032 add button region
1033 """
1034 if not self.show_add_button: # if not able to add, return False
1035 return
1036
1037 region = self.add_button.GetRegion()
1038 ax, ay = self.add_button.GetPosition()
1039 region.Offset(round(ax), round(ay))
1040
1041 if region.Contains(x, y):
1042 ev = PageAdding()
1043 wx.PostEvent(self.Parent, ev)
1044 if ev.isVetoed():
1045 return False
1046
1047 self.Parent.AddPage()
1048 wx.PostEvent(self.Parent, PageAdded())
1049 return True
1050
1051 def CheckCloseHighlighted(self, x, y):
1052 """

Callers 1

OnLeftUpMethod · 0.95

Calls 5

PageAddingClass · 0.85
GetRegionMethod · 0.80
isVetoedMethod · 0.80
GetPositionMethod · 0.45
AddPageMethod · 0.45

Tested by

no test coverage detected