diff --git a/wx/lib/ogl/_basic.py b/wx/lib/ogl/_basic.py index cab158cc..60cc64d1 100644 --- a/wx/lib/ogl/_basic.py +++ b/wx/lib/ogl/_basic.py @@ -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 diff --git a/wx/lib/ogl/_canvas.py b/wx/lib/ogl/_canvas.py index b04b69fe..674cf703 100644 --- a/wx/lib/ogl/_canvas.py +++ b/wx/lib/ogl/_canvas.py @@ -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(): diff --git a/wx/lib/ogl/_composit.py b/wx/lib/ogl/_composit.py index f6e698d2..87fa4e9f 100644 --- a/wx/lib/ogl/_composit.py +++ b/wx/lib/ogl/_composit.py @@ -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() diff --git a/wx/lib/ogl/_diagram.py b/wx/lib/ogl/_diagram.py index 345a4648..58430418 100644 --- a/wx/lib/ogl/_diagram.py +++ b/wx/lib/ogl/_diagram.py @@ -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]]) diff --git a/wx/lib/ogl/_divided.py b/wx/lib/ogl/_divided.py index 68b4ad8c..4ac296a4 100644 --- a/wx/lib/ogl/_divided.py +++ b/wx/lib/ogl/_divided.py @@ -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) diff --git a/wx/lib/ogl/_drawn.py b/wx/lib/ogl/_drawn.py index 91df2060..f61eb492 100644 --- a/wx/lib/ogl/_drawn.py +++ b/wx/lib/ogl/_drawn.py @@ -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 diff --git a/wx/lib/ogl/_lines.py b/wx/lib/ogl/_lines.py index 49e68619..79011823 100644 --- a/wx/lib/ogl/_lines.py +++ b/wx/lib/ogl/_lines.py @@ -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)