Esempio n. 1
0
    def __init__(self, parent):
        wx.Frame.__init__(self, parent, title="IIIF Downloader")
        dirlabel = wx.StaticText(self, label="Directory to Save Images: ")
        self.dirpicker = wx.DirPickerCtrl(self)

        self.dirsizer = wx.BoxSizer(wx.HORIZONTAL)
        self.dirsizer.Add(dirlabel)
        self.dirsizer.Add(self.dirpicker)

        urllabel = wx.StaticText(self, label="URL to IIIF Manifest: ")
        self.urlsizer = wx.BoxSizer(wx.HORIZONTAL)
        self.urlsizer.Add(urllabel)
        self.urlinput = wx.TextCtrl(self)
        self.urlsizer.Add(self.urlinput, flag=wx.EXPAND)

        self.startbutton = wx.Button(self, label="Start")
        self.Bind(wx.EVT_BUTTON, self.onStart, self.startbutton)

        self.sizer = wx.BoxSizer(wx.VERTICAL)
        self.sizer.Add(self.dirsizer, flag=wx.ALIGN_CENTER)
        self.sizer.Add(self.urlsizer, flag=wx.ALIGN_CENTER)
        self.sizer.Add(self.startbutton, flag=wx.ALIGN_CENTER)

        self.SetSizer(self.sizer)
        self.SetAutoLayout(1)
        self.sizer.Fit(self)
        self.Show()
Esempio n. 2
0
    def file_picker(self,
                    label,
                    pick_dir=False,
                    handler=None,
                    optional=False,
                    initial_on=False,
                    pack=True,
                    **kwargs):
        """
        Add a file picker to the tab
        """
        if not handler:
            handler = self._changed
        if pick_dir:
            picker = wx.DirPickerCtrl(self, style=wx.DIRP_USE_TEXTCTRL)
            picker.Bind(wx.EVT_DIRPICKER_CHANGED, handler)
        else:
            picker = wx.FilePickerCtrl(self)
            picker.Bind(wx.EVT_FILEPICKER_CHANGED, handler)
        picker.span = 2
        if optional:
            cb = wx.CheckBox(self, label=label)
            cb.SetValue(initial_on)
            cb.Bind(wx.EVT_CHECKBOX, handler)
            picker.checkbox = cb
            if pack:
                self.pack("", cb, picker, enable=initial_on, **kwargs)
        elif pack:
            self.pack(label, picker, **kwargs)

        return picker
Esempio n. 3
0
    def __init__(self, parent, payload_objs):

        ClientGUIScrolledPanels.ReviewPanel.__init__(self, parent)

        self._payload_objs = payload_objs

        self._directory_picker = wx.DirPickerCtrl(self)
        self._directory_picker.Bind(wx.EVT_DIRPICKER_CHANGED,
                                    self.EventChanged)

        self._width = wx.SpinCtrl(self, min=100, max=4096)

        self._export = ClientGUICommon.BetterButton(self, 'export',
                                                    self.Export)

        #

        self._width.SetValue(512)

        self._Update()

        #

        rows = []

        rows.append(('export path: ', self._directory_picker))
        rows.append(('png width: ', self._width))
        rows.append(('', self._export))

        gridbox = ClientGUICommon.WrapInGrid(self, rows)

        self.SetSizer(gridbox)
 def add_directory_picker(self, sizer):
     sub_sizer = wx.BoxSizer(wx.HORIZONTAL)
     sizer.Add(sub_sizer, 0, wx.EXPAND | wx.ALL, 5)
     sub_sizer.Add(wx.StaticText(self, label="Folder:"), 0,
                   wx.ALIGN_RIGHT | wx.RIGHT, 3)
     self.directory_picker = wx.DirPickerCtrl(self)
     sub_sizer.Add(self.directory_picker, 1, wx.EXPAND)
    def __init__(self):
        """Constructor"""
        wx.Dialog.__init__(self, None, title="New project", size=(430, 240))
        LabelSize = (100, 25)
        EntrySize = (300, 25)
        prjname_sizer = wx.BoxSizer(wx.HORIZONTAL)

        prj_lbl = wx.StaticText(self, label="Project name", size=LabelSize)
        prjname_sizer.Add(prj_lbl, 0, wx.ALL | wx.CENTER, 5)
        self.prjName = wx.TextCtrl(self, size=EntrySize)
        prjname_sizer.Add(self.prjName, 10, wx.ALL | wx.EXPAND, 5)

        prjlocation_sizer = wx.BoxSizer(wx.HORIZONTAL)
        prj_location_lbl = wx.StaticText(self,
                                         label="Location",
                                         size=LabelSize)
        prjlocation_sizer.Add(prj_location_lbl, 0, wx.ALL | wx.CENTER, 5)

        self.prjLocation = wx.DirPickerCtrl(
            self,
            message="Choose a project location",
            style=wx.DIRP_DEFAULT_STYLE | wx.DIRP_USE_TEXTCTRL,
            size=EntrySize)
        self.prjLocation.SetPath(common.getMostRecentPrjDir())
        prjlocation_sizer.Add(self.prjLocation, 0, wx.ALL, 5)

        datamodel_sizer = wx.BoxSizer(wx.HORIZONTAL)
        datamodel_lbl = wx.StaticText(self, label="Data model", size=LabelSize)
        datamodel_sizer.Add(datamodel_lbl, 0, wx.ALL | wx.CENTER, 5)

        defaultModel = common.fileResolver("SAFplusAmf.yang")
        self.datamodel = wx.FilePickerCtrl(
            self,
            message="Choose a file",
            path="SAFplusAmf.yang",
            style=wx.FLP_DEFAULT_STYLE | wx.FLP_USE_TEXTCTRL,
            wildcard="Data model (*.yang)|*.yang",
            size=EntrySize)
        datamodel_sizer.Add(self.datamodel, 0, wx.ALL, 5)

        main_sizer = wx.BoxSizer(wx.VERTICAL)
        main_sizer.Add(prjname_sizer, 0, wx.ALL, 5)
        main_sizer.Add(prjlocation_sizer, 0, wx.ALL, 5)
        main_sizer.Add(datamodel_sizer, 0, wx.ALL, 5)

        OK_btn = wx.Button(self, label="OK")
        OK_btn.Bind(wx.EVT_BUTTON, self.onBtnHandler)
        cancel_btn = wx.Button(self, label="Cancel")
        cancel_btn.Bind(wx.EVT_BUTTON, self.onBtnHandler)

        btn_sizer = wx.BoxSizer(wx.HORIZONTAL)
        btn_sizer.Add(OK_btn, 0, wx.ALL | wx.CENTER, 5)
        btn_sizer.Add(cancel_btn, 0, wx.ALL | wx.CENTER, 5)

        main_sizer.Add(btn_sizer, 0, wx.ALL | wx.CENTER, 5)

        self.SetSizer(main_sizer)
        main_sizer.Layout()
        prjname_sizer.Layout()
