Viewer.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:beremiz 作者: nucleron 项目源码 文件源码
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
    # -------------------------------------------------------------------------------
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号