]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormPreamble.C
xforms clean-up, described in detail in my mail of 31 May. See
[lyx.git] / src / frontends / xforms / FormPreamble.C
1 /**
2  * \file FormPreamble.C
3  * Copyright 2001 The LyX Team.
4  * See the file COPYING.
5  *
6  * \author Edwin Leuven, leuven@fee.uva.nl
7  */
8
9 #include <config.h>
10
11 #ifdef __GNUG__
12 #pragma implementation
13 #endif
14
15 #include "xformsBC.h"
16 #include "ControlPreamble.h"
17 #include "FormPreamble.h"
18 #include "forms/form_preamble.h"
19 #include "xforms_helpers.h"
20 #include FORMS_H_LOCATION
21
22 typedef FormCB<ControlPreamble, FormDB<FD_preamble> > base_class;
23
24 FormPreamble::FormPreamble(ControlPreamble & c)
25         : base_class(c, _("LaTeX preamble"))
26 {}
27
28
29 void FormPreamble::build()
30 {
31         dialog_.reset(build_preamble(this));
32
33         fl_set_input_return(dialog_->input_preamble, FL_RETURN_CHANGED);
34
35         // trigger an input event when pasting using the middle mouse button.
36         setPrehandler(dialog_->input_preamble);
37
38         // Manage the ok, apply and cancel/close buttons
39         bc().setOK(dialog_->button_ok);
40         bc().setApply(dialog_->button_apply);
41         bc().setCancel(dialog_->button_close);
42 }
43
44
45 void FormPreamble::apply()
46 {
47         controller().params() = fl_get_input(dialog_->input_preamble);
48 }
49
50
51 void FormPreamble::update()
52 {
53         fl_set_input(dialog_->input_preamble, controller().params().c_str());
54 }