mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-07 04:20:07 +01:00
PR 31 from Metallicow. Py3 and Phoenix updates for colourchooser.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@75592 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -44,7 +44,7 @@ class BitmapBuffer(wx.MemoryDC):
|
||||
self.SelectObject(self.bitmap)
|
||||
|
||||
# Initialize the buffer to the background colour
|
||||
self.SetBackground(wx.Brush(self.colour, wx.SOLID))
|
||||
self.SetBackground(wx.Brush(self.colour, wx.BRUSHSTYLE_SOLID))
|
||||
self.Clear()
|
||||
|
||||
# Make each logical unit of the buffer equal to 1 pixel
|
||||
|
||||
@@ -19,6 +19,6 @@ try:
|
||||
gettext.textdomain('pycolourchooser')
|
||||
_ = gettext.gettext
|
||||
except Exception, strerror:
|
||||
print "Warning: Couldn't import translation function: %(str)s" %{ 'str' : strerror }
|
||||
print "Defaulting to En"
|
||||
print("Warning: Couldn't import translation function: %(str)s" %{ 'str' : strerror })
|
||||
print("Defaulting to En")
|
||||
_ = lambda x: x
|
||||
|
||||
@@ -87,6 +87,6 @@ class PyColourSlider(canvas.Canvas):
|
||||
for y_pos in range(0, self.HEIGHT):
|
||||
r,g,b = [c * 255.0 for c in colorsys.hsv_to_rgb(h,s,v)]
|
||||
colour = wx.Colour(int(r), int(g), int(b))
|
||||
self.buffer.SetPen(wx.Pen(colour, 1, wx.SOLID))
|
||||
self.buffer.SetPen(wx.Pen(colour, 1, wx.PENSTYLE_SOLID))
|
||||
self.buffer.DrawRectangle(0, y_pos, 15, 1)
|
||||
v = v - vstep
|
||||
|
||||
@@ -137,8 +137,8 @@ class PyPalette(canvas.Canvas):
|
||||
"""Highlights an area of the palette with a little circle around
|
||||
the coordinate point"""
|
||||
colour = wx.Colour(0, 0, 0)
|
||||
self.buffer.SetPen(wx.Pen(colour, 1, wx.SOLID))
|
||||
self.buffer.SetBrush(wx.Brush(colour, wx.TRANSPARENT))
|
||||
self.buffer.SetPen(wx.Pen(colour, 1, wx.PENSTYLE_SOLID))
|
||||
self.buffer.SetBrush(wx.Brush(colour, wx.BRUSHSTYLE_TRANSPARENT))
|
||||
self.buffer.DrawCircle(x, y, 3)
|
||||
self.Refresh()
|
||||
|
||||
@@ -165,8 +165,8 @@ class PyPalette(canvas.Canvas):
|
||||
hue = float(x) / float(width)
|
||||
r,g,b = colorsys.hsv_to_rgb(hue, saturation, value)
|
||||
colour = wx.Colour(int(r * 255.0), int(g * 255.0), int(b * 255.0))
|
||||
self.buffer.SetPen(wx.Pen(colour, 1, wx.SOLID))
|
||||
self.buffer.SetBrush(wx.Brush(colour, wx.SOLID))
|
||||
self.buffer.SetPen(wx.Pen(colour, 1, wx.PENSTYLE_SOLID))
|
||||
self.buffer.SetBrush(wx.Brush(colour, wx.BRUSHSTYLE_SOLID))
|
||||
self.buffer.DrawRectangle(x, y,
|
||||
self.HORIZONTAL_STEP, self.vertical_step)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user