2001-02-20 13:34:05 +00:00
|
|
|
/**
|
|
|
|
* \file FormPreamble.C
|
|
|
|
* Copyright 2001 The LyX Team.
|
|
|
|
* See the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Edwin Leuven, leuven@fee.uva.nl
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
2001-03-15 13:37:04 +00:00
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
2001-03-27 16:03:28 +00:00
|
|
|
#include "xformsBC.h"
|
|
|
|
#include "ControlPreamble.h"
|
2001-02-20 13:34:05 +00:00
|
|
|
#include "FormPreamble.h"
|
2001-03-27 16:03:28 +00:00
|
|
|
#include "form_preamble.h"
|
2001-03-05 19:02:40 +00:00
|
|
|
#include "xforms_helpers.h"
|
2001-02-20 13:34:05 +00:00
|
|
|
|
2001-03-27 16:03:28 +00:00
|
|
|
typedef FormCB<ControlPreamble, FormDB<FD_form_preamble> > base_class;
|
2001-02-20 13:34:05 +00:00
|
|
|
|
2001-03-27 16:03:28 +00:00
|
|
|
FormPreamble::FormPreamble(ControlPreamble & c)
|
|
|
|
: base_class(c, _("LaTeX preamble"))
|
|
|
|
{}
|
2001-02-20 13:34:05 +00:00
|
|
|
|
2001-03-15 13:37:04 +00:00
|
|
|
|
2001-02-20 13:34:05 +00:00
|
|
|
void FormPreamble::build()
|
|
|
|
{
|
2001-03-27 16:03:28 +00:00
|
|
|
dialog_.reset(build_preamble());
|
2001-08-29 11:01:05 +00:00
|
|
|
|
2001-03-27 16:03:28 +00:00
|
|
|
fl_set_input_return(dialog_->input_preamble, FL_RETURN_CHANGED);
|
2002-02-05 14:59:26 +00:00
|
|
|
|
|
|
|
// trigger an input event when pasting using the middle mouse button.
|
|
|
|
setPrehandler(dialog_->input_preamble);
|
2001-03-27 16:03:28 +00:00
|
|
|
|
|
|
|
// Manage the ok, apply and cancel/close buttons
|
|
|
|
bc().setOK(dialog_->button_ok);
|
|
|
|
bc().setApply(dialog_->button_apply);
|
2002-03-12 14:11:15 +00:00
|
|
|
bc().setCancel(dialog_->button_close);
|
2001-02-20 13:34:05 +00:00
|
|
|
}
|
|
|
|
|
2001-03-15 13:37:04 +00:00
|
|
|
|
2001-02-20 13:34:05 +00:00
|
|
|
void FormPreamble::apply()
|
|
|
|
{
|
2001-03-27 16:03:28 +00:00
|
|
|
controller().params() = fl_get_input(dialog_->input_preamble);
|
2001-02-20 13:34:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void FormPreamble::update()
|
|
|
|
{
|
2001-03-27 16:03:28 +00:00
|
|
|
fl_set_input(dialog_->input_preamble, controller().params().c_str());
|
2001-02-20 13:34:05 +00:00
|
|
|
}
|