Python wx.MessageDialog() Examples
The following are 30
code examples of wx.MessageDialog().
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 IkaLog with Apache License 2.0 | 8 votes |
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ファイルからインポート #
Example #2
Source File: gui.py From superpaper with MIT License | 7 votes |
def onSaveDiagInch(self, event): """Save user modified display sizes to DisplaySystem.""" inches = [] for tc in self.tc_list_diaginch: tc_val = tc.GetValue() user_inch = self.test_diag_value(tc_val) if user_inch: inches.append(user_inch) else: # error msg msg = ("Display size must be a positive number, " "'{}' was entered.".format(tc_val)) sp_logging.G_LOGGER.info(msg) dial = wx.MessageDialog(self, msg, "Error", wx.OK|wx.STAY_ON_TOP|wx.CENTRE) dial.ShowModal() return -1 self.display_sys.update_display_diags(inches) self.display_sys.save_system() display_data = self.display_sys.get_disp_list(self.show_advanced_settings) self.wpprev_pnl.update_display_data( display_data, self.show_advanced_settings, self.use_multi_image )
Example #3
Source File: objdictedit.py From CANFestivino with GNU Lesser General Public License v2.1 | 6 votes |
def OnExportEDSMenu(self, event): dialog = wx.FileDialog(self, _("Choose a file"), os.getcwd(), self.Manager.GetCurrentNodeInfos()[0], _("EDS files (*.eds)|*.eds|All files|*.*"), wx.SAVE|wx.OVERWRITE_PROMPT|wx.CHANGE_DIR) if dialog.ShowModal() == wx.ID_OK: filepath = dialog.GetPath() if os.path.isdir(os.path.dirname(filepath)): path, extend = os.path.splitext(filepath) if extend in ("", "."): filepath = path + ".eds" result = self.Manager.ExportCurrentToEDSFile(filepath) if not result: message = wx.MessageDialog(self, _("Export successful"), _("Information"), wx.OK|wx.ICON_INFORMATION) message.ShowModal() message.Destroy() else: message = wx.MessageDialog(self, result, _("Error"), wx.OK|wx.ICON_ERROR) message.ShowModal() message.Destroy() else: message = wx.MessageDialog(self, _("\"%s\" is not a valid folder!")%os.path.dirname(filepath), _("Error"), wx.OK|wx.ICON_ERROR) message.ShowModal() message.Destroy() dialog.Destroy()
Example #4
Source File: systray.py From p2ptv-pi with MIT License | 6 votes |
def save(self): try: gender_id = self.ctrl_gender.GetClientData(self.ctrl_gender.GetSelection()) age_id = self.ctrl_age.GetClientData(self.ctrl_age.GetSelection()) self.user_profile.set_gender(gender_id) self.user_profile.set_age(age_id) self.user_profile.save() return True except Exception as e: print_exc() try: msg = str(e) except: msg = 'Cannot save profile' dlg = wx.MessageDialog(None, msg, self.bgapp.appname, wx.OK | wx.ICON_INFORMATION) dlg.ShowModal() dlg.Destroy() return False
Example #5
Source File: filmow_to_letterboxd.py From filmow_to_letterboxd with MIT License | 6 votes |
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()
Example #6
Source File: gui.py From superpaper with MIT License | 6 votes |
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
Example #7
Source File: salesPanel.py From HH---POS-Accounting-and-ERP-Software with MIT License | 6 votes |
def CheckOutFunc(self, event): if len(self.t.cart.products) == 0: return amt = self.makePopUp("Enter Recieved Amount", "Amount Recieved") if amt == "": return while amt.isdigit() is False: amt = self.makePopUp("Enter Recieved Amount (only digits)", "Amount Recieved") print(amt) isprinter = self.t.checkout(int(amt)) if isprinter is None: x = wx.MessageDialog(self, "Printer not connected", "No Printer", wx.OK) x.ShowModal() else: self.clearCartGrid()
Example #8
Source File: mainframe.py From youtube-dl-gui with The Unlicense | 6 votes |
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()
Example #9
Source File: g.gui.tangible.py From grass-tangible-landscape with GNU General Public License v2.0 | 6 votes |
def OnColorCalibration(self, event): if self.scaniface.IsScanning(): dlg = wx.MessageDialog(self, 'In order to calibrate, please stop scanning process first.', 'Stop scanning', wx.OK | wx.ICON_WARNING) dlg.ShowModal() dlg.Destroy() return training = self.trainingAreas.GetValue() if not training: return if self.settings['output']['color'] and self.settings['output']['color_name']: self.group = self.settings['output']['color_name'] else: self.group = None dlg = wx.MessageDialog(self, "In order to calibrate colors, please specify name of output color raster in 'Output' tab.", 'Need color output', wx.OK | wx.ICON_WARNING) dlg.ShowModal() dlg.Destroy() return self.CalibrateColor()
Example #10
Source File: g.gui.tangible.py From grass-tangible-landscape with GNU General Public License v2.0 | 6 votes |
def CalibrateModelBBox(self, event): if self.IsScanning(): dlg = wx.MessageDialog(self, 'In order to calibrate, please stop scanning process first.', 'Stop scanning', wx.OK | wx.ICON_WARNING) dlg.ShowModal() dlg.Destroy() return params = {} if self.calib_matrix: params['calib_matrix'] = self.calib_matrix params['rotate'] = self.scan['rotation_angle'] zrange = ','.join(self.scan['trim_nsewtb'].split(',')[4:]) params['zrange'] = zrange res = gscript.parse_command('r.in.kinect', flags='m', overwrite=True, **params) if not res['bbox']: gscript.message(_("Failed to find model extent")) offsetcm = 2 n, s, e, w = [int(round(float(each))) for each in res['bbox'].split(',')] self.scanning_panel.trim['n'].SetValue(str(n + offsetcm)) self.scanning_panel.trim['s'].SetValue(str(abs(s) + offsetcm)) self.scanning_panel.trim['e'].SetValue(str(e + offsetcm)) self.scanning_panel.trim['w'].SetValue(str(abs(w) + offsetcm))
Example #11
Source File: elecsus_gui.py From ElecSus with Apache License 2.0 | 6 votes |
def OnSaveConfig(self,event): """ Save present configuration settings - plot types, data ranges, parameters ... for faster repeating of common tasks """ dlg = wx.MessageDialog(self, "Save current configuration of the program - theory/fit parameters, plot settings etc...\n\nNot implemented yet...", "No no no", wx.OK) dlg.ShowModal() data_dump = [0] # get plot settings # ... # get theory tab settings # ... # get fit tab settings # ... # get mist settings # ... ## filedialog window for selecting filename/location filename = './elecsus_gui_config.dat' # save data in python-readable (binary) format using pickle module with open(filename,'wb') as file_obj: pickle.dump(data_dump, file_obj)
Example #12
Source File: subindextable.py From CANFestivino with GNU Lesser General Public License v2.1 | 6 votes |
def OnAddSubindexMenu(self, event): if self.Editable: selected = self.IndexList.GetSelection() if selected != wx.NOT_FOUND: index = self.ListIndex[selected] if self.Manager.IsCurrentEntry(index): dialog = wx.TextEntryDialog(self, _("Number of subindexes to add:"), _("Add subindexes"), "1", wx.OK|wx.CANCEL) if dialog.ShowModal() == wx.ID_OK: try: number = int(dialog.GetValue()) self.Manager.AddSubentriesToCurrent(index, number) self.ParentWindow.RefreshBufferState() self.RefreshIndexList() except: message = wx.MessageDialog(self, _("An integer is required!"), _("ERROR"), wx.OK|wx.ICON_ERROR) message.ShowModal() message.Destroy() dialog.Destroy()
Example #13
Source File: subindextable.py From CANFestivino with GNU Lesser General Public License v2.1 | 6 votes |
def OnDeleteSubindexMenu(self, event): if self.Editable: selected = self.IndexList.GetSelection() if selected != wx.NOT_FOUND: index = self.ListIndex[selected] if self.Manager.IsCurrentEntry(index): dialog = wx.TextEntryDialog(self, _("Number of subindexes to delete:"), _("Delete subindexes"), "1", wx.OK|wx.CANCEL) if dialog.ShowModal() == wx.ID_OK: try: number = int(dialog.GetValue()) self.Manager.RemoveSubentriesFromCurrent(index, number) self.ParentWindow.RefreshBufferState() self.RefreshIndexList() except: message = wx.MessageDialog(self, _("An integer is required!"), _("ERROR"), wx.OK|wx.ICON_ERROR) message.ShowModal() message.Destroy() dialog.Destroy()
Example #14
Source File: objdictedit.py From CANFestivino with GNU Lesser General Public License v2.1 | 6 votes |
def OnHelpDS301Menu(self, event): find_index = False selected = self.FileOpened.GetSelection() if selected >= 0: window = self.FileOpened.GetPage(selected) result = window.GetSelection() if result: find_index = True index, subIndex = result result = OpenPDFDocIndex(index, ScriptDirectory) if isinstance(result, (StringType, UnicodeType)): message = wx.MessageDialog(self, result, _("ERROR"), wx.OK|wx.ICON_ERROR) message.ShowModal() message.Destroy() if not find_index: result = OpenPDFDocIndex(None, ScriptDirectory) if isinstance(result, (StringType, UnicodeType)): message = wx.MessageDialog(self, result, _("ERROR"), wx.OK|wx.ICON_ERROR) message.ShowModal() message.Destroy()
Example #15
Source File: objdictedit.py From CANFestivino with GNU Lesser General Public License v2.1 | 6 votes |
def OnHelpCANFestivalMenu(self, event): #self.OpenHtmlFrame("CAN Festival Reference", os.path.join(ScriptDirectory, "doc/canfestival.html"), wx.Size(1000, 600)) if wx.Platform == '__WXMSW__': readerpath = get_acroversion() readerexepath = os.path.join(readerpath,"AcroRd32.exe") if(os.path.isfile(readerexepath)): os.spawnl(os.P_DETACH, readerexepath, "AcroRd32.exe", '"%s"'%os.path.join(ScriptDirectory, "doc","manual_en.pdf")) else: message = wx.MessageDialog(self, _("Check if Acrobat Reader is correctly installed on your computer"), _("ERROR"), wx.OK|wx.ICON_ERROR) message.ShowModal() message.Destroy() else: try: os.system("xpdf -remote CANFESTIVAL %s %d &"%(os.path.join(ScriptDirectory, "doc/manual_en.pdf"),16)) except: message = wx.MessageDialog(self, _("Check if xpdf is correctly installed on your computer"), _("ERROR"), wx.OK|wx.ICON_ERROR) message.ShowModal() message.Destroy()
Example #16
Source File: objdictedit.py From CANFestivino with GNU Lesser General Public License v2.1 | 6 votes |
def OnNewMenu(self, event): self.FilePath = "" dialog = CreateNodeDialog(self) if dialog.ShowModal() == wx.ID_OK: name, id, nodetype, description = dialog.GetValues() profile, filepath = dialog.GetProfile() NMT = dialog.GetNMTManagement() options = dialog.GetOptions() result = self.Manager.CreateNewNode(name, id, nodetype, description, profile, filepath, NMT, options) if isinstance(result, (IntType, LongType)): new_editingpanel = EditingPanel(self.FileOpened, self, self.Manager) new_editingpanel.SetIndex(result) self.FileOpened.AddPage(new_editingpanel, "") self.FileOpened.SetSelection(self.FileOpened.GetPageCount() - 1) self.EditMenu.Enable(ID_OBJDICTEDITEDITMENUDS302PROFILE, False) if "DS302" in options: self.EditMenu.Enable(ID_OBJDICTEDITEDITMENUDS302PROFILE, True) self.RefreshBufferState() self.RefreshProfileMenu() self.RefreshMainMenu() else: message = wx.MessageDialog(self, result, _("ERROR"), wx.OK|wx.ICON_ERROR) message.ShowModal() message.Destroy() dialog.Destroy()
Example #17
Source File: objdictedit.py From CANFestivino with GNU Lesser General Public License v2.1 | 6 votes |
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 #-------------------------------------------------------------------------------
Example #18
Source File: objdictedit.py From CANFestivino with GNU Lesser General Public License v2.1 | 6 votes |
def SaveAs(self): filepath = self.Manager.GetCurrentFilePath() if filepath != "": directory, filename = os.path.split(filepath) else: directory, filename = os.getcwd(), "%s.od"%self.Manager.GetCurrentNodeInfos()[0] dialog = wx.FileDialog(self, _("Choose a file"), directory, filename, _("OD files (*.od)|*.od|All files|*.*"), wx.SAVE|wx.OVERWRITE_PROMPT|wx.CHANGE_DIR) if dialog.ShowModal() == wx.ID_OK: filepath = dialog.GetPath() if os.path.isdir(os.path.dirname(filepath)): result = self.Manager.SaveCurrentInFile(filepath) if not isinstance(result, (StringType, UnicodeType)): self.RefreshBufferState() else: message = wx.MessageDialog(self, result, _("Error"), wx.OK|wx.ICON_ERROR) message.ShowModal() message.Destroy() else: message = wx.MessageDialog(self, _("%s is not a valid folder!")%os.path.dirname(filepath), _("Error"), wx.OK|wx.ICON_ERROR) message.ShowModal() message.Destroy() dialog.Destroy()
Example #19
Source File: activities.py From grass-tangible-landscape with GNU General Public License v2.0 | 5 votes |
def _checkChangeTask(self): if self.timer.IsRunning(): dlg = wx.MessageDialog(self, 'Stop currently running task before changing task', 'Stop task', wx.OK | wx.ICON_WARNING) dlg.ShowModal() dlg.Destroy() return False return True
Example #20
Source File: elecsus_gui.py From ElecSus with Apache License 2.0 | 5 votes |
def OnPlotHold(self,event): """ Toggle plot hold (keep data on updating figure) on/off Allows multiple data sets to be shown on same plot """ #self.PlotHold = bool(event.IsChecked()) #self.figs[0].hold(self.PlotHold) dlg = wx.MessageDialog(self, "Not implemented yet...", "No no no", wx.OK) dlg.ShowModal()
Example #21
Source File: usersPanel.py From HH---POS-Accounting-and-ERP-Software with MIT License | 5 votes |
def deleteUser (self, event): x = wx.MessageDialog(self, "Are you sure you want to delete this user?", "Delete User", wx.OK|wx.CANCEL) if x.ShowModal() == wx.ID_OK: qry = 'DELETE FROM users WHERE id = %s' % (self.usersGrid.GetCellValue(event.GetRow(), 0)) con = connectToDB() curs = con.cursor() curs.execute(qry) con.commit() self.updateUsers()
Example #22
Source File: elecsus_gui.py From ElecSus with Apache License 2.0 | 5 votes |
def OnDataProcessing(self,event): """ Open the dialog box for binning / smoothing data """ if self.x_fit_array is not None: dlg = DataProcessingDlg(self, "Data Processing", wx.ID_ANY) if dlg.Show() == wx.ID_OK: dlg.Destroy() else: dlg = wx.MessageDialog(self,"Can't process data that hasn't been loaded...", "Nope.", wx.OK|wx.ICON_INFORMATION) dlg.ShowModal()
Example #23
Source File: terminalFrontEnd.py From HH---POS-Accounting-and-ERP-Software with MIT License | 5 votes |
def alert(self, msg, title): x = wx.MessageDialog(self, msg, title) x.ShowModal()
Example #24
Source File: elecsus_gui.py From ElecSus with Apache License 2.0 | 5 votes |
def save_data(self,filename): """ Save the data using wx.TextCtrl built-in method """ success = self.StatusTextBox.SaveFile(filename) # returns true if no errors 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()
Example #25
Source File: backupTerminalFrontEnd.py From HH---POS-Accounting-and-ERP-Software with MIT License | 5 votes |
def alert(self, msg, title): x = wx.MessageDialog(self, msg, title) x.ShowModal()
Example #26
Source File: newUser.py From HH---POS-Accounting-and-ERP-Software with MIT License | 5 votes |
def SaveConnString(self, event): username = self.name.GetValue() passwd = self.passwd.GetValue() if username != '' and passwd != '': access = str(int(self.cashSale.GetValue())) \ + str(int(self.invoice.GetValue())) \ + str(int(self.quote.GetValue())) \ + str(int(self.purchase.GetValue())) \ + str(int(self.stockLevels.GetValue())) \ + str(int(self.cashSaleInfo.GetValue())) \ + str(int(self.invoiceInfo.GetValue())) \ + str(int(self.purchaseInfo.GetValue())) \ + str(int(self.quoteInfo.GetValue())) \ + str(int(self.customerInfo.GetValue())) \ + str(int(self.supplierInfo.GetValue())) \ + str(int(self.journal.GetValue())) \ + str(int(self.accountsByFolio.GetValue())) \ + str(int(self.controlAccount.GetValue())) \ + str(int(self.incomeStatement.GetValue())) \ + str(int(self.users.GetValue())) int_access = int(access) if int_access != 0: qry = 'INSERT INTO users (username, password, access) VALUES ("%s", "%s", "%s")' % (username, passwd, access) conn = connectToDB() curs = conn.cursor() curs.execute(qry) conn.commit() self.Destroy() else: y = wx.MessageDialog(self, "Please tick atleast one checkbox", "Notice", wx.OK) y.ShowModal() else: x = wx.MessageDialog(self, "Please enter both username and password", "Notice", wx.OK) x.ShowModal()
Example #27
Source File: elecsus_gui.py From ElecSus with Apache License 2.0 | 5 votes |
def OnLoadConfig(self,event): """ Load previous configuration settings from pickle file, for picking up where you left off... """ dlg = wx.MessageDialog(self, "Load previous configuration of the program - theory/fit parameters, plot settings etc...\n\nNot implemented yet...", "No no no", wx.OK) dlg.ShowModal() ## do the opposite of save config ...
Example #28
Source File: chronolapse.py From chronolapse with MIT License | 5 votes |
def showWarning(self, title, message): dlg = wx.MessageDialog(self, message, title, wx.OK | wx.ICON_ERROR) dlg.ShowModal() dlg.Destroy()
Example #29
Source File: elecsus_gui.py From ElecSus with Apache License 2.0 | 5 votes |
def OnUseExpDetuning(self,event): """ Action when Menu Item 'Use Experimental Detuning' is clicked """ if self.x_fit_array is not None: # only do anything if data has been loaded already self.UseExpDetuning = bool(event.IsChecked()) self.OnComputeButton(1) else: problem_dlg = wx.MessageDialog(self, "No experimental data has been loaded yet", "No data to use", wx.OK|wx.ICON_ERROR) problem_dlg.ShowModal() self.eM_UseExpDetuning.Check(False)
Example #30
Source File: elecsus_gui.py From ElecSus with Apache License 2.0 | 5 votes |
def OnSaveCSVData(self,event): """ Method to save the main plot data traces as a n-column csv file. *All* data is saved, whether or not it is displayed This method selects the file name, then passes that to SaveTheoryCurves() """ SaveFileDialog = wx.FileDialog(self,"Save Output File", "./", "Outputs", "CSV files (*.csv)|*.csv", wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT) if SaveFileDialog.ShowModal() == wx.ID_OK: output_filename = SaveFileDialog.GetPath() SaveFileDialog.Destroy() print(output_filename) # don't need this - FD_OVERWRITE_PROMPT does the same job #check for overwrite current files #if os.path.isfile(output_filename): # OverwriteDialog = wx.MessageDialog(self,"Warning: file exists already! Overwrite?",\ # "Overwrite?",wx.YES_NO|wx.NO_DEFAULT) # # if OverwriteDialog.ShowModal() == wx.NO: # OverwriteDialog.Destroy() # return # exit without saving # else: # OverwriteDialog.Destroy() ## do save self.SaveTheoryCurves(output_filename)