Exemplo n.º 1
0
    def __init__(self, parent):
        wx.Panel.__init__(self, parent, size=(800, 600))
        hbox = wx.BoxSizer(wx.HORIZONTAL)
        pnl1 = wx.Panel(self, -1, style=wx.SIMPLE_BORDER)
        pnl2 = wx.Panel(self, -1, style=wx.SIMPLE_BORDER)
        pnl3 = wx.Panel(self, -1, style=wx.SIMPLE_BORDER)
        hbox.Add(pnl1, 1, wx.EXPAND | wx.ALL, 3)
        hbox.Add(pnl2, 1, wx.EXPAND | wx.ALL, 3)
        hbox.Add(pnl3, 1, wx.EXPAND | wx.ALL, 3)
        self.SetSize((400, 500))
        self.SetSizer(hbox)

        self.dir1 = wx.GenericDirCtrl(pnl1,
                                      -1,
                                      size=(200, 600),
                                      dir='/home/',
                                      style=wx.DIRCTRL_DIR_ONLY
                                      | wx.BORDER_RAISED)
        self.dir2 = wx.GenericDirCtrl(pnl2,
                                      -1,
                                      size=(200, 600),
                                      dir='/home/',
                                      style=wx.DIRCTRL_DIR_ONLY
                                      | wx.BORDER_RAISED)

        self.mergeBtn = wx.Button(pnl3, -1, 'Merge', (20, 20))
        self.mergeBtn.Bind(wx.EVT_BUTTON, self.OnMerge)
Exemplo n.º 2
0
    def __init__(self, parent):
        wx.Panel.__init__(self, parent, wx.ID_ANY)

        resizer = wx.BoxSizer(wx.HORIZONTAL)
        # Starting directory for directory view
        data_directory = get_data_directory()

        if data_directory is None:
            self.file_explorer = wx.GenericDirCtrl(self, wx.ID_ANY)
        else:
            self.file_explorer = wx.GenericDirCtrl(self, wx.ID_ANY, dir=data_directory)

        resizer.Add(self.file_explorer, 1, wx.EXPAND | wx.ALL)
        self.SetSizerAndFit(resizer)
Exemplo n.º 3
0
    def __init__(self, parent, log):
        wx.Panel.__init__(self, parent, -1)

        self.log = log

        txt1 = wx.StaticText(self, -1, "style=0")
        dir1 = wx.GenericDirCtrl(self, -1, size=(200, 225), style=0)

        txt2 = wx.StaticText(self, -1, "wx.DIRCTRL_DIR_ONLY")
        dir2 = wx.GenericDirCtrl(self,
                                 -1,
                                 size=(200, 225),
                                 style=wx.DIRCTRL_DIR_ONLY)

        txt3 = wx.StaticText(
            self, -1,
            "wx.DIRCTRL_SHOW_FILTERS\nwx.DIRCTRL_3D_INTERNAL\nwx.DIRCTRL_MULTIPLE"
        )
        dir3 = wx.GenericDirCtrl(
            self,
            -1,
            size=(200, 225),
            style=wx.DIRCTRL_SHOW_FILTERS | wx.DIRCTRL_3D_INTERNAL
            | wx.DIRCTRL_MULTIPLE,
            filter="All files (*.*)|*.*|Python files (*.py)|*.py")

        sz = wx.FlexGridSizer(cols=3, hgap=5, vgap=5)
        sz.Add((35, 35))  # some space above
        sz.Add((35, 35))
        sz.Add((35, 35))

        sz.Add(txt1)
        sz.Add(txt2)
        sz.Add(txt3)

        sz.Add(dir1, 0, wx.EXPAND)
        sz.Add(dir2, 0, wx.EXPAND)
        sz.Add(dir3, 0, wx.EXPAND)

        sz.Add((35, 35))  # some space below

        sz.AddGrowableRow(2)
        sz.AddGrowableCol(0)
        sz.AddGrowableCol(1)
        sz.AddGrowableCol(2)

        self.SetSizer(sz)
        self.SetAutoLayout(True)
Exemplo n.º 4
0
 def create_contents(self, parent):
     control = wx.GenericDirCtrl(parent,
                                 -1,
                                 size=(200, -1),
                                 style=wx.NO_BORDER)
     control.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.on_selected)
     return control
