lyx_mirror/src/frontends/xforms/FormERT.C
Angus Leeming 7cbe56d12e sourcedoc-friendly files.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3713 a592a061-630c-0410-9148-cb99ea01b6c8
2002-03-11 17:00:41 +00:00

70 lines
1.4 KiB
C

/**
* \file FormERT.C
* Copyright 2001 The LyX Team.
* See the file COPYING.
*
* \author Jürgen Vigna, jug@sad.it
*/
#include <config.h>
#ifdef __GNUG__
#pragma implementation
#endif
#include "xformsBC.h"
#include "ControlERT.h"
#include "FormERT.h"
#include "form_ert.h"
#include "support/lstrings.h"
#include "helper_funcs.h"
#include "debug.h"
typedef FormCB<ControlERT, FormDB<FD_form_ert> > base_class;
FormERT::FormERT(ControlERT & c)
: base_class(c, _("ERT Options"))
{}
void FormERT::build()
{
dialog_.reset(build_ert());
// Manage the ok, apply and cancel/close buttons
bc().setOK(dialog_->button_ok);
bc().setApply(dialog_->button_apply);
bc().setCancel(dialog_->button_cancel);
bc().addReadOnly(dialog_->radio_open);
bc().addReadOnly(dialog_->radio_collapsed);
bc().addReadOnly(dialog_->radio_inlined);
}
void FormERT::apply()
{
if (fl_get_button(dialog_->radio_open))
controller().params().status = InsetERT::Open;
else if (fl_get_button(dialog_->radio_collapsed))
controller().params().status = InsetERT::Collapsed;
else
controller().params().status = InsetERT::Inlined;
}
void FormERT::update()
{
switch (controller().params().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;
}
}