本文整理汇总了Python中wx.ICON_QUESTION属性的典型用法代码示例。如果您正苦于以下问题:Python wx.ICON_QUESTION属性的具体用法?Python wx.ICON_QUESTION怎么用?Python wx.ICON_QUESTION使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.ICON_QUESTION属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_options_load_default
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ICON_QUESTION [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: onDeleteProfile
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ICON_QUESTION [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
示例3: OnClose
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ICON_QUESTION [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()
示例4: _wantToReuseAvailableCert
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ICON_QUESTION [as 别名]
def _wantToReuseAvailableCert( self, directReuseCert ):
certAnswer = wx.NO
if self.isCertificateGenerated(self.secureBootType):
if not directReuseCert:
msgText = ((uilang.kMsgLanguageContentDict['certGenInfo_reuseOldCert'][self.languageIndex]))
certAnswer = wx.MessageBox(msgText, "Certificate Question", wx.YES_NO | wx.CANCEL | wx.ICON_QUESTION)
if certAnswer == wx.CANCEL:
return None
elif certAnswer == wx.NO:
msgText = ((uilang.kMsgLanguageContentDict['certGenInfo_haveNewCert'][self.languageIndex]))
certAnswer = wx.MessageBox(msgText, "Certificate Question", wx.YES_NO | wx.CANCEL | wx.ICON_QUESTION)
if certAnswer == wx.CANCEL:
return None
elif certAnswer == wx.YES:
certAnswer = wx.NO
else:
certAnswer = wx.YES
else:
certAnswer = wx.YES
return (certAnswer == wx.YES)
示例5: _RefuseUnsavedModifications
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ICON_QUESTION [as 别名]
def _RefuseUnsavedModifications(self, refuse_modified_options=False):
"""If there exist unsaved entry modifications, inform the user
and return True. Otherwise, return False."""
if self.entry_modified:
wx.MessageBox(('Entry has been modified. You must either '
'save or revert it.'),
'Modified Entry',
wx.OK | wx.ICON_INFORMATION,
self.frame)
return True
elif refuse_modified_options and self.diary_modified:
if wx.OK == wx.MessageBox(('Diary has been modified. Click OK '
'to continue and lose the changes.'),
'Modified Diary',
wx.OK | wx.CANCEL | wx.ICON_QUESTION,
self.frame):
return False
return True
return False
示例6: _on_close
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ICON_QUESTION [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()
示例7: OnCloseMenu
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ICON_QUESTION [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
#-------------------------------------------------------------------------------
示例8: OnCloseProjectMenu
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ICON_QUESTION [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
#-------------------------------------------------------------------------------
示例9: OnDeleteButton
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ICON_QUESTION [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()
示例10: OnDeleteButton
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ICON_QUESTION [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()
示例11: CheckProjectPathPerm
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ICON_QUESTION [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
示例12: CheckSaveBeforeClosing
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ICON_QUESTION [as 别名]
def CheckSaveBeforeClosing(self, title=_("Close Project")):
"""Function displaying an question dialog if project is not saved"
:returns: False if closing cancelled.
"""
if not self.Controler.ProjectIsSaved():
dialog = wx.MessageDialog(self, _("There are changes, do you want to save?"), title, wx.YES_NO | wx.CANCEL | wx.ICON_QUESTION)
answer = dialog.ShowModal()
dialog.Destroy()
if answer == wx.ID_YES:
self.SaveProject()
elif answer == wx.ID_CANCEL:
return False
for idx in xrange(self.TabsOpened.GetPageCount()):
window = self.TabsOpened.GetPage(idx)
if not window.CheckSaveBeforeClosing():
return False
return True
# -------------------------------------------------------------------------------
# File Menu Functions
# -------------------------------------------------------------------------------
示例13: YesNo
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ICON_QUESTION [as 别名]
def YesNo(self, question, caption='Yes or no?'):
dlg = wx.MessageDialog(self.parent, question, caption,
wx.YES_NO | wx.ICON_QUESTION)
result = dlg.ShowModal() == wx.ID_YES
dlg.Destroy()
return result
示例14: onReset
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ICON_QUESTION [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()
示例15: _File_Close
# 需要导入模块: import wx [as 别名]
# 或者: from wx import ICON_QUESTION [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