Fix bug when double click while pressing CTRL on other elements than blocks
authorLaurent Bessard
Thu, 15 Nov 2012 22:57:55 +0100
changeset 882 3c6ce0a5ab2c
parent 881 68ac754a5a72
child 883 235a9ec83b95
Fix bug when double click while pressing CTRL on other elements than blocks
editors/Viewer.py
--- a/editors/Viewer.py	Thu Nov 15 22:45:04 2012 +0100
+++ b/editors/Viewer.py	Thu Nov 15 22:57:55 2012 +0100
@@ -1887,10 +1887,13 @@
                             self.ParentWindow.OpenGraphicViewer(iec_path)
             elif event.ControlDown() and not event.ShiftDown():
                 if not isinstance(self.SelectedElement, Graphic_Group):
-                    instance_type = self.SelectedElement.GetType()
-                    if self.IsBlock(self.SelectedElement) and instance_type in self.Controler.GetProjectPouNames(self.Debug):
+                    if isinstance(self.SelectedElement, FBD_Block):
+                        instance_type = self.SelectedElement.GetType()
+                    else:
+                        instance_type = None
+                    if instance_type in self.Controler.GetProjectPouNames(self.Debug):
                         self.ParentWindow.EditProjectElement(ITEM_POU, 
-                            self.Controler.ComputePouName(instance_type))
+                                self.Controler.ComputePouName(instance_type))
                     else:
                         self.SelectedElement.OnLeftDClick(event, self.GetLogicalDC(), self.Scaling)
             elif event.ControlDown() and event.ShiftDown():