stroke_demo.py
def _handle_paint(self, event):
        """ Draw a line showing the mouse path and add points to the line ends.
        A boundary grid may have been created to draw as well.
        """
        paint_dc = wx.PaintDC(self)
        if len(self.points) > 1:
            paint_dc.SetPen(wx.Pen(wx.Colour(0, 0, 0), 5))
            paint_dc.DrawLines(self.points)
            paint_dc.SetPen(wx.Pen(wx.Colour(255, 255, 255), 1))
            paint_dc.DrawPointList(self.points)
        grid = self.stroke.get_debug_grid()
        if grid:
            paint_dc.SetPen(wx.Pen(wx.Colour(255, 0, 0), 1))
            paint_dc.SetBrush(wx.Brush(wx.Colour(0, 0, 0), wx.BRUSHSTYLE_TRANSPARENT))
            for index, (cord_1, cord_2, cord_3, cord_4) in enumerate(grid):
                if index == 4:
                    paint_dc.DrawEllipse(int(cord_1), int(cord_2), int(cord_3), int(cord_4))
                else:
                    paint_dc.DrawLine(int(cord_1), int(cord_2), int(cord_3), int(cord_4))
        event.Skip()
 Draw a line showing the mouse path and add points to the line ends.
        A boundary grid may have been created to draw as well.
        
Draw a line showing the mouse path and add points to the line ends.
A boundary grid may have been created to draw as well.
Draw a line showing the mouse path and add points to the line ends . A boundary grid may have been created to draw as well .
def _handle_paint(self, event):
        paint_dc = wx.PaintDC(self)
        if len(self.points) > 1:
            paint_dc.SetPen(wx.Pen(wx.Colour(0, 0, 0), 5))
            paint_dc.DrawLines(self.points)
            paint_dc.SetPen(wx.Pen(wx.Colour(255, 255, 255), 1))
            paint_dc.DrawPointList(self.points)
        grid = self.stroke.get_debug_grid()
        if grid:
            paint_dc.SetPen(wx.Pen(wx.Colour(255, 0, 0), 1))
            paint_dc.SetBrush(wx.Brush(wx.Colour(0, 0, 0), wx.BRUSHSTYLE_TRANSPARENT))
            for index, (cord_1, cord_2, cord_3, cord_4) in enumerate(grid):
                if index == 4:
                    paint_dc.DrawEllipse(int(cord_1), int(cord_2), int(cord_3), int(cord_4))
                else:
                    paint_dc.DrawLine(int(cord_1), int(cord_2), int(cord_3), int(cord_4))
        event.Skip()
def _handle_paint ( self , event ) : paint_dc = wx . PaintDC ( self ) if len ( self . points ) > 1 : paint_dc . SetPen ( wx . Pen ( wx . Colour ( 0 , 0 , 0 ) , 5 ) ) paint_dc . DrawLines ( self . points ) paint_dc . SetPen ( wx . Pen ( wx . Colour ( 255 , 255 , 255 ) , 1 ) ) paint_dc . DrawPointList ( self . points ) grid = self . stroke . get_debug_grid ( ) if grid : paint_dc . SetPen ( wx . Pen ( wx . Colour ( 255 , 0 , 0 ) , 1 ) ) paint_dc . SetBrush ( wx . Brush ( wx . Colour ( 0 , 0 , 0 ) , wx . BRUSHSTYLE_TRANSPARENT ) ) for index , ( cord_1 , cord_2 , cord_3 , cord_4 ) in enumerate ( grid ) : if index == 4 : paint_dc . DrawEllipse ( int ( cord_1 ) , int ( cord_2 ) , int ( cord_3 ) , int ( cord_4 ) ) else : paint_dc . DrawLine ( int ( cord_1 ) , int ( cord_2 ) , int ( cord_3 ) , int ( cord_4 ) ) event . Skip ( )
Draw a line showing the mouse path and add points to the line ends.
Draw a line showing the mouse path and add points to the line ends .
""" Draw a line showing the mouse path and add points to the line ends.
        A boundary grid may have been created to draw as well.
        """
self
event