mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-06 12:00:13 +01:00
Some docstring updates, and add wx.svg to the docs to be built
This commit is contained in:
2
build.py
2
build.py
@@ -1095,7 +1095,7 @@ def cmd_wxlib(options, args):
|
|||||||
cmdTimer = CommandTimer('wx.lib')
|
cmdTimer = CommandTimer('wx.lib')
|
||||||
pwd = pushDir(phoenixDir())
|
pwd = pushDir(phoenixDir())
|
||||||
|
|
||||||
for wx_pkg in ['lib', 'py', 'tools']:
|
for wx_pkg in ['lib', 'py', 'svg', 'tools']:
|
||||||
libDir = os.path.join(phoenixDir(), 'wx', wx_pkg)
|
libDir = os.path.join(phoenixDir(), 'wx', wx_pkg)
|
||||||
|
|
||||||
if not os.path.isdir(libDir):
|
if not os.path.isdir(libDir):
|
||||||
|
|||||||
@@ -74,6 +74,8 @@ and launch the wxPython demo for you.
|
|||||||
<p class="mybiglink"><a class="mybiglink" href="wx.aui.1moduleindex.html">wx.aui</a><br/>
|
<p class="mybiglink"><a class="mybiglink" href="wx.aui.1moduleindex.html">wx.aui</a><br/>
|
||||||
<span class="linkdescr">Docking/floating window panes, draggable notebook tabs, etc.</span></p>
|
<span class="linkdescr">Docking/floating window panes, draggable notebook tabs, etc.</span></p>
|
||||||
|
|
||||||
|
<p class="mybiglink"><a class="mybiglink" href="wx.svg.html">wx.svg</a><br/>
|
||||||
|
<span class="linkdescr">Classes to parse and render Scalable Vector Graphics files.</span></p>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td valign="top" width="50%" style="margin-left: 5px">
|
<td valign="top" width="50%" style="margin-left: 5px">
|
||||||
@@ -149,3 +151,10 @@ and launch the wxPython demo for you.
|
|||||||
wx.lib
|
wx.lib
|
||||||
wx.py
|
wx.py
|
||||||
wx.tools
|
wx.tools
|
||||||
|
wx.svg
|
||||||
|
|
||||||
|
.. automodule:: wx.svg._nanosvg
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
@@ -10,7 +10,9 @@
|
|||||||
# Licence: wxWindows license
|
# Licence: wxWindows license
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
"""
|
"""
|
||||||
|
wx.svg docstring (TBW)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import wx
|
import wx
|
||||||
from six.moves import zip_longest
|
from six.moves import zip_longest
|
||||||
|
|
||||||
@@ -21,21 +23,28 @@ from ._nanosvg import *
|
|||||||
# let's leave this in place in case it's needed again in the future.
|
# let's leave this in place in case it's needed again in the future.
|
||||||
_RenderersWithoutGradientTransforms = []
|
_RenderersWithoutGradientTransforms = []
|
||||||
|
|
||||||
|
|
||||||
class SVGimage(SVGimageBase):
|
class SVGimage(SVGimageBase):
|
||||||
"""
|
"""
|
||||||
|
SVGimage docstring (TBW)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def RasterizeToBitmap(self, tx=0.0, ty=0.0, scale=1.0,
|
def RasterizeToBitmap(self, tx=0.0, ty=0.0, scale=1.0,
|
||||||
width=-1, height=-1, stride=-1):
|
width=-1, height=-1, stride=-1):
|
||||||
"""
|
"""
|
||||||
|
SVGimage.RasterizeToBitmap docstring (TBW)
|
||||||
"""
|
"""
|
||||||
buff = self.RasterizeToBytes(tx, ty, scale, width, height, stride)
|
buf = self.RasterizeToBytes(tx, ty, scale, width, height, stride)
|
||||||
bmp = wx.Bitmap.FromBufferRGBA(width, height, buff)
|
# import numpy as np
|
||||||
|
# buf = np.zeros((width, height, 4), np.uint8)
|
||||||
|
# self.RasterizeToBuffer(buf, tx, ty, scale, width, height, stride)
|
||||||
|
bmp = wx.Bitmap.FromBufferRGBA(width, height, buf)
|
||||||
return bmp
|
return bmp
|
||||||
|
|
||||||
|
|
||||||
def RenderToGC(self, ctx, scale=None, size=None, translate=(0.0, 0.0)):
|
def RenderToGC(self, ctx, scale=None, size=None, translate=(0.0, 0.0)):
|
||||||
"""
|
"""
|
||||||
|
SVGimage.RenderToGC docstring (TBW)
|
||||||
"""
|
"""
|
||||||
ctx.PushState()
|
ctx.PushState()
|
||||||
# set scale either from the parameter or as ratio of sizes
|
# set scale either from the parameter or as ratio of sizes
|
||||||
|
|||||||
Reference in New Issue
Block a user