2002-03-11 17:00:41 +00:00
|
|
|
/**
|
2002-03-11 22:47:41 +00:00
|
|
|
* \file xforms/FormIndex.C
|
2002-03-11 17:00:41 +00:00
|
|
|
* Copyright 2000-2001 The LyX Team.
|
|
|
|
* See the file COPYING.
|
|
|
|
*
|
2001-03-28 13:11:08 +00:00
|
|
|
* \author Angus Leeming, a.leeming@ic.ac.uk
|
2000-08-03 12:56:25 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
2001-03-28 13:11:08 +00:00
|
|
|
#include "xformsBC.h"
|
|
|
|
#include "ControlIndex.h"
|
2000-08-03 12:56:25 +00:00
|
|
|
#include "FormIndex.h"
|
|
|
|
#include "LyXView.h"
|
|
|
|
#include "form_index.h"
|
|
|
|
|
2001-03-28 13:11:08 +00:00
|
|
|
typedef FormCB<ControlIndex, FormDB<FD_form_index> > base_class;
|
2001-03-16 12:08:14 +00:00
|
|
|
|
2001-03-28 13:11:08 +00:00
|
|
|
FormIndex::FormIndex(ControlIndex & c)
|
|
|
|
: base_class(c, _("Index"))
|
|
|
|
{}
|
2000-10-03 05:53:25 +00:00
|
|
|
|
|
|
|
|
2000-08-03 12:56:25 +00:00
|
|
|
void FormIndex::build()
|
|
|
|
{
|
2001-03-15 13:37:04 +00:00
|
|
|
dialog_.reset(build_index());
|
2000-08-04 13:12:30 +00:00
|
|
|
|
2000-11-28 06:46:06 +00:00
|
|
|
fl_set_input_return(dialog_->input_key, FL_RETURN_CHANGED);
|
2002-03-11 18:24:31 +00:00
|
|
|
setPrehandler(dialog_->input_key);
|
2000-11-28 06:46:06 +00:00
|
|
|
|
|
|
|
// Manage the ok, apply, restore and cancel/close buttons
|
2001-03-15 13:37:04 +00:00
|
|
|
bc().setOK(dialog_->button_ok);
|
|
|
|
bc().setApply(dialog_->button_apply);
|
2002-03-12 14:11:15 +00:00
|
|
|
bc().setCancel(dialog_->button_close);
|
2001-04-03 14:30:58 +00:00
|
|
|
bc().setRestore(dialog_->button_restore);
|
2000-11-28 06:46:06 +00:00
|
|
|
|
2001-03-15 13:37:04 +00:00
|
|
|
bc().addReadOnly(dialog_->input_key);
|
2001-03-28 13:11:08 +00:00
|
|
|
|
2000-08-03 12:56:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-10-24 13:13:59 +00:00
|
|
|
void FormIndex::update()
|
2000-08-03 12:56:25 +00:00
|
|
|
{
|
2001-03-28 13:11:08 +00:00
|
|
|
fl_set_input(dialog_->input_key,
|
|
|
|
controller().params().getContents().c_str());
|
2000-08-03 12:56:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void FormIndex::apply()
|
|
|
|
{
|
2001-03-28 13:11:08 +00:00
|
|
|
controller().params().setContents(fl_get_input(dialog_->input_key));
|
2000-08-03 12:56:25 +00:00
|
|
|
}
|