2000-02-25 12:06:15 +00:00
|
|
|
/* This file is part of
|
|
|
|
* ======================================================
|
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
2000-02-25 13:35:38 +00:00
|
|
|
* Copyright 1998 The LyX Team.
|
2000-02-25 12:06:15 +00:00
|
|
|
*
|
|
|
|
*======================================================*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "insetert.h"
|
|
|
|
#include "gettext.h"
|
|
|
|
#include "lyxfont.h"
|
2000-03-08 13:52:57 +00:00
|
|
|
#include "buffer.h"
|
2000-07-04 11:30:07 +00:00
|
|
|
#include "insets/insettext.h"
|
2000-04-08 17:02:02 +00:00
|
|
|
#include "support/LOstream.h"
|
|
|
|
#include "lyx_gui_misc.h"
|
2000-02-25 12:06:15 +00:00
|
|
|
|
2000-04-04 00:19:15 +00:00
|
|
|
using std::ostream;
|
2000-02-25 12:06:15 +00:00
|
|
|
|
2000-06-12 11:27:15 +00:00
|
|
|
InsetERT::InsetERT() : InsetCollapsable()
|
2000-02-25 12:06:15 +00:00
|
|
|
{
|
2000-03-08 13:52:57 +00:00
|
|
|
setLabel(_("ERT"));
|
|
|
|
LyXFont font(LyXFont::ALL_SANE);
|
|
|
|
font.setLatex (LyXFont::ON);
|
2000-05-17 14:43:09 +00:00
|
|
|
labelfont = LyXFont(LyXFont::ALL_SANE);
|
2000-03-08 13:52:57 +00:00
|
|
|
labelfont.decSize();
|
|
|
|
labelfont.decSize();
|
|
|
|
labelfont.setColor(LColor::ert);
|
|
|
|
setAutoCollapse(false);
|
2000-04-19 14:42:19 +00:00
|
|
|
setInsetName("ERT");
|
2000-02-25 12:06:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-06-28 13:35:52 +00:00
|
|
|
void InsetERT::Write(Buffer const * buf, ostream & os) const
|
|
|
|
{
|
2000-07-04 19:16:35 +00:00
|
|
|
os << getInsetName() << "\n";
|
|
|
|
InsetCollapsable::Write(buf, os);
|
2000-06-28 13:35:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-10-10 11:50:43 +00:00
|
|
|
Inset * InsetERT::Clone(Buffer const &) const
|
2000-02-25 12:06:15 +00:00
|
|
|
{
|
2000-07-04 11:30:07 +00:00
|
|
|
InsetERT * result = new InsetERT;
|
|
|
|
result->inset->init(inset);
|
2000-02-25 12:06:15 +00:00
|
|
|
|
2000-04-19 14:42:19 +00:00
|
|
|
result->collapsed = collapsed;
|
|
|
|
return result;
|
2000-02-25 12:06:15 +00:00
|
|
|
}
|
|
|
|
|
2000-04-04 00:19:15 +00:00
|
|
|
|
2000-09-14 17:53:12 +00:00
|
|
|
string const InsetERT::EditMessage() const
|
2000-04-04 00:19:15 +00:00
|
|
|
{
|
2000-07-04 19:16:35 +00:00
|
|
|
return _("Opened ERT Inset");
|
2000-02-25 12:06:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-03-08 13:52:57 +00:00
|
|
|
void InsetERT::SetFont(BufferView *, LyXFont const &, bool)
|
2000-02-25 12:06:15 +00:00
|
|
|
{
|
|
|
|
WriteAlert(_("Impossible Operation!"),
|
|
|
|
_("Not permitted to change font-types inside ERT-insets!"),
|
|
|
|
_("Sorry."));
|
|
|
|
}
|
2000-03-24 13:24:58 +00:00
|
|
|
|
2000-07-04 19:16:35 +00:00
|
|
|
|
2000-03-24 13:24:58 +00:00
|
|
|
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);
|
|
|
|
}
|