203 defaulticon = wx.Image(Bpath("images", "brz.png")) |
203 defaulticon = wx.Image(Bpath("images", "brz.png")) |
204 starticon = wx.Image(Bpath("images", "icoplay24.png")) |
204 starticon = wx.Image(Bpath("images", "icoplay24.png")) |
205 stopicon = wx.Image(Bpath("images", "icostop24.png")) |
205 stopicon = wx.Image(Bpath("images", "icostop24.png")) |
206 |
206 |
207 class ParamsEntryDialog(wx.TextEntryDialog): |
207 class ParamsEntryDialog(wx.TextEntryDialog): |
208 if wx.VERSION < (2, 6, 0): |
|
209 def Bind(self, event, function, id=None): |
|
210 if id is not None: |
|
211 event(self, id, function) |
|
212 else: |
|
213 event(self, function) |
|
214 |
208 |
215 def __init__(self, parent, message, caption=_("Please enter text"), defaultValue="", |
209 def __init__(self, parent, message, caption=_("Please enter text"), defaultValue="", |
216 style=wx.OK | wx.CANCEL | wx.CENTRE, pos=wx.DefaultPosition): |
210 style=wx.OK | wx.CANCEL | wx.CENTRE, pos=wx.DefaultPosition): |
217 wx.TextEntryDialog.__init__(self, parent, message, caption, defaultValue, style, pos) |
211 wx.TextEntryDialog.__init__(self, parent, message, caption, defaultValue, style, pos) |
218 |
212 |
219 self.Tests = [] |
213 self.Tests = [] |
220 if wx.VERSION >= (2, 8, 0): |
214 self.Bind(wx.EVT_BUTTON, self.OnOK, id=self.GetAffirmativeId()) |
221 self.Bind(wx.EVT_BUTTON, self.OnOK, id=self.GetAffirmativeId()) |
|
222 elif wx.VERSION >= (2, 6, 0): |
|
223 self.Bind(wx.EVT_BUTTON, self.OnOK, id=self.GetSizer().GetItem(3).GetSizer().GetAffirmativeButton().GetId()) |
|
224 else: |
|
225 self.Bind(wx.EVT_BUTTON, self.OnOK, id=self.GetSizer().GetItem(3).GetSizer().GetChildren()[0].GetSizer().GetChildren()[0].GetWindow().GetId()) |
|
226 |
215 |
227 def OnOK(self, event): |
216 def OnOK(self, event): |
228 value = self.GetValue() |
217 value = self.GetValue() |
229 texts = {"value": value} |
218 texts = {"value": value} |
230 for function, message in self.Tests: |
219 for function, message in self.Tests: |