Python wx 模块,DD_DEFAULT_STYLE 实例源码

我们从Python开源项目中,提取了以下15个代码示例,用于说明如何使用wx.DD_DEFAULT_STYLE

项目:cebl    作者:idfah    | 项目源码 | 文件源码
def mediaBrowse(self, event):
        dialog = wx.DirDialog(self, 'Choose media directory', '',
                    style=wx.DD_DEFAULT_STYLE)

        try:
            if dialog.ShowModal() == wx.ID_CANCEL:
                return
            path = dialog.GetPath()
        except Exception:
            wx.LogError('Failed to open directory!')
            raise
        finally:
            dialog.Destroy()

        if len(path) > 0:
            self.mediaPathTextCtrl.SetValue(path)
            self.pg.mplayer.setCWD(path)
项目:PancakeViewer    作者:forensicmatt    | 项目源码 | 文件源码
def button_browse_path_click(self, event):
        print "Event handler 'button_browse_path_click' not implemented!"
        dlg = wx.DirDialog(
            self,
            "Choose a directory:",
            style=wx.DD_DEFAULT_STYLE
        )

        if dlg.ShowModal() == wx.ID_OK:
            self.text_ctrl_outpath.Clear()
            self.text_ctrl_outpath.SetValue(dlg.GetPath())
            print('You selected: %s\n' % dlg.GetPath())

        dlg.Destroy()

        event.Skip()
# end of class ExtractionDialog
项目:Turrican2Editor    作者:GitExl    | 项目源码 | 文件源码
def open(self, event):
        dialog = wx.DirDialog(self, 'Select a Turrican II CDTV directory', '', wx.DD_DEFAULT_STYLE | wx.DD_DIR_MUST_EXIST)
        if dialog.ShowModal() != wx.ID_OK:
            return

        directory = dialog.GetPath()
        test_files = ['L1-1', 'L2-1', 'L3-1', 'L4-1', 'L5-1', 'LOADER', 'MAIN']
        for filename in test_files:
            if not os.path.exists(os.path.join(directory, filename)):
                wx.MessageBox('Not a valid Turrican II CDTV directory.', 'Invalid directory', wx.OK | wx.ICON_EXCLAMATION)
                return

        self._game_dir = directory
        self._graphics = Graphics(self._game_dir)
        self.load_worlds()

        self.Entities.set_graphics(self._graphics)
        self.Entities.set_font(self._font)

        self.LevelSelect.SetSelection(0)
        self.select_level(0, 0)
        self.update_menu_state()
        self.update_title()
项目:gopro-organizer    作者:angusmacdonald    | 项目源码 | 文件源码
def chooseDirectory(self, text):
        response = ""

        dialog = wx.DirDialog(None, text,style=wx.DD_DEFAULT_STYLE | wx.DD_NEW_DIR_BUTTON)
        if dialog.ShowModal() == wx.ID_OK:
            response = dialog.GetPath()
        dialog.Destroy()

        return response
项目:CAAPR    作者:Stargrazer82301    | 项目源码 | 文件源码
def on_browser_button(self, evt):
        cur_entry = self.current_textctrl_GetValue()
        if len(cur_entry) == 0:
            cur_entry = self.default_entry
        cur_entry = os.path.abspath(os.path.expanduser(cur_entry))
        cur_entry_parts = [a for a in ['/'] + cur_entry.split('/') if len(a) > 0]
        while (len(cur_entry_parts) >= 1 and
               not (os.path.isdir(os.path.join(*cur_entry_parts)) or
                    os.path.isfile(os.path.join(*cur_entry_parts)))):
            cur_entry_parts = cur_entry_parts[:-1]
        if len(cur_entry_parts) > 1:
            cur_entry = os.path.join(*cur_entry_parts)
        else:
            cur_entry = os.path.expanduser('~')
        if os.path.isdir(cur_entry):
            cur_basename = ''
            cur_dirname = cur_entry
        else:
            cur_basename = os.path.basename(cur_entry)
            cur_dirname = os.path.dirname(cur_entry)
        if self.is_files_not_dirs:
            dlg = wx.FileDialog(self, "Choose a file:", style=wx.DD_DEFAULT_STYLE,
                                defaultDir=cur_dirname, defaultFile=cur_basename, wildcard=self.allowed_extensions)
            # TODO: defaultFile is not being set to cur_basename in the dialog box
        else:
            dlg = wx.DirDialog(self, "Choose a directory:", style=wx.DD_DEFAULT_STYLE, defaultPath=cur_dirname)
        if dlg.ShowModal() == wx.ID_OK:
            self._on_load(dlg.GetPath())
        dlg.Destroy()
