re-enable bits of selection

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8407 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2004-02-06 11:12:49 +00:00
parent 9270b36fb4
commit 93adf5d595
8 changed files with 28 additions and 3 deletions

View File

@ -975,7 +975,7 @@ bool BufferView::Pimpl::workAreaDispatch(FuncRequest const & cmd0)
bool BufferView::Pimpl::dispatch(FuncRequest const & cmd) bool BufferView::Pimpl::dispatch(FuncRequest const & cmd)
{ {
lyxerr << "*** BufferView::Pimpl: request: " << cmd << std::endl; //lyxerr << "*** BufferView::Pimpl: request: " << cmd << std::endl;
// Make sure that the cached BufferView is correct. // Make sure that the cached BufferView is correct.
lyxerr[Debug::ACTION] << "BufferView::Pimpl::Dispatch:" lyxerr[Debug::ACTION] << "BufferView::Pimpl::Dispatch:"
<< " action[" << cmd.action << ']' << " action[" << cmd.action << ']'

View File

@ -183,6 +183,12 @@ void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const
} }
void InsetCollapsable::drawSelection(PainterInfo & pi, int x, int y) const
{
inset.drawSelection(pi, x, y);
}
InsetOld::EDITABLE InsetCollapsable::editable() const InsetOld::EDITABLE InsetCollapsable::editable() const
{ {
return status_ != Collapsed ? HIGHLY_EDITABLE : IS_EDITABLE; return status_ != Collapsed ? HIGHLY_EDITABLE : IS_EDITABLE;

View File

@ -53,6 +53,8 @@ public:
/// ///
void draw(PainterInfo & pi, int x, int y) const; void draw(PainterInfo & pi, int x, int y) const;
/// ///
void drawSelection(PainterInfo & pi, int x, int y) const;
///
bool hitButton(FuncRequest const &) const; bool hitButton(FuncRequest const &) const;
/// ///
std::string const getNewLabel(std::string const & l) const; std::string const getNewLabel(std::string const & l) const;

View File

@ -213,6 +213,12 @@ void InsetText::draw(PainterInfo & pi, int x, int y) const
} }
void InsetText::drawSelection(PainterInfo & pi, int x, int y) const
{
text_.drawSelection(pi, x, y);
}
void InsetText::drawFrame(Painter & pain, int x) const void InsetText::drawFrame(Painter & pain, int x) const
{ {
int const ttoD2 = TEXT_TO_INSET_OFFSET / 2; int const ttoD2 = TEXT_TO_INSET_OFFSET / 2;

View File

@ -67,6 +67,8 @@ public:
void metrics(MetricsInfo & mi, Dimension & dim) const; void metrics(MetricsInfo & mi, Dimension & dim) const;
/// ///
void draw(PainterInfo & pi, int x, int y) const; void draw(PainterInfo & pi, int x, int y) const;
/// draw inset selection
void drawSelection(PainterInfo & pi, int x, int y) const;
/// ///
std::string const editMessage() const; std::string const editMessage() const;
/// ///

View File

@ -121,6 +121,8 @@ public:
void metrics(MetricsInfo & mi, Dimension & dim); void metrics(MetricsInfo & mi, Dimension & dim);
/// draw text (only used for insets) /// draw text (only used for insets)
void draw(PainterInfo & pi, int x, int y) const; void draw(PainterInfo & pi, int x, int y) const;
/// draw textselection
void drawSelection(PainterInfo & pi, int x, int y) const;
/// try to handle that request /// try to handle that request
DispatchResult dispatch(LCursor & cur, FuncRequest const & cmd); DispatchResult dispatch(LCursor & cur, FuncRequest const & cmd);

View File

@ -137,8 +137,8 @@ RowPainter::RowPainter(BufferView const & bv, LyXText const & text,
// paint the selection background // paint the selection background
#warning look here for selection #warning look here for selection
//if (bv_.cursor().selection() && &text_ == bv_.cursor().innerText()) if (bv_.cursor().selection() && &text_ == bv_.cursor().innerText())
// paintSelection(); paintSelection();
// vertical lines for appendix // vertical lines for appendix
paintAppendix(); paintAppendix();

View File

@ -1626,6 +1626,13 @@ void LyXText::draw(PainterInfo & pi, int x, int y) const
} }
// only used for inset right now. should also be used for main text
void LyXText::drawSelection(PainterInfo & pi, int x, int y) const
{
lyxerr << "LyXText::drawSelection at " << x << " " << y << endl;
}
bool LyXText::isLastRow(ParagraphList::iterator pit, Row const & row) const bool LyXText::isLastRow(ParagraphList::iterator pit, Row const & row) const
{ {
return row.endpos() >= pit->size() return row.endpos() >= pit->size()