diff --git a/wxPython/wxPython/py/editwindow.py b/wxPython/wxPython/py/editwindow.py index 7e7c4bc8fe..cc62b12488 100644 --- a/wxPython/wxPython/py/editwindow.py +++ b/wxPython/wxPython/py/editwindow.py @@ -182,14 +182,18 @@ class EditWindow(stc.StyledTextCtrl): else: self.BraceHighlight(braceAtCaret, braceOpposite) - def CanCut(self): - """Return true if text is selected and can be cut.""" - return self.CanCopy() - def CanCopy(self): - """Return true if text is selected and can be copied.""" + """Return True if text is selected and can be copied.""" return self.GetSelectionStart() != self.GetSelectionEnd() + def CanCut(self): + """Return True if text is selected and can be cut.""" + return self.CanCopy() and self.CanEdit() + def CanEdit(self): - """Return true if editing should succeed.""" - return True + """Return True if editing should succeed.""" + return not self.GetReadOnly() + + def CanPaste(self): + """Return True if pasting should succeed.""" + return stc.StyledTextCtrl.CanPaste(self) and self.CanEdit()