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"
24 typedef FormController<ControlPreamble, FormView<FD_preamble> > base_class;
26 FormPreamble::FormPreamble(Dialog & parent)
27 : base_class(parent, _("LaTeX Preamble"))
31 void FormPreamble::build()
33 dialog_.reset(build_preamble(this));
35 // Manage the ok, apply and cancel/close buttons
36 bcview().setOK(dialog_->button_ok);
37 bcview().setApply(dialog_->button_apply);
38 bcview().setCancel(dialog_->button_close);
40 // trigger an input event for cut&paste with middle mouse button.
41 setPrehandler(dialog_->input_preamble);
43 // for activate ok/apply immediately upon input
44 fl_set_input_return(dialog_->input_preamble, FL_RETURN_CHANGED);
48 void FormPreamble::apply()
50 controller().params(getString(dialog_->input_preamble));
54 void FormPreamble::update()
56 fl_set_input(dialog_->input_preamble, controller().params().c_str());