2002-03-11 17:00:41 +00:00
|
|
|
|
/**
|
2003-02-27 15:57:11 +00:00
|
|
|
|
* \file FormERT.C
|
2002-09-05 15:14:23 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-03-11 17:00:41 +00:00
|
|
|
|
*
|
2002-09-05 14:10:50 +00:00
|
|
|
|
* \author J<EFBFBD>rgen Vigna
|
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2001-08-06 14:55:02 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
|
|
#include "FormERT.h"
|
2003-09-05 13:15:43 +00:00
|
|
|
|
#include "ControlERT.h"
|
2002-06-13 13:43:51 +00:00
|
|
|
|
#include "forms/form_ert.h"
|
2003-09-05 13:15:43 +00:00
|
|
|
|
|
|
|
|
|
#include "xformsBC.h"
|
|
|
|
|
|
2003-05-14 09:17:22 +00:00
|
|
|
|
#include "lyx_forms.h"
|
2001-08-06 14:55:02 +00:00
|
|
|
|
|
2004-05-19 15:11:37 +00:00
|
|
|
|
namespace lyx {
|
|
|
|
|
namespace frontend {
|
2003-09-05 13:15:43 +00:00
|
|
|
|
|
2003-02-25 14:51:38 +00:00
|
|
|
|
typedef FormController<ControlERT, FormView<FD_ert> > base_class;
|
2001-08-06 14:55:02 +00:00
|
|
|
|
|
2003-02-25 14:51:38 +00:00
|
|
|
|
FormERT::FormERT(Dialog & parent)
|
2003-04-30 02:06:04 +00:00
|
|
|
|
: base_class(parent, _("TeX Settings"))
|
2001-08-06 14:55:02 +00:00
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void FormERT::build()
|
|
|
|
|
{
|
2002-06-13 13:43:51 +00:00
|
|
|
|
dialog_.reset(build_ert(this));
|
2001-08-06 14:55:02 +00:00
|
|
|
|
|
|
|
|
|
// Manage the ok, apply and cancel/close buttons
|
2003-03-10 03:13:28 +00:00
|
|
|
|
bcview().setOK(dialog_->button_ok);
|
|
|
|
|
bcview().setApply(dialog_->button_apply);
|
|
|
|
|
bcview().setCancel(dialog_->button_close);
|
2001-08-06 14:55:02 +00:00
|
|
|
|
|
2003-03-10 03:13:28 +00:00
|
|
|
|
bcview().addReadOnly(dialog_->radio_open);
|
|
|
|
|
bcview().addReadOnly(dialog_->radio_collapsed);
|
|
|
|
|
bcview().addReadOnly(dialog_->radio_inlined);
|
2001-08-06 14:55:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void FormERT::apply()
|
|
|
|
|
{
|
|
|
|
|
if (fl_get_button(dialog_->radio_open))
|
2003-02-25 14:51:38 +00:00
|
|
|
|
controller().setStatus(InsetERT::Open);
|
2001-08-06 14:55:02 +00:00
|
|
|
|
else if (fl_get_button(dialog_->radio_collapsed))
|
2003-02-25 14:51:38 +00:00
|
|
|
|
controller().setStatus(InsetERT::Collapsed);
|
2001-08-06 14:55:02 +00:00
|
|
|
|
else
|
2003-02-25 14:51:38 +00:00
|
|
|
|
controller().setStatus(InsetERT::Inlined);
|
2001-08-06 14:55:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void FormERT::update()
|
|
|
|
|
{
|
2003-02-25 14:51:38 +00:00
|
|
|
|
switch (controller().status()) {
|
2002-03-21 16:59:12 +00:00
|
|
|
|
case InsetERT::Open:
|
2001-08-06 14:55:02 +00:00
|
|
|
|
fl_set_button(dialog_->radio_open, 1);
|
|
|
|
|
break;
|
2002-03-21 16:59:12 +00:00
|
|
|
|
case InsetERT::Collapsed:
|
2001-08-06 14:55:02 +00:00
|
|
|
|
fl_set_button(dialog_->radio_collapsed, 1);
|
|
|
|
|
break;
|
2002-03-21 16:59:12 +00:00
|
|
|
|
case InsetERT::Inlined:
|
2001-08-06 14:55:02 +00:00
|
|
|
|
fl_set_button(dialog_->radio_inlined, 1);
|
|
|
|
|
break;
|
2002-03-21 16:59:12 +00:00
|
|
|
|
}
|
2001-08-06 14:55:02 +00:00
|
|
|
|
}
|
2004-05-19 15:11:37 +00:00
|
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
|
} // namespace lyx
|