diff --git a/doc/api/next_api_changes/2018-02-15-AL-deprecations.rst b/doc/api/next_api_changes/2018-02-15-AL-deprecations.rst index 2fce8789ed43..9d46bf332a3d 100644 --- a/doc/api/next_api_changes/2018-02-15-AL-deprecations.rst +++ b/doc/api/next_api_changes/2018-02-15-AL-deprecations.rst @@ -5,6 +5,8 @@ The following modules are deprecated: - :mod:`matplotlib.compat.subprocess`. This was a python 2 workaround, but all the functionality can now be found in the python 3 standard library :mod:`subprocess`. +- :mod:`matplotlib.backends.wx_compat`. Python 3 is only compatible with + wxPython 4, so support for wxPython 3 or earlier can be dropped. The following classes, methods, and functions are deprecated: diff --git a/examples/user_interfaces/mathtext_wx_sgskip.py b/examples/user_interfaces/mathtext_wx_sgskip.py index b06162b2f0f3..53a861986c23 100644 --- a/examples/user_interfaces/mathtext_wx_sgskip.py +++ b/examples/user_interfaces/mathtext_wx_sgskip.py @@ -10,7 +10,7 @@ import matplotlib matplotlib.use("WxAgg") from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas -from matplotlib.backends.backend_wx import NavigationToolbar2Wx, wxc +from matplotlib.backends.backend_wx import NavigationToolbar2Wx from matplotlib.figure import Figure import numpy as np @@ -27,7 +27,7 @@ def mathtext_to_wxbitmap(s): ftimage, depth = mathtext_parser.parse(s, 150) - return wxc.BitmapFromBuffer( + return wx.Bitmap.FromBufferRGBA( ftimage.get_width(), ftimage.get_height(), ftimage.as_rgba_str()) ############################################################ @@ -43,7 +43,6 @@ def mathtext_to_wxbitmap(s): class CanvasFrame(wx.Frame): def __init__(self, parent, title): wx.Frame.__init__(self, parent, -1, title, size=(550, 350)) - self.SetBackgroundColour(wxc.NamedColour("WHITE")) self.figure = Figure() self.axes = self.figure.add_subplot(111) @@ -61,8 +60,9 @@ def __init__(self, parent, title): # File Menu menu = wx.Menu() - menu.Append(wx.ID_EXIT, "E&xit\tAlt-X", "Exit this simple sample") + m_exit = menu.Append(wx.ID_EXIT, "E&xit\tAlt-X", "Exit this simple sample") menuBar.Append(menu, "&File") + self.Bind(wx.EVT_MENU, self.OnClose, m_exit) if IS_GTK or IS_WIN: # Equation Menu @@ -71,7 +71,7 @@ def __init__(self, parent, title): bm = mathtext_to_wxbitmap(mt) item = wx.MenuItem(menu, 1000 + i, " ") item.SetBitmap(bm) - menu.AppendItem(item) + menu.Append(item) self.Bind(wx.EVT_MENU, self.OnChangePlot, item) menuBar.Append(menu, "&Functions") @@ -113,6 +113,9 @@ def change_plot(self, plot_number): self.axes.plot(t, s) self.canvas.draw() + def OnClose(self, event): + self.Destroy() + class MyApp(wx.App): def OnInit(self): diff --git a/examples/user_interfaces/wxcursor_demo_sgskip.py b/examples/user_interfaces/wxcursor_demo_sgskip.py index d1b7650cc2f6..e74cf3e11f6e 100644 --- a/examples/user_interfaces/wxcursor_demo_sgskip.py +++ b/examples/user_interfaces/wxcursor_demo_sgskip.py @@ -8,7 +8,7 @@ from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas -from matplotlib.backends.backend_wx import NavigationToolbar2Wx, wxc +from matplotlib.backends.backend_wx import NavigationToolbar2Wx from matplotlib.figure import Figure import numpy as np @@ -17,10 +17,7 @@ class CanvasFrame(wx.Frame): def __init__(self, ): - wx.Frame.__init__(self, None, -1, - 'CanvasFrame', size=(550, 350)) - - self.SetBackgroundColour(wxc.NamedColour("WHITE")) + wx.Frame.__init__(self, None, -1, 'CanvasFrame', size=(550, 350)) self.figure = Figure() self.axes = self.figure.add_subplot(111) @@ -33,7 +30,8 @@ def __init__(self, ): self.figure_canvas = FigureCanvas(self, -1, self.figure) # Note that event is a MplEvent - self.figure_canvas.mpl_connect('motion_notify_event', self.UpdateStatusBar) + self.figure_canvas.mpl_connect( + 'motion_notify_event', self.UpdateStatusBar) self.figure_canvas.Bind(wx.EVT_ENTER_WINDOW, self.ChangeCursor) self.sizer = wx.BoxSizer(wx.VERTICAL) @@ -49,14 +47,12 @@ def __init__(self, ): self.toolbar.Show() def ChangeCursor(self, event): - self.figure_canvas.SetCursor(wxc.StockCursor(wx.CURSOR_BULLSEYE)) + self.figure_canvas.SetCursor(wx.Cursor(wx.CURSOR_BULLSEYE)) def UpdateStatusBar(self, event): if event.inaxes: - x, y = event.xdata, event.ydata - self.statusBar.SetStatusText(("x= " + str(x) + - " y=" + str(y)), - 0) + self.statusBar.SetStatusText( + "x={} y={}".format(event.xdata, event.ydata)) class App(wx.App): diff --git a/lib/matplotlib/backends/backend_wx.py b/lib/matplotlib/backends/backend_wx.py index 6fbc6b716f6c..a3c59f259ea5 100644 --- a/lib/matplotlib/backends/backend_wx.py +++ b/lib/matplotlib/backends/backend_wx.py @@ -1,29 +1,19 @@ """ - A wxPython backend for matplotlib, based (very heavily) on - backend_template.py and backend_gtk.py +A wxPython backend for matplotlib. - Author: Jeremy O'Donoghue (jeremy@o-donoghue.com) - - Derived from original copyright work by John Hunter - (jdhunter@ace.bsd.uchicago.edu) - - Copyright (C) Jeremy O'Donoghue & John Hunter, 2003-4 - - License: This work is licensed under a PSF compatible license. A copy - should be included with this source code. +Originally contributed by Jeremy O'Donoghue (jeremy@o-donoghue.com) and John +Hunter (jdhunter@ace.bsd.uchicago.edu). +Copyright (C) Jeremy O'Donoghue & John Hunter, 2003-4. """ -from __future__ import (absolute_import, division, print_function, - unicode_literals) import six -import sys -import os import os.path import math -import weakref +import sys import warnings +import weakref import matplotlib from matplotlib.backend_bases import ( @@ -39,7 +29,6 @@ from matplotlib.widgets import SubplotTool from matplotlib import cbook, rcParams, backend_tools -from . import wx_compat as wxc import wx # Debugging settings here... @@ -173,14 +162,45 @@ class RendererWx(RendererBase): # describes the colour and weight of any lines drawn, and a wxBrush # which describes the fill colour of any closed polygon. - fontweights = wxc.fontweights - fontangles = wxc.fontangles + # Font styles, families and weight. + fontweights = { + 100: wx.FONTWEIGHT_LIGHT, + 200: wx.FONTWEIGHT_LIGHT, + 300: wx.FONTWEIGHT_LIGHT, + 400: wx.FONTWEIGHT_NORMAL, + 500: wx.FONTWEIGHT_NORMAL, + 600: wx.FONTWEIGHT_NORMAL, + 700: wx.FONTWEIGHT_BOLD, + 800: wx.FONTWEIGHT_BOLD, + 900: wx.FONTWEIGHT_BOLD, + 'ultralight': wx.FONTWEIGHT_LIGHT, + 'light': wx.FONTWEIGHT_LIGHT, + 'normal': wx.FONTWEIGHT_NORMAL, + 'medium': wx.FONTWEIGHT_NORMAL, + 'semibold': wx.FONTWEIGHT_NORMAL, + 'bold': wx.FONTWEIGHT_BOLD, + 'heavy': wx.FONTWEIGHT_BOLD, + 'ultrabold': wx.FONTWEIGHT_BOLD, + 'black': wx.FONTWEIGHT_BOLD, + } + fontangles = { + 'italic': wx.FONTSTYLE_ITALIC, + 'normal': wx.FONTSTYLE_NORMAL, + 'oblique': wx.FONTSTYLE_SLANT, + } - # wxPython allows for portable font styles, choosing them appropriately - # for the target platform. Map some standard font names to the portable - # styles + # wxPython allows for portable font styles, choosing them appropriately for + # the target platform. Map some standard font names to the portable styles. # QUESTION: Is it be wise to agree standard fontnames across all backends? - fontnames = wxc.fontnames + fontnames = { + 'Sans': wx.FONTFAMILY_SWISS, + 'Roman': wx.FONTFAMILY_ROMAN, + 'Script': wx.FONTFAMILY_SCRIPT, + 'Decorative': wx.FONTFAMILY_DECORATIVE, + 'Modern': wx.FONTFAMILY_MODERN, + 'Courier': wx.FONTFAMILY_MODERN, + 'courier': wx.FONTFAMILY_MODERN, + } def __init__(self, bitmap, dpi): """ @@ -285,7 +305,7 @@ def draw_image(self, gc, x, y, im): w = self.width h = self.height rows, cols = im.shape[:2] - bitmap = wxc.BitmapFromBuffer(cols, rows, im.tostring()) + bitmap = wx.Bitmap.FromBufferRGBA(cols, rows, im.tostring()) gc = self.get_gc() gc.select() gc.gfx_ctx.DrawBitmap(bitmap, int(l), int(self.height - b), @@ -611,27 +631,8 @@ def __init__(self, parent, id, figure): wx.Panel.__init__(self, parent, id, size=wx.Size(w, h)) - def do_nothing(*args, **kwargs): - warnings.warn( - "could not find a setinitialsize function for backend_wx; " - "please report your wxpython version=%s " - "to the matplotlib developers list" % - wxc.backend_version) - pass - - # try to find the set size func across wx versions - try: - getattr(self, 'SetInitialSize') - except AttributeError: - self.SetInitialSize = getattr(self, 'SetBestFittingSize', - do_nothing) - - if not hasattr(self, 'IsShownOnScreen'): - self.IsShownOnScreen = getattr(self, 'IsVisible', - lambda *args: True) - # Create the drawing bitmap - self.bitmap = wxc.EmptyBitmap(w, h) + self.bitmap = wx.Bitmap(w, h) DEBUG_MSG("__init__() - bitmap w:%d h:%d" % (w, h), 2, self) # TODO: Add support for 'point' inspection and plot navigation. self._isDrawn = False @@ -733,7 +734,7 @@ def start_event_loop(self, timeout=0): self.Bind(wx.EVT_TIMER, self.stop_event_loop, id=id) # Event loop handler for start/stop event loop - self._event_loop = wxc.EventLoop() + self._event_loop = wx.GUIEventLoop() self._event_loop.Run() timer.Stop() @@ -845,7 +846,7 @@ def _onSize(self, evt): return self._width, self._height = size # Create a new, correctly sized bitmap - self.bitmap = wxc.EmptyBitmap(self._width, self._height) + self.bitmap = wx.Bitmap(self._width, self._height) self._isDrawn = False @@ -1083,7 +1084,7 @@ def _print_image(self, filename, filetype, *args, **kwargs): width = int(math.ceil(width)) height = int(math.ceil(height)) - self.bitmap = wxc.EmptyBitmap(width, height) + self.bitmap = wx.Bitmap(width, height) renderer = RendererWx(self.bitmap, self.figure.dpi) @@ -1172,12 +1173,8 @@ def __init__(self, num, fig): self.toolbar.Realize() # On Windows platform, default window size is incorrect, so set # toolbar width to figure width. - if wxc.is_phoenix: - tw, th = self.toolbar.GetSize() - fw, fh = self.canvas.GetSize() - else: - tw, th = self.toolbar.GetSizeTuple() - fw, fh = self.canvas.GetSizeTuple() + tw, th = self.toolbar.GetSize() + fw, fh = self.canvas.GetSize() # By adding toolbar in sizer, we are able to put it at the bottom # of the frame - so appearance is closer to GTK version. self.toolbar.SetSize(wx.Size(fw, th)) @@ -1368,12 +1365,8 @@ def Destroy(self): def _onMenuButton(self, evt): """Handle menu button pressed.""" - if wxc.is_phoenix: - x, y = self.GetPosition() - w, h = self.GetSize() - else: - x, y = self.GetPositionTuple() - w, h = self.GetSizeTuple() + x, y = self.GetPosition() + w, h = self.GetSize() self.PopupMenuXY(self._menu, x, y + h - 4) # When menu returned, indicate selection in button evt.Skip() @@ -1500,11 +1493,15 @@ def _init_toolbar(self): if text is None: self.AddSeparator() continue - self.wx_ids[text] = wx.NewId() - wxc._AddTool(self, self.wx_ids, text, - _load_bitmap(image_file + '.png'), - tooltip_text) - + self.wx_ids[text] = ( + self.AddTool( + -1, + bitmap=_load_bitmap(image_file + ".png"), + bmpDisabled=wx.NullBitmap, + label=text, shortHelp=text, longHelp=tooltip_text, + kind=(wx.ITEM_CHECK if text in ["Pan", "Zoom"] + else wx.ITEM_NORMAL)) + .Id) self.Bind(wx.EVT_TOOL, getattr(self, callback), id=self.wx_ids[text]) @@ -1569,7 +1566,7 @@ def save_figure(self, *args): error_msg_wx(str(e)) def set_cursor(self, cursor): - cursor = wxc.Cursor(cursord[cursor]) + cursor = wx.Cursor(cursord[cursor]) self.canvas.SetCursor(cursor) self.canvas.Update() @@ -1645,17 +1642,14 @@ def draw_rubberband(self, event, x0, y0, x1, y1): rubberBandColor = '#C0C0FF' # or load from config? # Set a pen for the border - color = wxc.NamedColour(rubberBandColor) + color = wx.Colour(rubberBandColor) dc.SetPen(wx.Pen(color, 1)) # use the same color, plus alpha for the brush r, g, b, a = color.Get(True) color.Set(r, g, b, 0x60) dc.SetBrush(wx.Brush(color)) - if wxc.is_phoenix: - dc.DrawRectangle(rect) - else: - dc.DrawRectangleRect(rect) + dc.DrawRectangle(rect) def set_status_bar(self, statbar): self.statbar = statbar @@ -1742,7 +1736,7 @@ def trigger(self, *args): class SetCursorWx(backend_tools.SetCursorBase): def set_cursor(self, cursor): - cursor = wxc.Cursor(cursord[cursor]) + cursor = wx.Cursor(cursord[cursor]) self.canvas.SetCursor(cursor) self.canvas.Update() @@ -1780,17 +1774,14 @@ def draw_rubberband(self, x0, y0, x1, y1): rubberBandColor = '#C0C0FF' # or load from config? # Set a pen for the border - color = wxc.NamedColour(rubberBandColor) + color = wx.Colour(rubberBandColor) dc.SetPen(wx.Pen(color, 1)) # use the same color, plus alpha for the brush r, g, b, a = color.Get(True) color.Set(r, g, b, 0x60) dc.SetBrush(wx.Brush(color)) - if wxc.is_phoenix: - dc.DrawRectangle(rect) - else: - dc.DrawRectangleRect(rect) + dc.DrawRectangle(rect) def remove_rubberband(self): if self.wxoverlay is None: @@ -1821,10 +1812,7 @@ def draw_rubberband(self, x0, y0, x1, y1): dc.SetPen(wx.Pen(wx.BLACK, 1, wx.SOLID)) dc.SetBrush(wx.TRANSPARENT_BRUSH) self._rect = (x0, self.canvas._height-y0, x1-x0, -y1+y0) - if wxc.is_phoenix: - dc.DrawRectangle(self._rect) - else: - dc.DrawRectangleRect(self._rect) + dc.DrawRectangle(self._rect) def remove_rubberband(self, dc=None): if not self._rect: @@ -1872,13 +1860,10 @@ def OnPrintPage(self, page): self.canvas.draw() dc = self.GetDC() - (ppw, pph) = self.GetPPIPrinter() # printer's pixels per in - (pgw, pgh) = self.GetPageSizePixels() # page size in pixels - (dcw, dch) = dc.GetSize() - if wxc.is_phoenix: - (grw, grh) = self.canvas.GetSize() - else: - (grw, grh) = self.canvas.GetSizeTuple() + ppw, pph = self.GetPPIPrinter() # printer's pixels per in + pgw, pgh = self.GetPageSizePixels() # page size in pixels + dcw, dch = dc.GetSize() + grw, grh = self.canvas.GetSize() # save current figure dpi resolution and bg color, # so that we can temporarily set them to the dpi of diff --git a/lib/matplotlib/backends/backend_wxagg.py b/lib/matplotlib/backends/backend_wxagg.py index ee628fc0dc9b..927d68d7198a 100644 --- a/lib/matplotlib/backends/backend_wxagg.py +++ b/lib/matplotlib/backends/backend_wxagg.py @@ -1,12 +1,8 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) - import six import wx import matplotlib -from . import wx_compat as wxc from .backend_agg import FigureCanvasAgg from .backend_wx import ( _BackendWx, _FigureCanvasWxBase, FigureFrameWx, @@ -82,7 +78,7 @@ def _convert_agg_to_wx_image(agg, bbox): """ if bbox is None: # agg => rgb -> image - image = wxc.EmptyImage(int(agg.width), int(agg.height)) + image = wx.Image(int(agg.width), int(agg.height)) image.SetData(agg.tostring_rgb()) return image else: @@ -99,8 +95,8 @@ def _convert_agg_to_wx_bitmap(agg, bbox): """ if bbox is None: # agg => rgba buffer -> bitmap - return wxc.BitmapFromBuffer(int(agg.width), int(agg.height), - agg.buffer_rgba()) + return wx.Bitmap.FromBufferRGBA(int(agg.width), int(agg.height), + agg.buffer_rgba()) else: # agg => rgba buffer -> bitmap => clipped bitmap return _WX28_clipped_agg_as_bitmap(agg, bbox) @@ -116,12 +112,12 @@ def _WX28_clipped_agg_as_bitmap(agg, bbox): r = l + width t = b + height - srcBmp = wxc.BitmapFromBuffer(int(agg.width), int(agg.height), - agg.buffer_rgba()) + srcBmp = wx.Bitmap.FromBufferRGBA(int(agg.width), int(agg.height), + agg.buffer_rgba()) srcDC = wx.MemoryDC() srcDC.SelectObject(srcBmp) - destBmp = wxc.EmptyBitmap(int(width), int(height)) + destBmp = wx.Bitmap(int(width), int(height)) destDC = wx.MemoryDC() destDC.SelectObject(destBmp) diff --git a/lib/matplotlib/backends/wx_compat.py b/lib/matplotlib/backends/wx_compat.py index 87f6312299f4..78bc34511e3a 100644 --- a/lib/matplotlib/backends/wx_compat.py +++ b/lib/matplotlib/backends/wx_compat.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python """ A wx API adapter to hide differences between wxPython classic and phoenix. @@ -7,146 +6,31 @@ For an example see embedding_in_wx2.py """ -from __future__ import (absolute_import, division, print_function, - unicode_literals) - -import six - import wx -backend_version = wx.VERSION_STRING -is_phoenix = 'phoenix' in wx.PlatformInfo - - -if is_phoenix: - # define all the wxPython phoenix stuff - - # font styles, families and weight - fontweights = { - 100: wx.FONTWEIGHT_LIGHT, - 200: wx.FONTWEIGHT_LIGHT, - 300: wx.FONTWEIGHT_LIGHT, - 400: wx.FONTWEIGHT_NORMAL, - 500: wx.FONTWEIGHT_NORMAL, - 600: wx.FONTWEIGHT_NORMAL, - 700: wx.FONTWEIGHT_BOLD, - 800: wx.FONTWEIGHT_BOLD, - 900: wx.FONTWEIGHT_BOLD, - 'ultralight': wx.FONTWEIGHT_LIGHT, - 'light': wx.FONTWEIGHT_LIGHT, - 'normal': wx.FONTWEIGHT_NORMAL, - 'medium': wx.FONTWEIGHT_NORMAL, - 'semibold': wx.FONTWEIGHT_NORMAL, - 'bold': wx.FONTWEIGHT_BOLD, - 'heavy': wx.FONTWEIGHT_BOLD, - 'ultrabold': wx.FONTWEIGHT_BOLD, - 'black': wx.FONTWEIGHT_BOLD - } - fontangles = { - 'italic': wx.FONTSTYLE_ITALIC, - 'normal': wx.FONTSTYLE_NORMAL, - 'oblique': wx.FONTSTYLE_SLANT} - - # wxPython allows for portable font styles, choosing them appropriately - # for the target platform. Map some standard font names to the portable - # styles - # QUESTION: Is it be wise to agree standard fontnames across all backends? - fontnames = {'Sans': wx.FONTFAMILY_SWISS, - 'Roman': wx.FONTFAMILY_ROMAN, - 'Script': wx.FONTFAMILY_SCRIPT, - 'Decorative': wx.FONTFAMILY_DECORATIVE, - 'Modern': wx.FONTFAMILY_MODERN, - 'Courier': wx.FONTFAMILY_MODERN, - 'courier': wx.FONTFAMILY_MODERN} - dashd_wx = {'solid': wx.PENSTYLE_SOLID, - 'dashed': wx.PENSTYLE_SHORT_DASH, - 'dashdot': wx.PENSTYLE_DOT_DASH, - 'dotted': wx.PENSTYLE_DOT} +from .. import cbook +from .backend_wx import RendererWx - # functions changes - BitmapFromBuffer = wx.Bitmap.FromBufferRGBA - EmptyBitmap = wx.Bitmap - EmptyImage = wx.Image - Cursor = wx.Cursor - EventLoop = wx.GUIEventLoop - NamedColour = wx.Colour - StockCursor = wx.Cursor -else: - # define all the wxPython classic stuff +cbook.warn_deprecated("3.0", "{} is deprecated.".format(__name__)) - # font styles, families and weight - fontweights = { - 100: wx.LIGHT, - 200: wx.LIGHT, - 300: wx.LIGHT, - 400: wx.NORMAL, - 500: wx.NORMAL, - 600: wx.NORMAL, - 700: wx.BOLD, - 800: wx.BOLD, - 900: wx.BOLD, - 'ultralight': wx.LIGHT, - 'light': wx.LIGHT, - 'normal': wx.NORMAL, - 'medium': wx.NORMAL, - 'semibold': wx.NORMAL, - 'bold': wx.BOLD, - 'heavy': wx.BOLD, - 'ultrabold': wx.BOLD, - 'black': wx.BOLD - } - fontangles = { - 'italic': wx.ITALIC, - 'normal': wx.NORMAL, - 'oblique': wx.SLANT} - - # wxPython allows for portable font styles, choosing them appropriately - # for the target platform. Map some standard font names to the portable - # styles - # QUESTION: Is it be wise to agree standard fontnames across all backends? - fontnames = {'Sans': wx.SWISS, - 'Roman': wx.ROMAN, - 'Script': wx.SCRIPT, - 'Decorative': wx.DECORATIVE, - 'Modern': wx.MODERN, - 'Courier': wx.MODERN, - 'courier': wx.MODERN} - - dashd_wx = {'solid': wx.SOLID, - 'dashed': wx.SHORT_DASH, - 'dashdot': wx.DOT_DASH, - 'dotted': wx.DOT} - - # functions changes - BitmapFromBuffer = wx.BitmapFromBufferRGBA - EmptyBitmap = wx.EmptyBitmap - EmptyImage = wx.EmptyImage - Cursor = wx.StockCursor - EventLoop = wx.EventLoop - NamedColour = wx.NamedColour - StockCursor = wx.StockCursor - - -# wxPython Classic's DoAddTool has become AddTool in Phoenix. Otherwise -# they are the same, except for early betas and prerelease builds of -# Phoenix. This function provides a shim that does the RightThing based on -# which wxPython is in use. -def _AddTool(parent, wx_ids, text, bmp, tooltip_text): - if text in ['Pan', 'Zoom']: - kind = wx.ITEM_CHECK - else: - kind = wx.ITEM_NORMAL - if is_phoenix: - add_tool = parent.AddTool - else: - add_tool = parent.DoAddTool - - kwargs = dict(label=text, - bitmap=bmp, - bmpDisabled=wx.NullBitmap, - shortHelp=text, - longHelp=tooltip_text, - kind=kind) +backend_version = wx.VERSION_STRING +is_phoenix = 'phoenix' in wx.PlatformInfo - return add_tool(wx_ids[text], **kwargs) +fontweights = RendererWx.fontweights +fontangles = RendererWx.fontangles +fontnames = RendererWx.fontnames + +dashd_wx = {'solid': wx.PENSTYLE_SOLID, + 'dashed': wx.PENSTYLE_SHORT_DASH, + 'dashdot': wx.PENSTYLE_DOT_DASH, + 'dotted': wx.PENSTYLE_DOT} + +# functions changes +BitmapFromBuffer = wx.Bitmap.FromBufferRGBA +EmptyBitmap = wx.Bitmap +EmptyImage = wx.Image +Cursor = wx.Cursor +EventLoop = wx.GUIEventLoop +NamedColour = wx.Colour +StockCursor = wx.Cursor