PR 37 from Metallicow. Pen and Brush style updates

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@75598 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2014-01-11 23:12:13 +00:00
parent 2ef0524e42
commit 0fd7d9313a
7 changed files with 29 additions and 29 deletions

View File

@@ -23,13 +23,13 @@ def OGLInitialize():
global WhiteBackgroundPen, WhiteBackgroundBrush, TransparentPen
global BlackForegroundPen, NormalFont
WhiteBackgroundPen = wx.Pen(wx.WHITE, 1, wx.SOLID)
WhiteBackgroundBrush = wx.Brush(wx.WHITE, wx.SOLID)
WhiteBackgroundPen = wx.Pen(wx.WHITE, 1, wx.PENSTYLE_SOLID)
WhiteBackgroundBrush = wx.Brush(wx.WHITE, wx.BRUSHSTYLE_SOLID)
TransparentPen = wx.Pen(wx.WHITE, 1, wx.TRANSPARENT)
BlackForegroundPen = wx.Pen(wx.BLACK, 1, wx.SOLID)
TransparentPen = wx.Pen(wx.WHITE, 1, wx.PENSTYLE_TRANSPARENT)
BlackForegroundPen = wx.Pen(wx.BLACK, 1, wx.PENSTYLE_SOLID)
NormalFont = wx.Font(10, wx.SWISS, wx.NORMAL, wx.NORMAL)
NormalFont = wx.Font(10, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)
def OGLCleanUp():
@@ -1011,7 +1011,7 @@ class Shape(ShapeEvtHandler):
self.GetCanvas().PrepareDC(dc)
dc.SetLogicalFunction(OGLRBLF)
dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.DOT)
dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.PENSTYLE_DOT)
dc.SetPen(dottedPen)
dc.SetBrush(wx.TRANSPARENT_BRUSH)
@@ -1046,7 +1046,7 @@ class Shape(ShapeEvtHandler):
xx, yy = self._canvas.Snap(xx, yy)
dc.SetLogicalFunction(OGLRBLF)
dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.DOT)
dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.PENSTYLE_DOT)
dc.SetPen(dottedPen)
dc.SetBrush(wx.TRANSPARENT_BRUSH)
@@ -1895,13 +1895,13 @@ class Shape(ShapeEvtHandler):
def GetBackgroundPen(self):
"""Return pen of the right colour for the background."""
if self.GetCanvas():
return wx.Pen(self.GetCanvas().GetBackgroundColour(), 1, wx.SOLID)
return wx.Pen(self.GetCanvas().GetBackgroundColour(), 1, wx.PENSTYLE_SOLID)
return WhiteBackgroundPen
def GetBackgroundBrush(self):
"""Return brush of the right colour for the background."""
if self.GetCanvas():
return wx.Brush(self.GetCanvas().GetBackgroundColour(), wx.SOLID)
return wx.Brush(self.GetCanvas().GetBackgroundColour(), wx.BRUSHSTYLE_SOLID)
return WhiteBackgroundBrush
def GetX(self):
@@ -2090,7 +2090,7 @@ class Shape(ShapeEvtHandler):
dc.SetLogicalFunction(OGLRBLF)
dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.DOT)
dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.PENSTYLE_DOT)
dc.SetPen(dottedPen)
dc.SetBrush(wx.TRANSPARENT_BRUSH)
@@ -2195,7 +2195,7 @@ class Shape(ShapeEvtHandler):
pt._controlPointDragStartWidth = bound_x
pt._controlPointDragStartHeight = bound_y
dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.DOT)
dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.PENSTYLE_DOT)
dc.SetPen(dottedPen)
dc.SetBrush(wx.TRANSPARENT_BRUSH)
@@ -2744,7 +2744,7 @@ class PolygonShape(Shape):
dc.SetLogicalFunction(OGLRBLF)
dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.DOT)
dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.PENSTYLE_DOT)
dc.SetPen(dottedPen)
dc.SetBrush(wx.TRANSPARENT_BRUSH)
@@ -2773,7 +2773,7 @@ class PolygonShape(Shape):
if pt._originalDistance == 0:
pt._originalDistance = 0.0001
dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.DOT)
dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.PENSTYLE_DOT)
dc.SetPen(dottedPen)
dc.SetBrush(wx.TRANSPARENT_BRUSH)
@@ -2987,7 +2987,7 @@ class ShapeRegion(object):
self._regionName = ""
self._textColour = "BLACK"
self._penColour = "BLACK"
self._penStyle = wx.SOLID
self._penStyle = wx.PENSTYLE_SOLID
self._actualColourObject = wx.TheColourDatabase.Find("BLACK")
self._actualPenObject = None

View File

@@ -69,7 +69,7 @@ class ShapeCanvas(wx.ScrolledWindow):
dc = wx.PaintDC(self)
self.PrepareDC(dc)
dc.SetBackground(wx.Brush(self.GetBackgroundColour(), wx.SOLID))
dc.SetBackground(wx.Brush(self.GetBackgroundColour(), wx.BRUSHSTYLE_SOLID))
dc.Clear()
if self.GetDiagram():

View File

