graphics/GraphicCommons.py
changeset 386 2049a2bd8017
parent 384 ed27a676d5c9
child 395 d432eae889ed
equal deleted inserted replaced
385:373635372b93 386:2049a2bd8017
  2775                 else:
  2775                 else:
  2776                     test = linetext + " " + word
  2776                     test = linetext + " " + word
  2777                 wordwidth, wordheight = dc.GetTextExtent(test)
  2777                 wordwidth, wordheight = dc.GetTextExtent(test)
  2778                 if y + wordheight > self.Pos.y + self.Size[1] - 10:
  2778                 if y + wordheight > self.Pos.y + self.Size[1] - 10:
  2779                     break
  2779                     break
  2780                 if wordwidth < self.Size[0] - 20 and i < len(words) - 1:
  2780                 if wordwidth < self.Size[0] - 20:
  2781                     linetext = test
  2781                     if i < len(words) - 1:
  2782                     first = False
  2782                         linetext = test
       
  2783                         first = False
       
  2784                     else:
       
  2785                         dc.DrawText(test, self.Pos.x + 10, y)
       
  2786                         y += wordheight + 5
  2783                 else:
  2787                 else:
  2784                     if wordwidth < self.Size[0] - 20 and i == len(words) - 1:
  2788                     dc.DrawText(linetext, self.Pos.x + 10, y)
  2785                         dc.DrawText(test, self.Pos.x + 10, y)
  2789                     if i == len(words) - 1:
       
  2790                         y += wordheight + 5
       
  2791                         if y + wordheight > self.Pos.y + self.Size[1] - 10:
       
  2792                             break
       
  2793                         dc.DrawText(word, self.Pos.x + 10, y)
  2786                     else:
  2794                     else:
  2787                         dc.DrawText(linetext, self.Pos.x + 10, y)
  2795                         linetext = word
  2788                         if i == len(words) - 1:
       
  2789                             y += wordheight + 5
       
  2790                             if y + wordheight > self.Pos.y + self.Size[1] - 10:
       
  2791                                 break
       
  2792                             dc.DrawText(word, self.Pos.x + 10, y)
       
  2793                         else:
       
  2794                             linetext = word
       
  2795                     y += wordheight + 5
  2796                     y += wordheight + 5
  2796             if y + wordheight > self.Pos.y + self.Size[1] - 10:
  2797             if y + wordheight > self.Pos.y + self.Size[1] - 10:
  2797                 break
  2798                 break
  2798 
  2799