#include "lyxfont.h"
#include "BufferView.h"
#include "Painter.h"
-#include "insets/insettext.h"
-#include "support/LOstream.h"
-#include "support/lstrings.h"
#include "debug.h"
#include "lyxtext.h"
#include "font.h"
#include "lyxlex.h"
-class LyXText;
+#include "insets/insettext.h"
+#include "support/LOstream.h"
+#include "support/lstrings.h"
+
+using std::vector;
using std::ostream;
using std::endl;
using std::max;
+class LyXText;
+
+
InsetCollapsable::InsetCollapsable(bool collapsed)
: UpdatableInset(), collapsed_(collapsed),
button_length(0), button_top_y(0), button_bottom_y(0),
}
-void InsetCollapsable::insetButtonRelease(BufferView * bv,
+bool InsetCollapsable::insetButtonRelease(BufferView * bv,
int x, int y, int button)
{
- if ((x >= 0) && (x < button_length) &&
+ bool ret = false;
+ if ((button != 3) && (x >= 0) && (x < button_length) &&
(y >= button_top_y) && (y <= button_bottom_y))
{
if (collapsed_) {
(ascent_collapsed() +
descent_collapsed() +
inset.ascent(bv, font));
- inset.insetButtonRelease(bv, x, yy, button);
+ ret = inset.insetButtonRelease(bv, x, yy, button);
+ }
+ if ((button == 3) && !ret) {
+ return showInsetDialog(bv);
}
+ return false;
}
return inset.latex(buf, os, fragile, free_spc);
}
+
+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
+{
+ return inset.linuxdoc(buf, os);
+}
+
+
+int InsetCollapsable::docbook(Buffer const * buf, ostream & os) const
+{
+ return inset.docbook(buf, os);
+}
+
#if 0
int InsetCollapsable::getMaxWidth(BufferView * bv,
UpdatableInset const * in) const
bool InsetCollapsable::updateInsetInInset(BufferView * bv, Inset *in)
{
- if (&inset == in)
+ if (in == this)
return true;
return inset.updateInsetInInset(bv, in);
}
}
-std::vector<string> const InsetCollapsable::getLabelList() const
+vector<string> const InsetCollapsable::getLabelList() const
{
return inset.getLabelList();
}
bool InsetCollapsable::searchForward(BufferView * bv, string const & str,
- bool const & cs, bool const & mw)
+ bool cs, bool mw)
{
bool found = inset.searchForward(bv, str, cs, mw);
if (first_after_edit && !found)
bool InsetCollapsable::searchBackward(BufferView * bv, string const & str,
- bool const & cs, bool const & mw)
+ bool cs, bool mw)
{
bool found = inset.searchBackward(bv, str, cs, mw);
if (first_after_edit && !found)