mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-07-21 12:41:10 +02:00
Fix even more Python 3.10 issues with wx.lib classes
This commit is contained in:
@@ -3735,7 +3735,7 @@ class FNBRendererRibbonTabs(FNBRenderer):
|
||||
if pageTextColour is not None:
|
||||
dc.SetTextForeground(pageTextColour)
|
||||
|
||||
dc.DrawText(pc.GetPageText(tabIdx), posx + textOffset, imageYCoord)
|
||||
dc.DrawText(pc.GetPageText(tabIdx), posx + textOffset, int(imageYCoord))
|
||||
|
||||
# draw 'x' on tab (if enabled)
|
||||
if pc.HasAGWFlag(FNB_X_ON_TAB) and tabIdx == pc.GetSelection():
|
||||
|
@@ -1014,7 +1014,7 @@ class CaptionBar(wx.Window):
|
||||
rf, gf, bf = 0, 0, 0
|
||||
|
||||
for y in range(rect.y, rect.y + rect.height):
|
||||
currCol = (r1 + rf, g1 + gf, b1 + bf)
|
||||
currCol = (int(r1 + rf), int(g1 + gf), int(b1 + bf))
|
||||
|
||||
dc.SetBrush(wx.Brush(currCol, wx.BRUSHSTYLE_SOLID))
|
||||
dc.DrawRectangle(rect.x, rect.y + (y - rect.y), rect.width, rect.height)
|
||||
|
@@ -675,7 +675,7 @@ class KnobCtrl(BufferedWindow):
|
||||
dc.SetBrush(wx.TRANSPARENT_BRUSH)
|
||||
|
||||
for ii in range(0, maxsize, 2):
|
||||
currCol = (r1 + rf, g1 + gf, b1 + bf)
|
||||
currCol = (int(r1 + rf), int(g1 + gf), int(b1 + bf))
|
||||
dc.SetPen(wx.Pen(currCol, 2))
|
||||
dc.DrawLine(0, ii+2, ii+2, 0)
|
||||
rf = rf + rstep
|
||||
@@ -683,7 +683,7 @@ class KnobCtrl(BufferedWindow):
|
||||
bf = bf + bstep
|
||||
|
||||
for ii in range(0, maxsize, 2):
|
||||
currCol = (r1 + rf, g1 + gf, b1 + bf)
|
||||
currCol = (int(r1 + rf), int(g1 + gf), int(b1 + bf))
|
||||
dc.SetPen(wx.Pen(currCol, 2))
|
||||
dc.DrawLine(ii+2, maxsize, maxsize, ii+2)
|
||||
rf = rf + rstep
|
||||
@@ -763,9 +763,9 @@ class KnobCtrl(BufferedWindow):
|
||||
pt2 = wx.Point(int(cx+r*math.sqrt(2)/2.0), int(cy-r*math.sqrt(2)/2.0))
|
||||
|
||||
dc.SetPen(p2)
|
||||
dc.DrawArc(pt1, pt2, (cx, cy))
|
||||
dc.DrawArc(pt1, pt2, (int(cx), int(cy)))
|
||||
dc.SetPen(p1)
|
||||
dc.DrawArc(pt2, pt1, (cx, cy))
|
||||
dc.DrawArc(pt2, pt1, (int(cx), int(cy)))
|
||||
|
||||
|
||||
def DrawBoundingCircle(self, dc, size):
|
||||
|
@@ -1306,9 +1306,9 @@ class RibbonMSWArtProvider(object):
|
||||
background.height -= 2
|
||||
|
||||
if style & RIBBON_SCROLL_BTN_UP:
|
||||
background.height /= 2
|
||||
background.height //= 2
|
||||
else:
|
||||
background.height /= 5
|
||||
background.height //= 5
|
||||
|
||||
dc.GradientFillLinear(background, self._page_background_top_colour,
|
||||
self._page_background_top_gradient_colour, wx.SOUTH)
|
||||
@@ -1363,28 +1363,28 @@ class RibbonMSWArtProvider(object):
|
||||
result = style & RIBBON_SCROLL_BTN_DIRECTION_MASK
|
||||
|
||||
if result == RIBBON_SCROLL_BTN_LEFT:
|
||||
arrow_points[0] = wx.Point(rect.width / 2 - 2, rect.height / 2)
|
||||
arrow_points[0] = wx.Point(rect.width // 2 - 2, rect.height // 2)
|
||||
if style & RIBBON_SCROLL_BTN_ACTIVE:
|
||||
arrow_points[0].y += 1
|
||||
arrow_points[1] = arrow_points[0] + wx.Point(3, -3)
|
||||
arrow_points[2] = arrow_points[0] + wx.Point(3, 3)
|
||||
|
||||
elif result == RIBBON_SCROLL_BTN_RIGHT:
|
||||
arrow_points[0] = wx.Point(rect.width / 2 + 2, rect.height / 2)
|
||||
arrow_points[0] = wx.Point(rect.width // 2 + 2, rect.height // 2)
|
||||
if style & RIBBON_SCROLL_BTN_ACTIVE:
|
||||
arrow_points[0].y += 1
|
||||
arrow_points[1] = arrow_points[0] - wx.Point(3, 3)
|
||||
arrow_points[2] = arrow_points[0] - wx.Point(3, -3)
|
||||
|
||||
elif result == RIBBON_SCROLL_BTN_UP:
|
||||
arrow_points[0] = wx.Point(rect.width / 2, rect.height / 2 - 2)
|
||||
arrow_points[0] = wx.Point(rect.width // 2, rect.height // 2 - 2)
|
||||
if style & RIBBON_SCROLL_BTN_ACTIVE:
|
||||
arrow_points[0].y += 1
|
||||
arrow_points[1] = arrow_points[0] + wx.Point( 3, 3)
|
||||
arrow_points[2] = arrow_points[0] + wx.Point(-3, 3)
|
||||
|
||||
elif result == RIBBON_SCROLL_BTN_DOWN:
|
||||
arrow_points[0] = wx.Point(rect.width / 2, rect.height / 2 + 2)
|
||||
arrow_points[0] = wx.Point(rect.width // 2, rect.height // 2 + 2)
|
||||
if style & RIBBON_SCROLL_BTN_ACTIVE:
|
||||
arrow_points[0].y += 1
|
||||
arrow_points[1] = arrow_points[0] - wx.Point( 3, 3)
|
||||
|
@@ -491,7 +491,7 @@ class CalDraw:
|
||||
|
||||
tw, th = DC.GetTextExtent(month)
|
||||
adjust = self.cx_st + (self.sizew - tw) / 2
|
||||
DC.DrawText(month, adjust, self.cy_st + th)
|
||||
DC.DrawText(month, int(adjust), self.cy_st + th)
|
||||
|
||||
year = str(self.year)
|
||||
tw, th = DC.GetTextExtent(year)
|
||||
@@ -602,7 +602,7 @@ class CalDraw:
|
||||
|
||||
DC.SetPen(pen)
|
||||
|
||||
point = (x + diffx, y + diffy)
|
||||
point = (int(x + diffx), int(y + diffy))
|
||||
DC.DrawText(day, point)
|
||||
cnt_x = cnt_x + 1
|
||||
|
||||
@@ -679,7 +679,7 @@ class CalDraw:
|
||||
|
||||
adj_v = adj_v + self.num_indent_vert
|
||||
|
||||
DC.DrawText(text, (x + adj_h, y + adj_v))
|
||||
DC.DrawText(text, (int(x + adj_h), int(y + adj_v)))
|
||||
|
||||
def DrawDayText(self, DC, key):
|
||||
"""
|
||||
@@ -1518,7 +1518,7 @@ class CalenDlg(wx.Dialog):
|
||||
|
||||
# alternate spin button to control the month
|
||||
h = self.m_date.GetSize().height
|
||||
self.m_spin = wx.SpinButton(self, -1, (115, 20), (h * 1.5, h), wx.SP_VERTICAL)
|
||||
self.m_spin = wx.SpinButton(self, -1, (115, 20), (int(h * 1.5), h), wx.SP_VERTICAL)
|
||||
self.m_spin.SetRange(1, 12)
|
||||
self.m_spin.SetValue(date.month)
|
||||
self.Bind(wx.EVT_SPIN, self.OnMonthSpin, self.m_spin)
|
||||
@@ -1527,7 +1527,7 @@ class CalenDlg(wx.Dialog):
|
||||
self.y_date = wx.TextCtrl(self, -1, str(date.year), (160, 20), (60, -1))
|
||||
h = self.y_date.GetSize().height
|
||||
|
||||
self.y_spin = wx.SpinButton(self, -1, (225, 20), (h * 1.5, h), wx.SP_VERTICAL)
|
||||
self.y_spin = wx.SpinButton(self, -1, (225, 20), (int(h * 1.5), h), wx.SP_VERTICAL)
|
||||
self.y_spin.SetRange(date.year-100, date.year+100)
|
||||
self.y_spin.SetValue(date.year)
|
||||
|
||||
|
Reference in New Issue
Block a user