editors/Viewer.py
changeset 2347 6dca42cd2b2b
parent 2345 a56362c818a3
child 2417 316ee9fff395
--- a/editors/Viewer.py	Wed Sep 26 14:20:51 2018 +0300
+++ b/editors/Viewer.py	Wed Sep 26 18:08:57 2018 +0300
@@ -2658,11 +2658,8 @@
             self.AddNewElement(connection, bbox, wire)
 
     def AddNewComment(self, bbox):
-        dialog = wx.TextEntryDialog(self.ParentWindow,
-                                    _("Edit comment"),
-                                    _("Please enter comment text"),
-                                    "", wx.OK | wx.CANCEL | wx.TE_MULTILINE)
-        dialog.SetClientSize(wx.Size(400, 200))
+        dialog = CommentEditDialog(self.ParentWindow,
+                                   self.GetFont())
         if dialog.ShowModal() == wx.ID_OK:
             value = dialog.GetValue()
             id = self.GetNewId()
@@ -3100,14 +3097,10 @@
         dialog.Destroy()
 
     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)
+        dialog = CommentEditDialog(self.ParentWindow,
+                                   self.GetFont(),
+                                   comment.GetContent(),
+                                   comment.GetSize())
         if dialog.ShowModal() == wx.ID_OK:
             value = dialog.GetValue()
             rect = comment.GetRedrawRect(1, 1)