From: Robin Dunn Date: Thu, 19 May 2005 00:13:43 +0000 (+0000) Subject: Patch from Davide Salomoni that adds an optional point X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/4809f5df5d38a5d8068c7857e295a4ed22b8659c Patch from Davide Salomoni that adds an optional point parameter to LineShape.InsertLineControlPoint allowing one to optionally specify where the new control point has to be drawn. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34157 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/docs/CHANGES.txt b/wxPython/docs/CHANGES.txt index b64dc29e53..47344750b7 100644 --- a/wxPython/docs/CHANGES.txt +++ b/wxPython/docs/CHANGES.txt @@ -91,6 +91,14 @@ while pasting). wx.lib.filebrowsebutton: Bug fix from Chad Netzer for when self.history is None. +wx.ogl: Patch from Davide Salomoni that adds an optional point +parameter to LineShape.InsertLineControlPoint allowing one to +optionally specify where the new control point has to be drawn. + +wxMSW: setting foreground colour for wx.CheckBox now works when using +XP themes. + + 2.6.0.0 diff --git a/wxPython/wx/lib/ogl/_lines.py b/wxPython/wx/lib/ogl/_lines.py index 6b6e4cf59b..1e1d3ab68a 100644 --- a/wxPython/wx/lib/ogl/_lines.py +++ b/wxPython/wx/lib/ogl/_lines.py @@ -298,16 +298,19 @@ class LineShape(Shape): # the middle points to something other than (-999, -999) self._initialised = False - def InsertLineControlPoint(self, dc = None): - """Insert a control point at an arbitrary position.""" + def InsertLineControlPoint(self, dc = None, point = None): + """Insert a control point at an optional given position.""" if dc: self.Erase(dc) - last_point = self._lineControlPoints[-1] - second_last_point = self._lineControlPoints[-2] + if point: + line_x, line_y = point + else: + last_point = self._lineControlPoints[-1] + second_last_point = self._lineControlPoints[-2] - line_x = (last_point[0] + second_last_point[0]) / 2.0 - line_y = (last_point[1] + second_last_point[1]) / 2.0 + line_x = (last_point[0] + second_last_point[0]) / 2.0 + line_y = (last_point[1] + second_last_point[1]) / 2.0 point = wx.RealPoint(line_x, line_y) self._lineControlPoints.insert(len(self._lineControlPoints)-1, point)