mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-04 06:15:59 +00:00
b538a4c8fe
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7675 a592a061-630c-0410-9148-cb99ea01b6c8
69 lines
1.4 KiB
C
69 lines
1.4 KiB
C
/**
|
|
* \file FormERT.C
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author Jürgen Vigna
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#include <config.h>
|
|
|
|
#include "FormERT.h"
|
|
#include "ControlERT.h"
|
|
#include "forms/form_ert.h"
|
|
|
|
#include "xformsBC.h"
|
|
|
|
#include "lyx_forms.h"
|
|
|
|
|
|
typedef FormController<ControlERT, FormView<FD_ert> > base_class;
|
|
|
|
FormERT::FormERT(Dialog & parent)
|
|
: base_class(parent, _("TeX Settings"))
|
|
{}
|
|
|
|
|
|
void FormERT::build()
|
|
{
|
|
dialog_.reset(build_ert(this));
|
|
|
|
// Manage the ok, apply and cancel/close buttons
|
|
bcview().setOK(dialog_->button_ok);
|
|
bcview().setApply(dialog_->button_apply);
|
|
bcview().setCancel(dialog_->button_close);
|
|
|
|
bcview().addReadOnly(dialog_->radio_open);
|
|
bcview().addReadOnly(dialog_->radio_collapsed);
|
|
bcview().addReadOnly(dialog_->radio_inlined);
|
|
}
|
|
|
|
|
|
void FormERT::apply()
|
|
{
|
|
if (fl_get_button(dialog_->radio_open))
|
|
controller().setStatus(InsetERT::Open);
|
|
else if (fl_get_button(dialog_->radio_collapsed))
|
|
controller().setStatus(InsetERT::Collapsed);
|
|
else
|
|
controller().setStatus(InsetERT::Inlined);
|
|
}
|
|
|
|
|
|
void FormERT::update()
|
|
{
|
|
switch (controller().status()) {
|
|
case InsetERT::Open:
|
|
fl_set_button(dialog_->radio_open, 1);
|
|
break;
|
|
case InsetERT::Collapsed:
|
|
fl_set_button(dialog_->radio_collapsed, 1);
|
|
break;
|
|
case InsetERT::Inlined:
|
|
fl_set_button(dialog_->radio_inlined, 1);
|
|
break;
|
|
}
|
|
}
|