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


Python wx.ICON_ERROR屬性代碼示例

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


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

示例1: open

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ICON_ERROR [as 別名]
def open(self, filename):
        try:
            freq, gain, cal, dynP, monitors = load_recordings(filename)
        except ValueError:
            msg = '\'' + os.path.split(filename)[1] + '\' is corrupt.'
            wx.MessageBox(msg, 'Error',
                          wx.OK | wx.ICON_ERROR)
            return

        self._filename = filename
        self.__set_title()
        self._toolbar.set_freq(freq)
        self._toolbar.set_gain(gain)
        self._toolbar.set_cal(cal)
        self._toolbar.set_dynamic_percentile(dynP)
        self.__clear_monitors()
        self.__add_monitors(monitors)
        self.__enable_controls(True)
        self.__set_timeline()
        self.__set_spectrum()
        self._isSaved = True
        self._warnedPush = False 
開發者ID:EarToEarOak,項目名稱:RF-Monitor,代碼行數:24,代碼來源:gui.py

示例2: windowProc

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ICON_ERROR [as 別名]
def windowProc(self, hwnd, msg, wParam, lParam):
		if msg != WM_COPYDATA:
			return
		hwnd = wParam
		struct_pointer = lParam
		message_data = ctypes.cast(struct_pointer, PCOPYDATASTRUCT)
		url = ctypes.wstring_at(message_data.contents.lpData)
		log.info("Received url: %s" % url)
		try:
			con_info = connection_info.ConnectionInfo.from_url(url)
		except connection_info.URLParsingError:
			wx.CallLater(50, gui.messageBox, parent=gui.mainFrame, caption=_("Invalid URL"),
			# Translators: Message shown when an invalid URL has been provided.
			message=_("Unable to parse url \"%s\"")%url, style=wx.OK | wx.ICON_ERROR)
			log.exception("unable to parse nvdaremote:// url %s" % url)
			raise
		log.info("Connection info: %r" % con_info)
		if callable(self.callback):
			wx.CallLater(50, self.callback, con_info) 
開發者ID:NVDARemote,項目名稱:NVDARemote,代碼行數:21,代碼來源:url_handler.py

示例3: Save_Report_As

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ICON_ERROR [as 別名]
def Save_Report_As(self, e):
            openFileDialog = wx.FileDialog(self, 'Save Report As', self.save_into_directory, '',
                                           'XML files (*.xml)|*.xml|All files (*.*)|*.*',
                                           wx.FD_SAVE | wx.wx.FD_OVERWRITE_PROMPT)
            if openFileDialog.ShowModal() == wx.ID_CANCEL:
                return
            filename = openFileDialog.GetPath()
            if filename == self.report._template_filename:
                wx.MessageBox('For safety reasons, template overwriting with generated report is not allowed!', 'Error',
                              wx.OK | wx.ICON_ERROR)
                return
            self.status('Generating and saving the report...')
            self.report.scan = self.scan
            self._clean_template()
            #self.report.xml_apply_meta()
            self.report.xml_apply_meta(vulnparam_highlighting=self.menu_view_v.IsChecked(), truncation=self.menu_view_i.IsChecked(), pPr_annotation=self.menu_view_p.IsChecked())
            self.report.save_report_xml(filename)
            #self._clean_template()

            # merge kb before generate
            self.ctrl_tc_k.SetValue('')
            self.menu_tools_merge_kb_into_content.Enable(False)

            self.status('Report saved') 
開發者ID:hvqzao,項目名稱:report-ng,代碼行數:26,代碼來源:gui.py

