Determines if add button was selected by comparing x and y position with add button region
(self, x, y)
| 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 | """ |
no test coverage detected