File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -1826,9 +1826,22 @@ def remove_rubberband(self, dc=None):
1826
1826
self ._rect = None
1827
1827
1828
1828
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
+
1829
1841
backend_tools .ToolSaveFigure = SaveFigureWx
1830
1842
backend_tools .ToolSetCursor = SetCursorWx
1831
1843
backend_tools .ToolRubberband = RubberbandWx
1844
+ backend_tools .ToolCopyToClipboard = ToolCopyToClipboardWx
1832
1845
1833
1846
1834
1847
# < Additions for printing support: Matt Newville
You can’t perform that action at this time.
0 commit comments