# HG changeset patch # User b.taylor@willowglen.ca # Date 1254345811 21600 # Node ID c7e0254be378ed5c9ba44763c5b750a065374116 # Parent f4c0e9c9b3b96b4bb82d0aee7356a8db8dbe45f7 remove several superfluous event.Skip()s (they caused double actions) diff -r f4c0e9c9b3b9 -r c7e0254be378 PLCOpenEditor.py --- a/PLCOpenEditor.py Mon Sep 21 10:31:38 2009 -0600 +++ b/PLCOpenEditor.py Wed Sep 30 15:23:31 2009 -0600 @@ -1061,7 +1061,6 @@ tagname = self.TabsOpened.GetPage(new_index).GetTagName() self.VariablePanelIndexer.ChangeVariablePanel(tagname) self._Refresh(TOOLBAR, FILEMENU, EDITMENU) - event.Skip() def OnCloseProjectMenu(self, event): if not self.CheckSaveBeforeClosing(): @@ -1079,11 +1078,9 @@ self._onsave() else: self.SaveProject() - event.Skip() def OnSaveProjectAsMenu(self, event): self.SaveProjectAs() - event.Skip() def OnGenerateProgramMenu(self, event): dialog = wx.FileDialog(self, _("Choose a file"), os.getcwd(), self.Controler.GetProgramFilePath(), _("ST files (*.st)|*.st|All files|*.*"), wx.SAVE|wx.CHANGE_DIR) @@ -1140,7 +1137,6 @@ self.PageSetupData = wx.PageSetupDialogData(dialog.GetPageSetupData()) self.PrintData = wx.PrintData(self.PageSetupData.GetPrintData()) dialog.Destroy() - event.Skip() def OnPreviewMenu(self, event): selected = self.TabsOpened.GetSelection() @@ -1159,7 +1155,6 @@ preview_frame.Initialize() preview_frame.Show(True) - event.Skip() def OnPrintMenu(self, event): selected = self.TabsOpened.GetSelection() @@ -1175,16 +1170,12 @@ if not printer.Print(self, printout, True): self.ShowErrorMessage(_("There was a problem printing.\nPerhaps your current printer is not set correctly?")) printout.Destroy() - event.Skip() def OnPropertiesMenu(self, event): self.ShowProperties() - event.Skip() def OnQuitMenu(self, event): self.Close() - # don't call event.Skip() here or it will attempt to close the - # frame twice for some reason #------------------------------------------------------------------------------- @@ -1239,7 +1230,6 @@ self.RefreshEditor() self._Refresh(TITLE, EDITMENU, TYPESTREE, INSTANCESTREE, LIBRARYTREE, SCALING) - event.Skip() def OnRedoMenu(self, event): self.Controler.LoadNext() @@ -1247,12 +1237,10 @@ self.RefreshEditor() self._Refresh(TITLE, EDITMENU, TYPESTREE, INSTANCESTREE, LIBRARYTREE, SCALING) - event.Skip() def OnEnableUndoRedoMenu(self, event): self.Controler.EnableProjectBuffer(event.IsChecked()) self.RefreshEditMenu() - event.Skip() OnCutMenu = GetShortcutKeyCallbackFunction("Cut") OnCopyMenu = GetShortcutKeyCallbackFunction("Copy") @@ -1266,7 +1254,6 @@ control.SetSelection(0, control.GetLastPosition()) elif isinstance(control, wx.ComboBox): control.SetMark(0, control.GetLastPosition() + 1) - event.Skip() DeleteFunctions = { ITEM_DATATYPE: GetDeleteElementFunction(PLCControler.ProjectRemoveDataType, check_function=PLCControler.DataTypeIsUsed), @@ -1293,7 +1280,6 @@ event = wx.KeyEvent(wx.EVT_CHAR._getEvtType()) event.m_keyCode = wx.WXK_DELETE window.ProcessEvent(event) - event.Skip() #------------------------------------------------------------------------------- @@ -1329,11 +1315,9 @@ def OnRefreshMenu(self, event): self.RefreshEditor(not self.Debug) - event.Skip() def OnClearErrorsMenu(self, event): self.ClearErrors() - event.Skip() def GenerateZoomFunction(self, idx): def ZoomFunction(event): @@ -2386,7 +2370,6 @@ self.RefreshEditMenu() self.RefreshTypesTree() dialog.Destroy() - event.Skip() def GenerateAddPouFunction(self, pou_type): def OnAddPouMenu(event): @@ -2401,7 +2384,6 @@ self.RefreshTypesTree() self.RefreshLibraryTree() dialog.Destroy() - event.Skip() return OnAddPouMenu def GenerateAddTransitionFunction(self, pou_name): @@ -2416,7 +2398,6 @@ self.RefreshEditMenu() self.RefreshTypesTree() dialog.Destroy() - event.Skip() return OnAddTransitionMenu def GenerateAddActionFunction(self, pou_name): @@ -2431,7 +2412,6 @@ self.RefreshEditMenu() self.RefreshTypesTree() dialog.Destroy() - event.Skip() return OnAddActionMenu def OnAddConfigurationMenu(self, event): @@ -2446,7 +2426,6 @@ self.RefreshTypesTree() self.RefreshInstancesTree() dialog.Destroy() - event.Skip() def GenerateAddResourceFunction(self, config_name): def OnAddResourceMenu(event): @@ -2461,7 +2440,6 @@ self.RefreshTypesTree() self.RefreshInstancesTree() dialog.Destroy() - event.Skip() return OnAddResourceMenu def GenerateChangePouTypeFunction(self, name, new_type):