diff options
author | nyamatongwe <unknown> | 2001-02-16 06:03:40 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2001-02-16 06:03:40 +0000 |
commit | 5cdc4be09639d035363b9bd3a048128fdb1e19c8 (patch) | |
tree | 66d6a16cd84f93c1f623c67071152e83892c73f8 | |
parent | c35c904387314847adcb8f8b07a6901bd148ff19 (diff) | |
download | scintilla-mirror-5cdc4be09639d035363b9bd3a048128fdb1e19c8.tar.gz |
Patch from Mark so context menu items take account of whether is writable.
-rw-r--r-- | src/ScintillaBase.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx index ccb9dcf53..29fad12d0 100644 --- a/src/ScintillaBase.cxx +++ b/src/ScintillaBase.cxx @@ -309,14 +309,15 @@ void ScintillaBase::AutoCompleteCompleted(char fillUp/*='\0'*/) { } void ScintillaBase::ContextMenu(Point pt) { + bool writable = !WndProc(SCI_GETREADONLY, 0, 0); popup.CreatePopUp(); - AddToPopUp("Undo", idcmdUndo, pdoc->CanUndo()); - AddToPopUp("Redo", idcmdRedo, pdoc->CanRedo()); + AddToPopUp("Undo", idcmdUndo, writable && pdoc->CanUndo()); + AddToPopUp("Redo", idcmdRedo, writable && pdoc->CanRedo()); AddToPopUp(""); - AddToPopUp("Cut", idcmdCut, currentPos != anchor); + AddToPopUp("Cut", idcmdCut, writable && currentPos != anchor); AddToPopUp("Copy", idcmdCopy, currentPos != anchor); - AddToPopUp("Paste", idcmdPaste, WndProc(SCI_CANPASTE, 0, 0)); - AddToPopUp("Delete", idcmdDelete, currentPos != anchor); + AddToPopUp("Paste", idcmdPaste, writable && WndProc(SCI_CANPASTE, 0, 0)); + AddToPopUp("Delete", idcmdDelete, writable && currentPos != anchor); AddToPopUp(""); AddToPopUp("Select All", idcmdSelectAll); popup.Show(pt, wMain); |