Esempio n. 6
0
    def __init__(self, parent, rate=None, out_dir=None, in_dir=None):
        super(FFmpegConvertDialog, self).__init__(parent=parent, title="pyjam Audio Converter",
                                                  style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)

        self.in_dir = in_dir

        self.game_rate = intctrl.IntCtrl(self)
        game_rate_text = wx.StaticText(self, label="Audio rate")
        if rate is not None:
            self.game_rate.SetValue(rate)

        self.volume = wx.SpinCtrl(self, initial=85)
        volume_text = wx.StaticText(self, label="Volume %")

        self.in_picker = wx.FilePickerCtrl(self, style=wx.FLP_USE_TEXTCTRL)
        in_picker_text = wx.StaticText(self, label="Input file names (manually changing them has no effect)")
        self.in_files = []
        # the dumbest thing i've done all year (i'm overriding the controls of the PickerBase)
        for child in self.in_picker.GetChildren():
            if isinstance(child, wx.Button):
                child.Bind(wx.EVT_BUTTON, self.browse)

        self.out_dir = wx.DirPickerCtrl(self, name="Output directory")
        out_dir_text = wx.StaticText(self, label="Output directory")
        if out_dir is not None:
            self.out_dir.SetPath(out_dir)

        top_sizer = wx.BoxSizer(wx.VERTICAL)
        top_row = wx.BoxSizer(wx.HORIZONTAL)
        rate_sizer = wx.BoxSizer(wx.VERTICAL)
        vol_sizer = wx.BoxSizer(wx.VERTICAL)
        dir_sizer = wx.BoxSizer(wx.VERTICAL)
        button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL)

        rate_sizer.Add(game_rate_text, 0, wx.ALL ^ wx.BOTTOM | wx.ALIGN_LEFT, 5)
        rate_sizer.Add(self.game_rate, 0, wx.ALL | wx.ALIGN_LEFT, 5)
        vol_sizer.Add(volume_text, 0, wx.ALL ^ wx.BOTTOM | wx.ALIGN_LEFT, 5)
        vol_sizer.Add(self.volume, 0, wx.ALL | wx.ALIGN_LEFT, 5)
        top_row.Add(rate_sizer)
        top_row.Add(vol_sizer)
        dir_sizer.Add(in_picker_text, 0, wx.ALL ^ wx.LEFT | wx.ALIGN_LEFT, 3)
        dir_sizer.Add(self.in_picker, 0, wx.ALL ^ wx.LEFT ^ wx.TOP | wx.ALIGN_LEFT | wx.EXPAND, 5)
        dir_sizer.Add(out_dir_text, 0, wx.ALL ^ wx.LEFT | wx.ALIGN_LEFT, 3)
        dir_sizer.Add(self.out_dir, 0, wx.ALL ^ wx.LEFT ^ wx.TOP | wx.ALIGN_LEFT | wx.EXPAND, 5)
        top_sizer.Add(top_row)
        top_sizer.Add(dir_sizer, 1, wx.ALL | wx.EXPAND | wx.ALIGN_TOP, 5)
        top_sizer.Add(button_sizer, 0, wx.ALL | wx.ALIGN_CENTER, 5)

        self.Bind(wx.EVT_BUTTON, self.on_ok, id=wx.ID_OK)
        self.Bind(wx.EVT_BUTTON, self.on_cancel, id=wx.ID_CANCEL)

        self.converter = None
        self.progress_dialog = None
        self.num_songs = 0

        self.SetSizer(top_sizer)
        # self.SetSize(400, 250)
        self.Center()
        self.ShowModal()
Esempio n. 7
0
    def OnInit(self):
        # Frame
        top_window = wx.Frame(None,
                              title="File/Directory Comparison App",
                              size=wx.Size(800, 600))
        top_window.SetSizer(wx.BoxSizer(orient=wx.VERTICAL))
        self.SetTopWindow(top_window)

        # Panel
        main_panel = wx.Panel(top_window)
        main_panel.SetSizer(wx.BoxSizer(orient=wx.VERTICAL))
        top_window.Sizer.Add(main_panel,
                             proportion=1,
                             flag=wx.ALL | wx.EXPAND | wx.EXPAND)

        # Controls
        self.Picker1 = wx.DirPickerCtrl(main_panel)
        self.Picker1.SetDropTarget(DirPickerDropTarget(self.Picker1))
        main_panel.Sizer.Add(self.Picker1, flag=wx.ALL | wx.EXPAND, border=20)

        self.Picker2 = wx.DirPickerCtrl(main_panel)
        self.Picker2.SetDropTarget(DirPickerDropTarget(self.Picker2))
        main_panel.Sizer.Add(self.Picker2,
                             flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND,
                             border=20)

        self.RadioBox = wx.RadioBox(main_panel,
                                    choices=self.OperationTypeChoices)
        main_panel.Sizer.Add(self.RadioBox, flag=wx.LEFT, border=20)

        compare_button = wx.Button(main_panel, label="Compare")
        main_panel.Sizer.Add(compare_button, flag=wx.ALIGN_CENTER_HORIZONTAL)
        compare_button.Bind(event=wx.EVT_BUTTON, handler=self.start_thread)

        self.Log = wx.TextCtrl(main_panel,
                               style=wx.TE_MULTILINE | wx.TE_READONLY)
        main_panel.Sizer.Add(self.Log,
                             proportion=1,
                             flag=wx.ALL | wx.EXPAND,
                             border=20)

        # Make stuff visible
        top_window.Center()
        top_window.Show()

        return True
 def _create_directory_picker(self, option_name: str, options: Sequence):
     sizer = self._create_horizontal_options_sizer(option_name)
     option = wx.DirPickerCtrl(
         self,
         style=wx.DIRP_USE_TEXTCTRL
     )
     sizer.Add(option)
     self._options[option_name] = option
Esempio n. 9
0
 def add_folders_button(self, event):
     if self.no_of_folders <= MAXIMUM_ALLOWED_FILES:
         height = self.no_of_folders * 35 + 200
         self.folderCtrl.append(
             wx.DirPickerCtrl(self.panel, pos=(400, height),
                              size=(260, -1)))
         self.sizer.Add(self.folderCtrl[self.no_of_folders], (400, height))
         self.no_of_folders = self.no_of_folders + 1
