]> git.lyx.org Git - features.git/blob - src/insets/insetert.C
854a3f52ce517a420ad84d8d134f32e06a203663
[features.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     labelfont = LyXFont(LyXFont::ALL_SANE);
32     labelfont.decSize();
33     labelfont.decSize();
34     labelfont.setColor(LColor::ert);
35     setAutoCollapse(false);
36     setInsetName("ERT");
37 }
38
39
40 Inset * InsetERT::Clone() const
41 {
42     InsetERT * result = new InsetERT();
43     result->init(this);
44
45     result->collapsed = collapsed;
46     return result;
47 }
48
49
50 char const * InsetERT::EditMessage() const 
51 {
52         return _("Opened ERT Inset");
53 }
54
55
56 bool InsetERT::InsertInset(BufferView *, Inset *)
57 {
58     return false;
59 }
60
61
62 void InsetERT::SetFont(BufferView *, LyXFont const &, bool)
63 {
64     WriteAlert(_("Impossible Operation!"),
65                _("Not permitted to change font-types inside ERT-insets!"),
66                _("Sorry."));
67 }
68
69 void InsetERT::Edit(BufferView * bv, int x, int y, unsigned int button)
70 {
71     InsetCollapsable::Edit(bv, x, y, button);
72     LyXFont font(LyXFont::ALL_SANE);
73     font.setLatex (LyXFont::ON);
74 }