示例4: OnSyncDone

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ICON_ERROR [as 別名]
def OnSyncDone(self, event):
        if not event.data:
            if self.sync_model.GetUseSystemNotifSetting():
                if wxgtk4:
                    nmsg = wx.adv.NotificationMessage(title="GoSync", message="Sync Completed!")
                    nmsg.SetFlags(wx.ICON_INFORMATION)
                    nmsg.Show(timeout=wx.adv.NotificationMessage.Timeout_Auto)
                else:
                    nmsg = wx.NotificationMessage("GoSync", "Sync Completed!")
                    nmsg.SetFlags(wx.ICON_INFORMATION)
                    nmsg.Show(timeout=wx.NotificationMessage.Timeout_Auto)
            self.sb.SetStatusText("Sync completed.")
        else:
            if self.sync_model.GetUseSystemNotifSetting():
                if wxgtk4:
                    nmsg = wx.adv.NotificationMessage(title="GoSync", message="Sync Completed with errors!\nPlease check ~/GoSync.log")
                    nmsg.SetFlags(wx.ICON_ERROR)
                    nmsg.Show(timeout=wx.adv.NotificationMessage.Timeout_Auto)
                else:
                    nmsg = wx.NotificationMessage("GoSync", "Sync Completed with errors!\nPlease check ~/GoSync.log")
                    nmsg.SetFlags(wx.ICON_ERROR)
                    nmsg.Show(timeout=wx.NotificationMessage.Timeout_Auto)
            self.sb.SetStatusText("Sync failed. Please check the logs.")
        self.sync_now_mitem.Enable(True)
        self.rcu.Enable(True) 
開發者ID:hschauhan,項目名稱:gosync,代碼行數:27,代碼來源:GoSyncController.py

示例5: new_external_profile

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ICON_ERROR [as 別名]
def new_external_profile(self, event):
        """Prompt for an external miner path, then create a miner.

        On Windows we validate against legal miners; on Linux they can pick
        whatever they want.
        """
        wildcard = _('External miner (*.exe)|*.exe|(*.py)|*.py') if sys.platform == 'win32' else '*.*'
        dialog = wx.FileDialog(self,
                               _("Select external miner:"),
                               defaultDir=os.path.join(get_module_path(), 'miners'),
                               defaultFile="",
                               wildcard=wildcard,
                               style=wx.OPEN)
        if dialog.ShowModal() != wx.ID_OK:
            return

        if sys.platform == 'win32' and dialog.GetFilename() not in SUPPORTED_BACKENDS:
            self.message(
                _("Unsupported external miner %(filename)s. Supported are: %(supported)s") % \
                  dict(filename=dialog.GetFilename(), supported='\n'.join(SUPPORTED_BACKENDS)),
                _("Miner not supported"), wx.OK | wx.ICON_ERROR)
            return
        path = os.path.join(dialog.GetDirectory(), dialog.GetFilename())
        dialog.Destroy()
        self.name_new_profile(extra_profile_data=dict(external_path="CGMINER")) 
開發者ID:theRealTacoTime,項目名稱:poclbm,代碼行數:27,代碼來源:guiminer.py

示例6: launch_solo_server

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ICON_ERROR [as 別名]
def launch_solo_server(self, event):
        """Launch the official bitcoin client in server mode.

        This allows poclbm to connect to it for mining solo.
        """
        if self.blockchain_directory and os.path.exists(self.blockchain_directory):
            datadir = " -datadir=%s" % self.blockchain_directory
        else:
            datadir = ""
        try:
            subprocess.Popen(self.bitcoin_executable + " -server" + datadir)
        except OSError:
            self.message(
                _("Couldn't find Bitcoin at %s. Is your path set correctly?") % self.bitcoin_executable,
                _("Launch failed"), wx.ICON_ERROR | wx.OK)
            return
        self.message(
            _("The Bitcoin client will now launch in server mode.\nOnce it connects to the network and downloads the block chain, you can start a miner in 'solo' mode."),
            _("Launched ok."),
            wx.OK) 
開發者ID:theRealTacoTime,項目名稱:poclbm,代碼行數:22,代碼來源:guiminer.py

示例7: SaveTheoryCurves

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ICON_ERROR [as 別名]
def SaveTheoryCurves(self,filename):
		""" 
		Method to actually do the saving of xy data to csv file. 
		Separate to the OnSaveCSVData method in case a filename is automatically chosen
		- i.e. when fitting data, there is an option to autosave the results which calls this method
		"""
		#print len(self.y_arrays)
		#print self.y_arrays		
					
		xy_data = list(zip(self.x_array,self.y_arrays[0].real,self.y_arrays[1].real,self.y_arrays[2].real,self.y_arrays[3].real,\
			self.y_arrays[4][0].real, self.y_arrays[4][1].real,\
			self.y_arrays[5][0].real, self.y_arrays[5][1].real, \
			self.y_arrays[6][0].real, self.y_arrays[6][1].real,\
			self.y_arrays[7][0].real, self.y_arrays[7][1].real, self.y_arrays[7][2].real))
		print('Here fine1')
		success = write_CSV(xy_data, filename, titles=['Detuning']+OutputTypes)
		if not success:
			problem_dlg = wx.MessageDialog(self, "There was an error saving the data...", "Error saving", wx.OK|wx.ICON_ERROR)
			problem_dlg.ShowModal()

