}
-void BufferView::toggleSelection(bool b)
-{
- pimpl_->toggleSelection(b);
-}
-
-
void BufferView::center()
{
pimpl_->center();
beforeChange(text);
text->selection.cursor = cur;
text->selectSelectedWord();
- toggleSelection(false);
update();
}
LyXText * tt = getLyXText();
- // clear the selection (if there is any)
- toggleSelection(false);
-
- // clear the selection (if there is any)
- toggleSelection(false);
tt->replaceSelectionWithString(replacestring);
-
tt->setSelectionRange(replacestring.length());
// Go back so that replacement string is also spellchecked
/// FIXME
bool fitLockedInsetCursor(int x, int y, int asc, int desc);
- /// FIXME
- void toggleSelection(bool = true);
/// hide the cursor if it is visible
void hideCursor();
{
if (available()) {
screen().hideCursor();
- toggleSelection();
bv_->getLyXText()->clearSelection();
bv_->text->xsel_cache.set(false);
}
if (!bv_->buffer()->params.tracking_changes)
return Change(Change::UNCHANGED);
- LyXText * t(bv_->getLyXText());
+ LyXText * text = bv_->getLyXText();
- if (!t->selection.set())
+ if (!text->selection.set())
return Change(Change::UNCHANGED);
- LyXCursor const & cur(t->selection.start);
+ LyXCursor const & cur = text->selection.start;
return cur.par()->lookupChangeFull(cur.pos());
}
void BufferView::Pimpl::beforeChange(LyXText * text)
{
- toggleSelection();
text->clearSelection();
}
}
-void BufferView::Pimpl::toggleSelection(bool b)
-{
- screen().toggleSelection(bv_->text, bv_, b);
-}
-
-
void BufferView::Pimpl::center()
{
LyXText * t = bv_->text;
///
void insetUnlock();
///
- void toggleSelection(bool = true);
- ///
void center();
///
bool insertInset(InsetOld * inset, string const & lout = string());
* text_funcs.C: split LyXText::rowlist_ into individual
Paragraph::rows_ chunks
+ * BufferView.[Ch]:
+ * BufferView_pimpl.[Ch]:
+ * lyxfind.C:
+ * lyxtext.h:
+ * text3.C: remove toggleSelection()
+
2003-08-12 Michael Schmitt <michael.schmitt@teststep.org>
* bufferlist.C: beautify two alerts (shorter text of buttons)
+
+2003-08-15 André Pönitz <poenitz@gmx.net>
+
+ * screen.[Ch]: remove toggle selection
+
2003-08-02 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* Makefile.am (SUBDIRS): use FRONTENDS_SUBDIRS
+
+2003-08-15 André Pönitz <poenitz@gmx.net>
+
+ * ControlErrorList.C:
+ * ControlSpellchecker.C: remove toggleSelection
+
2003-08-12 Michael Schmitt <michael.schmitt@teststep.org>
* ControlGraphics.C: rename "XXX baseline" to "Baseline XXX"
// Now make the selection.
BufferView * const bv = kernel().bufferview();
bv->insetUnlock();
- bv->toggleSelection();
bv->text->clearSelection();
bv->text->setCursor(pit.pit(), err.pos_start);
bv->text->setSelectionRange(range);
- bv->toggleSelection(false);
bv->fitCursor();
bv->update();
}
// clear any old selection
LyXText * text = bufferview()->getLyXText();
- bufferview()->toggleSelection(true);
bufferview()->update();
while (res == SpellBase::OK || res == SpellBase::IGNORE) {
}
-void LyXScreen::toggleSelection(LyXText * text, BufferView * bv,
- bool kill_selection,
- int yo, int xo)
-{
- // only if there is a selection
- if (!text->selection.set())
- return;
-
- int const bottom = min(
- max(int(text->selection.end.y()
- - text->getRow(text->selection.end)->baseline()
- + text->getRow(text->selection.end)->height()),
- text->top_y()),
- int(text->top_y() + workarea().workHeight()));
- int const top = min(
- max(int(text->selection.start.y() -
- text->getRow(text->selection.start)->baseline()),
- text->top_y()),
- int(text->top_y() + workarea().workHeight()));
-
- if (kill_selection)
- text->selection.set(false);
-
- workarea().getPainter().start();
-
- drawFromTo(text, bv, top - text->top_y(), bottom - text->top_y(), yo, xo);
- expose(0, top - text->top_y(), workarea().workWidth(), bottom - top);
-
- workarea().getPainter().end();
-}
-
-
void LyXScreen::redraw(BufferView & bv)
{
greyed_out_ = !bv.text;
/// toggle the cursor's visibility
void toggleCursor(BufferView & bv);
- /// FIXME
- virtual void toggleSelection(LyXText *, BufferView *, bool = true,
- int y_offset = 0, int x_offset = 0);
-
protected:
/// cause the display of the given area of the work area
virtual void expose(int x, int y, int w, int h) = 0;
if (!bv->theLockingInset() ||
((text != bv->text) &&
(text->inset_owner == text->inset_owner->getLockingInset()))) {
- bv->toggleSelection(false);
text->replaceSelectionWithString(replacestr);
text->setSelectionRange(replacestr.length());
++replace_count;
text->cursor = forward ?
text->selection.end : text->selection.start;
- bv->toggleSelection();
text->clearSelection();
SearchResult result = forward ?
if (result == SR_FOUND) {
bv->unlockInset(bv->theLockingInset());
text->setSelectionRange(searchstr.length());
- bv->toggleSelection(false);
} else if (result == SR_NOT_FOUND) {
bv->unlockInset(bv->theLockingInset());
found = false;
text->cursor = forward ?
text->selection.end : text->selection.start;
- bv->toggleSelection();
text->clearSelection();
SearchResult result = forward ?
if (text->selection.set())
text->cursor = text->selection.end;
- bv->toggleSelection();
text->clearSelection();
return nextChange(bv, text, length);
if (text->selection.set())
text->cursor = text->selection.end;
- bv->toggleSelection();
text->clearSelection();
SearchResult result = nextChange(bv, text, length);
if (result == SR_FOUND) {
bv->unlockInset(bv->theLockingInset());
text->setSelectionRange(length);
- bv->toggleSelection(false);
} else if (result == SR_NOT_FOUND) {
bv->unlockInset(bv->theLockingInset());
found = false;
/**
- This class holds the mapping between buffer paragraphs and screen rows.
+ This class used to hold the mapping between buffer paragraphs and
+ screen rows. Nowadays, the Paragraphs take care of their rows
+ themselves and this contains just most of the code for manipulating
+ them and interaction with the Cursor.
*/
// The inheritance from TextCursor should go. It's just there to ease
if (!isInInset() && bv->theLockingInset())
break;
if (cmd.button() == mouse_button::button1) {
- if (!isInInset())
- bv->screen().toggleSelection(this, bv);
cursorHome();
selection.cursor = cursor;
cursorEnd();
setSelection();
- if (!isInInset())
- bv->screen().toggleSelection(this, bv, false);
bv->update();
bv->haveSelection(selection.set());
}
if (!isInInset() && bv->theLockingInset())
break;
if (cmd.button() == mouse_button::button1) {
- if (!isInInset()) {
- bv->screen().toggleSelection(this, bv);
- selectWord(lyx::WHOLE_WORD_STRICT);
- bv->screen().toggleSelection(this, bv, false);
- } else {
- selectWord(lyx::WHOLE_WORD_STRICT);
- }
+ selectWord(lyx::WHOLE_WORD_STRICT);
bv->update();
bv->haveSelection(selection.set());
}
selection_possible = true;
// Clear the selection
- bv->screen().toggleSelection(bv->text, bv);
bv->text->clearSelection();
bv->update();
bv->updateScrollbar();