Esempio n. 10
0
    def __init__(self, parent):
        wx.Panel.__init__(self,
                          parent,
                          id=wx.ID_ANY,
                          pos=wx.DefaultPosition,
                          size=wx.Size(500, 300),
                          style=wx.TAB_TRAVERSAL)

        bSizer23 = wx.BoxSizer(wx.VERTICAL)

        bSizer24 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText16 = wx.StaticText(self, wx.ID_ANY, u"SVN美术目录",
                                            wx.DefaultPosition, wx.DefaultSize,
                                            0)
        self.m_staticText16.Wrap(-1)
        bSizer24.Add(self.m_staticText16, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL,
                     5)

        self.m_ArtPicker = wx.DirPickerCtrl(self, wx.ID_ANY, wx.EmptyString,
                                            u"Select a folder",
                                            wx.DefaultPosition, wx.DefaultSize,
                                            wx.DIRP_DEFAULT_STYLE)
        bSizer24.Add(self.m_ArtPicker, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)

        bSizer23.Add(bSizer24, 1, wx.EXPAND, 5)

        bSizer25 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText17 = wx.StaticText(self, wx.ID_ANY, u"选择美术分支",
                                            wx.DefaultPosition, wx.DefaultSize,
                                            0)
        self.m_staticText17.Wrap(-1)
        bSizer25.Add(self.m_staticText17, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL,
                     5)

        m_ArtBranchListChoices = []
        self.m_ArtBranchList = wx.ListBox(self, wx.ID_ANY, wx.DefaultPosition,
                                          wx.DefaultSize,
                                          m_ArtBranchListChoices, 0)
        bSizer25.Add(self.m_ArtBranchList, 1,
                     wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5)

        bSizer23.Add(bSizer25, 1, wx.EXPAND, 5)

        bSizer26 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_button37 = wx.Button(self, wx.ID_ANY, u"将SVN的美术资源同步至Git",
                                    wx.DefaultPosition, wx.DefaultSize, 0)
        bSizer26.Add(self.m_button37, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)

        bSizer23.Add(bSizer26, 1, wx.ALIGN_CENTER_HORIZONTAL, 5)

        self.SetSizer(bSizer23)
        self.Layout()

        # Connect Events
        self.m_button37.Bind(wx.EVT_BUTTON, self._OnClickConfirm)
Esempio n. 11
0
    def __init__(self, parent):
        super(DownloaderDialog,
              self).__init__(parent,
                             title="pyjam Downloader",
                             style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)
        self.parent = parent

        self.audio_links = wx.TextCtrl(self)
        audio_link_text = wx.StaticText(self,
                                        label="URL(s) (Separate with commas)")

        self.out_dir = wx.DirPickerCtrl(self,
                                        path=os.path.abspath("downloads"))
        out_dir_text = wx.StaticText(self, label="Output directory")

        warning_text = wx.StaticText(
            self,
            style=wx.ALIGN_CENTRE_HORIZONTAL,
            label=
            ("Note: The program will freeze for a bit while it processes the URL "
             "before downloading"))
        warning_text.Wrap(self.GetSize()[0])

        search_button = wx.Button(self, label="Search")

        top_sizer = wx.BoxSizer(wx.VERTICAL)
        control_sizer = wx.BoxSizer(wx.VERTICAL)
        text_sizer = wx.BoxSizer(wx.VERTICAL)
        button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL)

        control_sizer.Add(audio_link_text, 0, wx.ALL ^ wx.LEFT | wx.ALIGN_LEFT,
                          3)
        control_sizer.Add(
            self.audio_links, 0,
            wx.ALL ^ wx.LEFT ^ wx.TOP | wx.ALIGN_LEFT | wx.EXPAND, 5)
        control_sizer.Add(out_dir_text, 0, wx.ALL ^ wx.LEFT | wx.ALIGN_LEFT, 3)
        control_sizer.Add(
            self.out_dir, 0,
            wx.ALL ^ wx.LEFT ^ wx.TOP | wx.ALIGN_LEFT | wx.EXPAND, 5)
        text_sizer.Add(warning_text, 0, wx.ALL | wx.ALIGN_CENTER, 5)
        button_sizer.Add(search_button)
        top_sizer.Add(control_sizer, 1, wx.ALL | wx.EXPAND | wx.ALIGN_TOP, 5)
        top_sizer.Add(text_sizer, 0, wx.ALL | wx.ALIGN_CENTER, 5)
        top_sizer.Add(button_sizer, 0, wx.ALL | wx.ALIGN_CENTER, 5)

        self.Bind(wx.EVT_BUTTON, handler=self.on_ok, id=wx.ID_OK)
        self.Bind(wx.EVT_BUTTON,
                  handler=lambda x: SearchDialog(self),
                  source=search_button)

        self.downloader = None
        self.progress_dialog = None
        self.num_songs = 0

        self.SetSizerAndFit(top_sizer)
        self.Center()
        self.ShowModal()
