]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormIndex.C
4a0b62ed0a6fc684f6dfe0d9f1a44d0e9da5db8e
[lyx.git] / src / frontends / xforms / FormIndex.C
1 /**
2  * \file xforms/FormIndex.C
3  * Copyright 2000-2001 The LyX Team.
4  * See the file COPYING.
5  *
6  * \author Angus Leeming <leeming@lyx.org>
7  */
8
9 #include <config.h>
10
11 #ifdef __GNUG__
12 #pragma implementation
13 #endif
14
15 #include "xformsBC.h"
16 #include "ControlIndex.h"
17 #include "FormIndex.h"
18 #include "forms/form_index.h"
19 #include FORMS_H_LOCATION
20
21 typedef FormCB<ControlIndex, FormDB<FD_index> > base_class;
22
23 FormIndex::FormIndex()
24         : base_class(_("Index"))
25 {}
26
27
28 void FormIndex::build()
29 {
30         dialog_.reset(build_index(this));
31
32         fl_set_input_return(dialog_->input_key, FL_RETURN_CHANGED);
33         setPrehandler(dialog_->input_key);
34
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_close);
39         bc().setRestore(dialog_->button_restore);
40
41         bc().addReadOnly(dialog_->input_key);
42
43 }
44
45
46 void FormIndex::update()
47 {
48         fl_set_input(dialog_->input_key,
49                      controller().params().getContents().c_str());
50 }
51
52
53 void FormIndex::apply()
54 {
55         controller().params().setContents(fl_get_input(dialog_->input_key));
56 }