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