Esempio n. 12
0
    def __init__(self, parent, id):
        wx.Frame.__init__(self, parent, id, 'shit', size=(330, 350))
        self.SetBackgroundColour('White')

        self.Center()
        self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize)

        bSizer = wx.BoxSizer(wx.VERTICAL)
        bSizer6 = wx.BoxSizer(wx.HORIZONTAL)
        self.m_staticText2 = wx.StaticText(self, wx.ID_ANY, u"123:",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        self.m_staticText2.Wrap(-1)
        bSizer6.Add(self.m_staticText2, 0, wx.ALL, 5)
        self.m_dirPicker1 = wx.DirPickerCtrl(self, wx.ID_ANY, wx.EmptyString,
                                             u"选择文件", wx.DefaultPosition,
                                             wx.DefaultSize,
                                             wx.DIRP_DEFAULT_STYLE)
        self.m_dirPicker1.SetPath("D:\VirtualMachine\share\work\minerUI")
        pButt = self.m_dirPicker1.GetPickerCtrl()
        if pButt is not None:
            pButt.SetLabel('12345')

        bSizer6.Add(self.m_dirPicker1, 0, wx.ALL, 5)
        bSizer.Add(bSizer6, 0, wx.EXPAND, 5)
        self.SetSizer(bSizer)
        self.Layout()
        self.Centre(wx.BOTH)

        panel1 = wx.Panel(self)
        self.basicLabel = wx.StaticText(panel1, -1, " 11111:")
        self.basicText = wx.TextCtrl(panel1, -1, "", size=(175, -1))
        self.basicText.SetInsertionPoint(0)

        self.pwdLabel = wx.StaticText(panel1, -1, " 111222:")
        self.pwdText = wx.TextCtrl(panel1,
                                   -1,
                                   "",
                                   size=(175, -1),
                                   style=wx.TE_PASSWORD)
        sizer = wx.FlexGridSizer(cols=2, hgap=6, vgap=6)
        sizer.AddMany(
            [self.basicLabel, self.basicText, self.pwdLabel, self.pwdText])
        panel1.SetSizer(sizer)
        bSizer.Add(panel1, 0, wx.EXPAND, 5)
        self.m_dirPicker1.Bind(wx.EVT_DIRPICKER_CHANGED, self.src_dir)

        panel = wx.Panel(self)  #创建画板
        button1 = wx.Button(panel, label='登录', pos=(20, 200),
                            size=(50, 25))  #将按钮添加到画板
        button2 = wx.Button(panel, label='关闭', pos=(240, 200),
                            size=(50, 25))  #将按钮添加到画板
        #绑定按钮的单击事件
        #self.Bind(wx.EVT_BUTTON, self.OnInitDisk, button1)
        #绑定窗口的关闭事件
        self.Bind(wx.EVT_CLOSE, self.OnCloseMe, button2)
        bSizer.Add(panel, 0, wx.EXPAND, 5)
Esempio n. 13
0
    def __do_layout(self):
        self.dirListCtrl = wx.ListBox(self,
                                      -1,
                                      choices=self.criteria.keys(),
                                      style=wx.LB_SORT)
        self.createNewDirBt = wx.Button(self,
                                        -1,
                                        label='Create new project directory')
        self.delDirBt = wx.Button(self, -1, label='Delete')
        self.authorKwdTC = wx.TextCtrl(self, -1)
        self.titleKwdTC = wx.TextCtrl(self, -1)
        self.sweepDirCh = wx.DirPickerCtrl(self,
                                           -1,
                                           path=config.get(
                                               'AToptions', 'sweep_directory'),
                                           style=wx.DIRP_USE_TEXTCTRL)
        self.fileDirCh = wx.DirPickerCtrl(self,
                                          -1,
                                          path=config.get(
                                              'AToptions', 'filing_directory'),
                                          style=wx.DIRP_USE_TEXTCTRL)

        s1 = wx.BoxSizer(wx.VERTICAL)
        s2 = wx.BoxSizer(wx.HORIZONTAL)
        s1.Add(wx.StaticText(self, -1, 'Project directories:'), 0, wx.ALL, 3)
        s1.Add(self.dirListCtrl, 1, wx.ALL | wx.EXPAND, 3)
        s2.Add(self.createNewDirBt, 3, wx.ALL | wx.EXPAND, 3)
        s2.Add(self.delDirBt, 1, wx.ALL | wx.EXPAND, 3)
        s1.Add(s2, 0, wx.EXPAND)
        s1.Add(wx.StaticText(self, -1, 'Move files to directory with Author:'),
               0, wx.ALL, 3)
        s1.Add(self.authorKwdTC, 0, wx.ALL | wx.EXPAND, 3)
        s1.Add(wx.StaticText(self, -1, 'Move files to directory with Title:'),
               0, wx.ALL, 3)
        s1.Add(self.titleKwdTC, 0, wx.ALL | wx.EXPAND, 3)
        s1.Add(wx.StaticText(self, -1, 'Directory to sweep:'), 0, wx.ALL, 3)
        s1.Add(self.sweepDirCh, 0, wx.ALL | wx.EXPAND, 3)
        s1.Add(wx.StaticText(self, -1, 'Root directory for filing system:'), 0,
               wx.ALL, 3)
        s1.Add(self.fileDirCh, 0, wx.ALL | wx.EXPAND, 3)

        self.SetSizer(s1)
        self.Layout()
    def InitWidgets(self):

        # Widget creations
        self.statusbar = self.CreateStatusBar(1, 0)

        panel1 = wx.Panel(self, -1)

        panel12 = wx.Panel(panel1, -1)
        self.olv = FastObjectListView(panel1,
                                      -1,
                                      style=wx.LC_REPORT | wx.SUNKEN_BORDER)

        rootText = wx.StaticText(panel12, -1, "&Tree walk from:")
        self.tcRoot = wx.DirPickerCtrl(panel12, style=wx.DIRP_USE_TEXTCTRL)
        self.btnStart = wx.Button(panel12, -1, "&Start")
        secondsText = wx.StaticText(panel12, -1, "Seconds &between updates:")
        self.scSeconds = wx.SpinCtrl(panel12, -1, "")

        # Layout
        sizer_3 = wx.FlexGridSizer(2, 3, 4, 4)
        sizer_3.AddGrowableCol(1)
        sizer_3.Add(rootText, 1, wx.ALIGN_CENTER_VERTICAL, 0)
        sizer_3.Add(self.tcRoot, 1, wx.ALL | wx.EXPAND, 0)
        sizer_3.Add(self.btnStart, 1, wx.ALL | wx.EXPAND, 0)
        sizer_3.Add(secondsText, 1, wx.ALIGN_CENTER_VERTICAL, 0)
        sizer_3.Add(self.scSeconds, 1)
        panel12.SetSizer(sizer_3)
        panel12.Layout()

        sizer_2 = wx.FlexGridSizer(3, 1, 4, 4)
        sizer_2.Add(panel12, 1, wx.ALL | wx.EXPAND, 4)
        sizer_2.Add(self.olv, 1, wx.ALL | wx.EXPAND, 4)
        sizer_2.AddGrowableCol(0)
        sizer_2.AddGrowableRow(1)
        panel1.SetSizer(sizer_2)
        panel1.Layout()

        sizer_1 = wx.BoxSizer(wx.VERTICAL)
        sizer_1.Add(panel1, 1, wx.EXPAND)
        self.SetSizer(sizer_1)
        self.Layout()

        # Event handling
        self.Bind(wx.EVT_CLOSE, self.HandleClose)
        self.btnStart.Bind(wx.EVT_BUTTON, self.HandleStart)
        self.tcRoot.Bind(wx.EVT_DIRPICKER_CHANGED, self.HandleRootText)

        # Widget initialization
        self.btnStart.SetDefault()
        self.scSeconds.SetRange(0, 15)
        self.scSeconds.SetValue(2)
        self.tcRoot.SetPath(wx.StandardPaths.Get().GetDocumentsDir())

        # OK, This is the whole point of the example. Wrap the ObjectListView in a batch updater
        self.olv = BatchedUpdate(self.olv, 2)
Esempio n. 15
0
	def __init__( self, parent ):
		wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = u"PNG to PDF", pos = wx.DefaultPosition, size = wx.Size( 575,522 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )
		
		self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
		
		bSizer1 = wx.BoxSizer( wx.VERTICAL )
		
		self.WhatsThis = wx.StaticText( self, wx.ID_ANY, u"Please choose a directory to convert.", wx.DefaultPosition, wx.DefaultSize, 0 )
		self.WhatsThis.Wrap( -1 )
		self.WhatsThis.SetFont( wx.Font( 20, 73, 90, 90, False, "Comic Sans MS" ) )
		
		bSizer1.Add( self.WhatsThis, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 )
		
		self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, u"All files must be in the .PNG format.\nIn addition, their names must be in alphanumerical order.\nFor example:\nimage1.png\nimage2.png\nimage3.png\n...\nimage15.png\n\nPlease proofread PDFs created using this tool.", wx.DefaultPosition, wx.DefaultSize, 0 )
		self.m_staticText2.Wrap( -1 )
		self.m_staticText2.SetFont( wx.Font( 14, 73, 93, 90, False, "Comic Sans MS" ) )
		self.m_staticText2.SetForegroundColour( wx.Colour( 128, 0, 64 ) )
		
		bSizer1.Add( self.m_staticText2, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 )
		
		bSizer2 = wx.BoxSizer( wx.VERTICAL )
		
		self.DirPicker = wx.DirPickerCtrl( self, wx.ID_ANY, wx.EmptyString, u"Select a folder", wx.DefaultPosition, wx.DefaultSize, wx.DIRP_DEFAULT_STYLE )
		bSizer2.Add( self.DirPicker, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 )
		
		
		bSizer1.Add( bSizer2, 1, wx.EXPAND, 5 )
		
		bSizer3 = wx.BoxSizer( wx.VERTICAL )
		
		self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, u"                               ", wx.DefaultPosition, wx.DefaultSize, 0 )
		self.m_staticText3.Wrap( -1 )
		self.m_staticText3.SetFont( wx.Font( 14, 71, 90, 90, False, "Harrington" ) )
		self.m_staticText3.SetForegroundColour( wx.Colour( 128, 0, 64 ) )
		
		bSizer3.Add( self.m_staticText3, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 )
		
		self.StartConversion = wx.Button( self, wx.ID_ANY, u"Convert", wx.DefaultPosition, wx.DefaultSize, 0 )
		self.StartConversion.SetFont( wx.Font( 20, 73, 90, 90, False, "Forte" ) )
		self.StartConversion.SetForegroundColour( wx.Colour( 200, 26, 6 ) )
		self.StartConversion.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_HIGHLIGHTTEXT ) )
		
		bSizer3.Add( self.StartConversion, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 )
		
		
		bSizer1.Add( bSizer3, 1, wx.EXPAND, 5 )
		
		
		self.SetSizer( bSizer1 )
		self.Layout()
		
		self.Centre( wx.BOTH )
		
		# Connect Events
		self.StartConversion.Bind( wx.EVT_BUTTON, self.TransformFile )