项目:CAAPR    作者:Stargrazer82301    | 项目源码 | 文件源码
def on_browser_button(self, evt):
        cur_entry = self.current_textctrl_GetValue()
        if len(cur_entry) == 0:
            cur_entry = self.default_entry
        cur_entry = os.path.abspath(os.path.expanduser(cur_entry))
        cur_entry_parts = [a for a in ['/'] + cur_entry.split('/') if len(a) > 0]
        while (len(cur_entry_parts) >= 1 and
               not (os.path.isdir(os.path.join(*cur_entry_parts)) or
                    os.path.isfile(os.path.join(*cur_entry_parts)))):
            cur_entry_parts = cur_entry_parts[:-1]
        if len(cur_entry_parts) > 1:
            cur_entry = os.path.join(*cur_entry_parts)
        else:
            cur_entry = os.path.expanduser('~')
        if os.path.isdir(cur_entry):
            cur_basename = ''
            cur_dirname = cur_entry
        else:
            cur_basename = os.path.basename(cur_entry)
            cur_dirname = os.path.dirname(cur_entry)
        if self.is_files_not_dirs:
            dlg = wx.FileDialog(self, "Choose a file:", style=wx.DD_DEFAULT_STYLE,
                                defaultDir=cur_dirname, defaultFile=cur_basename, wildcard=self.allowed_extensions)
            # TODO: defaultFile is not being set to cur_basename in the dialog box
        else:
            dlg = wx.DirDialog(self, "Choose a directory:", style=wx.DD_DEFAULT_STYLE, defaultPath=cur_dirname)
        if dlg.ShowModal() == wx.ID_OK:
            self._on_load(dlg.GetPath())
        dlg.Destroy()
项目:bonsu    作者:bonsudev    | 项目源码 | 文件源码
def OnCWD(self,e):
        panelphase = self.GetChildren()[1].GetPage(0)
        if panelphase.pipeline_started == False:
            cwd = self.CurrentWD()
            dlg = wx.DirDialog(self, 'Set Working Directory', cwd, style=wx.DD_DEFAULT_STYLE, name="Change Current Working Directory")
            if dlg.ShowModal() == wx.ID_OK:
                os.chdir(dlg.GetPath())
            dlg.Destroy()
项目:Portfolio    作者:rebeccapizano    | 项目源码 | 文件源码
def onDir1(self, event):
        """
        Show the DirDialog and print the user's choice to stdout
        """
        dlg = wx.DirDialog(self, "Choose a directory:",
                           style=wx.DD_DEFAULT_STYLE
                           #| wx.DD_DIR_MUST_EXIST
                           #| wx.DD_CHANGE_DIR
                           )
        if dlg.ShowModal() == wx.ID_OK:
            global src
            src=dlg.GetPath()
            print('Source folder:', src)
        dlg.Destroy()
项目:Portfolio    作者:rebeccapizano    | 项目源码 | 文件源码
def onDir2(self, event):
        """
        Show the DirDialog and print the user's choice to stdout
        """
        dlg2 = wx.DirDialog(self, "Choose a directory:",
                           style=wx.DD_DEFAULT_STYLE
                           #| wx.DD_DIR_MUST_EXIST
                           #| wx.DD_CHANGE_DIR
                           )
        if dlg2.ShowModal() == wx.ID_OK:
            global dst
            dst=dlg2.GetPath()
            print('Destination folder:', dst)
        dlg2.Destroy()
