当前位置: 首页>>代码示例>>Python>>正文


Python wx.ID_YES属性代码示例

本文整理汇总了Python中wx.ID_YES属性的典型用法代码示例。如果您正苦于以下问题:Python wx.ID_YES属性的具体用法?Python wx.ID_YES怎么用?Python wx.ID_YES使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在wx的用法示例。


在下文中一共展示了wx.ID_YES属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: on_options_load_default

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ID_YES [as 别名]
def on_options_load_default(self, event):
        '''Resets the changes to the default, but not save them.'''
        r = wx.MessageDialog(
            None,
            _('IkaLog preferences will be reset to default. Continue?') + '\n' +
            _('The change will be updated when the apply button is pressed.'),
            _('Confirm'),
            wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION
        ).ShowModal()

        if r != wx.ID_YES:
            return

        self.engine.call_plugins('on_config_reset', debug=True)

    # 現在の設定値をYAMLファイルからインポート
    # 
开发者ID:hasegaw,项目名称:IkaLog,代码行数:19,代码来源:gui.py

示例2: onDeleteProfile

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ID_YES [as 别名]
def onDeleteProfile(self, event):
        """Deletes the currently selected profile after getting confirmation."""
        profname = self.tc_name.GetLineText(0)
        fname = os.path.join(PROFILES_PATH, profname + ".profile")
        file_exists = os.path.isfile(fname)
        if not file_exists:
            msg = "Selected profile is not saved."
            show_message_dialog(msg, "Error")
            return
        # Open confirmation dialog
        dlg = wx.MessageDialog(None,
                               "Do you want to delete profile: {}?".format(profname),
                               'Confirm Delete',
                               wx.YES_NO | wx.ICON_QUESTION)
        result = dlg.ShowModal()
        if result == wx.ID_YES and file_exists:
            os.remove(fname)
            self.update_choiceprofile()
            self.onCreateNewProfile(None)
        else:
            pass 
开发者ID:hhannine,项目名称:superpaper,代码行数:23,代码来源:gui.py

示例3: OnClose

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ID_YES [as 别名]
def OnClose(self, event):
    if self.is_running:
      confirm_exit = wx.MessageDialog(
        self,
        'Tem certeza que quer parar o programa?',
        'Sair',
        wx.YES_NO | wx.ICON_QUESTION
      )

      if confirm_exit.ShowModal() == wx.ID_YES:
        self.Destroy()
        wx.Window.Destroy(self)
      else:
        confirm_exit.Destroy()
    else:
      event.Skip() 
开发者ID:yanari,项目名称:filmow_to_letterboxd,代码行数:18,代码来源:filmow_to_letterboxd.py

示例4: _on_close

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ID_YES [as 别名]
def _on_close(self, event):
        """Event handler for the wx.EVT_CLOSE event.

        This method is used when the user tries to close the program
        to save the options and make sure that the download & update
        processes are not running.

        """
        if self.opt_manager.options["confirm_exit"]:
            dlg = wx.MessageDialog(self, _("Are you sure you want to exit?"), _("Exit"), wx.YES_NO | wx.ICON_QUESTION)

            result = dlg.ShowModal() == wx.ID_YES
            dlg.Destroy()
        else:
            result = True

        if result:
            self.close() 
开发者ID:MrS0m30n3,项目名称:youtube-dl-gui,代码行数:20,代码来源:mainframe.py

示例5: OnCloseMenu

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ID_YES [as 别名]
def OnCloseMenu(self, event):
        answer = wx.ID_YES
        result = self.Manager.CloseCurrent()
        if not result:
            dialog = wx.MessageDialog(self, _("There are changes, do you want to save?"),  _("Close File"), wx.YES_NO|wx.CANCEL|wx.ICON_QUESTION)
            answer = dialog.ShowModal()
            dialog.Destroy()
            if answer == wx.ID_YES:
                self.OnSaveMenu(event)
                if self.Manager.CurrentIsSaved():
                    self.Manager.CloseCurrent()
            elif answer == wx.ID_NO:
                self.Manager.CloseCurrent(True)
        if self.FileOpened.GetPageCount() > self.Manager.GetBufferNumber():
            current = self.FileOpened.GetSelection()
            self.FileOpened.DeletePage(current)
            if self.FileOpened.GetPageCount() > 0:
                self.FileOpened.SetSelection(min(current, self.FileOpened.GetPageCount() - 1))
            self.RefreshBufferState()
            self.RefreshMainMenu()
        

#-------------------------------------------------------------------------------
#                         Import and Export Functions
#------------------------------------------------------------------------------- 
开发者ID:jgeisler0303,项目名称:CANFestivino,代码行数:27,代码来源:objdictedit.py

