parameters: (self)
docstring: Copy the currently selected cells to the clipboard
docstring_summary: Copy the currently selected cells to the clipboard
docstring_tokens: Copy the currently selected cells to the clipboard
function: def Copy(self):
          """ Copy the currently selected cells to the clipboard """
          # TODO: raise an error when there are no cells selected?
          if self._selected == None: return
          ((r1, c1), (r2, c2)) = self._selected
  
          # Build a string to put on the clipboard
          # (Is there a faster way to do this in Python?)
          crlf = chr(13) + chr(10)
          tab = chr(9)
          s = ""
          for row in range(r1, r2+1):
              for col in range(c1, c2):
                  s += self.GetCellValue(row,col)
                  s += tab
              s += self.GetCellValue(row, c2)
              s += crlf
  
          # Put the string on the clipboard
          if wx.TheClipboard.Open():
              wx.TheClipboard.Clear()
              wx.TheClipboard.SetData(wx.TextDataObject(s))
              wx.TheClipboard.Close()
function_tokens: def Copy ( self ) : # TODO: raise an error when there are no cells selected? if self . _selected == None : return ( ( r1 , c1 ) , ( r2 , c2 ) ) = self . _selected # Build a string to put on the clipboard # (Is there a faster way to do this in Python?) crlf = chr ( 13 ) + chr ( 10 ) tab = chr ( 9 ) s = "" for row in range ( r1 , r2 + 1 ) : for col in range ( c1 , c2 ) : s += self . GetCellValue ( row , col ) s += tab s += self . GetCellValue ( row , c2 ) s += crlf # Put the string on the clipboard if wx . TheClipboard . Open ( ) : wx . TheClipboard . Clear ( ) wx . TheClipboard . SetData ( wx . TextDataObject ( s ) ) wx . TheClipboard . Close ( )