mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-05 11:30:06 +01:00
Some tweaks for PenInfo and GraphicsPenInfo wrappers
This commit is contained in:
@@ -281,6 +281,10 @@ def run():
|
||||
# GraphicsPenInfo is transitory we can't save the reference in it to the
|
||||
# holder, and the pen will not have been created yet...
|
||||
c.find('Dashes').ignore()
|
||||
c.find('GetDashes').ignore()
|
||||
c.find('GetDashCount').ignore()
|
||||
c.find('GetDash').ignore()
|
||||
|
||||
|
||||
|
||||
#---------------------------------------------
|
||||
|
||||
@@ -111,6 +111,9 @@ def run():
|
||||
# transitory we can't save the reference in it to the holder, and the pen
|
||||
# will not have been created yet...
|
||||
c.find('Dashes').ignore()
|
||||
c.find('GetDashes').ignore()
|
||||
c.find('GetDashCount').ignore()
|
||||
c.find('GetDash').ignore()
|
||||
|
||||
|
||||
# it is delay-initialized, see stockgdi.sip
|
||||
|
||||
@@ -197,12 +197,14 @@ class GraphicsPen(GraphicsObject):
|
||||
|
||||
@staticmethod
|
||||
def CreateFromPen(pen):
|
||||
"""Convert a :class:`wx.Pen` to a ``GraphicsPen``"""
|
||||
assert isinstance(pen, wx.Pen)
|
||||
p = GraphicsPen(pen.Colour, pen.Width, pen.Style)
|
||||
p._cap = pen.Cap
|
||||
p._dashes = pen.Dashes
|
||||
p._join = pen.Join
|
||||
"""Convert a :class:`wx.Pen` or :class:`wx.GraphicsPenInfo` to a ``GraphicsPen``"""
|
||||
assert isinstance(pen, (wx.Pen, wx.GraphicsPenInfo))
|
||||
p = GraphicsPen(pen.GetColour(), pen.GetWidth(), pen.GetStyle())
|
||||
p._cap = pen.GetCap()
|
||||
p._join = pen.GetJoin()
|
||||
if isinstance(pen, wx.Pen):
|
||||
# TODO: GraphicsPenInfo still needs Dashes support added.
|
||||
p._dashes = pen.GetDashes()
|
||||
return p
|
||||
|
||||
|
||||
@@ -1330,7 +1332,7 @@ class GraphicsContext(GraphicsObject):
|
||||
|
||||
def CreatePen(self, pen):
|
||||
"""
|
||||
Create a new pen from a wx.Pen.
|
||||
Create a new pen from a wx.Pen or a wx.GraphicsPenInfo.
|
||||
"""
|
||||
return GraphicsPen.CreateFromPen(pen)
|
||||
|
||||
@@ -1824,6 +1826,10 @@ class GraphicsContext(GraphicsObject):
|
||||
self._context.paint_with_alpha(opacity)
|
||||
|
||||
|
||||
def Flush(self):
|
||||
pass
|
||||
|
||||
|
||||
def GetSize(self):
|
||||
return (self._width, self._height)
|
||||
Size = property(GetSize)
|
||||
|
||||
Reference in New Issue
Block a user