示例6: OnCloseProjectMenu

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ID_YES [as 别名]
def OnCloseProjectMenu(self, event):
        if self.NodeList:
            if self.NodeList.HasChanged():
                dialog = wx.MessageDialog(self, _("There are changes, do you want to save?"), _("Close Project"), wx.YES_NO|wx.CANCEL|wx.ICON_QUESTION)
                answer = dialog.ShowModal()
                dialog.Destroy()
                if answer == wx.ID_YES:
                    result = self.NodeList.SaveProject()
                    if result:
                        message = wx.MessageDialog(self, result, _("Error"), wx.OK|wx.ICON_ERROR)
                        message.ShowModal()
                        message.Destroy()
                elif answer == wx.ID_NO:
                    self.NodeList.ForceChanged(False)
            if not self.NodeList.HasChanged():
                self.Manager = None
                self.NodeList = None
                self.RefreshNetworkNodes()
                self.RefreshTitle()
                self.RefreshMainMenu()
        
        
#-------------------------------------------------------------------------------
#                             Refresh Functions
#------------------------------------------------------------------------------- 
开发者ID:jgeisler0303,项目名称:CANFestivino,代码行数:27,代码来源:networkedit.py

示例7: OnImportEDSButton

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ID_YES [as 别名]
def OnImportEDSButton(self, event):
        dialog = wx.FileDialog(self,
                               _("Choose an EDS file"),
                               os.path.expanduser("~"),
                               "",
                               _("EDS files (*.eds)|*.eds|All files|*.*"),
                               wx.OPEN)
        if dialog.ShowModal() == wx.ID_OK:
            filepath = dialog.GetPath()
        else:
            filepath = ""
        dialog.Destroy()
        if os.path.isfile(filepath):
            result, question = self.NodeList.ImportEDSFile(filepath)
            if result is not None and question:
                dialog = wx.MessageDialog(self, _("%s\nWould you like to replace it ?")%result, _("Question"), wx.YES_NO|wx.ICON_QUESTION)
                if dialog.ShowModal() == wx.ID_YES:
                    result, question = self.NodeList.ImportEDSFile(filepath, True)
                dialog.Destroy()
            if result is not None and not question:
                dialog = wx.MessageDialog(self, result, _("Error"), wx.OK|wx.ICON_ERROR)
                dialog.ShowModal()
                dialog.Destroy()
        self.RefreshEDSFile()
        event.Skip() 
开发者ID:jgeisler0303,项目名称:CANFestivino,代码行数:27,代码来源:commondialogs.py

示例8: quitButton

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ID_YES [as 别名]
def quitButton(self, event):
        """
        Quits the GUI
        """
        self.statusbar.SetStatusText("")
        dlg = wx.MessageDialog(
            None, "Are you sure?", "Quit!", wx.YES_NO | wx.ICON_WARNING
        )
        result = dlg.ShowModal()
        if result == wx.ID_YES:
            print(
                "Closing... The refined labels are stored in a subdirectory under labeled-data. Use the function 'merge_datasets' to augment the training dataset, and then re-train a network using create_training_dataset followed by train_network!"
            )
            self.Destroy()
        else:
            self.save.Enable(True) 
开发者ID:DeepLabCut,项目名称:DeepLabCut,代码行数:18,代码来源:refinement.py

示例9: AskSave

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ID_YES [as 别名]
def AskSave(self):
        if not (self.modified or panel.IsModified()): return True
        flags = wx.ICON_EXCLAMATION | wx.YES_NO | wx.CANCEL | wx.CENTRE
        dlg = wx.MessageDialog( self, 'File is modified. Save before exit?',
                               'Save before too late?', flags )
        say = dlg.ShowModal()
        dlg.Destroy()
        wx.Yield()
        if say == wx.ID_YES:
            self.OnSaveOrSaveAs(wx.CommandEvent(wx.ID_SAVE))
            # If save was successful, modified flag is unset
            if not self.modified: return True
        elif say == wx.ID_NO:
            self.SetModified(False)
            panel.SetModified(False)
            return True
        return False 
开发者ID:andreas-p,项目名称:admin4,代码行数:19,代码来源:xrced.py

示例10: checkNode

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ID_YES [as 别名]
def checkNode():
        dlm = nbdler.Manager()
        if not os.path.exists('node.exe') or os.path.exists('node.exe.nbdler'):
            dlg = wx.MessageDialog(None, u'该程序需要Nodejs.exe才能完成工作,是否要下载?', u'提示', wx.YES_NO | wx.ICON_INFORMATION)
            if dlg.ShowModal() != wx.ID_YES:
                return False
            dl = nbdler.open(urls=[TOOL_REQ_URL['node']],
                             max_conn=16, filename='node.exe')
            dlm.addHandler(dl)
            dlg = gui.DialogGetTool(gui.frame_downloader, u'正在下载 Nodejs v10.15.3', dl.getFileSize(), dlm)

            dlg.Bind(wx.EVT_TIMER, GetTool._process, dlg.timer)
            dlg.timer.Start(50, oneShot=False)
            dlm.run()
            msg = dlg.ShowModal()
            dlm.shutdown()
            dlg.Destroy()
            if msg == wx.ID_OK:
                return True
            else:
                return False
        else:
            return True 
