ConfigTreeNode.py
changeset 774 78b5fa92dd1c
parent 744 bdab45f96aa0
child 780 70632f4612a1
equal deleted inserted replaced
773:3f3f1b8fcb07 774:78b5fa92dd1c
   404         # Finally set IEC Channel
   404         # Finally set IEC Channel
   405         self.BaseParams.setIEC_Channel(res)
   405         self.BaseParams.setIEC_Channel(res)
   406         return res
   406         return res
   407 
   407 
   408     def _OpenView(self, name=None):
   408     def _OpenView(self, name=None):
   409         if self.EditorType is not None and self._View is None:
   409         if self.EditorType is not None:
   410             app_frame = self.GetCTRoot().AppFrame
   410             if self._View is None:
   411             
   411                 app_frame = self.GetCTRoot().AppFrame
   412             self._View = self.EditorType(app_frame.TabsOpened, self, app_frame)
   412                 
   413             
   413                 self._View = self.EditorType(app_frame.TabsOpened, self, app_frame)
   414             app_frame.EditProjectElement(self._View, self.CTNName())
   414                 
   415             
   415                 app_frame.EditProjectElement(self._View, self.CTNName())
       
   416                 
   416             return self._View
   417             return self._View
   417         return None
   418         return None
       
   419 
       
   420     def _CloseView(self, view):
       
   421         app_frame = self.GetCTRoot().AppFrame
       
   422         if app_frame is not None:
       
   423             app_frame.DeletePage(view)
   418 
   424 
   419     def OnCloseEditor(self, view):
   425     def OnCloseEditor(self, view):
   420         if self._View == view:
   426         if self._View == view:
   421             self._View = None
   427             self._View = None
   422 
   428 
   423     def OnCTNClose(self):
   429     def OnCTNClose(self):
   424         if self._View is not None:
   430         if self._View is not None:
   425             app_frame = self.GetCTRoot().AppFrame
   431             self._CloseView(self.View)
   426             if app_frame is not None:
   432             self._View = None
   427                 app_frame.DeletePage(self._View)
       
   428         return True
   433         return True
   429 
   434 
   430     def _doRemoveChild(self, CTNInstance):
   435     def _doRemoveChild(self, CTNInstance):
   431         # Remove all children of child
   436         # Remove all children of child
   432         for SubCTNInstance in CTNInstance.IterChildren():
   437         for SubCTNInstance in CTNInstance.IterChildren():