editors/Viewer.py
changeset 2341 210cddfa16cf
parent 2301 5b8a7dd43f9f
child 2344 94045bfa2d94
equal deleted inserted replaced
2302:69fefac5760e 2341:210cddfa16cf
  3715             dc.DrawRectangle(1, 1, width, height)
  3715             dc.DrawRectangle(1, 1, width, height)
  3716         if self.PageSize is not None and not printing:
  3716         if self.PageSize is not None and not printing:
  3717             dc.SetPen(self.PagePen)
  3717             dc.SetPen(self.PagePen)
  3718             xstart, ystart = self.GetViewStart()
  3718             xstart, ystart = self.GetViewStart()
  3719             window_size = self.Editor.GetClientSize()
  3719             window_size = self.Editor.GetClientSize()
  3720             for x in xrange(self.PageSize[0] - (xstart * SCROLLBAR_UNIT) % self.PageSize[0], int(window_size[0] / self.ViewScale[0]), self.PageSize[0]):
  3720             if self.PageSize[0] != 0:
  3721                 dc.DrawLine(xstart * SCROLLBAR_UNIT + x + 1, int(ystart * SCROLLBAR_UNIT / self.ViewScale[0]),
  3721                 for x in xrange(self.PageSize[0] - (xstart * SCROLLBAR_UNIT) % self.PageSize[0], int(window_size[0] / self.ViewScale[0]), self.PageSize[0]):
  3722                             xstart * SCROLLBAR_UNIT + x + 1, int((ystart * SCROLLBAR_UNIT + window_size[1]) / self.ViewScale[0]))
  3722                     dc.DrawLine(xstart * SCROLLBAR_UNIT + x + 1, int(ystart * SCROLLBAR_UNIT / self.ViewScale[0]),
  3723             for y in xrange(self.PageSize[1] - (ystart * SCROLLBAR_UNIT) % self.PageSize[1], int(window_size[1] / self.ViewScale[1]), self.PageSize[1]):
  3723                                 xstart * SCROLLBAR_UNIT + x + 1, int((ystart * SCROLLBAR_UNIT + window_size[1]) / self.ViewScale[0]))
  3724                 dc.DrawLine(int(xstart * SCROLLBAR_UNIT / self.ViewScale[0]), ystart * SCROLLBAR_UNIT + y + 1,
  3724             if self.PageSize[1] != 0:
  3725                             int((xstart * SCROLLBAR_UNIT + window_size[0]) / self.ViewScale[1]), ystart * SCROLLBAR_UNIT + y + 1)
  3725                 for y in xrange(self.PageSize[1] - (ystart * SCROLLBAR_UNIT) % self.PageSize[1], int(window_size[1] / self.ViewScale[1]), self.PageSize[1]):
       
  3726                     dc.DrawLine(int(xstart * SCROLLBAR_UNIT / self.ViewScale[0]), ystart * SCROLLBAR_UNIT + y + 1,
       
  3727                                 int((xstart * SCROLLBAR_UNIT + window_size[0]) / self.ViewScale[1]), ystart * SCROLLBAR_UNIT + y + 1)
  3726 
  3728 
  3727         # Draw all elements
  3729         # Draw all elements
  3728         for comment in self.Comments.itervalues():
  3730         for comment in self.Comments.itervalues():
  3729             if comment != self.SelectedElement and (comment.IsVisible() or printing):
  3731             if comment != self.SelectedElement and (comment.IsVisible() or printing):
  3730                 comment.Draw(dc)
  3732                 comment.Draw(dc)