]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetnote.C
fix #832
[lyx.git] / src / insets / insetnote.C
index f5d7fc8ca5fa5a1e5ababfdefec7c160e624902a..1a4253d5c846a07c07017019ee670c16469f89cd 100644 (file)
@@ -1,67 +1,72 @@
-/* This file is part of
- * ======================================================
- * 
- *           LyX, The Document Processor
- *      
- *          Copyright 1998 The LyX Team.
+/**
+ * \file insetnote.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * ======================================================
+ * \author Angus Leeming
+ *
+ * Full author contact details are available in file CREDITS
  */
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
 
 #include "insetnote.h"
 #include "gettext.h"
 #include "lyxfont.h"
+#include "language.h"
+#include "buffer.h"
 #include "BufferView.h"
 #include "lyxtext.h"
 #include "insets/insettext.h"
 #include "support/LOstream.h"
+#include "support/lstrings.h"
 #include "debug.h"
 
 using std::ostream;
 
-InsetNote::InsetNote()
-       : InsetCollapsable()
+
+void InsetNote::init()
 {
        LyXFont font(LyXFont::ALL_SANE);
        font.decSize();
        font.decSize();
        font.setColor(LColor::note);
        setLabelFont(font);
-       setAutoCollapse(true);
-
+       setBackgroundColor(LColor::notebg);
        setLabel(_("note"));
        setInsetName("Note");
 }
 
 
-Inset * InsetNote::clone(Buffer const &, bool same_id) const
+InsetNote::InsetNote(BufferParams const & bp)
+       : InsetCollapsable(bp)
 {
-       InsetNote * result = new InsetNote;
-       result->inset.init(&inset, same_id);
+       init();
+}
+
 
-       result->collapsed_ = collapsed_;
-       if (same_id)
-               result->id_ = id_;
-       return result;
+InsetNote::InsetNote(InsetNote const & in, bool same_id)
+       : InsetCollapsable(in, same_id)
+{
+       init();
 }
 
 
-string const InsetNote::editMessage() const 
+Inset * InsetNote::clone(Buffer const &, bool same_id) const
+{
+       return new InsetNote(*const_cast<InsetNote *>(this), same_id);
+}
+
+
+string const InsetNote::editMessage() const
 {
        return _("Opened Note Inset");
 }
 
 
-void InsetNote::write(Buffer const *buf, ostream & os) const
+void InsetNote::write(Buffer const * buf, ostream & os) const
 {
-       //os << getInsetName() << "\n";
-       os << "Info\n";
+       os << getInsetName() << "\n";
        InsetCollapsable::write(buf, os);
 }
-