File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1826,9 +1826,22 @@ def remove_rubberband(self, dc=None):
18261826 self ._rect = None
18271827
18281828
1829+ class ToolCopyToClipboardWx (backend_tools .ToolCopyToClipboardBase ):
1830+ def trigger (self , * args , ** kwargs ):
1831+ if not self .canvas ._isDrawn :
1832+ self .canvas .draw ()
1833+ if not self .canvas .bitmap .IsOk () or not wx .TheClipboard .Open ():
1834+ return
1835+ try :
1836+ wx .TheClipboard .SetData (wx .BitmapDataObject (self .canvas .bitmap ))
1837+ finally :
1838+ wx .TheClipboard .Close ()
1839+
1840+
18291841backend_tools .ToolSaveFigure = SaveFigureWx
18301842backend_tools .ToolSetCursor = SetCursorWx
18311843backend_tools .ToolRubberband = RubberbandWx
1844+ backend_tools .ToolCopyToClipboard = ToolCopyToClipboardWx
18321845
18331846
18341847# < Additions for printing support: Matt Newville
You can’t perform that action at this time.
0 commit comments