]> git.lyx.org Git - lyx.git/blob - src/insets/insetert.C
396342f49f1114d74e2e556f919cd27d6c535a92
[lyx.git] / src / insets / insetert.C
1 /* This file is part of
2  * ======================================================
3  * 
4  *           LyX, The Document Processor
5  *       
6  *          Copyright 1998 The LyX Team.
7  *
8  *======================================================*/
9
10 #include <config.h>
11
12 #ifdef __GNUG__
13 #pragma implementation
14 #endif
15
16 #include "insetert.h"
17 #include "gettext.h"
18 #include "lyxfont.h"
19 #include "Painter.h"
20 #include "buffer.h"
21 #include "support/LOstream.h"
22 #include "lyx_gui_misc.h"
23
24 using std::ostream;
25
26 InsetERT::InsetERT() : InsetCollapsable()
27 {
28     setLabel(_("ERT"));
29     LyXFont font(LyXFont::ALL_SANE);
30     font.setLatex (LyXFont::ON);
31     real_current_font = current_font = font;
32     labelfont = LyXFont(LyXFont::ALL_SANE);
33     labelfont.decSize();
34     labelfont.decSize();
35     labelfont.setColor(LColor::ert);
36     setAutoCollapse(false);
37     setInsetName("ERT");
38 }
39
40
41 Inset * InsetERT::Clone() const
42 {
43     InsetERT * result = new InsetERT();
44     result->init(this);
45
46     result->collapsed = collapsed;
47     return result;
48 }
49
50
51 char const * InsetERT::EditMessage() const 
52 {
53         return _("Opened ERT Inset");
54 }
55
56
57 bool InsetERT::InsertInset(BufferView *, Inset *)
58 {
59     return false;
60 }
61
62
63 void InsetERT::SetFont(BufferView *, LyXFont const &, bool)
64 {
65     WriteAlert(_("Impossible Operation!"),
66                _("Not permitted to change font-types inside ERT-insets!"),
67                _("Sorry."));
68 }
69
70 void InsetERT::Edit(BufferView * bv, int x, int y, unsigned int button)
71 {
72     InsetCollapsable::Edit(bv, x, y, button);
73     LyXFont font(LyXFont::ALL_SANE);
74     font.setLatex (LyXFont::ON);
75     current_font = real_current_font = font;
76 }