當前位置: 首頁>>代碼示例>>Python>>正文


Python wx.NO_DEFAULT屬性代碼示例

本文整理匯總了Python中wx.NO_DEFAULT屬性的典型用法代碼示例。如果您正苦於以下問題:Python wx.NO_DEFAULT屬性的具體用法?Python wx.NO_DEFAULT怎麽用?Python wx.NO_DEFAULT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在wx的用法示例。


在下文中一共展示了wx.NO_DEFAULT屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: on_options_load_default

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import NO_DEFAULT [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: getExportable

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import NO_DEFAULT [as 別名]
def getExportable(self, action):
        if cfgGl.checkOnExport:
            line = self.sp.findError(0)[0]

            if line != -1:
                if wx.MessageBox(
                    "The script seems to contain errors.\n"
                    "Are you sure you want to %s it?" % action, "Confirm",
                     wx.YES_NO | wx.NO_DEFAULT, mainFrame) == wx.NO:

                    return None

        sp = self.sp
        if sp.cfg.pdfRemoveNotes:
            sp = copy.deepcopy(self.sp)
            sp.removeElementTypes({screenplay.NOTE : None}, False)

        sp.paginate()

        return sp 
開發者ID:trelby,項目名稱:trelby,代碼行數:22,代碼來源:trelby.py

示例3: verify_connect

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import NO_DEFAULT [as 別名]
def verify_connect(self, con_info):
		if self.is_connected() or self.connecting:
			gui.messageBox(_("NVDA Remote is already connected. Disconnect before opening a new connection."), _("NVDA Remote Already Connected"), wx.OK|wx.ICON_WARNING)
			return
		self.connecting = True
		server_addr = con_info.get_address()
		key = con_info.key
		if con_info.mode == 'master':
			message = _("Do you wish to control the machine on server {server} with key {key}?").format(server=server_addr, key=key)
		elif con_info.mode == 'slave':
			message = _("Do you wish to allow this machine to be controlled on server {server} with key {key}?").format(server=server_addr, key=key)
		if gui.messageBox(message, _("NVDA Remote Connection Request"), wx.YES|wx.NO|wx.NO_DEFAULT|wx.ICON_WARNING) != wx.YES:
			self.connecting = False
			return
		if con_info.mode == 'master':
			self.connect_as_master((con_info.hostname, con_info.port), key=key)
		elif con_info.mode == 'slave':
			self.connect_as_slave((con_info.hostname, con_info.port), key=key)
		self.connecting = False 
開發者ID:NVDARemote,項目名稱:NVDARemote,代碼行數:21,代碼來源:__init__.py

示例4: AskDelete

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import NO_DEFAULT [as 別名]
def AskDelete(self):
        actionItemCls = self.document.ActionItem

        def SearchFunc(obj):
            if obj.__class__ == actionItemCls:
                if obj.executable and obj.executable.plugin == self.executable:
                    return True
            return None

        if self.root.Traverse(SearchFunc) is not None:
            eg.MessageBox(
                eg.text.General.deletePlugin,
                eg.APP_NAME,
                wx.NO_DEFAULT | wx.OK | wx.ICON_EXCLAMATION
            )
            return False
        if not TreeItem.AskDelete(self):
            return False
        return True 
開發者ID:EventGhost,項目名稱:EventGhost,代碼行數:21,代碼來源:PluginItem.py

示例5: AskDelete

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import NO_DEFAULT [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

示例6: CheckProjectPathPerm

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import NO_DEFAULT [as 別名]
def CheckProjectPathPerm(self, dosave=True):
        if CheckPathPerm(self.ProjectPath):
            return True
        if self.AppFrame is not None:
            dialog = wx.MessageDialog(
                self.AppFrame,
                _('You must have permission to work on the project\nWork on a project copy ?'),
                _('Error'),
                wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION)
            answer = dialog.ShowModal()
            dialog.Destroy()
            if answer == wx.ID_YES:
                if self.SaveProjectAs():
                    self.AppFrame.RefreshTitle()
                    self.AppFrame.RefreshFileMenu()
                    self.AppFrame.RefreshPageTitles()
                    return True
        return False 
開發者ID:thiagoralves,項目名稱:OpenPLC_Editor,代碼行數:20,代碼來源:ProjectController.py

示例7: canBeClosed

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import NO_DEFAULT [as 別名]
def canBeClosed(self):
        if self.sp.isModified():
            if wx.MessageBox("The script has been modified. Are you sure\n"
                             "you want to discard the changes?", "Confirm",
                             wx.YES_NO | wx.NO_DEFAULT, mainFrame) == wx.NO:
                return False

        return True

    # page up (dir == -1) or page down (dir == 1) was pressed, handle it.
    # cs = CommandState. 
開發者ID:trelby,項目名稱:trelby,代碼行數:13,代碼來源:trelby.py

示例8: OnCloseWindow

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import NO_DEFAULT [as 別名]
def OnCloseWindow(self, event):
        doExit = True
        if event.CanVeto() and self.isModifications():
            if wx.MessageBox("You have unsaved changes. Are\n"
                             "you sure you want to exit?", "Confirm",
                             wx.YES_NO | wx.NO_DEFAULT, self) == wx.NO:
                doExit = False

        if doExit:
            util.writeToFile(gd.stateFilename, gd.save(), self)
            util.removeTempFiles(misc.tmpPrefix)
            self.Destroy()
            myApp.ExitMainLoop()
        else:
            event.Veto() 
開發者ID:trelby,項目名稱:trelby,代碼行數:17,代碼來源:trelby.py

示例9: onReset

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import NO_DEFAULT [as 別名]
def onReset(self, e):
		dlg = wx.MessageDialog(None, _('If your sensors are not detected right, try resetting system or forcing name and address.\n\nDo you want to try auto detection again?'),_('Question'), wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION)
		if dlg.ShowModal() == wx.ID_YES:
			try:
				os.remove(self.home + '/.pypilot/RTIMULib2.ini')
			except: pass
			self.detection()
		dlg.Destroy() 
開發者ID:sailoog,項目名稱:openplotter,代碼行數:10,代碼來源:add_i2c.py

示例10: _File_Close

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import NO_DEFAULT [as 別名]
def _File_Close(self):
        #if self.filename != None and self.file_changed:
        if self.file_changed:
            dlg = wx.MessageDialog(self, 'You have unsaved changes. Do you want to close the file anyway?', 'Question', wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION)
            if not dlg.ShowModal() == wx.ID_YES:
                return False
        while self.n:
            self.DeleteNode(self.n[0])
        self.menu_file_save_as.Enable(False)
        self.menu_file_close.Enable(False)
        self.filename = None
        self.file_changed = None
        self._title_update()
        return True 
開發者ID:hvqzao,項目名稱:report-ng,代碼行數:16,代碼來源:yamled.py

示例11: __OnClose

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import NO_DEFAULT [as 別名]
def __OnClose(self, event):
        #if self.filename != None and self.file_changed:
        if self.file_changed:
            dlg = wx.MessageDialog(self, 'You have unsaved changes. Do you really want to quit?', 'Question', wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION)
            if dlg.ShowModal() == wx.ID_YES:
                self.Destroy()
            else:
                event.Veto()
        else:
            self.Destroy() 
開發者ID:hvqzao,項目名稱:report-ng,代碼行數:12,代碼來源:yamled.py

示例12: OnExit

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import NO_DEFAULT [as 別名]
def OnExit(self, event):
        dial = wx.MessageDialog(None, 'GoSync will stop syncing files until restarted.\nAre you sure to quit?\n',
                                'Question', wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION)
        res = dial.ShowModal()
        if res == wx.ID_YES:
            if self.sync_model.IsSyncEnabled() or self.sync_model.IsSyncRunning():
                self.sync_model.StopTheShow()
                self.sb.SetStatusText("Paused", 1)

            wx.CallAfter(self.Destroy) 
開發者ID:hschauhan,項目名稱:gosync,代碼行數:12,代碼來源:GoSyncController.py

示例13: on_page_closing

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import NO_DEFAULT [as 別名]
def on_page_closing(self, event):
        """Handle a tab closing event.

        If they are closing a special panel, we have to shut it down.
        If the tab has a miner running in it, we have to stop the miner
        before letting the tab be removed.
        """
        p = self.nb.GetPage(event.GetSelection())

        if p == self.console_panel:
            self.console_panel.on_close()
            self.console_panel = None
            event.Skip()
            return
        if p == self.summary_panel:
            self.summary_panel.on_close()
            self.summary_panel = None
            event.Skip()
            return

        if p.is_mining:
            result = self.message(
                _("Closing this miner will stop it. Continue?"),
                _("Close miner"),
                wx.YES_NO | wx.NO_DEFAULT | wx.ICON_INFORMATION)
            if result == wx.ID_NO:
                event.Veto()
                return
        p.on_close()
        event.Skip() # OK to close the tab now 
開發者ID:theRealTacoTime,項目名稱:poclbm,代碼行數:32,代碼來源:guiminer.py

示例14: create_solo_password

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import NO_DEFAULT [as 別名]
def create_solo_password(self, event):
        """Prompt the user for login credentials to the bitcoin client.

        These are required to connect to the client over JSON-RPC and are
        stored in 'bitcoin.conf'.
        """
        if sys.platform == 'win32':
            filename = os.path.join(os.getenv("APPDATA"), "Bitcoin", "bitcoin.conf")
        else: # Assume Linux for now TODO test
            filename = os.path.join(os.getenv('HOME'), ".bitcoin")
        if os.path.exists(filename):
            result = self.message(
                _("%s already exists. Overwrite?") % filename,
                _("bitcoin.conf already exists."),
                wx.YES_NO | wx.NO_DEFAULT | wx.ICON_INFORMATION)
            if result == wx.ID_NO:
                return

        dialog = SoloPasswordRequest(self, _('Enter password'))
        result = dialog.ShowModal()
        dialog.Destroy()
        if result == wx.ID_CANCEL:
            return

        with open(filename, "w") as f:
            f.write('\nrpcuser=%s\nrpcpassword=%s\nrpcallowip=*' % dialog.get_value())
            f.close()

        self.message(_("Wrote bitcoin config ok."), _("Success"), wx.OK) 
開發者ID:theRealTacoTime,項目名稱:poclbm,代碼行數:31,代碼來源:guiminer.py

示例15: OnDeleteButton

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import NO_DEFAULT [as 別名]
def OnDeleteButton(self, evt):
        items = self.dvc.GetSelections()
        rows = [self.model.GetRow(item) for item in items]

        # Ask if user really wants to delete
        if wx.MessageBox(_('Are you sure to delete selected IDs?'),
                         _('Delete IDs'),
                         wx.YES_NO | wx.CENTRE | wx.NO_DEFAULT) != wx.YES:
            return

        self.model.DeleteRows(rows) 
開發者ID:thiagoralves,項目名稱:OpenPLC_Editor,代碼行數:13,代碼來源:IDBrowser.py


注:本文中的wx.NO_DEFAULT屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。