def __drawNote(self,note,xpos,dc,colour): penColour=colour brushColour=colour ypos = self.origin[1]+(8-(int(note)-1))*self.noteRadius if int(note)>4: self.circles.append(stavecircle(xpos,ypos,self.noteRadius,colour=brushColour)) self.lines.append(staveline((xpos-self.noteRadius),ypos,(xpos-self.noteRadius),ypos+self.tailLength,colour=penColour,penWidth=self.lineWidth)) else: self.circles.append(stavecircle(xpos,ypos,self.noteRadius,colour=brushColour)) self.lines.append(staveline((xpos+self.noteRadius)-1,ypos,(xpos+self.noteRadius)-1,ypos-self.tailLength,colour=penColour,penWidth=self.lineWidth)) if self.showNumbers: pts,weight=fonts.setStaffNumbersFont(dc) y=self.origin[1]-dc.GetTextExtent(note)[1] x=self.xpos-1.3*self.noteRadius self.numbers.append(stavenumber(note,x,y,colour=colour)) fonts.resetFont(dc,pts,weight)
def scrolldraw(self,dc,xOffset=0,yOffset=0,xRange=(-10000,10000),yRange=(-10000,10000)): drawutils.setPenColour(dc,self.lineColour) drawutils.setPenWidth(dc,1) for stave in self.staves: for item in stave.lines: item.setXOffset(xOffset) item.setYOffset(yOffset) if xRange: item.setXRange(xRange) item.m_draw(dc) drawutils.setBrushColour(dc,self.noteColour) drawutils.setPenColour(dc,self.noteColour) for stave in self.staves: for item in stave.circles: item.setXOffset(xOffset) item.setYOffset(yOffset) if xRange: item.setXRange(xRange) item.m_draw(dc) for stave in self.staves: for item in stave.text: item.setXOffset(xOffset) item.setYOffset(yOffset) if xRange: item.setXRange(xRange) item.m_draw(dc) pts,weight=fonts.setStaffNumbersFont(dc) for stave in self.staves: for item in stave.numbers: item.setXOffset(xOffset) item.setYOffset(yOffset) if xRange: item.setXRange(xRange) item.m_draw(dc) fonts.resetFont(dc,pts,weight)
def draw(self,dc): pts,weight=fonts.setStaffNumbersFont(dc) dc.SetTextForeground(self.colour) if self.__inXRange() and self.__inYRange(): dc.DrawText(self.text,self.x,self.y) fonts.resetFont(dc,pts,weight)