]> git.lyx.org Git - features.git/commitdiff
InsetInfo: allow select and copy of text inside InsetInfo, trigger the info dialog...
authorBo Peng <bpeng@lyx.org>
Fri, 6 Jun 2008 03:25:36 +0000 (03:25 +0000)
committerBo Peng <bpeng@lyx.org>
Fri, 6 Jun 2008 03:25:36 +0000 (03:25 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25151 a592a061-630c-0410-9148-cb99ea01b6c8

lib/ui/stdcontext.inc
src/BufferView.cpp
src/insets/InsetInfo.cpp

index 784a3a7d7d7472da51762974bdbf0c0f6902a2d8..d9a74d2bef4f66265b690403ba9ff7f135b0353d 100644 (file)
@@ -353,7 +353,7 @@ Menuset
 #
 
        Menu "context-info"
-               Item "Settings...|S" "inset-settings"
+               Item "Settings...|S" "inset-settings info"
        End
 
 End
index 4ae5627279a8b6da6b4b837d623f0e9931cbee2b..4d0a1caad2ccb1d910f9872b0756676786cbf765 100644 (file)
@@ -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;
index 98b3a6167b727abfbaba15f2c512da3e6b840c04..1853291ff6a5a829f54a7a26b8de2a7f1b5bfaa6 100644 (file)
@@ -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;
        }
 }