]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormPreamble.C
Change the semantics of 'none' and 'auto' viewers/editors: 'none' means now
[lyx.git] / src / frontends / xforms / FormPreamble.C
1 /**
2  * \file FormPreamble.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Edwin Leuven
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "FormPreamble.h"
14 #include "forms/form_preamble.h"
15
16 #include "controllers/ControlPreamble.h"
17
18 #include "xforms_helpers.h"
19 #include "xformsBC.h"
20
21 #include "lyx_forms.h"
22
23 namespace lyx {
24 namespace frontend {
25
26 typedef FormController<ControlPreamble, FormView<FD_preamble> > base_class;
27
28 FormPreamble::FormPreamble(Dialog & parent)
29         : base_class(parent, _("LaTeX Preamble"))
30 {}
31
32
33 void FormPreamble::build()
34 {
35         dialog_.reset(build_preamble(this));
36
37         // Manage the ok, apply and cancel/close buttons
38         bcview().setOK(dialog_->button_ok);
39         bcview().setApply(dialog_->button_apply);
40         bcview().setCancel(dialog_->button_close);
41
42         // trigger an input event for cut&paste with middle mouse button.
43         setPrehandler(dialog_->input_preamble);
44
45         // for activate ok/apply immediately upon input
46         fl_set_input_return(dialog_->input_preamble, FL_RETURN_CHANGED);
47 }
48
49
50 void FormPreamble::apply()
51 {
52         controller().params(getString(dialog_->input_preamble));
53 }
54
55
56 void FormPreamble::update()
57 {
58         fl_set_input(dialog_->input_preamble, controller().params().c_str());
59 }
60
61 } // namespace frontend
62 } // namespace lyx