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 "forms/form_preamble.h"
16 #include "controllers/ControlPreamble.h"
18 #include "xforms_helpers.h"
21 #include "lyx_forms.h"
26 typedef FormController<ControlPreamble, FormView<FD_preamble> > base_class;
28 FormPreamble::FormPreamble(Dialog & parent)
29 : base_class(parent, _("LaTeX Preamble"))
33 void FormPreamble::build()
35 dialog_.reset(build_preamble(this));
37 // Manage the ok, apply and cancel/close buttons
38 bcview().setOK(dialog_->button_ok);
39 bcview().setApply(dialog_->button_apply);
40 bcview().setCancel(dialog_->button_close);
42 // trigger an input event for cut&paste with middle mouse button.
43 setPrehandler(dialog_->input_preamble);
45 // for activate ok/apply immediately upon input
46 fl_set_input_return(dialog_->input_preamble, FL_RETURN_CHANGED);
50 void FormPreamble::apply()
52 controller().params(getString(dialog_->input_preamble));
56 void FormPreamble::update()
58 fl_set_input(dialog_->input_preamble, controller().params().c_str());
61 } // namespace frontend