20 from ..context
import IS_WINDOWS, IS_MAC
30 return self.
_clipboard_clipboard.get_contents()
49 self.
_clipboard_clipboard.set_contents(self.
_grid_grid.get_selected_content())
59 clipboard = self.
_clipboard_clipboard.get_contents()
60 if isinstance(clipboard, list):
61 cells_as_text =
' '.join([
' '.join(row)
for row
in clipboard])
65 clipboard = self.
_clipboard_clipboard.get_contents()
69 if not isinstance(clipboard, list):
70 self.
_write_cell_write_cell(cell.row, cell.col, clipboard)
73 for datarow
in clipboard:
81 return self.
_grid_grid.selection.topleft
84 self.
_grid_grid.write_cell(row, col, value, update_history=
False)
87 return self.
_grid_grid.get_cell_edit_control()
90 return self.
_grid_grid.IsCellEditControlShown()
99 _ClipboardHandler.copy(self)
105 _ClipboardHandler.cut(self)
114 _ClipboardHandler.paste(self)
118 ClipboardHandler = _WindowsClipboardHandler
if IS_WINDOWS
or IS_MAC
else _ClipboardHandler
133 if not (data
and wx.TheClipboard.Open()):
136 tdo = wx.TextDataObject()
138 wx.TheClipboard.SetData(tdo)
140 wx.TheClipboard.Close()
143 if isinstance(data, list):
144 return os.linesep.join(
'\t'.join(row)
for row
in data)
145 if isinstance(data, str):
157 if not wx.TheClipboard.Open():
160 tdo = wx.TextDataObject()
161 wx.TheClipboard.GetData(tdo)
162 return tdo.GetText()
or ''
164 wx.TheClipboard.Close()
167 return [line.split(
'\t')
for line
in string.splitlines()]
def _edit_control_shown(self)
def _get_edit_control(self)
def _add_selected_data_to_clipboard(self)
def _paste_to_cell_editor(self)
def _write_cell(self, row, col, value)
def cut(self)
Cuts the contents of the selected cell(s).
def _get_starting_cell(self)
def clipboard_content(self)
def copy(self)
Copy the contents of the selected cell(s).
def paste(self)
Paste the contents of the clipboard.
Implements a "smart" clipboard.
def _format_data(self, data)
def _split_string_from_tabs_and_newlines(self, string)
def set_contents(self, data)
Insert data to the system clipboard.
def get_contents(self)
Gets contents of the clipboard.
def paste(self)
Paste the contents of the clipboard.
def _paste_to_cell_editor(self)
def copy(self)
Copy the contents of the selected cell(s).
def cut(self)
Cuts the contents of the selected cell(s).