def Configure(self, cmdLineArgs=""): vlcPath = GetVlcPath() panel = eg.ConfigPanel() cmdLineCtrl = panel.TextCtrl(cmdLineArgs) resultCtrl = eg.StaticTextBox(panel) def OnTextChange(event=None): cmdLineArgs = cmdLineCtrl.GetValue() cmdString = '"%s" %s' % (vlcPath, self.GetCmdLineArgs(cmdLineArgs)) resultCtrl.SetValue(cmdString) if event: event.Skip() OnTextChange() cmdLineCtrl.Bind(wx.EVT_TEXT, OnTextChange) panel.sizer.AddMany([ (panel.StaticText(self.text.additionalArgs), 0, wx.BOTTOM, 3), (cmdLineCtrl, 0, wx.EXPAND | wx.BOTTOM, 5), ((15, 15), ), (panel.StaticText(self.text.resultingCmdLine), 0, wx.BOTTOM, 3), (resultCtrl, 1, wx.EXPAND), ]) while panel.Affirmed(): panel.SetResult(cmdLineCtrl.GetValue())
def __init__(self, parent, label, title, mesg, treeLink=None): if treeLink is None: treeLink = eg.TreeLink(eg.Utils.GetTopLevelWindow(parent).treeItem) self.treeLink = treeLink self.macro = treeLink.target if self.macro is None: macroName = "" else: macroName = self.macro.name self.title = title self.mesg = mesg wx.Window.__init__(self, parent, -1) self.textBox = eg.StaticTextBox(self, -1, macroName, size=(200, -1)) self.button = wx.Button(self, -1, label) self.Bind(wx.EVT_BUTTON, self.OnButton) sizer = wx.BoxSizer(wx.HORIZONTAL) sizer.Add(self.textBox, 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL) sizer.Add(self.button, 0, wx.LEFT, 5) self.SetSizer(sizer) self.Bind(wx.EVT_SIZE, self.OnSize) self.Bind(wx.EVT_SET_FOCUS, self.OnSetFocus) self.Layout()