diff -r 1b1472e76f07 -r 26baa0ae9fd7 editors/TextViewer.py --- a/editors/TextViewer.py Mon May 13 14:36:54 2013 +0200 +++ b/editors/TextViewer.py Mon May 13 16:38:53 2013 +0200 @@ -141,6 +141,7 @@ self.Bind(wx.stc.EVT_STC_STYLENEEDED, self.OnStyleNeeded, id=ID_TEXTVIEWERTEXTCTRL) self.Editor.Bind(wx.stc.EVT_STC_MARGINCLICK, self.OnMarginClick) + self.Editor.Bind(wx.stc.EVT_STC_UPDATEUI, self.OnUpdateUI) self.Editor.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown) if self.Controler is not None: self.Editor.Bind(wx.EVT_KILL_FOCUS, self.OnKillFocus) @@ -714,7 +715,12 @@ if self.Editor.GetFoldLevel(line) & wx.stc.STC_FOLDLEVELHEADERFLAG: self.Editor.ToggleFold(line) event.Skip() - + + def OnUpdateUI(self, event): + if self.ParentWindow: + self.ParentWindow.SetCopyBuffer(self.Editor.GetSelectedText(), True) + event.Skip() + def Cut(self): self.ResetBuffer() self.DisableEvents = True @@ -725,6 +731,8 @@ def Copy(self): self.Editor.CmdKeyExecute(wx.stc.STC_CMD_COPY) + if self.ParentWindow: + self.ParentWindow.RefreshEditMenu() def Paste(self): self.ResetBuffer()