Esempio n. 16
0
 def add_dir(self, path=None):
     dir_picker = wx.DirPickerCtrl(self.panel)
     self.pickers_sizer.Add(dir_picker, 0, wx.EXPAND)
     if isinstance(path, str):  # Assuming initial calls
         dir_picker.SetPath(path)
     else:  # Assuming manual adding
         self.top_sizer.Layout()
         size = self.GetClientSize()
         size[1] += dir_picker.GetClientSize()[1]
         self.SetClientSize(size)
     self.dir_pickers.append(dir_picker)
Esempio n. 17
0
    def __init__(self, parent, fgs, port):

        super().__init__(port, "DirChooser(%s)" % port.name)
        self.port = port

        self.ctrl = wx.DirPickerCtrl(parent)

        fgs.Add(self.ctrl, 1, wx.EXPAND)

        self.ctrl.Bind(wx.EVT_DIRPICKER_CHANGED, self.on_picked)
        self.path = None
Esempio n. 18
0
    def __init__(self, *args, **kw):
        super(LocationPicker, self).__init__(*args, **kw)

        global CAPTURE_ERRORS
        if CAPTURE_ERRORS:
            sys.excepthook = handleexception

        self.pnl = wx.Panel(self)
        st = wx.StaticText(self.pnl, label="Steam installation:")
        self.steamLocation = wx.DirPickerCtrl(
            self.pnl, path="C:\\Program Files (x86)\\Steam")

        egst = wx.StaticText(self.pnl, label="Epic Games Store installation:")
        self.egsLocation = wx.DirPickerCtrl(
            self.pnl, path="C:\\ProgramData\\Epic\\EpicGamesLauncher")

        nextButton = wx.Button(self.pnl, label="Next")
        nextButton.Bind(wx.EVT_BUTTON, self.next)

        sizer = wx.BoxSizer(wx.VERTICAL)
        flags = wx.EXPAND
        sizer.AddSpacer(15)
        sizer.Add(st, 0, flags)
        sizer.Add(self.steamLocation, 0, flags)
        sizer.AddSpacer(15)
        sizer.Add(egst, 0, flags)
        sizer.Add(self.egsLocation, 0, flags)
        sizer.AddSpacer(15)
        sizer.Add(nextButton, 0, flags)
        sizer.AddSpacer(15)
        sizer.Add(
            hl.HyperLinkCtrl(
                self.pnl,
                label="steamsync by Jayden Milne",
                URL="https://github.com/jaydenmilne/steamsync",
            ),
            0,
        )
        sizer.AddSpacer(15)

        self.pnl.SetSizer(sizer)
Esempio n. 19
0
    def __init__(self, parent):
        wx.Frame.__init__(self,
                          parent,
                          id=wx.ID_ANY,
                          title=wx.EmptyString,
                          pos=wx.DefaultPosition,
                          size=wx.Size(500, 300),
                          style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL)

        self.SetSizeHints(wx.DefaultSize, wx.DefaultSize)

        self.m_toolBar1 = self.CreateToolBar(wx.TB_HORIZONTAL, wx.ID_ANY)
        self.m_staticText2 = wx.StaticText(self.m_toolBar1, wx.ID_ANY,
                                           u"MyLabel", wx.DefaultPosition,
                                           wx.DefaultSize, 0)
        self.m_staticText2.Wrap(-1)

        self.m_toolBar1.AddControl(self.m_staticText2)
        self.m_button12 = wx.Button(self.m_toolBar1, wx.ID_ANY, u"MyButton",
                                    wx.DefaultPosition, wx.DefaultSize, 0)
        self.m_toolBar1.AddControl(self.m_button12)
        self.m_dirPicker1 = wx.DirPickerCtrl(self.m_toolBar1, wx.ID_ANY,
                                             wx.EmptyString,
                                             u"/home/pydev/Music/salsa/",
                                             wx.DefaultPosition,
                                             wx.DefaultSize,
                                             wx.DIRP_DEFAULT_STYLE)
        self.m_toolBar1.AddControl(self.m_dirPicker1)
        self.m_toolBar1.Realize()

        self.m_statusBar1 = self.CreateStatusBar(1, wx.STB_SIZEGRIP, wx.ID_ANY)
        self.SetStatusText("Welcome to wxPython!")
        bSizer3 = wx.BoxSizer(wx.VERTICAL)

        self.m_panel1 = wx.Panel(self, wx.ID_ANY, wx.DefaultPosition,
                                 wx.DefaultSize, wx.TAB_TRAVERSAL)
        bSizer5 = wx.BoxSizer(wx.VERTICAL)

        m_listBox2Choices = getTracksList()
        self.m_listBox2 = wx.ListBox(self.m_panel1, wx.ID_ANY,
                                     wx.DefaultPosition, wx.DefaultSize,
                                     m_listBox2Choices, 0)
        bSizer5.Add(self.m_listBox2, 0, wx.ALL, 5)

        self.m_panel1.SetSizer(bSizer5)
        self.m_panel1.Layout()
        bSizer5.Fit(self.m_panel1)
        bSizer3.Add(self.m_panel1, 1, wx.EXPAND | wx.ALL, 5)

        self.SetSizer(bSizer3)
        self.Layout()

        self.Centre(wx.BOTH)
