Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Resources/CeciliaPlot.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,9 @@ def draw(self, gc, coord=None):
gc.SetPen(pen)
if coord is None:
if len(self.scaled) >= 2:
gc.StrokeLines([[x[0], x[1]] for x in self.scaled])
gc.StrokeLines([[int(x[0]), int(x[1])] for x in self.scaled])
else:
gc.StrokeLines(coord.tolist()) # draw legend line, not used in Cecilia
gc.StrokeLines([[int(p[0]), int(p[1])] for p in coord.tolist()]) # draw legend line, not used in Cecilia

def getSymExtent(self):
"""Width and Height of Marker"""
Expand Down Expand Up @@ -332,7 +332,7 @@ def _bmp(self, gc, coords, size=1):
last = (0, 0)
for c in coords:
dx, dy = c[0] - last[0], c[1] - last[1]
gc.Translate(dx, dy)
gc.Translate(int(dx), int(dy))
gc.FillPath(path)
last = c
gc.PopState()
Expand All @@ -344,7 +344,7 @@ def _bmpsel(self, gc, coords, size=1):
last = (0, 0)
for c in coords:
dx, dy = c[0] - last[0], c[1] - last[1]
gc.Translate(dx, dy)
gc.Translate(int(dx), int(dy))
gc.DrawPath(path)
last = c
gc.PopState()
Expand Down Expand Up @@ -962,7 +962,7 @@ def _Draw(self, graphics, xAxis=None, yAxis=None, dc=None):
# sets new dc and clears it
dc = wx.BufferedDC(wx.ClientDC(self.canvas), self._Buffer)
dc.Clear()
gc = wx.GraphicsContext_Create(dc)
gc = wx.GraphicsContext.Create(dc)

# set font size for every thing but title and legend
dc.SetFont(self._getFont(self._fontSizeAxis))
Expand Down
10 changes: 5 additions & 5 deletions Resources/Control.py
Original file line number Diff line number Diff line change
Expand Up @@ -1533,7 +1533,7 @@ def OnLeave(self, evt):
def OnPaint(self, evt):
w, h = self.GetSize()
dc = self.dcref(self)
gc = wx.GraphicsContext_Create(dc)
gc = wx.GraphicsContext.Create(dc)

dc.SetBrush(wx.Brush(BACKGROUND_COLOUR, wx.SOLID))
dc.Clear()
Expand Down Expand Up @@ -1592,7 +1592,7 @@ def setOpenSndCtrl(self, str):
def OnPaint(self, evt):
w, h = self.GetSize()
dc = self.dcref(self)
gc = wx.GraphicsContext_Create(dc)
gc = wx.GraphicsContext.Create(dc)

dc.SetBrush(wx.Brush(self.backgroundColour, wx.SOLID))
dc.Clear()
Expand All @@ -1607,11 +1607,11 @@ def OnPaint(self, evt):
if self.orient == wx.VERTICAL:
w2 = (w - self.sliderWidth) / 2
rec = wx.Rect(int(w2), 0, int(self.sliderWidth), h)
brush = gc.CreateLinearGradientBrush(w2, 0, w2 + self.sliderWidth, 0, "#646986", sliderColour)
brush = gc.CreateLinearGradientBrush(int(w2), 0, int(w2 + self.sliderWidth), 0, "#646986", sliderColour)
else:
h2 = self.sliderHeight / 4
rec = wx.Rect(0, int(h2), w, int(self.sliderHeight))
brush = gc.CreateLinearGradientBrush(0, h2, 0, h2 + self.sliderHeight, "#646986", sliderColour)
brush = gc.CreateLinearGradientBrush(0, int(h2), 0, int(h2 + self.sliderHeight), "#646986", sliderColour)
gc.SetBrush(brush)
gc.DrawRoundedRectangle(rec[0], rec[1], rec[2], rec[3], 2)

Expand Down Expand Up @@ -1645,7 +1645,7 @@ def OnPaint(self, evt):
if self.selected:
brush = wx.Brush('#333333', wx.SOLID)
else:
brush = gc.CreateLinearGradientBrush(self.pos - self.knobHalfSize, 0, self.pos + self.knobHalfSize, 0, "#323854", knobColour)
brush = gc.CreateLinearGradientBrush(int(self.pos - self.knobHalfSize), 0, int(self.pos + self.knobHalfSize), 0, "#323854", knobColour)
gc.SetBrush(brush)
gc.DrawRoundedRectangle(rec[0], rec[1], rec[2], rec[3], 3)

Expand Down
2 changes: 1 addition & 1 deletion Resources/Grapher.py
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,7 @@ def createBitmap(self):
maskColour = GRAPHER_BACK_COLOUR
b = wx.EmptyBitmap(w, h)
dc = wx.MemoryDC(b)
gc = wx.GraphicsContext_Create(dc)
gc = wx.GraphicsContext.Create(dc)
dc.SetBrush(wx.Brush(maskColour))
dc.SetPen(wx.Pen(maskColour))
dc.Clear()
Expand Down
20 changes: 10 additions & 10 deletions Resources/Sliders.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def OnLeave(self, evt):
def OnPaint(self, evt):
w, h = self.GetSize()
dc = self.dcref(self)
gc = wx.GraphicsContext_Create(dc)
gc = wx.GraphicsContext.Create(dc)