Exemplo n.º 5
0
    def __init__(self, parent=None):
        """FileChooseWindow(parent=None) -> wx.Frame

        Create a window that provides user to choose a file.
        """
        super(FileChooseWindow, self).__init__(parent,
                                               title=self.title,
                                               style=wx.DEFAULT_FRAME_STYLE)
        self.parent = parent
        self.search = wx.ComboBox(self, style=wx.TE_PROCESS_ENTER)
        self.search.Bind(wx.EVT_TEXT_ENTER, self.OnExpand)
        self.chooser = wx.GenericDirCtrl(self, style=wx.DIRCTRL_EDIT_LABELS)
        self.chooser.Bind(wx.EVT_DIRCTRL_FILEACTIVATED, self.OnOpen)
        self.chooser.Bind(wx.EVT_DIRCTRL_SELECTIONCHANGED, self.OnUpdate)
        self.ver = wx.BoxSizer(wx.VERTICAL)
        self.ver.Add(self.search,
                     proportion=0,
                     flag=wx.EXPAND | wx.ALL,
                     border=0)
        self.ver.Add(self.chooser,
                     proportion=1,
                     flag=wx.EXPAND | wx.ALL,
                     border=0)
        self.SetSizer(self.ver)
        self.Bind(wx.EVT_CLOSE, self.OnClose)
        self.Show(True)
Exemplo n.º 6
0
   def __init__(self,parent,id = -1,title='',pos = wx.Point(1,1),size = wx.Size(495,420),style = wx.DEFAULT_FRAME_STYLE,name = 'frame'):
       
       
       wx.Frame.__init__(self, parent, id, title, pos, size, style)
 
       tree = wx.GenericDirCtrl(self, -1,  size=(160, 250), style=wx.DIRCTRL_SHOW_FILTERS,
                               filter="All files (*.*)|*.*|Python files (*.py)|*.py")
Exemplo n.º 7
0
 def __init__(self, parent):
     super().__init__(
         parent, style=wx.SIMPLE_BORDER
     )  # wx.SIMPLE_BORDER wx.RAISED_BORDER wx.SUNKEN_BORDER wx.NO_BORDER
     framex, framey, framew, frameh = wx.ClientDisplayRect()
     rm = [
         "All files (*.*)", "Python files (*.py)", "csv files (*.csv)",
         "txt files (*.txt)"
     ]
     self.Manage_type = wx.ComboBox(self,
                                    121,
                                    value="All files (*.*)",
                                    choices=rm,
                                    style=wx.CB_READONLY)
     self.dir = wx.GenericDirCtrl(
         self, 122, os.path.dirname(os.path.abspath(__file__)),
         wx.DefaultPosition, (framew / 5, frameh / 2), wx.DIRCTRL_MULTIPLE,
         "All files (*.*)|*.*")
     self.Manage_sizer = wx.BoxSizer(wx.VERTICAL)
     self.Manage_sizer.Add(self.dir, proportion=1, flag=wx.ALL, border=10)
     self.Manage_sizer.Add(self.Manage_type, 0, wx.EXPAND | wx.ALL, 10)
     self.SetSizer(self.Manage_sizer)
     self.Manage_type.Bind(wx.EVT_COMBOBOX, self.OnCombo)
     self.dir.Bind(wx.EVT_DIRCTRL_SELECTIONCHANGED, self.OnSelect)
     self.Layout()
     self.Hide()