项目:Portfolio    作者:rebeccapizano    | 项目源码 | 文件源码
def onDir1(self, event):
        """
        Show the DirDialog and print the user's choice to stdout
        """
        dlg = wx.DirDialog(self, "Choose a directory:",
                           style=wx.DD_DEFAULT_STYLE
                           #| wx.DD_DIR_MUST_EXIST
                           #| wx.DD_CHANGE_DIR
                           )
        if dlg.ShowModal() == wx.ID_OK:
            global src
            src=dlg.GetPath()
            print 'Source folder:', src    
        dlg.Destroy()
项目:Portfolio    作者:rebeccapizano    | 项目源码 | 文件源码
def onDir2(self, event):
        """
        Show the DirDialog and print the user's choice to stdout
        """
        dlg2 = wx.DirDialog(self, "Choose a directory:",
                           style=wx.DD_DEFAULT_STYLE
                           #| wx.DD_DIR_MUST_EXIST
                           #| wx.DD_CHANGE_DIR
                           )
        if dlg2.ShowModal() == wx.ID_OK:
            global dst
            dst=dlg2.GetPath()
            print 'Destination folder:', dst
        dlg2.Destroy()
项目:Portfolio    作者:rebeccapizano    | 项目源码 | 文件源码
def onDir1(self, event):
        """
        Show the DirDialog and print the user's choice to stdout
        """
        dlg = wx.DirDialog(self, "Choose a directory:",
                           style=wx.DD_DEFAULT_STYLE
                           #| wx.DD_DIR_MUST_EXIST
                           #| wx.DD_CHANGE_DIR
                           )
        if dlg.ShowModal() == wx.ID_OK:
            global src
            src=dlg.GetPath()
            print 'Source folder:', src    
        dlg.Destroy()
项目:smartschool    作者:asifkodur    | 项目源码 | 文件源码
def on_promotion(self, event):  # wxGlade: admin_dash.<event_handler>
        dir = "/home"
        dlg=promo_window(self,-1,'')
        dlg.ShowModal()
        divs= dlg.get_div()
        dlg.Destroy()

        self.label_promo.SetForegroundColour(self.label_fg_color)
        if divs!=[]:
            dir_dlg=wx.DirDialog(self, message='Choose Folder...', defaultPath=dir, style=wx.DD_DEFAULT_STYLE)#wx.OVERWRITE_PROMPT
            if dir_dlg.ShowModal() == wx.ID_OK:

                path = dir_dlg.GetPath()

                for each in divs:


                    year=each[0]
                    class_=each[1]
                    div=each[2]
                    deo=self.DB.Get_School_DEO()
                    school=self.DB.Get_School_Name()
                    w_d=self.DB.Get_Working_Days(year,'3')
                    each_path=path+"/"+class_+div+".pdf"
                    self.P=Promotion_List(year,school,class_,div,deo,w_d,path=each_path)
                    self.P.run(open=False)
                    #self.P=None

                os.system("nautilus "+path)
        event.Skip()
项目:Janet    作者:nosmokingbandit    | 项目源码 | 文件源码
def set_library_dir(self):
        dialog = wx.DirDialog(None, "Choose library directory", desktop, wx.DD_DEFAULT_STYLE | wx.DD_DIR_MUST_EXIST)

        dialog.ShowModal()
        library_directory = dialog.GetPath()

        if library_directory:
            core.CONFIG['library_directory'] = library_directory
            self.browser.ExecuteJavascript('$("input#library_directory").val({})'.format(json.dumps(library_directory)))

        dialog.Destroy()
项目:wxpythoncookbookcode    作者:driscollis    | 项目源码 | 文件源码
def onOpenDirectory(self, event):
        """
        Opens a DirDialog to allow the user to open a folder with pictures
        """
        dlg = wx.DirDialog(self, "Choose a directory",
                           style=wx.DD_DEFAULT_STYLE)

        if dlg.ShowModal() == wx.ID_OK:
            self.folderPath = dlg.GetPath()
            print self.folderPath
            picPaths = glob.glob(self.folderPath + "\\*.jpg")
            print picPaths
        Publisher().sendMessage("update images", picPaths)