|
40 | 40 | # for some info about screen dpi
|
41 | 41 | PIXELS_PER_INCH = 75
|
42 | 42 |
|
43 |
| -# Delay time for idle checks |
44 |
| -IDLE_DELAY = 5 # Documented as deprecated as of Matplotlib 3.1. |
| 43 | + |
| 44 | +@functools.lru_cache(None) |
| 45 | +def __getattr__(name): |
| 46 | + if name == "IDLE_DELAY": |
| 47 | + _api.warn_deprecated("3.1", name=name) |
| 48 | + return 5 |
| 49 | + elif name == "cursord": |
| 50 | + _api.warn_deprecated("3.5", name=name) |
| 51 | + return { # deprecated in Matplotlib 3.5. |
| 52 | + cursors.MOVE: wx.CURSOR_HAND, |
| 53 | + cursors.HAND: wx.CURSOR_HAND, |
| 54 | + cursors.POINTER: wx.CURSOR_ARROW, |
| 55 | + cursors.SELECT_REGION: wx.CURSOR_CROSS, |
| 56 | + cursors.WAIT: wx.CURSOR_WAIT, |
| 57 | + cursors.RESIZE_HORIZONTAL: wx.CURSOR_SIZEWE, |
| 58 | + cursors.RESIZE_VERTICAL: wx.CURSOR_SIZENS, |
| 59 | + } |
| 60 | + else: |
| 61 | + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") |
45 | 62 |
|
46 | 63 |
|
47 | 64 | def error_msg_wx(msg, parent=None):
|
@@ -721,7 +738,15 @@ def _onKeyUp(self, event):
|
721 | 738 |
|
722 | 739 | def set_cursor(self, cursor):
|
723 | 740 | # docstring inherited
|
724 |
| - cursor = wx.Cursor(_api.check_getitem(cursord, cursor=cursor)) |
| 741 | + cursor = wx.Cursor(_api.check_getitem({ |
| 742 | + cursors.MOVE: wx.CURSOR_HAND, |
| 743 | + cursors.HAND: wx.CURSOR_HAND, |
| 744 | + cursors.POINTER: wx.CURSOR_ARROW, |
| 745 | + cursors.SELECT_REGION: wx.CURSOR_CROSS, |
| 746 | + cursors.WAIT: wx.CURSOR_WAIT, |
| 747 | + cursors.RESIZE_HORIZONTAL: wx.CURSOR_SIZEWE, |
| 748 | + cursors.RESIZE_VERTICAL: wx.CURSOR_SIZENS, |
| 749 | + }, cursor=cursor)) |
725 | 750 | self.SetCursor(cursor)
|
726 | 751 | self.Update()
|
727 | 752 |
|
@@ -1049,17 +1074,6 @@ def _set_frame_icon(frame):
|
1049 | 1074 | frame.SetIcons(bundle)
|
1050 | 1075 |
|
1051 | 1076 |
|
1052 |
| -cursord = { # deprecated in Matplotlib 3.5. |
1053 |
| - cursors.MOVE: wx.CURSOR_HAND, |
1054 |
| - cursors.HAND: wx.CURSOR_HAND, |
1055 |
| - cursors.POINTER: wx.CURSOR_ARROW, |
1056 |
| - cursors.SELECT_REGION: wx.CURSOR_CROSS, |
1057 |
| - cursors.WAIT: wx.CURSOR_WAIT, |
1058 |
| - cursors.RESIZE_HORIZONTAL: wx.CURSOR_SIZEWE, |
1059 |
| - cursors.RESIZE_VERTICAL: wx.CURSOR_SIZENS, |
1060 |
| -} |
1061 |
| - |
1062 |
| - |
1063 | 1077 | class NavigationToolbar2Wx(NavigationToolbar2, wx.ToolBar):
|
1064 | 1078 | def __init__(self, canvas, coordinates=True):
|
1065 | 1079 | wx.ToolBar.__init__(self, canvas.GetParent(), -1)
|
|
0 commit comments