* \author Jürgen Vigna
* \author Lars Gullik Bjønnes
*
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
*/
#include <config.h>
#if 0
autocollapse(false),
#endif
- oldWidth(0), in_update(false), first_after_edit(false)
+ in_update(false), first_after_edit(false)
{
inset.setOwner(this);
inset.setAutoBreakRows(true);
- inset.setDrawFrame(0, InsetText::ALWAYS);
- inset.setFrameColor(0, LColor::collapsableframe);
+ inset.setDrawFrame(InsetText::ALWAYS);
+ inset.setFrameColor(LColor::collapsableframe);
setInsetName("Collapsable");
}
#if 0
autocollapse(in.autocollapse),
#endif
- oldWidth(0), in_update(false), first_after_edit(false)
+ in_update(false), first_after_edit(false)
{
inset.init(&(in.inset));
inset.setOwner(this);
}
-void InsetCollapsable::write(Buffer const * buf, ostream & os) const
+void InsetCollapsable::write(Buffer const & buf, ostream & os) const
{
os << "collapsed " << (collapsed_ ? "true" : "false") << "\n";
inset.writeParagraphData(buf, os);
}
-void InsetCollapsable::read(Buffer const * buf, LyXLex & lex)
+void InsetCollapsable::read(Buffer const & buf, LyXLex & lex)
{
if (lex.isOK()) {
lex.next();
void InsetCollapsable::metrics(MetricsInfo & mi, Dimension & dim) const
{
- //lyxerr << "InsetCollapsable::metrics: width: " << mi.base.textwidth << "\n";
+ //lyxerr << "InsetCollapsable::metrics: width: " << mi.base.textwidth << endl;
dimension_collapsed(dim);
if (!collapsed_) {
Dimension insetdim;
if (collapsed_ && cmd.button() != mouse_button::button3) {
collapsed_ = false;
- inset.setUpdateStatus(InsetText::FULL);
bv->updateInset(this);
bv->buffer()->markDirty();
return;
}
- if (cmd.button() != mouse_button::button3 && hitButton(cmd))
- {
+ if (cmd.button() != mouse_button::button3 && hitButton(cmd)) {
if (collapsed_) {
collapsed_ = false;
- inset.setUpdateStatus(InsetText::FULL);
- bv->updateInset(this);
- bv->buffer()->markDirty();
} else {
collapsed_ = true;
bv->unlockInset(this);
- bv->updateInset(this);
- bv->buffer()->markDirty();
}
- } else if (!collapsed_ && (cmd.y > button_dim.y2)) {
- ret = (inset.localDispatch(adjustCommand(cmd)) == DISPATCHED);
+ bv->updateInset(this);
+ bv->buffer()->markDirty();
+ lyxerr << "InsetCollapsable::lfunMouseRelease\n";
+ } else if (!collapsed_ && cmd.y > button_dim.y2) {
+ ret = inset.localDispatch(adjustCommand(cmd)) == DISPATCHED;
}
if (cmd.button() == mouse_button::button3 && !ret)
showInsetDialog(bv);
}
-int InsetCollapsable::latex(Buffer const * buf, ostream & os,
+int InsetCollapsable::latex(Buffer const & buf, ostream & os,
LatexRunParams const & runparams) const
{
return inset.latex(buf, os, runparams);
}
-int InsetCollapsable::ascii(Buffer const * buf, ostream & os, int ll) const
+int InsetCollapsable::ascii(Buffer const & buf, ostream & os, int ll) const
{
return inset.ascii(buf, os, ll);
}
-int InsetCollapsable::linuxdoc(Buffer const * buf, ostream & os) const
+int InsetCollapsable::linuxdoc(Buffer const & buf, ostream & os) const
{
return inset.linuxdoc(buf, os);
}
-int InsetCollapsable::docbook(Buffer const * buf, ostream & os, bool mixcont) const
+int InsetCollapsable::docbook(Buffer const & buf, ostream & os, bool mixcont) const
{
return inset.docbook(buf, os, mixcont);
}
if (!cmd.argument.empty()) {
UpdatableInset::localDispatch(cmd);
if (collapsed_) {
- lyxerr << "branch collapsed_\n";
+ lyxerr << "branch collapsed_" << endl;
collapsed_ = false;
if (bv->lockInset(this)) {
- inset.setUpdateStatus(InsetText::FULL);
bv->updateInset(this);
bv->buffer()->markDirty();
inset.localDispatch(cmd);
first_after_edit = true;
}
} else {
- lyxerr << "branch not collapsed_\n";
+ lyxerr << "branch not collapsed_" << endl;
if (bv->lockInset(this))
inset.localDispatch(cmd);
}
}
-bool InsetCollapsable::updateInsetInInset(BufferView * bv, InsetOld *in)
-{
- if (in == this)
- return true;
- return inset.updateInsetInInset(bv, in);
-}
-
-
int InsetCollapsable::insetInInsetY() const
{
return inset.insetInInsetY() - (top_baseline - inset.y());
}
-void InsetCollapsable::resizeLyXText(BufferView * bv, bool force) const
-{
- inset.resizeLyXText(bv, force);
- oldWidth = width();
-}
-
-
void InsetCollapsable::getLabelList(std::vector<string> & list) const
{
inset.getLabelList(list);
void InsetCollapsable::open(BufferView * bv)
{
- if (!collapsed_) return;
+ if (!collapsed_)
+ return;
collapsed_ = false;
bv->updateInset(this);
return;
collapsed_ = true;
- bv->updateInset(const_cast<InsetCollapsable *>(this));
+ bv->updateInset(this);
}