Esempio n. 20
0
 def __init__(self, parent, attr_name):
     Base.SettingPage.__init__(self, parent=parent, attr_name=attr_name)
     main_sizer = wx.BoxSizer(wx.VERTICAL)
     wx_static_text = wx.StaticText(self, wx.ID_ANY, u"请设置测试过程中产生文件的存放路径:",
                                    wx.DefaultPosition, wx.DefaultSize, 0)
     main_sizer.Add(wx_static_text, 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 3)
     self.dir_picker = wx.DirPickerCtrl(
         self, wx.ID_ANY, wx.EmptyString, u"请选择一个目录:", wx.DefaultPosition,
         wx.DefaultSize,
         wx.DIRP_DEFAULT_STYLE | wx.DIRP_SMALL | wx.DIRP_DIR_MUST_EXIST)
     main_sizer.Add(self.dir_picker, 0, wx.EXPAND | wx.ALL, 3)
     self.SetSizer(main_sizer)
Esempio n. 21
0
    def init_panel(self):
        panel = wx.Panel(self, -1)
        hbox = wx.BoxSizer(wx.HORIZONTAL)
        boxs = wx.FlexGridSizer(7, 2, 9, 25)

        source_title = wx.StaticText(panel, label="项目地址:")
        des_title = wx.StaticText(panel, label="打包目录:")
        list_title = wx.StaticText(panel, label="打包列表:")
        file_name_title = wx.StaticText(panel, label="打包名称:")
        pass_title = wx.StaticText(panel, label="加密密码:")

        self.dic_picker1 = wx.DirPickerCtrl(panel, wx.ID_ANY, wx.EmptyString)
        self.dic_picker2 = wx.DirPickerCtrl(panel, wx.ID_ANY, wx.EmptyString)
        self.dir_list = wx.TextCtrl(panel, style=wx.TE_MULTILINE)
        self.pwd = wx.TextCtrl(panel, -1, "vcfez3G0mLZoE0LCjgJG8uvNkYJI53mJ")
        self.file_name = wx.TextCtrl(panel, -1, "pack.zip")

        boxs.AddMany([(source_title), (self.dic_picker1, 1, wx.EXPAND),
                      (des_title), (self.dic_picker2, 1, wx.EXPAND),
                      (list_title, 1, wx.EXPAND),
                      (self.dir_list, 1, wx.EXPAND), (file_name_title),
                      (self.file_name, 1, wx.EXPAND), (pass_title),
                      (self.pwd, 1, wx.EXPAND)])

        boxs.AddGrowableRow(2, 1)
        boxs.AddGrowableCol(1, 1)

        hbox.Add(boxs, proportion=1, flag=wx.ALL | wx.EXPAND, border=15)

        self.submit = wx.Button(panel, label="打包")
        self.cancel = wx.Button(panel, label="取消")

        # self.cancel.Bind(wx.EVT_BUTTON, self.on_self.cancel)
        self.Bind(wx.EVT_BUTTON, self.on_zip, self.submit)
        self.Bind(wx.EVT_BUTTON, self.on_cancel, self.cancel)

        boxs.Add(self.submit)
        boxs.Add(self.cancel)

        panel.SetSizer(hbox)
Esempio n. 22
0
    def __init__(self, parent):
        wx.Frame.__init__(self,
                          parent,
                          id=wx.ID_ANY,
                          title=u"Create a new key",
                          pos=wx.DefaultPosition,
                          size=wx.Size(525, 200),
                          style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL)

        self.SetSizeHints(wx.Size(525, 200), wx.DefaultSize)

        create_new_key_pair_bSizer = wx.BoxSizer(wx.VERTICAL)

        pair_location_sbSizer = wx.StaticBoxSizer(
            wx.StaticBox(self, wx.ID_ANY, u"Location"), wx.VERTICAL)

        self.pair_creation_info_1_staticText = wx.StaticText(
            pair_location_sbSizer.GetStaticBox(), wx.ID_ANY,
            u"Note: as soon as you select a directory, the creation will launch.",
            wx.DefaultPosition, wx.DefaultSize, 0)
        self.pair_creation_info_1_staticText.Wrap(-1)

        pair_location_sbSizer.Add(self.pair_creation_info_1_staticText, 0,
                                  wx.ALL, 5)

        self.key_pair_location_dirPicker = wx.DirPickerCtrl(
            pair_location_sbSizer.GetStaticBox(), wx.ID_ANY, wx.EmptyString,
            u"Select a folder where the keys will be stored",
            wx.DefaultPosition, wx.DefaultSize, wx.DIRP_DEFAULT_STYLE)
        pair_location_sbSizer.Add(self.key_pair_location_dirPicker, 0,
                                  wx.ALL | wx.EXPAND, 5)

        self.pair_creation_info_2_staticText = wx.StaticText(
            pair_location_sbSizer.GetStaticBox(), wx.ID_ANY,
            u"File will be named \"private_[ID].pem\".", wx.DefaultPosition,
            wx.DefaultSize, 0)
        self.pair_creation_info_2_staticText.Wrap(-1)

        pair_location_sbSizer.Add(self.pair_creation_info_2_staticText, 0,
                                  wx.ALL, 5)

        create_new_key_pair_bSizer.Add(pair_location_sbSizer, 0,
                                       wx.ALL | wx.EXPAND, 5)

        self.SetSizer(create_new_key_pair_bSizer)
        self.Layout()

        self.Centre(wx.BOTH)

        # Connect Events
        self.key_pair_location_dirPicker.Bind(wx.EVT_DIRPICKER_CHANGED,
                                              self.create_key_pair)
