def EditCommentContent(self, comment):
dialog = wx.TextEntryDialog(self.ParentWindow,
_("Edit comment"),
_("Please enter comment text"),
comment.GetContent(),
wx.OK | wx.CANCEL | wx.TE_MULTILINE)
width, height = comment.GetSize()
dialogSize = wx.Size(max(width + 30, 400), max(height + 60, 200))
dialog.SetClientSize(dialogSize)
if dialog.ShowModal() == wx.ID_OK:
value = dialog.GetValue()
rect = comment.GetRedrawRect(1, 1)
comment.SetContent(value)
comment.SetSize(*self.GetScaledSize(*comment.GetSize()))
rect = rect.Union(comment.GetRedrawRect())
self.RefreshCommentModel(comment)
self.RefreshBuffer()
self.RefreshScrollBars()
self.RefreshVisibleElements()
comment.Refresh(rect)
dialog.Destroy()
# -------------------------------------------------------------------------------
# Model update functions
# -------------------------------------------------------------------------------
评论列表
文章目录