]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormPreamble.C
Introduce LFUN_PRINT.
[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 "ControlPreamble.h"
15 #include "forms/form_preamble.h"
16
17 #include "xforms_helpers.h"
18 #include "xformsBC.h"
19
20 #include "lyx_forms.h"
21
22
23 typedef FormCB<ControlPreamble, FormDB<FD_preamble> > base_class;
24
25 FormPreamble::FormPreamble()
26         : base_class(_("LaTeX Preamble"))
27 {}
28
29
30 void FormPreamble::build()
31 {
32         dialog_.reset(build_preamble(this));
33
34         // Manage the ok, apply and cancel/close buttons
35         bcview().setOK(dialog_->button_ok);
36         bcview().setApply(dialog_->button_apply);
37         bcview().setCancel(dialog_->button_close);
38
39         // trigger an input event for cut&paste with middle mouse button.
40         setPrehandler(dialog_->input_preamble);
41
42         // for activate ok/apply immediately upon input
43         fl_set_input_return(dialog_->input_preamble, FL_RETURN_CHANGED);
44 }
45
46
47 void FormPreamble::apply()
48 {
49         controller().params(getString(dialog_->input_preamble));
50 }
51
52
53 void FormPreamble::update()
54 {
55         fl_set_input(dialog_->input_preamble, controller().params().c_str());
56 }