Esempio n. 23
0
    def __init__(self, *args, **kw):
        # ensure the parent's __init__ is called
        super(StegAppFrameJoiner, self).__init__(*args, **kw)

        # create a panel in the frame
        self.pnl = wx.Panel(self)
        self.pnl.SetBackgroundColour("#ffffff")

        sizer = wx.GridBagSizer(4, 4)

        text = wx.StaticText(self.pnl, label="Information")
        sizer.Add(text, pos=(5, 0), flag=wx.TOP | wx.LEFT | wx.BOTTOM, border=5)

        self.information_text = wx.StaticText(self.pnl, label="CHUNK COUNT: 0")
        sizer.Add(self.information_text, pos=(5, 1), flag=wx.TOP | wx.LEFT | wx.BOTTOM, border=5)

        text = wx.StaticText(self.pnl, label="File Processing Percentage")
        sizer.Add(text, pos=(6, 0), flag=wx.TOP | wx.LEFT | wx.BOTTOM, border=5)

        self.gauge = wx.Gauge(self.pnl, id=wx.ID_ANY, range=100, pos=(10, 190), size=wx.DefaultSize,
                              style=wx.GA_HORIZONTAL,
                              validator=wx.DefaultValidator)
        sizer.Add(self.gauge, pos=(6, 1), flag=wx.TOP | wx.LEFT | wx.BOTTOM, border=5)

        """
        spinControl = wx.SpinCtrl(self.pnl, value="", pos=(10, 220),
         size=wx.DefaultSize, style=wx.SP_ARROW_KEYS, min=0, max=100, initial=0,
         name="wxSpinCtrl")
        sizer.Add(spinControl, pos=(4, 0), flag=wx.TOP | wx.LEFT | wx.BOTTOM, border=5)
        """

        text = wx.StaticText(self.pnl, label="Select file to split into Images")
        sizer.Add(text, pos=(0, 0), flag=wx.TOP | wx.LEFT | wx.BOTTOM, border=5)

        self.file_picker = wx.DirPickerCtrl(self.pnl, message="Select Compressed Files Folder", size=wx.DefaultSize)
        font = self.file_picker.GetFont()
        font.PointSize += 10
        font = font.Bold()
        self.file_picker.SetFont(font)
        sizer.Add(self.file_picker, pos=(1, 0), span=(1, 5),
                  flag=wx.EXPAND | wx.LEFT | wx.RIGHT, border=5)



        buttonOk = wx.Button(self.pnl, label="Open Selected Folder", id=1)
        sizer.Add(buttonOk, pos=(6, 3))
        sizer.AddGrowableCol(2)
        sizer.AddGrowableRow(4)
        self.pnl.SetSizer(sizer)

        # create a menu bar
        self.makeMenuBar()
    def __init__(self, parent):
        super(NewProjectPanel, self).__init__(parent)

        # Attributes
        self._ptype = ProjectTypePanel(self)
        self._pname = wx.TextCtrl(self)  # TODO validator alpha-numeric only
        self._pname.ToolTip = wx.ToolTip(
            _("Project directory will be created using this name."))
        self._pdir = wx.DirPickerCtrl(self)  # TODO: default path
        self._pdir.ToolTip = wx.ToolTip(_("Location to create new project."))

        # Setup
        self.__DoLayout()
Esempio n. 25
0
 def __init__(self, parent):
     TitledPage.__init__(self, parent,
                         _('Please select your desktop folder'))
     self.deskdirctrl = wx.DirPickerCtrl(
         self,
         -1,
         # path = PIE_CONFIG.get('Profile', 'rootdir'),
         path=os.getcwd(),
         style=wx.DIRP_USE_TEXTCTRL | wx.DIRP_DIR_MUST_EXIST)
     self.sizer.AddWindow((20, 20), 1)
     self.sizer.AddWindow(self.deskdirctrl, 0,
                          wx.ALIGN_CENTRE | wx.EXPAND | wx.ALL, 5)
     self.sizer.AddWindow((20, 20), 1)
