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"
|
|
|
|
#include "Painter.h"
|
2000-03-08 13:52:57 +00:00
|
|
|
#include "buffer.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-02-25 13:35:38 +00:00
|
|
|
InsetERT::InsetERT(Buffer * bf)
|
2000-03-08 13:52:57 +00:00
|
|
|
: InsetCollapsable(bf)
|
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);
|
|
|
|
real_current_font = current_font = font;
|
|
|
|
LyXFont labelfont(LyXFont::ALL_SANE);
|
|
|
|
labelfont.decSize();
|
|
|
|
labelfont.decSize();
|
|
|
|
labelfont.setColor(LColor::ert);
|
|
|
|
setLabelFont(labelfont);
|
|
|
|
setAutoCollapse(false);
|
2000-02-25 12:06:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-02-25 16:42:21 +00:00
|
|
|
Inset * InsetERT::Clone() const
|
2000-02-25 12:06:15 +00:00
|
|
|
{
|
|
|
|
InsetERT * result = new InsetERT(buffer);
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void InsetERT::Write(ostream & os) const
|
|
|
|
{
|
|
|
|
os << "ERT\n";
|
|
|
|
WriteParagraphData(os);
|
|
|
|
}
|
|
|
|
|
2000-04-04 00:19:15 +00:00
|
|
|
|
|
|
|
char const * InsetERT::EditMessage() const
|
|
|
|
{
|
|
|
|
return _("Opened ERT Inset");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-03-08 13:52:57 +00:00
|
|
|
bool InsetERT::InsertInset(BufferView *, Inset *)
|
2000-02-25 12:06:15 +00:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
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;
|
|
|
|
}
|