3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "FormPreamble.h"
14 #include "ControlPreamble.h"
15 #include "forms/form_preamble.h"
17 #include "xforms_helpers.h"
20 #include "lyx_forms.h"
23 typedef FormCB<ControlPreamble, FormDB<FD_preamble> > base_class;
25 FormPreamble::FormPreamble()
26 : base_class(_("LaTeX Preamble"))
30 void FormPreamble::build()
32 dialog_.reset(build_preamble(this));
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);
39 // trigger an input event for cut&paste with middle mouse button.
40 setPrehandler(dialog_->input_preamble);
42 // for activate ok/apply immediately upon input
43 fl_set_input_return(dialog_->input_preamble, FL_RETURN_CHANGED);
47 void FormPreamble::apply()
49 controller().params(getString(dialog_->input_preamble));
53 void FormPreamble::update()
55 fl_set_input(dialog_->input_preamble, controller().params().c_str());