372 kind=wx.ITEM_NORMAL, text=_(u'Undo') + '\tCTRL+Z') |
372 kind=wx.ITEM_NORMAL, text=_(u'Undo') + '\tCTRL+Z') |
373 AppendMenu(parent, help='', id=wx.ID_REDO, |
373 AppendMenu(parent, help='', id=wx.ID_REDO, |
374 kind=wx.ITEM_NORMAL, text=_(u'Redo') + '\tCTRL+Y') |
374 kind=wx.ITEM_NORMAL, text=_(u'Redo') + '\tCTRL+Y') |
375 #AppendMenu(parent, help='', id=ID_PLCOPENEDITOREDITMENUENABLEUNDOREDO, |
375 #AppendMenu(parent, help='', id=ID_PLCOPENEDITOREDITMENUENABLEUNDOREDO, |
376 # kind=wx.ITEM_CHECK, text=_(u'Enable Undo/Redo')) |
376 # kind=wx.ITEM_CHECK, text=_(u'Enable Undo/Redo')) |
377 enable_undo_redo = _(u'Enable Undo/Redo') # Keeping text in translations for possible menu reactivation |
377 enable_undo_redo = _(u'Enable Undo/Redo') # Keeping text in translations for possible menu reactivation |
378 parent.AppendSeparator() |
378 parent.AppendSeparator() |
379 AppendMenu(parent, help='', id=wx.ID_CUT, |
379 AppendMenu(parent, help='', id=wx.ID_CUT, |
380 kind=wx.ITEM_NORMAL, text=_(u'Cut') + '\tCTRL+X') |
380 kind=wx.ITEM_NORMAL, text=_(u'Cut') + '\tCTRL+X') |
381 AppendMenu(parent, help='', id=wx.ID_COPY, |
381 AppendMenu(parent, help='', id=wx.ID_COPY, |
382 kind=wx.ITEM_NORMAL, text=_(u'Copy') + '\tCTRL+C') |
382 kind=wx.ITEM_NORMAL, text=_(u'Copy') + '\tCTRL+C') |
2393 def OnPastePou(self, event): |
2393 def OnPastePou(self, event): |
2394 selected = self.ProjectTree.GetSelection() |
2394 selected = self.ProjectTree.GetSelection() |
2395 |
2395 |
2396 if self.ProjectTree.GetPyData(selected)["type"] != ITEM_PROJECT: |
2396 if self.ProjectTree.GetPyData(selected)["type"] != ITEM_PROJECT: |
2397 pou_type = self.ProjectTree.GetItemText(selected) |
2397 pou_type = self.ProjectTree.GetItemText(selected) |
2398 pou_type = UNEDITABLE_NAMES_DICT[pou_type] # one of 'Functions', 'Function Blocks' or 'Programs' |
2398 pou_type = UNEDITABLE_NAMES_DICT[pou_type] # one of 'Functions', 'Function Blocks' or 'Programs' |
2399 pou_type = {'Functions': 'function', 'Function Blocks': 'functionBlock', 'Programs': 'program'}[pou_type] |
2399 pou_type = {'Functions': 'function', 'Function Blocks': 'functionBlock', 'Programs': 'program'}[pou_type] |
2400 else: |
2400 else: |
2401 pou_type = None |
2401 pou_type = None |
2402 |
2402 |
2403 pou_xml = self.GetCopyBuffer() |
2403 pou_xml = self.GetCopyBuffer() |