]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetert.C
clear()->erase() ; lots of using directives for cxx
[lyx.git] / src / insets / insetert.C
index 27ddcdd7d8b95552c7af2e417252b8553948cbc4..795ca2c042dc54fcc1bba3c0fe4e049364f9b779 100644 (file)
 #include "lyxfont.h"
 #include "Painter.h"
 #include "buffer.h"
-//#include "lyx_gui_misc.h"
+#include "support/LOstream.h"
+#include "lyx_gui_misc.h"
 
+using std::ostream;
 
 InsetERT::InsetERT(Buffer * bf)
        : InsetCollapsable(bf)
@@ -34,22 +36,26 @@ InsetERT::InsetERT(Buffer * bf)
     labelfont.setColor(LColor::ert);
     setLabelFont(labelfont);
     setAutoCollapse(false);
+    setInsetName("ERT");
 }
 
 
 Inset * InsetERT::Clone() const
 {
     InsetERT * result = new InsetERT(buffer);
+    result->init(buffer, this);
+
+    result->collapsed = collapsed;
     return result;
 }
 
 
-void InsetERT::Write(ostream & os) const
+char const * InsetERT::EditMessage() const 
 {
-    os << "ERT\n";
-    WriteParagraphData(os);
+       return _("Opened ERT Inset");
 }
 
+
 bool InsetERT::InsertInset(BufferView *, Inset *)
 {
     return false;
@@ -62,3 +68,11 @@ void InsetERT::SetFont(BufferView *, LyXFont const &, bool)
               _("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);
+    current_font = real_current_font = font;
+}