############## 
開發者ID:jameskeaveney,項目名稱:ElecSus,代碼行數:23,代碼來源:elecsus_gui.py

示例8: _HelpUpdateMenu

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ICON_ERROR [as 別名]
def _HelpUpdateMenu(self, event):
        new_version = None
        from .utils import (update_check, get_update_message)
        try:
            new_version, info_url = update_check()
        except Exception as e:
            wx.MessageBox((f'Error occurred while checking for updates\n'
                           f'{e}'),
                          'Update Check',
                          wx.OK | wx.ICON_ERROR,
                          self.frame)
            return
        wx.MessageBox(get_update_message(new_version, info_url),
                      'Update Check', wx.OK, self.frame)

    # -----------------------------------------------------------------
    # Miscellaneous Event Handlers
    # ----------------------------------------------------------------- 
開發者ID:cmpilato,項目名稱:thotkeeper,代碼行數:20,代碼來源:app.py

示例9: _loadConfiguration

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ICON_ERROR [as 別名]
def _loadConfiguration(self, event):
        self.configFile = self.configPath.GetValue().strip()
        if self.configFile:
            self.settings['activities']['config'] = self.configFile
            self._enableGUI(True)
            with open(self.configFile, 'r') as f:
                try:
                    self.configuration = json.load(f)
                    self.tasks = self.configuration['tasks']
                    self.title.SetLabel(self.tasks[self.current]['title'])
                    self.instructions.SetLabel(self._getInstructions())
                except ValueError:
                    self.configuration = {}
                    self.settings['activities']['config'] = ''
                    self._enableGUI(False)
                    wx.MessageBox(parent=self, message='Parsing error while reading JSON file, please correct it and try again.',
                                  caption="Can't read JSON file", style=wx.OK | wx.ICON_ERROR)
            self._bindUserStop()
        else:
            self.settings['activities']['config'] = ''
            self._enableGUI(False)

        self.slidesStatus.Show(bool('slides' in self.configuration and self.configuration['slides']))
        self.Layout() 
開發者ID:tangible-landscape,項目名稱:grass-tangible-landscape,代碼行數:26,代碼來源:activities.py

示例10: on_close

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ICON_ERROR [as 別名]
def on_close(self, event):
        if not event.CanVeto():
            event.Skip
            return
        if self.ask_save():
            # close application
            # first, let's see if we have to save the geometry...
            prefs = config.preferences
            if prefs.remember_geometry:
                self._store_layout()
                prefs.set_dict("layout", self.layout_settings)
                prefs.changed = True
            common.root.clear()
            common.root.new()
            try:
                common.save_preferences()
            except Exception as e:
                wx.MessageBox( _('Error saving preferences:\n%s') % e,
                               _('Error'), wx.OK|wx.CENTRE|wx.ICON_ERROR )
            self.Destroy()
            common.remove_autosaved()
            wx.CallAfter(wx.GetApp().ExitMainLoop)
        elif event.CanVeto():
            event.Veto() 
開發者ID:wxGlade,項目名稱:wxGlade,代碼行數:26,代碼來源:main.py

示例11: ShowEnvironmentError

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ICON_ERROR [as 別名]
def ShowEnvironmentError(msg, inst):
    """Show EnvironmentError exceptions detailed and user-friendly

    msg:  Error message
    inst: The caught exception"""

    details = {'msg':msg, 'type':inst.__class__.__name__}

    if inst.filename:
        details['filename'] = _('Filename:   %s') % inst.filename

    if inst.errno is not None and inst.strerror is not None:
        details['error'] = '%s - %s' % (inst.errno, inst.strerror)
    else:
        details['error'] = str(inst.args)

    text = _("""%(msg)s

Error type: %(type)s
Error code: %(error)s
%(filename)s""") % details

    wx.MessageBox(text, _('Error'), wx.OK | wx.CENTRE | wx.ICON_ERROR) 
開發者ID:wxGlade,項目名稱:wxGlade,代碼行數:25,代碼來源:bugdialog.py

