editors/Viewer.py
changeset 1660 ccf2bcf66c70
parent 1647 13d15a1ae899
child 1671 0dc834721d8e
equal deleted inserted replaced
1659:aec0ed4b6f39 1660:ccf2bcf66c70
  3014         dialog = wx.TextEntryDialog(self.ParentWindow,
  3014         dialog = wx.TextEntryDialog(self.ParentWindow,
  3015                                     _("Edit comment"),
  3015                                     _("Edit comment"),
  3016                                     _("Please enter comment text"),
  3016                                     _("Please enter comment text"),
  3017                                     comment.GetContent(),
  3017                                     comment.GetContent(),
  3018                                     wx.OK|wx.CANCEL|wx.TE_MULTILINE)
  3018                                     wx.OK|wx.CANCEL|wx.TE_MULTILINE)
  3019         dialog.SetClientSize(wx.Size(400, 200))
  3019         width, height = comment.GetSize()
       
  3020         dialogSize = wx.Size(max(width + 30, 400), max(height + 60, 200))
       
  3021         dialog.SetClientSize(dialogSize)
  3020         if dialog.ShowModal() == wx.ID_OK:
  3022         if dialog.ShowModal() == wx.ID_OK:
  3021             value = dialog.GetValue()
  3023             value = dialog.GetValue()
  3022             rect = comment.GetRedrawRect(1, 1)
  3024             rect = comment.GetRedrawRect(1, 1)
  3023             comment.SetContent(value)
  3025             comment.SetContent(value)
  3024             comment.SetSize(*self.GetScaledSize(*comment.GetSize()))
  3026             comment.SetSize(*self.GetScaledSize(*comment.GetSize()))