@@ -397,7 +397,7 @@ class CompositeShape(RectangleShape):
if self._shadowMode != SHADOW_NONE:
if self._shadowBrush:
dc.SetBrush(self._shadowBrush)
dc.SetPen(wx.Pen(wx.WHITE, 1, wx.TRANSPARENT))
dc.SetPen(wx.Pen(wx.WHITE, 1, wx.PENSTYLE_TRANSPARENT))
if self._cornerRadius:
dc.DrawRoundedRectangle(x1 + self._shadowOffsetX, y1 + self._shadowOffsetY, self._width, self._height, self._cornerRadius)
@@ -438,7 +438,7 @@ class CompositeShape(RectangleShape):
self.GetCanvas().PrepareDC(dc)
dc.SetLogicalFunction(OGLRBLF)
dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.DOT)
dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.PENSTYLE_DOT)
dc.SetPen(dottedPen)
dc.SetBrush(wx.TRANSPARENT_BRUSH)
@@ -456,7 +456,7 @@ class CompositeShape(RectangleShape):
#self.Erase(dc)
dc.SetLogicalFunction(OGLRBLF)
dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.DOT)
dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.PENSTYLE_DOT)
dc.SetPen(dottedPen)
dc.SetBrush(wx.TRANSPARENT_BRUSH)
self._canvas.CaptureMouse()

View File

@@ -87,7 +87,7 @@ class Diagram(object):
def DrawOutline(self, dc, x1, y1, x2, y2):
"""Draw an outline rectangle on the current device context."""
dc.SetPen(wx.Pen(wx.Colour(0, 0, 0), 1, wx.DOT))
dc.SetPen(wx.Pen(wx.Colour(0, 0, 0), 1, wx.PENSTYLE_DOT))
dc.SetBrush(wx.TRANSPARENT_BRUSH)
dc.DrawLines([[x1, y1], [x2, y1], [x2, y2], [x1, y2], [x1, y1]])

View File

@@ -31,7 +31,7 @@ class DividedShapeControlPoint(ControlPoint):
self.GetCanvas().PrepareDC(dc)
dc.SetLogicalFunction(OGLRBLF)
dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.DOT)
dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.PENSTYLE_DOT)
dc.SetPen(dottedPen)
dc.SetBrush(wx.TRANSPARENT_BRUSH)
@@ -48,7 +48,7 @@ class DividedShapeControlPoint(ControlPoint):
self.GetCanvas().PrepareDC(dc)
dc.SetLogicalFunction(OGLRBLF)
dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.DOT)
dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.PENSTYLE_DOT)
dc.SetPen(dottedPen)
dc.SetBrush(wx.TRANSPARENT_BRUSH)

View File

@@ -91,7 +91,7 @@ class OpSetGDI(DrawOp):
if self._gdiIndex in self._image._outlineColours:
# Need to construct a brush to match the outline pen's colour
if self._image._outlinePen:
br = wx.Brush(self._image._outlinePen, wx.SOLID)
br = wx.Brush(self._image._outlinePen, wx.BRUSHSTYLE_SOLID)
if br:
dc.SetBrush(br)
elif self._gdiIndex in self._image._fillColours:
@@ -638,7 +638,7 @@ class DrawnShape(RectangleShape):
if self._shadowMode != SHADOW_NONE:
if self._shadowBrush:
self._metafiles[self._currentAngle]._fillBrush = self._shadowBrush
self._metafiles[self._currentAngle]._outlinePen = wx.Pen(wx.WHITE, 1, wx.TRANSPARENT)
self._metafiles[self._currentAngle]._outlinePen = wx.Pen(wx.WHITE, 1, wx.PENSTYLE_TRANSPARENT)
self._metafiles[self._currentAngle].Draw(dc, self._xpos + self._shadowOffsetX, self._ypos + self._shadowOffsetY)
self._metafiles[self._currentAngle]._outlinePen = self._pen

View File

@@ -132,7 +132,7 @@ class LabelShape(RectangleShape):
RectangleShape.__init__(self, w, h)
self._lineShape = parent
self._shapeRegion = region
self.SetPen(wx.Pen(wx.Colour(0, 0, 0), 1, wx.DOT))
self.SetPen(wx.Pen(wx.Colour(0, 0, 0), 1, wx.PENSTYLE_DOT))
def OnDraw(self, dc):
if self._lineShape and not self._lineShape.GetDrawHandles():
@@ -867,7 +867,7 @@ class LineShape(Shape):
old_pen = self._pen
old_brush = self._brush
dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.DOT)
dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.PENSTYLE_DOT)
self.SetPen(dottedPen)
self.SetBrush(wx.TRANSPARENT_BRUSH)
@@ -1027,8 +1027,8 @@ class LineShape(Shape):
# Problem with pen - if not a solid pen, does strange things
# to the arrowhead. So make (get) a new pen that's solid.
if self._pen and self._pen.GetStyle() != wx.SOLID:
solid_pen = wx.Pen(self._pen.GetColour(), 1, wx.SOLID)
if self._pen and self._pen.GetStyle() != wx.PENSTYLE_SOLID:
solid_pen = wx.Pen(self._pen.GetColour(), 1, wx.PENSTYLE_SOLID)
if solid_pen:
dc.SetPen(solid_pen)
@@ -1148,7 +1148,7 @@ class LineShape(Shape):
dc.SetLogicalFunction(OGLRBLF)
dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.DOT)
dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.PENSTYLE_DOT)
dc.SetPen(dottedPen)
dc.SetBrush(wx.TRANSPARENT_BRUSH)
@@ -1199,7 +1199,7 @@ class LineShape(Shape):
old_pen = self.GetPen()
old_brush = self.GetBrush()
dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.DOT)
dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.PENSTYLE_DOT)
self.SetPen(dottedPen)
self.SetBrush(wx.TRANSPARENT_BRUSH)