dc.SetBrush(wx.Brush(BACKGROUND_COLOUR, wx.SOLID))
dc.Clear()
Expand All @@ -148,7 +148,7 @@ def OnPaint(self, evt):
else: playColour = self.playColour
gc.SetPen(wx.Pen(playColour, width=1, style=wx.SOLID))
gc.SetBrush(wx.Brush(playColour, wx.SOLID))
tri = [(14, h / 2), (9, 4), (9, h - 4), (14, h / 2)]
tri = [(14, h // 2), (9, 4), (9, h - 4), (14, h // 2)]
gc.DrawLines(tri)

dc.SetPen(wx.Pen('#333333', width=1, style=wx.SOLID))
Expand All @@ -159,7 +159,7 @@ def OnPaint(self, evt):
else: recColour = self.recColour
gc.SetPen(wx.Pen(recColour, width=1, style=wx.SOLID))
gc.SetBrush(wx.Brush(recColour, wx.SOLID))
gc.DrawEllipse(w / 4 + w / 2 - 4, h / 2 - 4, 8, 8)
gc.DrawEllipse(int(w / 4 + w / 2 - 4), int(h / 2 - 4), 8, 8)

evt.Skip()

Expand Down Expand Up @@ -350,7 +350,7 @@ def createBackgroundBitmap(self):
w, h = self.GetSize()
self.backgroundBitmap = wx.EmptyBitmap(w, h)
dc = wx.MemoryDC(self.backgroundBitmap)
gc = wx.GraphicsContext_Create(dc)
gc = wx.GraphicsContext.Create(dc)

dc.SetBrush(wx.Brush(BACKGROUND_COLOUR, wx.SOLID))
dc.Clear()
Expand All @@ -363,7 +363,7 @@ def createBackgroundBitmap(self):
h2 = self.sliderHeight // 4
rec = wx.Rect(0, h2, w-1, int(self.sliderHeight))
gc.SetPen(wx.Pen(WIDGET_BORDER_COLOUR, width=1))
brush = gc.CreateLinearGradientBrush(0, h2, 0, h2 + self.sliderHeight, GRADIENT_DARK_COLOUR, self.fillcolor)
brush = gc.CreateLinearGradientBrush(0, h2, 0, h2 + int(self.sliderHeight), GRADIENT_DARK_COLOUR, self.fillcolor)
gc.SetBrush(brush)
gc.DrawRoundedRectangle(rec[0], rec[1], rec[2], rec[3], 4)
dc.SelectObject(wx.NullBitmap)
Expand All @@ -372,7 +372,7 @@ def createKnobBitmap(self):
w, h = self.GetSize()
self.knobBitmap = wx.EmptyBitmap(self.knobSize, h)
dc = wx.MemoryDC(self.knobBitmap)
gc = wx.GraphicsContext_Create(dc)
gc = wx.GraphicsContext.Create(dc)

dc.SetBrush(wx.Brush(BACKGROUND_COLOUR, wx.SOLID))
dc.Clear()
Expand All @@ -383,7 +383,7 @@ def createKnobBitmap(self):
dc.SetPen(wx.Pen(BACKGROUND_COLOUR, width=self.borderWidth, style=wx.SOLID))
dc.DrawRectangle(rec)

brush = gc.CreateLinearGradientBrush(0, 0, self.knobSize, 0, GRADIENT_DARK_COLOUR, self.knobcolor)
brush = gc.CreateLinearGradientBrush(0, 0, int(self.knobSize), 0, GRADIENT_DARK_COLOUR, self.knobcolor)
gc.SetPen(wx.Pen(KNOB_BORDER_COLOUR, width=1))
gc.SetBrush(brush)
gc.DrawRoundedRectangle(rec[0], rec[1], rec[2]-1, rec[3]-1, 2)
Expand Down Expand Up @@ -927,7 +927,7 @@ def createBackgroundBitmap(self):
w, h = self.GetSize()
self.backgroundBitmap = wx.EmptyBitmap(w, h)
dc = wx.MemoryDC(self.backgroundBitmap)
gc = wx.GraphicsContext_Create(dc)
gc = wx.GraphicsContext.Create(dc)

dc.SetBrush(wx.Brush(BACKGROUND_COLOUR, wx.SOLID))
dc.Clear()
Expand All @@ -940,7 +940,7 @@ def createBackgroundBitmap(self):
h2 = self.sliderHeight // 4
rec = wx.Rect(0, h2, w-1, int(self.sliderHeight))
gc.SetPen(wx.Pen(WIDGET_BORDER_COLOUR, width=1))
brush = gc.CreateLinearGradientBrush(0, h2, 0, h2 + self.sliderHeight, GRADIENT_DARK_COLOUR, self.fillcolor)
brush = gc.CreateLinearGradientBrush(0, h2, 0, h2 + int(self.sliderHeight), GRADIENT_DARK_COLOUR, self.fillcolor)
gc.SetBrush(brush)
gc.DrawRoundedRectangle(rec[0], rec[1], rec[2], rec[3], 4)
dc.SelectObject(wx.NullBitmap)
Expand Down Expand Up @@ -1481,7 +1481,7 @@ def createKnobMaskBitmap(self):
def setFillColour(self, col1, col2):
self.fillcolor = col1
self.knobcolor = col2
self.handlecolor = wx.Colour(self.knobcolor[0] * 0.25, self.knobcolor[1] * 0.25, self.knobcolor[2] * 0.25)
self.handlecolor = wx.Colour(int(self.knobcolor[0] * 0.25), int(self.knobcolor[1] * 0.25), int(self.knobcolor[2] * 0.25))
self.createSliderBitmap()

def SetRange(self, minvalue, maxvalue):
Expand Down
Loading