Exemplo n.º 8
0
    def InitUI(self):

        splitter1 = wx.SplitterWindow(self, style=wx.SP_3D)
        splitter2 = wx.SplitterWindow(splitter1, style=wx.SP_3D)

        home_dir = str(Path.home())

        self.dirWid = wx.GenericDirCtrl(splitter1,
                                        dir=home_dir,
                                        style=wx.DIRCTRL_DIR_ONLY)

        self.lc1 = wx.ListCtrl(splitter2, style=wx.LC_LIST)
        self.lc2 = wx.ListCtrl(splitter2, style=wx.LC_LIST)

        dt = MyTextDropTarget(self.lc2)
        self.lc2.SetDropTarget(dt)

        self.Bind(wx.EVT_LIST_BEGIN_DRAG, self.OnDragInit, id=self.lc1.GetId())

        tree = self.dirWid.GetTreeCtrl()

        splitter2.SplitHorizontally(self.lc1, self.lc2, 150)
        splitter1.SplitVertically(self.dirWid, splitter2, 200)

        self.Bind(wx.EVT_TREE_SEL_CHANGED, self.OnSelect, id=tree.GetId())

        self.OnSelect(0)

        self.SetTitle('Drag and drop text')
        self.Centre()
    def __init__(self, parent, message=_("Choose a directory"), title=_("Browse For Folders"),
                 defaultPath="", style=wx.DD_DEFAULT_STYLE|DD_MULTIPLE, pos=wx.DefaultPosition,
                 size=wx.DefaultSize, name="multidirdialog"):
        
        """
        Default class constructor.

        @param parent: the dialog parent widget;
        @param message: the message to show on the dialog;
        @param title: the dialog title;
        @param defaultPath: the default path, or the empty string;
        @param style: the custom dir dialog style;
        @param pos: the dialog position;
        @param size: the dialog size;
        @param name: the dialog name.
        """

        self.ddStyle = style

        wx.Dialog.__init__(self, parent, pos=pos, size=size, style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER, name=name)
        
        self.dirCtrl = wx.GenericDirCtrl(self, size=(300, 300), style=wx.DIRCTRL_3D_INTERNAL|wx.DIRCTRL_DIR_ONLY)
        self.folderText = wx.TextCtrl(self, -1, defaultPath, style=wx.TE_PROCESS_ENTER)
        self.CreateButtons()
        
        self.SetProperties(title)           
        # Setup the layout and frame properties        
        self.SetupDirCtrl(defaultPath)
        self.LayoutItems()
        self.BindEvents()
    
        if parent and pos == wx.DefaultPosition:
            self.CenterOnParent()
Exemplo n.º 10
0
    def __init__(self,parent):
        """初始化对话框
        @type parent: wxCtrl
        @param parent: 父框架
        """
        wx.Dialog.__init__(self,parent,-1)
        self.path = ""
        self.dir1 = wx.GenericDirCtrl(self, -1, size = (200,300),style=0)
        self.but = wx.Button(self,wx.ID_OK,"&OK")

        sz = wx.BoxSizer(wx.VERTICAL)
        sz.Add((35, 35))  # some space above

        sz.Add(self.dir1, 0, wx.EXPAND,wx.ALL,10)

        sz.Add((35,35))

        sz.Add(self.but, 0, wx.ALIGN_CENTER)

        self.SetSizer(sz)
        self.SetAutoLayout(True)
        self.Layout()

        #self.but.Bind(wx.EVT_BUTTON, self.OnSel)
        wx.EVT_BUTTON( self, wx.ID_OK, self.OnSel)
Exemplo n.º 11
0
    def __init__(self, parent, ida, title):
        wx.Frame.__init__(self, parent, ida, title, size=(650, 500))

        splitter1 = wx.SplitterWindow(self, -1, style=wx.SP_3D)
        splitter2 = wx.SplitterWindow(splitter1, -1, style=wx.SP_3D)
        splitter1.SetMinimumPaneSize(50)
        splitter2.SetMinimumPaneSize(100)
        self.dir = wx.GenericDirCtrl(splitter1,
                                     -1,
                                     dir='C:\\',
                                     style=wx.DIRCTRL_DIR_ONLY)
        self.lc1 = wx.ListCtrl(splitter2, -1, style=wx.LC_LIST)
        self.lc2 = wx.ListCtrl(splitter2, -1, style=wx.LC_LIST)

        dt = MyTextDropTarget(self.lc2)
        self.lc2.SetDropTarget(dt)
        self.Bind(wx.EVT_LIST_BEGIN_DRAG,
                  self.on_drag_init,
                  id=self.lc1.GetId())

        tree = self.dir.GetTreeCtrl()

        splitter2.SplitHorizontally(self.lc1, self.lc2)
        splitter1.SplitVertically(self.dir, splitter2)

        self.Bind(wx.EVT_TREE_SEL_CHANGED, self.on_select, id=tree.GetId())

        self.on_select(0)
        self.Centre()
        self.Show(True)
