2002-09-25 14:26:13 +00:00
|
|
|
/**
|
|
|
|
* \file insetnote.C
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-03-21 17:09:55 +00:00
|
|
|
*
|
2002-09-25 14:26:13 +00:00
|
|
|
* \author Angus Leeming
|
2002-03-21 17:09:55 +00:00
|
|
|
*
|
2002-09-25 14:26:13 +00:00
|
|
|
* Full author contact details are available in file CREDITS
|
2001-07-20 09:57:23 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include "insetnote.h"
|
|
|
|
#include "gettext.h"
|
|
|
|
#include "lyxfont.h"
|
2001-11-26 18:03:23 +00:00
|
|
|
#include "language.h"
|
2001-07-23 09:11:14 +00:00
|
|
|
#include "buffer.h"
|
2001-07-20 09:57:23 +00:00
|
|
|
#include "BufferView.h"
|
|
|
|
#include "lyxtext.h"
|
|
|
|
#include "insets/insettext.h"
|
|
|
|
#include "support/LOstream.h"
|
2001-07-24 10:13:19 +00:00
|
|
|
#include "support/lstrings.h"
|
2001-07-20 09:57:23 +00:00
|
|
|
#include "debug.h"
|
|
|
|
|
|
|
|
using std::ostream;
|
|
|
|
|
2001-11-27 10:34:16 +00:00
|
|
|
|
2001-07-23 09:11:14 +00:00
|
|
|
void InsetNote::init()
|
2001-07-20 09:57:23 +00:00
|
|
|
{
|
|
|
|
LyXFont font(LyXFont::ALL_SANE);
|
|
|
|
font.decSize();
|
2002-12-04 13:26:55 +00:00
|
|
|
font.decSize();
|
2001-07-20 09:57:23 +00:00
|
|
|
font.setColor(LColor::note);
|
|
|
|
setLabelFont(font);
|
2002-02-12 10:01:52 +00:00
|
|
|
setBackgroundColor(LColor::notebg);
|
2001-07-20 09:57:23 +00:00
|
|
|
setLabel(_("note"));
|
|
|
|
setInsetName("Note");
|
|
|
|
}
|
|
|
|
|
2001-07-24 10:13:19 +00:00
|
|
|
|
2002-03-03 20:25:07 +00:00
|
|
|
InsetNote::InsetNote(BufferParams const & bp)
|
|
|
|
: InsetCollapsable(bp)
|
2001-07-23 09:11:14 +00:00
|
|
|
{
|
|
|
|
init();
|
|
|
|
}
|
|
|
|
|
2001-07-24 10:13:19 +00:00
|
|
|
|
2001-07-27 12:03:36 +00:00
|
|
|
InsetNote::InsetNote(InsetNote const & in, bool same_id)
|
|
|
|
: InsetCollapsable(in, same_id)
|
|
|
|
{
|
|
|
|
init();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Inset * InsetNote::clone(Buffer const &, bool same_id) const
|
|
|
|
{
|
|
|
|
return new InsetNote(*const_cast<InsetNote *>(this), same_id);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-03-21 17:09:55 +00:00
|
|
|
string const InsetNote::editMessage() const
|
2001-07-20 09:57:23 +00:00
|
|
|
{
|
|
|
|
return _("Opened Note Inset");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void InsetNote::write(Buffer const *buf, ostream & os) const
|
|
|
|
{
|
2001-07-20 12:40:38 +00:00
|
|
|
os << getInsetName() << "\n";
|
2001-07-20 09:57:23 +00:00
|
|
|
InsetCollapsable::write(buf, os);
|
|
|
|
}
|