28 # POU Name Dialog |
28 # POU Name Dialog |
29 #------------------------------------------------------------------------------- |
29 #------------------------------------------------------------------------------- |
30 |
30 |
31 class PouNameDialog(wx.TextEntryDialog): |
31 class PouNameDialog(wx.TextEntryDialog): |
32 |
32 |
33 def __init__(self, parent, message, caption = "Please enter text", defaultValue = "", |
33 def __init__(self, parent, message, caption = "Please enter text", defaultValue = "", |
34 style = wx.OK|wx.CANCEL|wx.CENTRE, pos = wx.DefaultPosition): |
34 style = wx.OK|wx.CANCEL|wx.CENTRE, pos = wx.DefaultPosition): |
35 wx.TextEntryDialog.__init__(self, parent, message, caption, defaultValue, style, pos) |
35 wx.TextEntryDialog.__init__(self, parent, message, caption, defaultValue, style, pos) |
36 |
36 |
37 self.PouNames = [] |
37 self.PouNames = [] |
38 |
38 |
39 self.Bind(wx.EVT_BUTTON, self.OnOK, |
39 self.Bind(wx.EVT_BUTTON, self.OnOK, |
40 self.GetSizer().GetItem(2).GetSizer().GetItem(1).GetSizer().GetAffirmativeButton()) |
40 self.GetSizer().GetItem(2).GetSizer().GetItem(1).GetSizer().GetAffirmativeButton()) |
41 |
41 |
42 def OnOK(self, event): |
42 def OnOK(self, event): |
43 message = None |
43 message = None |
44 step_name = self.GetSizer().GetItem(1).GetWindow().GetValue() |
44 step_name = self.GetSizer().GetItem(1).GetWindow().GetValue() |
45 if step_name == "": |
45 if step_name == "": |
46 message = _("You must type a name!") |
46 message = _("You must type a name!") |