2656 connection = FBD_Connector(self, values["type"], values["name"], id) |
2656 connection = FBD_Connector(self, values["type"], values["name"], id) |
2657 self.Controler.AddEditedElementConnection(self.TagName, id, values["type"]) |
2657 self.Controler.AddEditedElementConnection(self.TagName, id, values["type"]) |
2658 self.AddNewElement(connection, bbox, wire) |
2658 self.AddNewElement(connection, bbox, wire) |
2659 |
2659 |
2660 def AddNewComment(self, bbox): |
2660 def AddNewComment(self, bbox): |
2661 dialog = wx.TextEntryDialog(self.ParentWindow, |
2661 dialog = CommentEditDialog(self.ParentWindow, |
2662 _("Edit comment"), |
2662 self.GetFont()) |
2663 _("Please enter comment text"), |
|
2664 "", wx.OK | wx.CANCEL | wx.TE_MULTILINE) |
|
2665 dialog.SetClientSize(wx.Size(400, 200)) |
|
2666 if dialog.ShowModal() == wx.ID_OK: |
2663 if dialog.ShowModal() == wx.ID_OK: |
2667 value = dialog.GetValue() |
2664 value = dialog.GetValue() |
2668 id = self.GetNewId() |
2665 id = self.GetNewId() |
2669 comment = Comment(self, value, id) |
2666 comment = Comment(self, value, id) |
2670 comment.SetPosition(bbox.x, bbox.y) |
2667 comment.SetPosition(bbox.x, bbox.y) |
3098 self.RefreshVisibleElements() |
3095 self.RefreshVisibleElements() |
3099 actionblock.Refresh(rect) |
3096 actionblock.Refresh(rect) |
3100 dialog.Destroy() |
3097 dialog.Destroy() |
3101 |
3098 |
3102 def EditCommentContent(self, comment): |
3099 def EditCommentContent(self, comment): |
3103 dialog = wx.TextEntryDialog(self.ParentWindow, |
3100 dialog = CommentEditDialog(self.ParentWindow, |
3104 _("Edit comment"), |
3101 self.GetFont(), |
3105 _("Please enter comment text"), |
3102 comment.GetContent(), |
3106 comment.GetContent(), |
3103 comment.GetSize()) |
3107 wx.OK | wx.CANCEL | wx.TE_MULTILINE) |
|
3108 width, height = comment.GetSize() |
|
3109 dialogSize = wx.Size(max(width + 30, 400), max(height + 60, 200)) |
|
3110 dialog.SetClientSize(dialogSize) |
|
3111 if dialog.ShowModal() == wx.ID_OK: |
3104 if dialog.ShowModal() == wx.ID_OK: |
3112 value = dialog.GetValue() |
3105 value = dialog.GetValue() |
3113 rect = comment.GetRedrawRect(1, 1) |
3106 rect = comment.GetRedrawRect(1, 1) |
3114 comment.SetContent(value) |
3107 comment.SetContent(value) |
3115 comment.SetSize(*self.GetScaledSize(*comment.GetSize())) |
3108 comment.SetSize(*self.GetScaledSize(*comment.GetSize())) |