开发者ID:ZSAIm,项目名称:iqiyi-parser,代码行数:25,代码来源:flow.py

示例11: handle

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ID_YES [as 别名]
def handle():
        if cv.UNDONE_JOB:
            if 'url' not in cv.UNDONE_JOB or 'quality' not in cv.UNDONE_JOB or 'features' not in cv.UNDONE_JOB:
                ConfigSettings.fail()
                FrameParser.handle()
            else:
                msg = '[Url]: %s\n[Title]: %s\n[Quality]: %s\n上一次任务尚未完成,是否继续任务?' \
                      % (cv.UNDONE_JOB['url'], cv.UNDONE_JOB.get('title'), cv.UNDONE_JOB['quality'])
                dlg = wx.MessageDialog(None, msg, '提示', wx.YES_NO | wx.ICON_INFORMATION)
                if dlg.ShowModal() == wx.ID_YES:
                    UndoneJob.do()
                else:
                    UndoneJob.skip()
                dlg.Destroy()
        else:
            FrameParser.handle() 
开发者ID:ZSAIm,项目名称:iqiyi-parser,代码行数:18,代码来源:flow.py

示例12: CheckFileNeedsSave

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ID_YES [as 别名]
def CheckFileNeedsSave(self):
        """
        Checks if the file was changed and if necessary asks the user if he
        wants to save it. If the user affirms, calls Save/SaveAs also.

        returns: wx.ID_OK     if no save was needed
                 wx.ID_YES    if file was saved
                 wx.ID_NO     if file was not saved
                 wx.ID_CANCEL if user canceled possible save
        """
        if not self.isDirty:
            return wx.ID_OK
        dialog = SaveChangesDialog(self.frame)
        result = dialog.ShowModal()
        dialog.Destroy()
        if result == wx.ID_CANCEL:
            return wx.ID_CANCEL
        elif result == wx.ID_YES:
            return self.Save()
        else:
            return wx.ID_NO 
开发者ID:EventGhost,项目名称:EventGhost,代码行数:23,代码来源:Document.py

示例13: AskDelete

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ID_YES [as 别名]
def AskDelete(self):
        allItems = self.GetAllItems()
        if eg.config.confirmDelete:
            count = len(allItems) - 1
            if count > 0:
                mesg = eg.text.General.deleteManyQuestion % str(count)
            else:
                mesg = eg.text.General.deleteQuestion
            answer = eg.MessageBox(
                mesg,
                eg.APP_NAME,
                wx.NO_DEFAULT | wx.YES_NO | wx.ICON_EXCLAMATION
            )
            if answer == wx.ID_NO:
                return False
        dependants = self.GetDependantsOutside(allItems)
        if len(dependants) > 0:
            answer = eg.MessageBox(
                eg.text.General.deleteLinkedItems,
                eg.APP_NAME,
                wx.NO_DEFAULT | wx.YES_NO | wx.ICON_EXCLAMATION
            )
            return answer == wx.ID_YES
        return True 
开发者ID:EventGhost,项目名称:EventGhost,代码行数:26,代码来源:TreeItem.py

示例14: OnDeleteButton

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ID_YES [as 别名]
def OnDeleteButton(self, event):
        filepath = self.GetSelectedFilePath()
        if os.path.isfile(filepath):
            _folder, filename = os.path.split(filepath)

            dialog = wx.MessageDialog(self.ParentWindow,
                                      _("Do you really want to delete the file '%s'?") % filename,
                                      _("Delete File"),
                                      wx.YES_NO | wx.ICON_QUESTION)
            remove = dialog.ShowModal() == wx.ID_YES
            dialog.Destroy()

            if remove:
                os.remove(filepath)
                self.ModuleLibrary.LoadModules()
                wx.CallAfter(self.RefreshView)
        event.Skip() 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:19,代码来源:ConfigEditor.py

示例15: OnDeleteButton

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ID_YES [as 别名]
def OnDeleteButton(self, event):
        filepath = self.ManagedDir.GetPath()
        if os.path.isfile(filepath):
            _folder, filename = os.path.split(filepath)

            dialog = wx.MessageDialog(self,
                                      _("Do you really want to delete the file '%s'?") % filename,
                                      _("Delete File"),
                                      wx.YES_NO | wx.ICON_QUESTION)
            remove = dialog.ShowModal() == wx.ID_YES
            dialog.Destroy()

            if remove:
                os.remove(filepath)
                self.ManagedDir.RefreshTree()
        event.Skip() 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:18,代码来源:FileManagementPanel.py


注:本文中的wx.ID_YES属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。