]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormPreamble.C
Bugfixes: checkboxes to radiobuttons (from J�rgen S) and remove a little
[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 "form_preamble.h"
19 #include "xforms_helpers.h"
20
21 // To trigger an input event when pasting in an xforms input object
22 // using the middle mouse button.
23 extern "C" int C_CutandPastePH(FL_OBJECT *, int, FL_Coord, FL_Coord,
24                                int, void *);
25
26 typedef FormCB<ControlPreamble, FormDB<FD_form_preamble> > base_class;
27
28 FormPreamble::FormPreamble(ControlPreamble & c)
29         : base_class(c, _("LaTeX preamble"))
30 {}
31
32
33 void FormPreamble::build()
34 {
35         dialog_.reset(build_preamble());
36
37         fl_set_input_return(dialog_->input_preamble, FL_RETURN_CHANGED);
38         fl_set_object_prehandler(dialog_->input_preamble, C_CutandPastePH);
39
40         // Manage the ok, apply and cancel/close buttons
41         bc().setOK(dialog_->button_ok);
42         bc().setApply(dialog_->button_apply);
43         bc().setCancel(dialog_->button_cancel);
44 }
45
46
47 void FormPreamble::apply()
48 {
49         controller().params() = fl_get_input(dialog_->input_preamble);
50 }
51
52
53 void FormPreamble::update()
54 {
55         fl_set_input(dialog_->input_preamble, controller().params().c_str());
56 }