示例#1
0
 def paste_from_cache(self):
     if structure_cache:
         structure, dimension = structure_cache.get_structure()
         wx.PostEvent(self, ToolChangeEvent(tool="Select"))
         wx.PostEvent(self,
                      PasteEvent(structure=structure, dimension=dimension))
     else:
         wx.MessageBox(
             "A structure needs to be copied before one can be pasted.")
 def paste(self, structure: Structure = None):
     if not isinstance(structure, Structure):
         if structure_cache:
             structure = structure_cache.get_structure()
         else:
             wx.MessageBox(
                 "A structure needs to be copied before one can be pasted.")
             return
     wx.PostEvent(self, ToolChangeEvent(tool="Select"))
     wx.PostEvent(self, PasteEvent(structure=structure))
示例#3
0
 def paste_from_cache(self):
     if structure_cache:
         self.paste(*structure_cache.get_structure())
     else:
         wx.MessageBox(
             "A structure needs to be copied before one can be pasted.")