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
This commit is contained in:
Bo Peng 2008-06-06 03:25:36 +00:00
parent 95a5be2891
commit f5101ebec8
3 changed files with 8 additions and 8 deletions

View File

@ -353,7 +353,7 @@ Menuset
#
Menu "context-info"
Item "Settings...|S" "inset-settings"
Item "Settings...|S" "inset-settings info"
End
End

View 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;

View 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;
}
}