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.
|
|
|
|
*
|
2002-08-15 16:02:22 +00:00
|
|
|
* \author Angus Leeming <leeming@lyx.org>
|
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"
|
2002-06-13 13:43:51 +00:00
|
|
|
#include "forms/form_index.h"
|
|
|
|
#include FORMS_H_LOCATION
|
2000-08-03 12:56:25 +00:00
|
|
|
|
2002-06-13 13:43:51 +00:00
|
|
|
typedef FormCB<ControlIndex, FormDB<FD_index> > base_class;
|
2001-03-16 12:08:14 +00:00
|
|
|
|
2002-08-12 14:28:43 +00:00
|
|
|
FormIndex::FormIndex()
|
|
|
|
: base_class(_("Index"))
|
2001-03-28 13:11:08 +00:00
|
|
|
{}
|
2000-10-03 05:53:25 +00:00
|
|
|
|
|
|
|
|
2000-08-03 12:56:25 +00:00
|
|
|
void FormIndex::build()
|
|
|
|
{
|
2002-06-13 13:43:51 +00:00
|
|
|
dialog_.reset(build_index(this));
|
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
|
|
|
|
2002-03-21 21:21:28 +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
|
|
|
}
|