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"
22 #include FORMS_H_LOCATION
24 typedef FormCB<ControlPreamble, FormDB<FD_preamble> > base_class;
26 FormPreamble::FormPreamble()
27 : base_class(_("LaTeX preamble"))
31 void FormPreamble::build()
33 dialog_.reset(build_preamble(this));
35 fl_set_input_return(dialog_->input_preamble, FL_RETURN_CHANGED);
37 // trigger an input event when pasting using the middle mouse button.
38 setPrehandler(dialog_->input_preamble);
40 // Manage the ok, apply and cancel/close buttons
41 bc().setOK(dialog_->button_ok);
42 bc().setApply(dialog_->button_apply);
43 bc().setCancel(dialog_->button_close);
47 void FormPreamble::apply()
49 controller().params() = fl_get_input(dialog_->input_preamble);
53 void FormPreamble::update()
55 fl_set_input(dialog_->input_preamble, controller().params().c_str());