wolfhece.CpGrid

Module Contents

class wolfhece.CpGrid.CpGrid(parent, id, style)[source]

Bases: wx.grid.Grid

Inheritance diagram of wolfhece.CpGrid.CpGrid

A Full Copy and Paste enabled grid class which implements Excel like copy, paste, and delete functionality.

  • Ctrl+c : Copy range of selected cells.

  • Ctrl+v : Paste copy selection at point of currently selected cell.

  • If paste selection is larger than copy selection, copy selection will be replicated to fill paste region if it is a modulo number of copy rows and/or columns, otherwise just the copy selection will be pasted.

  • Ctrl+x : Delete current selection.

  • Deleted selection can be restored with Ctrl+z, or pasted with Ctrl+v.

  • Delete or backspace key will also perform this action.

  • Ctrl+z : Undo the last paste or delete action.

OnKey(event)[source]

Handles all key events.

copy()[source]

Copies the current range of select cells to clipboard.

build_paste_selection()[source]

This method creates the paste selection, builds it into a clipboard string, and puts it on the clipboard. When building the paste selection it fills in replicas of the copy selection if: number of rows and/or columns in the paste selection is larger than the copy selection, and they are multiples of the corresponding copy selection rows and/or columns, otherwise just the copy selection will be used.

paste(mode)[source]

Handles paste and undo operations.

delete()[source]

This method deletes text from selected cells, places a copy of the deleted cells on the clipboard for pasting (Ctrl+v), and places a copy in the self.data4undo variable for undoing (Ctrl+z)