From f5101ebec873f8e62a8d50e4a388565101486f00 Mon Sep 17 00:00:00 2001 From: Bo Peng Date: Fri, 6 Jun 2008 03:25:36 +0000 Subject: [PATCH] InsetInfo: allow select and copy of text inside InsetInfo, trigger the info dialog correctly git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25151 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/ui/stdcontext.inc | 2 +- src/BufferView.cpp | 1 - src/insets/InsetInfo.cpp | 13 +++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/ui/stdcontext.inc b/lib/ui/stdcontext.inc index 784a3a7d7d..d9a74d2bef 100644 --- a/lib/ui/stdcontext.inc +++ b/lib/ui/stdcontext.inc @@ -353,7 +353,7 @@ Menuset # Menu "context-info" - Item "Settings...|S" "inset-settings" + Item "Settings...|S" "inset-settings info" End End diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 4ae5627279..4d0a1caad2 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -953,7 +953,6 @@ FuncStatus BufferView::getStatus(FuncRequest const & cmd) case BRANCH_CODE: case BOX_CODE: case LISTINGS_CODE: - case INFO_CODE: enable = (cmd.argument().empty() || cmd.getArg(0) == insetName(next_code)); break; diff --git a/src/insets/InsetInfo.cpp b/src/insets/InsetInfo.cpp index 98b3a6167b..1853291ff6 100644 --- a/src/insets/InsetInfo.cpp +++ b/src/insets/InsetInfo.cpp @@ -56,9 +56,10 @@ InsetInfo::InsetInfo(Buffer const & buf, string const & name) } -Inset * InsetInfo::editXY(Cursor &, int, int) +Inset * InsetInfo::editXY(Cursor & cur, int x, int y) { - return this; + cur.push(*this); + return InsetText::editXY(cur, x, y); } @@ -168,19 +169,19 @@ bool InsetInfo::getStatus(Cursor & cur, FuncRequest const & cmd, void InsetInfo::doDispatch(Cursor & cur, FuncRequest & cmd) { - // FIXME: we should allow selection, copy etc... + // allow selection, copy but not cut, delete etc switch (cmd.action) { case LFUN_MOUSE_PRESS: case LFUN_MOUSE_RELEASE: case LFUN_MOUSE_MOTION: case LFUN_MOUSE_DOUBLE: case LFUN_MOUSE_TRIPLE: - // do not dispatch to InsetText - cur.dispatched(); + case LFUN_COPY: + case LFUN_INSET_SETTINGS: + InsetText::doDispatch(cur, cmd); break; default: - InsetText::doDispatch(cur, cmd); break; } }