]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormIndex.C
Yet more dialog tweaking from Rob.
[lyx.git] / src / frontends / xforms / FormIndex.C
1 /**
2  * \file xforms/FormIndex.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Angus Leeming 
7  *
8  * Full author contact details are available in file CREDITS
9  */
10
11 #include <config.h>
12
13 #ifdef __GNUG__
14 #pragma implementation
15 #endif
16
17 #include "xformsBC.h"
18 #include "ControlIndex.h"
19 #include "FormIndex.h"
20 #include "forms/form_index.h"
21 #include FORMS_H_LOCATION
22
23 typedef FormCB<ControlIndex, FormDB<FD_index> > base_class;
24
25 FormIndex::FormIndex()
26         : base_class(_("Index"))
27 {}
28
29
30 void FormIndex::build()
31 {
32         dialog_.reset(build_index(this));
33
34         fl_set_input_return(dialog_->input_key, FL_RETURN_CHANGED);
35         setPrehandler(dialog_->input_key);
36
37         // Manage the ok, apply, restore and cancel/close buttons
38         bc().setOK(dialog_->button_ok);
39         bc().setApply(dialog_->button_apply);
40         bc().setCancel(dialog_->button_close);
41         bc().setRestore(dialog_->button_restore);
42
43         bc().addReadOnly(dialog_->input_key);
44
45 }
46
47
48 void FormIndex::update()
49 {
50         fl_set_input(dialog_->input_key,
51                      controller().params().getContents().c_str());
52 }
53
54
55 void FormIndex::apply()
56 {
57         controller().params().setContents(fl_get_input(dialog_->input_key));
58 }