Exemplo n.º 12
0
def Notebook(parent, *a, **k):
    obj = wx.Notebook(parent, *a, **k)

    parent.dirctrl = wx.GenericDirCtrl(obj, \
         wx.ID_ANY, \
         dir=UIConfig.inst().getLastDir(), \
         style = wx.BORDER_NONE)

    parent.statsctrl = LoadedListCtrl(obj, wx.ID_ANY, \
      style = wx.LC_REPORT | wx.LC_SINGLE_SEL | wx.NO_BORDER)

    obj.AddPage(parent.dirctrl, 'Files')
    obj.AddPage(parent.statsctrl, 'loaded pf')

    def OnDirctrlContextMenu(evt):
        def OnRefresh(evt):
            path = parent.dirctrl.GetPath()
            parent.dirctrl.ReCreateTree()
            parent.dirctrl.SetPath(path)

        menu = wx.Menu()
        menu.AppendSeparator()
        ID_REFRESH = wx.NewId()
        item_refresh = wx.MenuItem(menu, ID_REFRESH, 'Refresh')
        obj.Bind(wx.EVT_MENU, OnRefresh, id=ID_REFRESH)
        menu.AppendItem(item_refresh)

        parent.dirctrl.PopupMenu(menu)
        menu.Destroy()

    parent.dirctrl.Bind(wx.EVT_CONTEXT_MENU, OnDirctrlContextMenu)

    return obj
Exemplo n.º 13
0
    def __init__(self, parent):

        no_resize = wx.DEFAULT_FRAME_STYLE & ~(
            wx.RESIZE_BORDER | wx.RESIZE_BOX | wx.MAXIMIZE_BOX | wx.CLOSE_BOX)

        super(ImportPresentation, self).__init__(None,
                                                 -1,
                                                 'Presentation Import',
                                                 style=no_resize)
        self.parent = parent

        self.presentationList = wx.GenericDirCtrl(self,
                                                  -1,
                                                  style=wx.LC_REPORT,
                                                  size=self.GetSize())

        select = wx.Button(self, -1, 'Select', size=(200, 20))
        select.Bind(wx.EVT_BUTTON, self.SelectPresentation)

        cancel = wx.Button(self, -1, 'Cancel', size=(200, 20))
        cancel.Bind(wx.EVT_BUTTON, self.CancelSelectPresentation)

        sizer = wx.BoxSizer(wx.VERTICAL)
        horiSizer = wx.BoxSizer(wx.HORIZONTAL)
        sizer.Add(self.presentationList, 1, wx.ALIGN_CENTER)
        horiSizer.AddStretchSpacer(3)
        horiSizer.Add(select, 1)
        horiSizer.Add(cancel, 1)
        horiSizer.AddStretchSpacer(3)
        sizer.Add(horiSizer)
        self.SetSizer(sizer)
        self.Centre()
Exemplo n.º 14
0
    def __init__(self, *arg, **kwargs):
        super(Tree_panel, self).__init__(*arg, **kwargs)
        self.tree = wx.GenericDirCtrl(self, size=(100, 200))
        sizer = wx.BoxSizer(wx.VERTICAL)

        sizer.Add(self.tree, -1, wx.ALL | wx.EXPAND)
        self.SetSizer(sizer)
        sizer.Fit(self)
        self.Layout()
Exemplo n.º 15
0
    def __init__(self, primaryFrame, parent, *args, **kwargs):
        # Create the panel.
        wx.Panel.__init__(self, parent, *args, **kwargs)

        self.parent = parent
        self.primaryFrame = primaryFrame
        self.dir = wx.GenericDirCtrl(self, -1, size=(900,600), style=0, filter = "*.csv")

        self.Bind(wx.EVT_TREE_SEL_CHANGED, self.onSel, self.dir.TreeCtrl)
Exemplo n.º 16
0
 def __init__(self, parent):
     wx.Panel.__init__(self, parent=parent)
     # Creating the Sizer
     self.Sizer_left = wx.BoxSizer(wx.HORIZONTAL)
     # File Browswer
     self.Directory_column=wx.GenericDirCtrl(self,dir=os.environ['USERPROFILE'],filter=File_set,\
     style=wx.DIRCTRL_EDIT_LABELS|wx.DIRCTRL_SHOW_FILTERS)
     self.Directory_column.ShowHidden(show=False)
     # Set Sizer
     self.Sizer_left.Add(self.Directory_column, 1, wx.EXPAND, 0)
     self.SetSizer(self.Sizer_left)
