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
14 #pragma implementation
18 #include "ControlPreamble.h"
19 #include "FormPreamble.h"
20 #include "forms/form_preamble.h"
21 #include "xforms_helpers.h"
23 #include FORMS_H_LOCATION
25 typedef FormCB<ControlPreamble, FormDB<FD_preamble> > base_class;
27 FormPreamble::FormPreamble()
28 : base_class(_("LaTeX preamble"))
32 void FormPreamble::build()
34 dialog_.reset(build_preamble(this));
36 // Manage the ok, apply and cancel/close buttons
37 bc().setOK(dialog_->button_ok);
38 bc().setApply(dialog_->button_apply);
39 bc().setCancel(dialog_->button_close);
41 // trigger an input event for cut&paste with middle mouse button.
42 setPrehandler(dialog_->input_preamble);
44 // for activate ok/apply immediately upon input
45 fl_set_input_return(dialog_->input_preamble, FL_RETURN_CHANGED);
49 void FormPreamble::apply()
51 controller().params(getString(dialog_->input_preamble));
55 void FormPreamble::update()
57 fl_set_input(dialog_->input_preamble, controller().params().c_str());