示例12: OnProcessVariablesGridCellChange

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ICON_ERROR [as 別名]
def OnProcessVariablesGridCellChange(self, event):
        row, col = event.GetRow(), event.GetCol()
        colname = self.ProcessVariablesTable.GetColLabelValue(col, False)
        value = self.ProcessVariablesTable.GetValue(row, col)
        message = None
        if colname == "Name":
            if not TestIdentifier(value):
                message = _("\"%s\" is not a valid identifier!") % value
            elif value.upper() in IEC_KEYWORDS:
                message = _("\"%s\" is a keyword. It can't be used!") % value
            elif value.upper() in [var["Name"].upper() for idx, var in enumerate(self.ProcessVariablesTable.GetData()) if idx != row]:
                message = _("An variable named \"%s\" already exists!") % value
        if message is None:
            self.SaveProcessVariables()
            wx.CallAfter(self.ProcessVariablesTable.ResetView, self.ProcessVariablesGrid)
            event.Skip()
        else:
            dialog = wx.MessageDialog(self, message, _("Error"), wx.OK | wx.ICON_ERROR)
            dialog.ShowModal()
            dialog.Destroy()
            event.Veto() 
開發者ID:thiagoralves,項目名稱:OpenPLC_Editor,代碼行數:23,代碼來源:ConfigEditor.py

示例13: OnOK

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ICON_ERROR [as 別名]
def OnOK(self, event):
        """
        Checks new entered value
        before closing dialog window
        """
        message = None
        ret = True
        value = self.GetEnteredValue()
        if value == "":
            message = _("You must type a value!")
        elif GetTypeValue[self.IEC_Type](value) is None:
            message = _("Invalid value \"{a1}\" for \"{a2}\" variable!").format(a1=value, a2=self.IEC_Type)
        if message is not None:
            dialog = wx.MessageDialog(self, message, _("Error"), wx.OK | wx.ICON_ERROR)
            dialog.ShowModal()
            dialog.Destroy()
            ret = False
        else:
            self.EndModal(wx.ID_OK)
        event.Skip(ret) 
開發者ID:thiagoralves,項目名稱:OpenPLC_Editor,代碼行數:22,代碼來源:ForceVariableDialog.py

示例14: OnOK

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ICON_ERROR [as 別名]
def OnOK(self, event):
        message = None
        step_name = self.GetSizer().GetItem(1).GetWindow().GetValue()
        if step_name == "":
            message = _("You must type a name!")
        elif not TestIdentifier(step_name):
            message = _("\"%s\" is not a valid identifier!") % step_name
        elif step_name.upper() in IEC_KEYWORDS:
            message = _("\"%s\" is a keyword. It can't be used!") % step_name
        elif step_name.upper() in self.PouNames:
            message = _("A POU named \"%s\" already exists!") % step_name
        if message is not None:
            dialog = wx.MessageDialog(self, message, _("Error"), wx.OK | wx.ICON_ERROR)
            dialog.ShowModal()
            dialog.Destroy()
        else:
            self.EndModal(wx.ID_OK)
        event.Skip() 
開發者ID:thiagoralves,項目名稱:OpenPLC_Editor,代碼行數:20,代碼來源:PouNameDialog.py

示例15: OnOK

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import ICON_ERROR [as 別名]
def OnOK(self, event):
        message = None
        step_name = self.GetSizer().GetItem(1).GetWindow().GetValue()
        if step_name == "":
            message = _("You must type a name!")
        elif not TestIdentifier(step_name):
            message = _("\"%s\" is not a valid identifier!") % step_name
        elif step_name.upper() in IEC_KEYWORDS:
            message = _("\"%s\" is a keyword. It can't be used!") % step_name
        elif step_name.upper() in self.PouNames:
            message = _("A POU named \"%s\" already exists!") % step_name
        elif step_name.upper() in self.Variables:
            message = _("A variable with \"%s\" as name already exists in this pou!") % step_name
        elif step_name.upper() in self.StepNames:
            message = _("\"%s\" step already exists!") % step_name
        if message is not None:
            dialog = wx.MessageDialog(self, message, _("Error"), wx.OK | wx.ICON_ERROR)
            dialog.ShowModal()
            dialog.Destroy()
        else:
            self.EndModal(wx.ID_OK)
        event.Skip() 
開發者ID:thiagoralves,項目名稱:OpenPLC_Editor,代碼行數:24,代碼來源:SFCStepNameDialog.py


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