update layout choice properly (bug 975)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6563 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
John Levon 2003-03-24 02:31:44 +00:00
parent 3095e8a7b4
commit a4d63e9e79
3 changed files with 27 additions and 6 deletions

View File

@ -111,7 +111,7 @@ BufferView::Pimpl::Pimpl(BufferView * bv, LyXView * owner,
resizecon = workarea().workAreaResize
.connect(boost::bind(&BufferView::Pimpl::workAreaResize, this));
dispatchcon = workarea().dispatch
.connect(boost::bind(&BufferView::Pimpl::dispatch, this, _1));
.connect(boost::bind(&BufferView::Pimpl::workAreaDispatch, this, _1));
kpresscon = workarea().workAreaKeyPress
.connect(boost::bind(&BufferView::Pimpl::workAreaKeyPress, this, _1, _2));
selectioncon = workarea().selectionRequested
@ -914,6 +914,23 @@ void BufferView::Pimpl::trackChanges()
}
// Doesn't go through lyxfunc, so we need to update the
// layout choice etc. ourselves
bool BufferView::Pimpl::workAreaDispatch(FuncRequest const & ev_in)
{
// e.g. Qt mouse press when no buffer
if (!available())
return false;
bool const res = dispatch(ev_in);
bv_->owner()->updateLayoutChoice();
bv_->fitCursor();
return res;
}
bool BufferView::Pimpl::dispatch(FuncRequest const & ev_in)
{
// Make sure that the cached BufferView is correct.
@ -928,10 +945,6 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev_in)
<< " button[" << ev.button() << ']'
<< endl;
// e.g. Qt mouse press when no buffer
if (!buffer_)
return false;
LyXTextClass const & tclass = buffer_->params.getLyXTextClass();
switch (ev.action) {

View File

@ -102,7 +102,9 @@ struct BufferView::Pimpl : public boost::signals::trackable {
bool insertInset(Inset * inset, string const & lout = string());
///
void updateInset(Inset * inset);
///
/// a function should be executed from the workarea
bool workAreaDispatch(FuncRequest const & ev);
/// a function should be executed
bool dispatch(FuncRequest const & ev);
private:
/// track changes for the document

View File

@ -1,3 +1,9 @@
2003-03-24 John Levon <levon@movementarian.org>
* BufferView_pimpl.h:
* BufferView_pimpl.C: update layout choice on a mouse
press/release
2003-03-23 John Levon <levon@movementarian.org>
* Makefile.am: fix commandtags.h reference