当前位置: 首页>>代码示例>>Python>>正文


Python wx.MessageDialog方法代码示例

本文整理汇总了Python中wx.MessageDialog方法的典型用法代码示例。如果您正苦于以下问题:Python wx.MessageDialog方法的具体用法?Python wx.MessageDialog怎么用?Python wx.MessageDialog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wx的用法示例。


在下文中一共展示了wx.MessageDialog方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: on_options_load_default

# 需要导入模块: import wx [as 别名]
# 或者: from wx import MessageDialog [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ファイルからインポート
    # 
开发者ID:hasegaw,项目名称:IkaLog,代码行数:19,代码来源:gui.py

示例2: onSaveDiagInch

# 需要导入模块: import wx [as 别名]
# 或者: from wx import MessageDialog [as 别名]
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
        ) 
开发者ID:hhannine,项目名称:superpaper,代码行数:26,代码来源:gui.py

示例3: onDeleteProfile

# 需要导入模块: import wx [as 别名]
# 或者: from wx import MessageDialog [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 
开发者ID:hhannine,项目名称:superpaper,代码行数:23,代码来源:gui.py

示例4: save

# 需要导入模块: import wx [as 别名]
# 或者: from wx import MessageDialog [as 别名]
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 
开发者ID:alesnav,项目名称:p2ptv-pi,代码行数:21,代码来源:systray.py

示例5: OnClose

# 需要导入模块: import wx [as 别名]
# 或者: from wx import MessageDialog [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() 
开发者ID:yanari,项目名称:filmow_to_letterboxd,代码行数:18,代码来源:filmow_to_letterboxd.py

示例6: OnSaveConfig

# 需要导入模块: import wx [as 别名]
# 或者: from wx import MessageDialog [as 别名]
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) 
开发者ID:jameskeaveney,项目名称:ElecSus,代码行数:27,代码来源:elecsus_gui.py

示例7: CheckOutFunc

# 需要导入模块: import wx [as 别名]
# 或者: from wx import MessageDialog [as 别名]
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() 
开发者ID:104H,项目名称:HH---POS-Accounting-and-ERP-Software,代码行数:19,代码来源:salesPanel.py

示例8: _on_close

# 需要导入模块: import wx [as 别名]
# 或者: from wx import MessageDialog [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() 
开发者ID:MrS0m30n3,项目名称:youtube-dl-gui,代码行数:20,代码来源:mainframe.py

示例9: OnColorCalibration

# 需要导入模块: import wx [as 别名]
# 或者: from wx import MessageDialog [as 别名]
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() 
开发者ID:tangible-landscape,项目名称:grass-tangible-landscape,代码行数:26,代码来源:g.gui.tangible.py

示例10: CalibrateModelBBox

# 需要导入模块: import wx [as 别名]
# 或者: from wx import MessageDialog [as 别名]
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)) 
开发者ID:tangible-landscape,项目名称:grass-tangible-landscape,代码行数:25,代码来源:g.gui.tangible.py

示例11: OnAddSubindexMenu

# 需要导入模块: import wx [as 别名]
# 或者: from wx import MessageDialog [as 别名]
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() 
开发者ID:jgeisler0303,项目名称:CANFestivino,代码行数:21,代码来源:subindextable.py

示例12: OnDeleteSubindexMenu

# 需要导入模块: import wx [as 别名]
# 或者: from wx import MessageDialog [as 别名]
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() 
开发者ID:jgeisler0303,项目名称:CANFestivino,代码行数:21,代码来源:subindextable.py

示例13: OnHelpDS301Menu

# 需要导入模块: import wx [as 别名]
# 或者: from wx import MessageDialog [as 别名]
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() 
开发者ID:jgeisler0303,项目名称:CANFestivino,代码行数:22,代码来源:objdictedit.py

示例14: OnHelpCANFestivalMenu

# 需要导入模块: import wx [as 别名]
# 或者: from wx import MessageDialog [as 别名]
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() 
开发者ID:jgeisler0303,项目名称:CANFestivino,代码行数:20,代码来源:objdictedit.py

示例15: OnNewMenu

# 需要导入模块: import wx [as 别名]
# 或者: from wx import MessageDialog [as 别名]
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() 
开发者ID:jgeisler0303,项目名称:CANFestivino,代码行数:27,代码来源:objdictedit.py


注:本文中的wx.MessageDialog方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。