Exemplo n.º 17
0
    def __init__(self, parent):
        super(wx.Panel, self).__init__(parent, id=mu.id_window[mu.k_panel_filetree])
        self.filetree = wx.GenericDirCtrl(self, id=mu.id_window[mu.k_filetree], style=wx.LC_REPORT)
        self.sizer = wx.BoxSizer(wx.VERTICAL)
        self.sizer.Add(self.filetree, 1, wx.EXPAND)
        self.SetSizer(self.sizer)

        dirpath_macro = pathlib.Path.cwd() / mu.k_dirpath_macro
        pathlib.Path(dirpath_macro).mkdir(parents=True, exist_ok=True)
        self.filetree.SetPath(str(dirpath_macro))
        self.filetree.Bind(wx.EVT_DIRCTRL_FILEACTIVATED, parent.Parent.Parent.on_dirctl_fileactivated)
Exemplo n.º 18
0
    def __init__(self, parent, folder=FOLDER, fileext=FILEEXT):
        wx.Panel.__init__(self, parent)

        hbox = wx.BoxSizer(wx.HORIZONTAL)
        self.SetSizer(hbox)

        self.dirctrl = wx.GenericDirCtrl(self,
                                         wx.ID_ANY,
                                         dir=folder,
                                         filter="*" + fileext)
        hbox.Add(self.dirctrl, 1, wx.EXPAND | wx.ALL, 1)
Exemplo n.º 19
0
    def create_control(self, parent):
        """ Creates the file control and gets it ready for use.
        """
        style = self.get_style()
        if len(self.filter) > 0:
            style |= wx.DIRCTRL_SHOW_FILTERS

        self._files = files = wx.GenericDirCtrl(parent, style=style,
                                                filter='|'.join(self.filter))
        files.SetPath(self.file_name)
        self._tree = tree = files.GetTreeCtrl()
        wx.EVT_TREE_SEL_CHANGED(tree, tree.GetId(), self._select_file)
