2 * \file xforms/FormIndex.C
3 * See the file COPYING.
5 * \author Angus Leeming
7 * Full author contact details are available in file CREDITS
13 #pragma implementation
17 #include "ControlIndex.h"
18 #include "FormIndex.h"
19 #include "forms/form_index.h"
20 #include FORMS_H_LOCATION
22 typedef FormCB<ControlIndex, FormDB<FD_index> > base_class;
24 FormIndex::FormIndex()
25 : base_class(_("Index"))
29 void FormIndex::build()
31 dialog_.reset(build_index(this));
33 fl_set_input_return(dialog_->input_key, FL_RETURN_CHANGED);
34 setPrehandler(dialog_->input_key);
36 // Manage the ok, apply, restore and cancel/close buttons
37 bc().setOK(dialog_->button_ok);
38 bc().setApply(dialog_->button_apply);
39 bc().setCancel(dialog_->button_close);
40 bc().setRestore(dialog_->button_restore);
42 bc().addReadOnly(dialog_->input_key);
47 void FormIndex::update()
49 fl_set_input(dialog_->input_key,
50 controller().params().getContents().c_str());
54 void FormIndex::apply()
56 controller().params().setContents(fl_get_input(dialog_->input_key));