From 34c34fc02ed936077dc845256f422e5b1035098c Mon Sep 17 00:00:00 2001 From: Alfredo Braunstein Date: Fri, 21 Nov 2003 11:16:37 +0000 Subject: [PATCH] allow extending a double/triple click + whitespace + correct a comment git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8112 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferView_pimpl.C | 2 +- src/ChangeLog | 5 +++++ src/lyxfunc.C | 1 - src/lyxtext.h | 2 +- src/text2.C | 2 +- src/text3.C | 2 ++ 6 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index 4bc6c64f44..72bc9ec154 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -486,7 +486,7 @@ void BufferView::Pimpl::scroll(int lines) // Restrict to a valid value new_top_y = std::min(t->height - 4 * line_height, new_top_y); new_top_y = std::max(0, new_top_y); - + scrollDocView(new_top_y); // Update the scrollbar. diff --git a/src/ChangeLog b/src/ChangeLog index f6c5a45dca..f67591c2f4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2003-11-21 Alfredo Braunstein + + * text3.C (dispatch): make possible to extend a word/row selection + with the mouse + 2003-11-21 Alfredo Braunstein * lyxtext.h: x0_,y0_ -> xo_,yo_ diff --git a/src/lyxfunc.C b/src/lyxfunc.C index 3b85af5b7e..6891eee207 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -1409,7 +1409,6 @@ void LyXFunc::dispatch(FuncRequest const & func, bool verbose) if (view()->available()) { view()->fitCursor(); view()->update(); - view()->cursor().updatePos(); // if we executed a mutating lfun, mark the buffer as dirty if (!getStatus(func).disabled() diff --git a/src/lyxtext.h b/src/lyxtext.h index 06b6aedf1f..743e3537e2 100644 --- a/src/lyxtext.h +++ b/src/lyxtext.h @@ -462,7 +462,7 @@ public: bool checkAndActivateInset(bool front); private: - + /// prohibit this as long as there are back pointers... LyXText(LyXText const &); diff --git a/src/text2.C b/src/text2.C index c9046dfc68..af4e26a4e4 100644 --- a/src/text2.C +++ b/src/text2.C @@ -1563,7 +1563,7 @@ void LyXText::setCursorFromCoordinates(int x, int y) deleteEmptyParagraphMechanism(old_cursor); } -//gets LyXText coordinates +//x,y are coordinates relative to this LyXText void LyXText::setCursorFromCoordinates(LyXCursor & cur, int x, int y) { // Get the row first. diff --git a/src/text3.C b/src/text3.C index cb721b8486..d2507bf6e5 100644 --- a/src/text3.C +++ b/src/text3.C @@ -1203,6 +1203,7 @@ DispatchResult LyXText::dispatch(FuncRequest const & cmd) if (!bv->buffer()) break; if (cmd.button() == mouse_button::button1) { + selection_possible = true; cursorHome(); selection.cursor = cursor; cursorEnd(); @@ -1215,6 +1216,7 @@ DispatchResult LyXText::dispatch(FuncRequest const & cmd) if (!bv->buffer()) break; if (cmd.button() == mouse_button::button1) { + selection_possible = true; selectWord(lyx::WHOLE_WORD_STRICT); bv->haveSelection(selection.set()); }