Exemplo n.º 20
0
    def __init__(self, parent, log):
        eclib.SegmentBook.__init__(self, parent,
                                       style=eclib.SEGBOOK_STYLE_NO_DIVIDERS|\
                                             eclib.SEGBOOK_STYLE_LABELS)

        # Attributes
        self.log = log
        self._menu = None
        self._imglst = list()
        #        self._imglst = wx.ImageList(32, 32, mask=False)

        # Setup
        bmp = IconFile.Monkey.GetBitmap()
        self._imglst.append(bmp)
        #        self._imglst.Add(bmp)
        bmp = IconFile.Devil.GetBitmap()
        self._imglst.append(bmp)
        #        self._imglst.Add(bmp)
        self.SetUsePyImageList(True)  # HACK workaround for mask issues on msw
        self.SetImageList(self._imglst)

        self.AddPage(wx.TextCtrl(self, style=wx.TE_MULTILINE, value="Hello"),
                     "Text Editor",
                     img_id=0)
        self.AddPage(wx.GenericDirCtrl(self), "File Browser", img_id=1)
        self.AddPage(wx.TextCtrl(self,
                                 style=wx.TE_MULTILINE,
                                 value="Test Control"),
                     "Text Editor2",
                     img_id=0)
        todo = wx.ListBox(self,
                          choices=[
                              'Wake up', 'Finish Event handling', 'Take a nap',
                              'Procrastinate for a while', 'Drink some coffee',
                              'Check in code'
                          ])
        self.AddPage(todo, "TODO List", img_id=1)

        # Add a sub controlbar
        cbar = eclib.ControlBar(self, style=eclib.CTRLBAR_STYLE_GRADIENT)
        cbar.SetVMargin(3, 3)
        self.SetControlBar(cbar, wx.BOTTOM)
        cbar.AddControl(wx.Button(cbar, wx.ID_NEW))
        cbar.AddControl(wx.Button(cbar, wx.ID_DELETE))

        # Event Handlers
        self.Bind(eclib.EVT_SB_PAGE_CHANGING, self.OnPageChanging)
        self.Bind(eclib.EVT_SB_PAGE_CHANGED, self.OnPageChanged)
        self.Bind(eclib.EVT_SB_PAGE_CONTEXT_MENU, self.OnPageMenu)
        self.Bind(wx.EVT_BUTTON, self.OnButton)
        self.Bind(wx.EVT_MENU, self.OnButton, id=wx.ID_NEW)
        self.Bind(wx.EVT_MENU, self.OnButton, id=wx.ID_DELETE)
    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Dialog.__init__(self, id=wxID_PYINTERPRETERCHOOSERDLG,
              name='PyInterpreterChooserDlg', parent=prnt, pos=wx.Point(548,
              354), size=wx.Size(532, 358),
              style=wx.RESIZE_BORDER | wx.DEFAULT_DIALOG_STYLE,
              title=_('Python Interpreter Chooser'))
        self._init_utils()
        self.SetClientSize(wx.Size(524, 331))
        self.Center(wx.BOTH)

        self.staticText1 = wx.StaticText(id=wxID_PYINTERPRETERCHOOSERDLGSTATICTEXT1,
              label=_('Found installations: (double click to select)'),
              name='staticText1', parent=self, pos=wx.Point(10, 10),
              size=wx.Size(203, 13), style=0)

        self.gdcInstallPath = wx.GenericDirCtrl(defaultFilter=0, dir='.',
              filter=self.installPathFilter,
              id=wxID_PYINTERPRETERCHOOSERDLGGDCINSTALLPATH,
              name='gdcInstallPath', parent=self, pos=wx.Point(272, 52),
              size=wx.Size(242, 146),
              style=wx.DIRCTRL_SHOW_FILTERS | wx.DIRCTRL_3D_INTERNAL | wx.NO_BORDER)

        self.lcInstallations = wx.ListView(id=wxID_PYINTERPRETERCHOOSERDLGLCINSTALLATIONS,
              name='lcInstallations', parent=self, pos=wx.Point(10, 52),
              size=wx.Size(242, 146), style=wx.SUNKEN_BORDER | wx.LC_REPORT,
              validator=wx.DefaultValidator)
        self._init_coll_lcInstallations_Columns(self.lcInstallations)
        self.lcInstallations.Bind(wx.EVT_LIST_ITEM_ACTIVATED,
              self.OnLcinstallationsListItemActivated,
              id=wxID_PYINTERPRETERCHOOSERDLGLCINSTALLATIONS)

        self.staticText2 = wx.StaticText(id=wxID_PYINTERPRETERCHOOSERDLGSTATICTEXT2,
              label=_('Current interpreter path (Blank means sys.executable will be used.)'),
              name='staticText2', parent=self, pos=wx.Point(10, 218),
              size=wx.Size(504, 19), style=0)

        self.txtPyIntpPath = wx.TextCtrl(id=wxID_PYINTERPRETERCHOOSERDLGTXTPYINTPPATH,
              name='txtPyIntpPath', parent=self, pos=wx.Point(10, 257),
              size=wx.Size(504, 21), style=0, value=self.pythonInterpreterPath)

        self.btnOK = wx.Button(id=wx.ID_OK, label=_('OK'), name='btnOK',
              parent=self, pos=wx.Point(287, 298), size=wx.Size(101, 23),
              style=0)

        self.btnCancel = wx.Button(id=wx.ID_CANCEL, label=_('Cancel'),
              name='btnCancel', parent=self, pos=wx.Point(408, 298),
              size=wx.Size(106, 23), style=0)

        self._init_sizers()
Exemplo n.º 22
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)
Exemplo n.º 23
0
 def __init__(self, parent):
     super(MyNotebook, self).__init__(parent, style=wx.NB_BOTTOM)  # NB_TOP
     # Attributes
     self.textctrl = wx.TextCtrl(self,
                                 value="edit me",
                                 style=wx.TE_MULTILINE)
     self.blue = wx.Panel(self)
     self.blue.SetBackgroundColour(wx.BLUE)
     #使用此类进行文件系统的选择
     self.fbrowser = wx.GenericDirCtrl(self, style=wx.DIRCTRL_3D_INTERNAL)
     # Setup
     self.AddPage(self.textctrl, "Text Editor")
     self.AddPage(self.blue, "Blue Panel")
     self.AddPage(self.fbrowser, "File Browser")
Exemplo n.º 24
0
    def __init__(self, parent):
        super(MyNotebook, self).__init__(parent)

        # Attributes
        self.textctrl = wx.TextCtrl(self, value="edit me",
                                    style=wx.TE_MULTILINE)
        self.blue = wx.Panel(self)
        self.blue.SetBackgroundColour(wx.BLUE)
        self.fbrowser = wx.GenericDirCtrl(self)

        # Setup
        self.AddPage(self.textctrl, "Text Editor")
        self.AddPage(self.blue, "Blue Panel")
        self.AddPage(self.fbrowser, "File Browser")
