]> git.lyx.org Git - lyx.git/blob - src/insets/insetert.C
reformatting and remove using delc
[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 "buffer.h"
20 #include "insets/insettext.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 void InsetERT::Write(Buffer const * buf, ostream & os) const 
41 {
42         os << getInsetName() << "\n";
43         InsetCollapsable::Write(buf, os);
44 }
45
46
47 Inset * InsetERT::Clone(Buffer const &) const
48 {
49         InsetERT * result = new InsetERT;
50         result->inset.init(&inset);
51         
52         result->collapsed = collapsed;
53         return result;
54 }
55
56
57 string const InsetERT::EditMessage() const 
58 {
59         return _("Opened ERT Inset");
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
71 void InsetERT::Edit(BufferView * bv, int x, int y, unsigned int button)
72 {
73         InsetCollapsable::Edit(bv, x, y, button);
74         LyXFont font(LyXFont::ALL_SANE);
75         font.setLatex (LyXFont::ON);
76 }