Python wx.MessageBox() Examples
The following are 30
code examples of wx.MessageBox().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
wx
, or try the search function
.
Example #1
Source File: gui.py From RF-Monitor with GNU General Public License v2.0 | 6 votes |
def __on_rec(self, recording): timestamp = time.time() for monitor in self._monitors: if not recording: monitor.set_level(None, timestamp, None) monitor.set_recording(recording, timestamp) if recording: self.__on_start() else: while self._push.hasFailed(): resp = wx.MessageBox('Web push has failed, retry?', 'Warning', wx.OK | wx.CANCEL | wx.ICON_WARNING) if resp == wx.OK: busy = wx.BusyInfo('Pushing...', self) self._push.send_failed(self._settings.get_push_uri()) del busy else: self._push.clear_failed() self._warnedPush = False self.__set_timeline()
Example #2
Source File: RTyyyy_main.py From NXP-MCUBootUtility with Apache License 2.0 | 6 votes |
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)
Example #3
Source File: cfgdlg.py From trelby with GNU General Public License v2.0 | 6 votes |
def OnAdd(self, event): dlg = misc.KeyDlg(cfgFrame, self.cmd.name) key = None if dlg.ShowModal() == wx.ID_OK: key = dlg.key dlg.Destroy() if key: kint = key.toInt() if kint in self.cmd.keys: wx.MessageBox("The key is already bound to this command.", "Error", wx.OK, cfgFrame) return if key.isValidInputChar(): wx.MessageBox("You can't bind input characters to commands.", "Error", wx.OK, cfgFrame) return self.cmd.keys.append(kint) self.cfg2gui()
Example #4
Source File: trelby.py From trelby with GNU General Public License v2.0 | 6 votes |
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
Example #5
Source File: trelby.py From trelby with GNU General Public License v2.0 | 6 votes |
def OnFindNextError(self): self.clearAutoComp() line, msg = self.sp.findError(self.sp.line) if line != -1: self.sp.line = line self.sp.column = 0 self.makeLineVisible(self.sp.line) self.updateScreen() else: msg = "No errors found." wx.MessageBox(msg, "Results", wx.OK, mainFrame)
Example #6
Source File: trelby.py From trelby with GNU General Public License v2.0 | 6 votes |
def updateKbdCommands(self): cfgGl.addShiftKeys() if cfgGl.getConflictingKeys() != None: wx.MessageBox("You have at least one key bound to more than one\n" "command. The program will not work correctly until\n" "you fix this.", "Warning", wx.OK, self) self.kbdCommands = {} for cmd in cfgGl.commands: if not (cmd.isFixed and cmd.isMenu): for key in cmd.keys: self.kbdCommands[key] = cmd # open script, in the current tab if it's untouched, or in a new one # otherwise
Example #7
Source File: misc.py From trelby with GNU General Public License v2.0 | 6 votes |
def getPathFromRegistry(): registryPath = r"Software\Microsoft\Windows\CurrentVersion\App Paths\trelby.exe" try: import _winreg regPathKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, registryPath) regPathValue, regPathType = _winreg.QueryValueEx(regPathKey, "Path") if regPathType == _winreg.REG_SZ: return regPathValue else: raise TypeError except: wx.MessageBox("There was an error reading the following registry key: %s.\n" "You may need to reinstall the program to fix this error." % registryPath, "Error", wx.OK) sys.exit() # convert s, which is returned from the wxWidgets GUI and is an Unicode # string, to a normal string.
Example #8
Source File: trelby.py From trelby with GNU General Public License v2.0 | 6 votes |
def checkFonts(self): names = ["Normal", "Bold", "Italic", "Bold-Italic"] failed = [] for i, fi in enumerate(cfgGui.fonts): if not util.isFixedWidth(fi.font): failed.append(names[i]) if failed: wx.MessageBox( "The fonts listed below are not fixed width and\n" "will cause the program not to function correctly.\n" "Please change the fonts at File/Settings/Change.\n\n" + "\n".join(failed), "Error", wx.OK, self) # If we get focus, pass it on to ctrl.
Example #9
Source File: gutil.py From trelby with GNU General Public License v2.0 | 6 votes |
def showTempPDF(pdfData, cfgGl, mainFrame): try: try: util.removeTempFiles(misc.tmpPrefix) fd, filename = tempfile.mkstemp(prefix = misc.tmpPrefix, suffix = ".pdf") try: os.write(fd, pdfData) finally: os.close(fd) util.showPDF(filename, cfgGl, mainFrame) except IOError, (errno, strerror): raise MiscError("IOError: %s" % strerror) except TrelbyError, e: wx.MessageBox("Error writing temporary PDF file: %s" % e, "Error", wx.OK, mainFrame)
Example #10
Source File: gui.py From report-ng with GNU General Public License v2.0 | 6 votes |
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')
Example #11
Source File: gui.py From RF-Monitor with GNU General Public License v2.0 | 6 votes |
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
Example #12
Source File: util.py From trelby with GNU General Public License v2.0 | 6 votes |
def writeToFile(filename, data, frame): try: f = open(misc.toPath(filename), "wb") try: f.write(data) finally: f.close() return True except IOError, (errno, strerror): wx.MessageBox("Error writing file '%s': %s" % ( filename, strerror), "Error", wx.OK, frame) return False
Example #13
Source File: pyResManController.py From pyResMan with GNU General Public License v2.0 | 5 votes |
def deleteKey(self, keysInfo): if wx.CANCEL == wx.MessageBox('Are you sure to do this operation?', caption='Delete key', style=wx.ICON_WARNING|wx.OK|wx.CANCEL|wx.CANCEL_DEFAULT): return self.__deleteKeyThread = threading.Thread(target=self.__deleteKey, args=(keysInfo, ), name="Delete key thread") self.__deleteKeyThread.start()
Example #14
Source File: ui_cfg_flexspinand.py From NXP-MCUBootUtility with Apache License 2.0 | 5 votes |
def OnClose_FLEXSPI_NAND(self, event): ret = wx.MessageBox('Do you really want to leave?', 'Confirm', wx.OK | wx.CANCEL) if ret == wx.OK: self.Show(False)
Example #15
Source File: ui_settings_flexible_user_keys_bee.py From NXP-MCUBootUtility with Apache License 2.0 | 5 votes |
def popupMsgBox( self, msgStr ): messageText = (msgStr) wx.MessageBox(messageText, "Error", wx.OK | wx.ICON_INFORMATION)
Example #16
Source File: ui_cfg_flexspinand.py From NXP-MCUBootUtility with Apache License 2.0 | 5 votes |
def _getBlockCountandID( self ): val_block_count = int(self.m_textCtrl_block_count.GetLineText(0)) val_block_id = int(self.m_textCtrl_block_id.GetLineText(0)) if val_block_id > val_block_count: wx.MessageBox('Block ID Error', 'Confirm', wx.OK) if val_block_count > 8: wx.MessageBox('Max Block Number Error', 'Confirm', wx.OK) self.flexspiNandImageInfo = (self.flexspiNandImageInfo & 0xFFFF0000) | (val_block_id << 0) self.flexspiNandImageInfo = (self.flexspiNandImageInfo & 0x0000FFFF) | (val_block_count << 16) ################################# may be exist problem Need to be confirmed#################################
Example #17
Source File: uicore.py From NXP-MCUBootUtility with Apache License 2.0 | 5 votes |
def saveLog( self ): self.m_textCtrl_log.SaveFile(self.logFilename) msgText = (('Log is saved in file: ' + self.logFilename + ' \n').encode('utf-8')) wx.MessageBox(msgText, "Log Info", wx.OK | wx.ICON_INFORMATION)
Example #18
Source File: add_action.py From openplotter with GNU General Public License v2.0 | 5 votes |
def ShowMessage(self, w_msg): wx.MessageBox(w_msg, 'Info', wx.OK | wx.ICON_INFORMATION)
Example #19
Source File: GoSyncSettingPage.py From gosync with GNU General Public License v2.0 | 5 votes |
def OnChangeMirror(self, event): new_dir_help = "Your new local mirror directory is set. This will take effect after GoSync restart.\n\nPlease note that GoSync hasn't moved your files from old location. You would need to copy or move your current directory to new location before restarting GoSync." dlg = wx.DirDialog(None, "Choose target directory", "", wx.DD_DEFAULT_STYLE | wx.DD_DIR_MUST_EXIST) if dlg.ShowModal() == wx.ID_OK: self.sync_model.SetLocalMirrorDirectory(dlg.GetPath()) resp = wx.MessageBox(new_dir_help, "IMPORTANT INFORMATION", (wx.OK | wx.ICON_WARNING)) self.md.SetLabel(self.sync_model.GetLocalMirrorDirectory()) dlg.Destroy()
Example #20
Source File: validators.py From HH---POS-Accounting-and-ERP-Software with MIT License | 5 votes |
def Validate(self, event): k = event.GetKeyCode() print(k) if not(k >= 48 and k <= 57 or k is 8): #wx.MessageBox("Please enter numbers only", "Invalid Input", wx.OK | wx.ICON_ERROR) return False event.Skip() return True # --------------------------------------------------------------------------
Example #21
Source File: gui.py From IkaLog with Apache License 2.0 | 5 votes |
def on_input_file_added(self, event): input_file = event.input_file if input_file in self._file_list: wx.MessageBox(_('Already added.'), _('Error')) return self._file_list.append(input_file) self.engine.put_source_file(event.input_file)
Example #22
Source File: add_trigger.py From openplotter with GNU General Public License v2.0 | 5 votes |
def ShowMessage(self, w_msg): wx.MessageBox(w_msg, 'Info', wx.OK | wx.ICON_INFORMATION)
Example #23
Source File: pyResManController.py From pyResMan with GNU General Public License v2.0 | 5 votes |
def putKey(self, oldKVN, newKVN, key1, key2, key3): if wx.CANCEL == wx.MessageBox('Make sure your new key has been stored well!', caption='Put key', style=wx.ICON_WARNING|wx.OK|wx.CANCEL|wx.CANCEL_DEFAULT): return self.__putKeyThread = threading.Thread(target=self.__putKey, args=(oldKVN, newKVN, key1, key2, key3), name="Put key thread") self.__putKeyThread.start()
Example #24
Source File: add_MCP.py From openplotter with GNU General Public License v2.0 | 5 votes |
def on_convert(self, e): convert = 0 if self.convert.GetValue(): convert = 1 if self.conf.has_option('SPI', 'value_' + str(self.edit[2])): data = self.conf.get('SPI', 'value_' + str(self.edit[2])) try: temp_list = eval(data) except: temp_list = [] min = 1023 max = 0 for ii in temp_list: if ii[0] > max: max = ii[0] if ii[0] < min: min = ii[0] if min > 0: wx.MessageBox(_('minimum raw value in setting table > 0'), 'info', wx.OK | wx.ICON_INFORMATION) convert = 0 if max < 1023: wx.MessageBox(_('maximum raw value in setting table < 1023'), 'info', wx.OK | wx.ICON_INFORMATION) convert = 0 else: wx.MessageBox(_('no option value ').decode('utf8') + str(self.edit[2]) + _(' in openplotter.conf').decode('utf8'), 'info', wx.OK | wx.ICON_INFORMATION) convert = 0 self.convert.SetValue(convert)
Example #25
Source File: add_kplex.py From openplotter with GNU General Public License v2.0 | 5 votes |
def ShowMessage(self, w_msg): wx.MessageBox(w_msg, 'Info', wx.OK | wx.ICON_INFORMATION)
Example #26
Source File: add_deviation_setting.py From openplotter with GNU General Public License v2.0 | 5 votes |
def ShowMessage(self, w_msg): wx.MessageBox(w_msg, 'Info', wx.OK | wx.ICON_WARNING)
Example #27
Source File: demo_tool.py From openplotter with GNU General Public License v2.0 | 5 votes |
def ShowMessage(self, w_msg): wx.MessageBox(w_msg, 'Info', wx.OK | wx.ICON_INFORMATION)
Example #28
Source File: SDR_AIS.py From openplotter with GNU General Public License v2.0 | 5 votes |
def ShowMessage(self, w_msg): wx.MessageBox(w_msg, 'Info', wx.OK | wx.ICON_INFORMATION)
Example #29
Source File: Frame1.py From KeymouseGo with GNU General Public License v2.0 | 5 votes |
def OnAbout(self, event): wx.MessageBox('https://github.com/taojy123/KeymouseGo', 'KeymouseGo') event.Skip()
Example #30
Source File: NMEA_0183_generator.py From openplotter with GNU General Public License v2.0 | 5 votes |
def kplex_diagnostic(self,e): wx.MessageBox('use diagnostic on NMEA0183\nselect system\npush diagnostic', 'Info', wx.OK | wx.ICON_INFORMATION)