(self, event)
| 97 | raise NotImplementedError() |
| 98 | |
| 99 | def OnNew(self, event): |
| 100 | with TextEntryValidatedDialog( |
| 101 | self, self.validator, "Enter a name for your new {}:".format(self.entityName), |
| 102 | "New {}".format(self.entityName) |
| 103 | ) as dlg: |
| 104 | dlg.CenterOnParent() |
| 105 | |
| 106 | if dlg.ShowModal() == wx.ID_OK: |
| 107 | # using dlg.textctrl.GetValue instead of simply dlg.GetValue because the proper way does not work in wxPython 2.8 |
| 108 | new = self.DoNew(dlg.txtctrl.GetValue().strip()) |
| 109 | self.refreshEntityList(new) |
| 110 | wx.PostEvent(self.entityChoices, wx.CommandEvent(wx.wxEVT_COMMAND_CHOICE_SELECTED)) |
| 111 | else: |
| 112 | return False |
| 113 | |
| 114 | def OnCopy(self, event): |
| 115 | with TextEntryValidatedDialog( |
no test coverage detected