Exemplo n.º 25
0
    def _initSecondStepPanel(self):
        panel = wx.Panel(self, size=(580, 600))
        panel.SetBackgroundColour('white')

        mainSizer = wx.BoxSizer(wx.VERTICAL)

        title = wx.StaticText(panel, -1, 'Configuração')
        font = wx.Font(wx.FontInfo(13).Bold())
        title.SetFont(font)

        nfsDirFont = wx.Font(wx.FontInfo(10))
        lblNfsDir = wx.StaticText(
            panel, -1, 'Localização da pasta com as Notas Fiscais:')
        lblNfsDir.SetFont(nfsDirFont)

        self.txtNfsDir = wx.StaticText(panel, -1, '')
        self.txtNfsDir.SetFont(nfsDirFont)
        self.txtNfsDir.SetForegroundColour(colors.GREY)

        self.nfsDir = wx.GenericDirCtrl(panel,
                                        -1,
                                        size=(-1, 380),
                                        style=wx.DIRCTRL_DIR_ONLY)

        self.btnCancel = widgets.SecondaryButton(panel, 'CANCELAR')
        self.btnConfirmNfsDir = widgets.PrimaryButton(panel, 'OK')

        btnSizer = wx.BoxSizer(wx.HORIZONTAL)
        btnSizer.Add(self.btnCancel, wx.SizerFlags(0).Border(wx.RIGHT, 10))
        btnSizer.Add(self.btnConfirmNfsDir)

        nfsPathSizer = wx.BoxSizer(wx.HORIZONTAL)
        nfsPathSizer.Add(lblNfsDir, wx.SizerFlags(0))
        nfsPathSizer.Add(self.txtNfsDir, wx.SizerFlags(0).Border(wx.LEFT, 5))

        nfsDirSizer = wx.BoxSizer(wx.HORIZONTAL)
        nfsDirSizer.Add(self.nfsDir,
                        wx.SizerFlags(1).Expand().Border(wx.TOP, 15))

        mainSizer.Add(title, wx.SizerFlags(0).Border(wx.TOP | wx.LEFT, 25))
        mainSizer.Add(nfsPathSizer,
                      wx.SizerFlags(0).Expand().Border(wx.TOP | wx.LEFT, 25))
        mainSizer.Add(nfsDirSizer,
                      wx.SizerFlags(0).Expand().Border(wx.LEFT | wx.RIGHT, 25))
        mainSizer.Add(btnSizer, wx.SizerFlags(0).Right().Border(wx.ALL, 25))

        panel.SetSizer(mainSizer)

        return panel
Exemplo n.º 26
0
    def __init__(self, *args, **kwds):
        wx.Dialog.__init__(self, *args, **kwds)
        #        self.tree_ctrl_1 = wx.TreeCtrl(self, wx.ID_ANY, style=wx.TR_HIDE_ROOT)
        #        self.tree_ctrl_1.AddRoot(os.path.dirname(os.path.abspath(__file__)))
        self.dir = wx.GenericDirCtrl(self,
                                     wx.ID_ANY,
                                     dir=os.path.dirname(
                                         os.path.abspath(__file__)),
                                     style=wx.DIRCTRL_DIR_ONLY)

        self.button_1 = wx.Button(self, wx.ID_ANY, _("Select Folder"))

        self.__set_properties()
        self.__do_layout()
        self.__bind_events()
Exemplo n.º 27
0
	def _layoutUI(self):
		sizer = wx.BoxSizer(wx.VERTICAL)
		
		sizer.Add(wx.StaticText(self, -1, "Brush Library:"), 0, wx.ALL|wx.EXPAND)
		
		self.dirCtrl = wx.GenericDirCtrl(self, -1, style=wx.DIRCTRL_DIR_ONLY)
		self.dirCtrl.GetTreeCtrl().Bind(wx.EVT_TREE_SEL_CHANGED, self.onBrushDirSelected)
		sizer.Add(self.dirCtrl, 1, wx.ALL|wx.EXPAND)
		
		whiteMask = wx.CheckBox(self, -1, "Use White as Alpha")
		whiteMask.SetValue(True)
		self.Bind(wx.EVT_CHECKBOX, self.onWhiteMaskChanged, whiteMask)
		sizer.Add(whiteMask, 0, wx.ALL|wx.EXPAND)
		
		sizer.Add(wx.StaticLine(self), 0, wx.ALL|wx.EXPAND, 5)
        
		self.SetSizer(sizer)
