}
break;
+ case LFUN_OPENSTUFF:
+ {
+ LyXText * lt = bv_->getLyXText();
+ hideCursor();
+ beforeChange(lt);
+ update(lt, BufferView::SELECT|BufferView::FITCUR);
+ lt->openStuff(bv_);
+ update(lt, BufferView::SELECT|BufferView::FITCUR);
+ setState();
+ }
+ break;
+
case LFUN_QUOTE:
bv_->insertCorrectQuote();
break;
+2001-07-10 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+
+ * BufferView_pimpl.C (Dispatch): handle LFUN_OPENSTUFF.
+
+ * text2.C (openStuff): reintroduce this method (which had been
+ nuked in NEW_INSETS frenzy).
+
+ * lyxfunc.C (Dispatch): when an action has not been handled, use
+ its name in the error message, not its number.
+
+ * paragraph.C (inInset): change method name to begin with lowercase.
+
+ * undo_funcs.C:
+ * text2.C: updates because of this.
+
+2001-07-09 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+
+ * ToolbarDefaults.C (add): add spaces in error message
+
2001-07-10 Lars Gullik Bjønnes <larsbj@birdstep.com>
- * buffer.C (readLyXformat2): initailize the ert comp. variables.
+ * buffer.C (readLyXformat2): initialize the ert comp. variables.
(readLyXformat2): rename return_par to first_par, use lyxlex's
pushToken and remove the manual push handling.
(parseSingleLyXformat2Token): add another ert comp. variable:
int const tf = lyxaction.LookupFunc(func);
if (tf == -1) {
- lyxerr << "Toolbar::add: no LyX command called`"
- << func << "'exists!" << endl;
+ lyxerr << "Toolbar::add: no LyX command called `"
+ << func << "' exists!" << endl;
} else {
add(tf);
}
+2001-07-11 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+
+ * insetcollapsable.C (edit): always open collapsed insets (even if
+ they are not autocollapsable)
+
+ * insetcommand.C (operator=): simplify.
+
2001-07-10 Lars Gullik Bjønnes <larsbj@birdstep.com>
* insetert.C (latex): handle META_NEWLINE
{
UpdatableInset::edit(bv, xp, yp, button);
- if (collapsed && autocollapse) {
+ if (collapsed) {
collapsed = false;
if (!bv->lockInset(this))
return;
bv->updateInset(this, false);
inset.edit(bv, 0, 0, button);
- } else if (!collapsed) {
+ } else {
if (!bv->lockInset(this))
return;
inset.edit(bv, xp, yp + (top_baseline - inset.y()), button);
bool InsetCommandParams::operator==(InsetCommandParams const & o) const
{
- if (cmdname == o.cmdname && contents == o.contents && options == o.options) return true;
- return false;
+ return cmdname == o.cmdname && contents == o.contents
+ && options == o.options;
}
// Then if it was none of the above
if (!owner->view()->Dispatch(action, argument))
lyxerr << "A truly unknown func ["
- << action << "]!" << endl;
+ << lyxaction.getActionName(action) << "]!"
+ << endl;
break;
} // end of switch
void getVisibleRow(BufferView *, int y_offset, int x_offset,
Row * row_ptr, int y, bool cleared=false);
+ ///
+ void openStuff(BufferView *);
///
void cutSelection(BufferView *, bool = true);
///
// create a new paragraph
Paragraph * tmp = new Paragraph(this);
// remember to set the inset_owner
- tmp->setInsetOwner(InInset());
+ tmp->setInsetOwner(inInset());
// this is an idea for a more userfriendly layout handling, I will
// see what the users say
}
-Inset * Paragraph::InInset() const
+Inset * Paragraph::inInset() const
{
return pimpl_->inset_owner;
}
proof environment */
int getEndLabel(BufferParams const &) const;
///
- Inset * InInset() const;
+ Inset * inInset() const;
///
void setInsetOwner(Inset * i);
///
}
}
+void LyXText::openStuff(BufferView * bview)
+{
+ if (cursor.pos() == 0 && cursor.par()->bibkey){
+ cursor.par()->bibkey->edit(bview, 0, 0, 0);
+ } else if (cursor.pos() < cursor.par()->size()
+ && cursor.par()->getChar(cursor.pos()) == Paragraph::META_INSET) {
+ Inset * inset = cursor.par()->getInset(cursor.pos());
+ if (!inset->editable())
+ return;
+ bview->owner()->message(inset->editMessage());
+ if (inset->editable() != Inset::HIGHLY_EDITABLE)
+ setCursorParUndo(bview);
+ inset->edit(bview, 0, 0, 0);
+ }
+}
+
/* used in setlayout */
// Asger is not sure we want to do this...
// the caption hack:
if (layout.labeltype == LABEL_SENSITIVE) {
- bool isOK (par->InInset() && par->InInset()->owner() &&
- (par->InInset()->owner()->lyxCode() == Inset::FLOAT_CODE));
+ bool isOK (par->inInset() && par->inInset()->owner() &&
+ (par->inInset()->owner()->lyxCode() == Inset::FLOAT_CODE));
if (isOK) {
- InsetFloat * tmp = static_cast<InsetFloat*>(par->InInset()->owner());
+ InsetFloat * tmp = static_cast<InsetFloat*>(par->inInset()->owner());
Floating const & fl
= floatList.getType(tmp->type());
// We should get the correct number here too.
Paragraph::size_type pos,
bool setfont, bool boundary) const
{
- InsetText * it = static_cast<InsetText *>(par->InInset());
+ InsetText * it = static_cast<InsetText *>(par->inInset());
if (it && (it != inset_owner)) {
it->getLyXText(bview)->setCursorIntern(bview, par, pos, setfont,
boundary);
Paragraph * LyXText::ownerParagraph(int id, Paragraph * p) const
{
Paragraph * op = bv_owner->buffer()->getParFromID(id);
- if (op && op->InInset()) {
- static_cast<InsetText *>(op->InInset())->paragraph(p);
+ if (op && op->inInset()) {
+ static_cast<InsetText *>(op->inInset())->paragraph(p);
} else {
if (inset_owner) {
inset_owner->paragraph(p);
endpar = behind;
tmppar = bv->buffer()->getParFromID(undo->number_of_cursor_par);
- UpdatableInset* it = static_cast<UpdatableInset*>(tmppar3->InInset());
+ UpdatableInset* it = static_cast<UpdatableInset*>(tmppar3->inInset());
if (it) {
it->getLyXText(bv)->redoParagraphs(bv, it->getLyXText(bv)->cursor,
endpar);
before_number = first->previous()->id();
if (behind)
behind_number = behind->id();
- if (first->InInset())
- inset_id = first->InInset()->id();
+ if (first->inInset())
+ inset_id = first->inInset()->id();
// Undo::EDIT and Undo::FINISH are
// always finished. (no overlapping there)