本文整理汇总了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ファイルからインポート
#
示例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
示例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
示例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
示例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
示例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
示例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.
示例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()
示例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()
示例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
示例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()
示例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)
示例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
示例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)
示例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)