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

Method OnNew

gui/builtinViews/entityEditor.py:99–112  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

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(

Callers 1

enterNewEntityMethod · 0.95

Calls 4

DoNewMethod · 0.95
refreshEntityListMethod · 0.95
GetValueMethod · 0.45

Tested by

no test coverage detected