Esempio n. 26
0
    def __init__( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.Size( 320,400 ), style = wx.TAB_TRAVERSAL, name = wx.EmptyString ):
        wx.Panel.__init__ ( self, parent, id = id, pos = pos, size = size, style = style, name = name )

        bSizer23 = wx.BoxSizer( wx.VERTICAL )

        sbSizer10 = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"Destination" ), wx.VERTICAL )

        fgSizer2 = wx.FlexGridSizer( 0, 2, 0, 0 )
        fgSizer2.AddGrowableCol( 1 )
        fgSizer2.SetFlexibleDirection( wx.BOTH )
        fgSizer2.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )

        self.m_staticText10 = wx.StaticText( sbSizer10.GetStaticBox(), wx.ID_ANY, u"Directory", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText10.Wrap( -1 )

        fgSizer2.Add( self.m_staticText10, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )

        self.outputDirPicker = wx.DirPickerCtrl( sbSizer10.GetStaticBox(), wx.ID_ANY, wx.EmptyString, u"Select a folder", wx.DefaultPosition, wx.DefaultSize, wx.DIRP_SMALL|wx.DIRP_USE_TEXTCTRL )
        fgSizer2.Add( self.outputDirPicker, 1, wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.EXPAND, 5 )

        self.m_staticText11 = wx.StaticText( sbSizer10.GetStaticBox(), wx.ID_ANY, u"Name format", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText11.Wrap( -1 )

        fgSizer2.Add( self.m_staticText11, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )

        bSizer24 = wx.BoxSizer( wx.HORIZONTAL )

        self.fileNameFormatTextControl = wx.TextCtrl( sbSizer10.GetStaticBox(), wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
        bSizer24.Add( self.fileNameFormatTextControl, 1, wx.ALL|wx.EXPAND, 5 )

        self.m_button16 = wx.Button( sbSizer10.GetStaticBox(), wx.ID_ANY, u"?", wx.DefaultPosition, wx.DefaultSize, wx.BU_EXACTFIT )
        bSizer24.Add( self.m_button16, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 4 )


        fgSizer2.Add( bSizer24, 1, wx.EXPAND, 5 )


        sbSizer10.Add( fgSizer2, 1, wx.EXPAND, 5 )


        bSizer23.Add( sbSizer10, 0, wx.ALL|wx.EXPAND, 5 )


        bSizer23.Add( ( 0, 0), 2, wx.EXPAND, 5 )


        self.SetSizer( bSizer23 )
        self.Layout()

        # Connect Events
        self.m_button16.Bind( wx.EVT_BUTTON, self.OnNameFormatHintClick )
Esempio n. 27
0
    def __init__(self, *args, **kwargs):
        super(DirectoryChooser, self).__init__(*args, **kwargs)

        self.chooser = wx.DirPickerCtrl(self, wx.ID_ANY, u'')
        self.checkbx = wx.CheckBox(self, wx.ID_ANY, _('None'))

        sz = wx.BoxSizer(wx.VERTICAL)
        sz.Add(self.chooser, 1, wx.EXPAND)
        sz.Add(self.checkbx, 1)

        self.SetSizer(sz)
        self.Fit()

        wx.EVT_CHECKBOX(self.checkbx, wx.ID_ANY, self.OnCheck)
 def __init__(self, parent, pageThree, mutualMet):
     wx.Panel.__init__(self, parent)
     self.__pageThree = pageThree
     self.__mutualMet = mutualMet
     static_box = wx.StaticBox(parent=self,
                               id=wx.ID_ANY,
                               label='Details',
                               size=(210, 180),
                               pos=(5, 10))
     wx.StaticText(self, label='City', pos=(15, 30))
     self.__city = wx.ComboBox(self,
                               choices=self.__mutualMet.getAllCities(),
                               pos=(65, 30))  # show all the chains
     self.__city.Bind(wx.EVT_COMBOBOX, self.getAreasInCity)
     wx.StaticText(self, label='Area', pos=(15, 60))
     self.__areaList = wx.ListBox(self,
                                  style=wx.LB_MULTIPLE,
                                  choices=[],
                                  pos=(65, 60))
     self.__selectAllAreas = wx.CheckBox(self,
                                         id=wx.ID_ANY,
                                         label='Select All',
                                         pos=(65, 112))
     self.__selectAllAreas.Bind(wx.EVT_CHECKBOX, self.areasChecked)
     self.__areaList.Bind(wx.EVT_LISTBOX_DCLICK, self.getBranchesInArea)
     wx.StaticText(self, label='Date', pos=(15, 145))
     self.__date = wx.adv.DatePickerCtrl(self, pos=(65, 145))
     static_box = wx.StaticBox(parent=self,
                               id=wx.ID_ANY,
                               label='Shop Basket',
                               size=(310, 180),
                               pos=(220, 10))
     self.__productsList = wx.ListBox(
         self,
         style=wx.LB_MULTIPLE,
         choices=self.__mutualMet.getAllProductsNames(),
         pos=(225, 30))
     wx.StaticText(self, label='Results File Path', pos=(80, 215))
     self.__dirPicker = wx.DirPickerCtrl(parent=self,
                                         id=wx.ID_ANY,
                                         message="Choose Directory",
                                         pos=(170, 210),
                                         size=(270, -1),
                                         style=wx.DIRP_DIR_MUST_EXIST
                                         | wx.DIRP_USE_TEXTCTRL
                                         | wx.DIRP_SMALL)
     btn = wx.Button(self,
                     label='Find The Cheapest Basket!',
                     pos=(200, 255))
     btn.Bind(wx.EVT_BUTTON, self.OnClick)
    def __init__(self, parent, title):
        super(OnlineTestWindow, self).__init__(parent,
                                               title=title,
                                               size=(615, 280))
        self.Centre()
        panel = wx.Panel(self)
        TrainModelWildcard = "pkl Data File (.pkl)" + "|*.pkl"

        # Online Test box
        sbox1 = wx.StaticBox(panel, -1, label=u'训练阶段')
        self.sbsizer1 = wx.StaticBoxSizer(sbox1, wx.VERTICAL)
        gridSizer1 = wx.FlexGridSizer(cols=3, vgap=10, hgap=1)

        label = wx.StaticText(panel)
        label.SetLabel("选择模型:")
        gridSizer1.Add(label, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
        self.SelectTrainModelPath = wx.FilePickerCtrl(
            panel, wildcard=TrainModelWildcard, size=(320, 27))
        self.SelectTrainModelPath.GetPickerCtrl().SetLabel('浏览')
        gridSizer1.Add(self.SelectTrainModelPath, 0,
                       wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)

        label = wx.StaticText(panel)
        label.SetLabel("")
        gridSizer1.Add(label, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)

        label = wx.StaticText(panel)
        label.SetLabel("训练数据存储路径:")
        gridSizer1.Add(label, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
        self.OnlineDataPath = wx.DirPickerCtrl(panel, size=(320, 27))
        self.OnlineDataPath.GetPickerCtrl().SetLabel('浏览')
        gridSizer1.Add(self.OnlineDataPath, 0,
                       wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)

        self.OnlineStartBtn = wx.Button(panel,
                                        label="开始康复训练",
                                        size=wx.Size(100, 27))
        self.OnlineStartBtn.Bind(wx.EVT_BUTTON, self.OnOnlineStart)
        gridSizer1.Add(self.OnlineStartBtn, 0,
                       wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
        self.sbsizer1.Add(gridSizer1, proportion=0, flag=wx.ALL, border=5)

        self.backBtn = wx.Button(panel, label="返回", size=(100, 27))
        self.backBtn.Bind(wx.EVT_BUTTON, self.OnBack)
        gridSizer = wx.FlexGridSizer(cols=1, vgap=1, hgap=1)
        gridSizer.Add(self.backBtn, 0, wx.ALL, 5)
        gridSizer.Add(self.sbsizer1, 0, wx.ALL, 5)
        panel.SetSizerAndFit(gridSizer)
        panel.Center()
        self.Fit()
Esempio n. 30
0
    def _init_contents(self):
        self.statusBar = self.CreateStatusBar()

        sizer = wx.BoxSizer(orient=wx.VERTICAL)

        self.dirPicker = wx.DirPickerCtrl(self,
                                          id=wx.ID_ANY,
                                          style=wx.DIRP_DIR_MUST_EXIST
                                          | wx.DIRP_USE_TEXTCTRL)
        sizer.Add(
            self.dirPicker,
            0,  # make vertically unstretchable
            wx.EXPAND |  # make horizontally stretchable
            wx.ALL,  # and make border all around
        )

        self.splitter1 = wx.SplitterWindow(self, id=wx.ID_ANY, style=wx.SP_3D)
        sizer.Add(
            self.splitter1,
            1,  # make vertically stretchable
            wx.EXPAND |  # make horizontally stretchable
            wx.ALL,  # and make border all around
        )

        self.textCtrl1 = wx.TextCtrl(self.splitter1,
                                     id=wx.ID_ANY,
                                     style=wx.TE_READONLY | wx.TE_MULTILINE)
        self.setSummaryText('(empty)')

        self.dir = wx.GenericDirCtrl(
            self.splitter1,
            wx.ID_ANY,
            dir=self.prefs['start_dir'],
            filter=self.prefs['file_filter'],
        )

        # Select the starting folder and expand to it
        self.setCurrentDirectory(self.prefs['start_dir'])
        self.splitter1.SplitVertically(self.dir, self.textCtrl1)

        tree = self.dir.GetTreeCtrl()

        wx.EVT_TREE_SEL_CHANGED(self, tree.GetId(), self.OnSelectTreeCtrlItem)
        wx.EVT_SPLITTER_SASH_POS_CHANGED(self, self.splitter1.GetId(),
                                         self.OnSashMoved)
        #self.Bind(wx.EVT_SIZE, self.OnWindowGeometryChanged)
        self.Bind(wx.EVT_MOVE, self.OnWindowGeometryChanged)
        self.Bind(wx.EVT_DIRPICKER_CHANGED, self.OnSelectDirPicker)

        self.SetSizerAndFit(sizer)