Ejemplo n.º 1
0
    def Configure(self, name="", file=""):
        panel = eg.ConfigPanel(self)
        nameLabel = wx.StaticText(panel, -1, self.text.nameLabel)
        fileLabel = wx.StaticText(panel, -1, self.text.fileLabel)
        nameCtrl = wx.TextCtrl(panel, -1, name)
        folder = split(file)[0] if file else eg.folderPath.Music
        fileCtrl = eg.FileBrowseButton(
            panel,
            -1,
            dialogTitle=self.text.browseFile,
            buttonText=eg.text.General.browse,
            startDirectory=folder,
            initialValue=file,
        )
        mainSizer = wx.FlexGridSizer(2, 2, 10, 5)
        mainSizer.AddGrowableCol(1)
        mainSizer.Add(nameLabel, 0, wx.TOP, 3)
        mainSizer.Add(nameCtrl, 1, wx.EXPAND)
        mainSizer.Add(fileLabel, 0, wx.TOP, 3)
        mainSizer.Add(fileCtrl, 1, wx.EXPAND)
        panel.sizer.Add(mainSizer, 1, wx.ALL | wx.EXPAND, 10)

        while panel.Affirmed():
            panel.SetResult(
                nameCtrl.GetValue(),
                fileCtrl.GetValue(),
            )
 def FileBrowseButton(self, value, **kwargs):
     filepathCtrl = eg.FileBrowseButton(self,
                                        size=(320, -1),
                                        initialValue=value,
                                        labelText="",
                                        buttonText=eg.text.General.browse,
                                        **kwargs)
     return filepathCtrl
Ejemplo n.º 3
0
 def Configure(self, filePath=""):
     panel = eg.ConfigPanel()
     filepathCtrl = eg.FileBrowseButton(
         panel,
         size=(340, -1),
         initialValue=filePath,
         labelText="File",
         fileMask="AutoHotKey Files|*.ahk",
     )
     panel.sizer.Add(filepathCtrl)
     while panel.Affirmed():
         panel.SetResult(filepathCtrl.GetValue(), )
Ejemplo n.º 4
0
    def Configure(self,
                  imagePath="",
                  evtID="",
                  cType=0,
                  evtF=False,
                  evtNF=False):
        panel = eg.ConfigPanel()
        imagePathCtrl = eg.FileBrowseButton(
            panel,
            size=(340, -1),
            initialValue=imagePath,
            labelText="Image",
            fileMask="Image|*.gif;*.jpg;*.jpeg;*.bmp;*.png;*.ico;*.cur;*.ani",
        )
        evtIDCtrl = panel.TextCtrl(evtID)
        clickTypes = [
            "No Click", "Single-Click", "Double-Click", "Right-Click"
        ]
        clickCtrl = panel.Choice(cType, clickTypes)
        foundEvtCtrl = panel.CheckBox(evtF, "Trigger Event if Image Found")
        noFoundEvtCtrl = panel.CheckBox(evtNF,
                                        "Trigger Event if Image Not Found")

        panel.sizer.AddMany([
            panel.StaticText("Image:"),
            imagePathCtrl,
            panel.StaticText("ID(for event triggers):"),
            evtIDCtrl,
            panel.StaticText("Click Type:"),
            clickCtrl,
            foundEvtCtrl,
            noFoundEvtCtrl,
        ])

        while panel.Affirmed():
            panel.SetResult(
                imagePathCtrl.GetValue(),
                evtIDCtrl.GetValue(),
                clickCtrl.GetValue(),
                foundEvtCtrl.GetValue(),
                noFoundEvtCtrl.GetValue(),
            )