#include "insetert.h"
#include "gettext.h"
#include "lyxfont.h"
-#include "Painter.h"
#include "buffer.h"
-//#include "lyx_gui_misc.h"
+#include "insets/insettext.h"
+#include "support/LOstream.h"
+#include "lyx_gui_misc.h"
+using std::ostream;
-InsetERT::InsetERT(Buffer * bf)
- : InsetCollapsable(bf)
+InsetERT::InsetERT() : InsetCollapsable()
{
setLabel(_("ERT"));
LyXFont font(LyXFont::ALL_SANE);
font.setLatex (LyXFont::ON);
- real_current_font = current_font = font;
- LyXFont labelfont(LyXFont::ALL_SANE);
+ labelfont = LyXFont(LyXFont::ALL_SANE);
labelfont.decSize();
labelfont.decSize();
labelfont.setColor(LColor::ert);
- setLabelFont(labelfont);
setAutoCollapse(false);
+ setInsetName("ERT");
}
-Inset * InsetERT::Clone() const
+void InsetERT::Write(Buffer const * buf, ostream & os) const
{
- InsetERT * result = new InsetERT(buffer);
- return result;
+ os << getInsetName() << "\n";
+ InsetCollapsable::Write(buf, os);
}
-void InsetERT::Write(ostream & os) const
+Inset * InsetERT::Clone(Buffer const &) const
{
- os << "ERT\n";
- WriteParagraphData(os);
+ InsetERT * result = new InsetERT;
+ result->inset->init(inset);
+
+ result->collapsed = collapsed;
+ return result;
}
-bool InsetERT::InsertInset(BufferView *, Inset *)
+
+string const InsetERT::EditMessage() const
{
- return false;
+ return _("Opened ERT Inset");
}
_("Not permitted to change font-types inside ERT-insets!"),
_("Sorry."));
}
+
+
+void InsetERT::Edit(BufferView * bv, int x, int y, unsigned int button)
+{
+ InsetCollapsable::Edit(bv, x, y, button);
+ LyXFont font(LyXFont::ALL_SANE);
+ font.setLatex (LyXFont::ON);
+}