2 * \file xforms/FormIndex.C
3 * Copyright 2000-2001 The LyX Team.
4 * See the file COPYING.
6 * \author Angus Leeming, a.leeming@ic.ac.uk
12 #pragma implementation
16 #include "ControlIndex.h"
17 #include "FormIndex.h"
19 #include "form_index.h"
21 typedef FormCB<ControlIndex, FormDB<FD_form_index> > base_class;
23 FormIndex::FormIndex(ControlIndex & c)
24 : base_class(c, _("Index"))
28 void FormIndex::build()
30 dialog_.reset(build_index());
32 fl_set_input_return(dialog_->input_key, FL_RETURN_CHANGED);
33 setPrehandler(dialog_->input_key);
35 // Manage the ok, apply, restore and cancel/close buttons
36 bc().setOK(dialog_->button_ok);
37 bc().setApply(dialog_->button_apply);
38 bc().setCancel(dialog_->button_cancel);
39 bc().setRestore(dialog_->button_restore);
41 bc().addReadOnly(dialog_->input_key);
46 void FormIndex::update()
48 fl_set_input(dialog_->input_key,
49 controller().params().getContents().c_str());
53 void FormIndex::apply()
55 controller().params().setContents(fl_get_input(dialog_->input_key));