2002-03-11 17:00:41 +00:00
|
|
|
|
/**
|
2002-03-11 22:47:41 +00:00
|
|
|
|
* \file xforms/FormERT.C
|
2002-03-11 17:00:41 +00:00
|
|
|
|
* Copyright 2001 The LyX Team.
|
|
|
|
|
* See the file COPYING.
|
|
|
|
|
*
|
2001-08-06 14:55:02 +00:00
|
|
|
|
* \author J<EFBFBD>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);
|
2002-03-12 14:11:15 +00:00
|
|
|
|
bc().setCancel(dialog_->button_close);
|
2001-08-06 14:55:02 +00:00
|
|
|
|
|
|
|
|
|
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()
|
|
|
|
|
{
|
2002-03-21 16:59:12 +00:00
|
|
|
|
switch (controller().params().status) {
|
|
|
|
|
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
|
|
|
|
}
|