1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 2001 The LyX Team.
8 * ======================================================
10 * \author Jürgen Vigna, jug@sad.it
11 * \author Angus Leeming, a.leeming@ic.ac.uk
17 #pragma implementation
21 #include "ButtonControllerBase.h"
22 #include "ControlERT.h"
23 #include "ControlInset.tmpl"
27 #include "BufferView.h"
32 // sorry this is just a temporary hack we should include vspace.h! (Jug)
33 extern const char * stringFromUnit(int);
35 ControlERT::ControlERT(LyXView & lv, Dialogs & d)
36 : ControlInset<InsetERT, ERTParams>(lv, d)
38 d_.showERT.connect(slot(this, &ControlERT::showInset));
40 // We could have an extra method updateInset that calls
41 // view().update() rather than view().show(), but I don't see why
42 // it is really needed.
43 d_.updateERT.connect(slot(this, &ControlERT::showInset));
47 void ControlERT::applyParamsToInset()
49 inset()->status(lv_.view(), params().status);
53 void ControlERT::applyParamsNoInset()
58 ERTParams const ControlERT::getParams(InsetERT const & inset)
60 return ERTParams(inset);
64 ERTParams::ERTParams()
65 : status(InsetERT::Collapsed)
68 ERTParams::ERTParams(InsetERT const & inset)
69 : status(inset.status())
73 bool operator==(ERTParams const & p1, ERTParams const & p2)
75 return (p1.status == p2.status);
79 bool operator!=(ERTParams const & p1, ERTParams const & p2)