Exemplo n.º 28
0
    def init_dir_tree(self, parent):

        self.dir_tree = wx.Panel(parent)
        dir_tree_sizer = wx.BoxSizer(wx.VERTICAL)
        #txt1 = wx.StaticText(self, -1, "style=0")
        #dir_tree_sizer.Add((35, 35)) # some space above
        #dir_tree_sizer.Add(txt1)
        self.dir1 = wx.GenericDirCtrl(parent,
                                      -1,
                                      size=(200, 225),
                                      style=wx.DIRCTRL_DIR_ONLY)
        dir_tree_sizer.Add(self.dir1, 0, wx.EXPAND)
        self.SetSizer(dir_tree_sizer)
        self.SetAutoLayout(True)
        # events
        #self.dir_tree1 = self.dirBrowser.GetTreeCtrl()
        self.dir1.Bind(wx.EVT_TREE_SEL_CHANGED,
                       self.controller.on_property_change)
Exemplo n.º 29
0
    def __init__(self, parent, message=_("Choose one or more folders:"), title=_("Browse For Folders"),
                 defaultPath="", style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER, agwStyle=DD_MULTIPLE, pos=wx.DefaultPosition,
                 size=wx.DefaultSize, name="multidirdialog"):
        """
        Default class constructor.

        :param `parent`: the dialog parent widget;
        :param `message`: the message to show on the dialog;
        :param `title`: the dialog title;
        :param `defaultPath`: the default path, or the empty string;
        :param `style`: the underlying :class:`Dialog` window style;
        :param `agwStyle`: the AGW-specific dialog style; this can be a combination of the
         following bits:

         ===================== =========== ==================================================
         Window Styles         Hex Value   Description
         ===================== =========== ==================================================
         ``DD_NEW_DIR_BUTTON``       0x000 Enable/disable the "Make new folder" button
         ``DD_DIR_MUST_EXIST``       0x200 The dialog will allow the user to choose only an existing folder. When this style is not given, a "Create new directory" button is added to the dialog (on Windows) or some other way is provided to the user to type the name of a new folder.
         ``DD_MULTIPLE``             0x400 Allows the selection of multiple folders.
         ===================== =========== ==================================================

        :param `pos`: the dialog position;
        :param `size`: the dialog size;
        :param `name`: the dialog name.
        """

        wx.Dialog.__init__(self, parent, pos=pos, size=size, style=style, name=name)

        self.agwStyle = agwStyle
        
        self.dirCtrl = wx.GenericDirCtrl(self, size=(300, 300), style=wx.DIRCTRL_3D_INTERNAL|wx.DIRCTRL_DIR_ONLY)
        self.folderText = wx.TextCtrl(self, -1, defaultPath, style=wx.TE_PROCESS_ENTER)
        self.CreateButtons()
        
        self.SetProperties(title)           
        # Setup the layout and frame properties        
        self.SetupDirCtrl(defaultPath)
        self.LayoutItems(message)
        self.BindEvents()
    
        if parent and pos == wx.DefaultPosition:
            self.CenterOnParent()
Exemplo n.º 30
0
 def SetViewWindows(self):
     # Create windows for Main Panels
     self.vert = wx.SplitterWindow(self,
                                   -1,
                                   pos=(0, 0),
                                   size=(self.fSize[0] * 1000 / 1125,
                                         self.fSize[1] * 500 / 600),
                                   style=wx.SP_NO_XP_THEME)
     self.horz = wx.SplitterWindow(self.vert,
                                   -1,
                                   size=(self.fSize[0] * 1000 / 1125,
                                         self.fSize[1] * 500 / 600),
                                   style=wx.SP_NO_XP_THEME)
     self.Bind(wx.EVT_SPLITTER_SASH_POS_CHANGED, self.SashMoved, self.vert)
     self.Bind(wx.EVT_SPLITTER_SASH_POS_CHANGED, self.SashMoved, self.horz)
     self.dirCtrl = wx.GenericDirCtrl(self.vert,
                                      -1,
                                      style=wx.DIRCTRL_DIR_ONLY)
     self.dirCtrl.SetPath(self.hD + r"\Records\Amino Acids")