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
15 #include "ControlPreamble.h"
16 #include "FormPreamble.h"
17 #include "forms/form_preamble.h"
18 #include "xforms_helpers.h"
20 #include "lyx_forms.h"
22 typedef FormCB<ControlPreamble, FormDB<FD_preamble> > base_class;
24 FormPreamble::FormPreamble()
25 : base_class(_("LaTeX Preamble"))
29 void FormPreamble::build()
31 dialog_.reset(build_preamble(this));
33 // Manage the ok, apply and cancel/close buttons
34 bcview().setOK(dialog_->button_ok);
35 bcview().setApply(dialog_->button_apply);
36 bcview().setCancel(dialog_->button_close);
38 // trigger an input event for cut&paste with middle mouse button.
39 setPrehandler(dialog_->input_preamble);
41 // for activate ok/apply immediately upon input
42 fl_set_input_return(dialog_->input_preamble, FL_RETURN_CHANGED);
46 void FormPreamble::apply()
48 controller().params(getString(dialog_->input_preamble));
52 void FormPreamble::update()
54 fl_set_input(dialog_->input_preamble, controller().params().c_str());