]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormIndex.C
2002-07-02 Lars Gullik Bj�nnes <larsbj@birdstep.com>
[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, a.leeming@ic.ac.uk
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 "frontends/LyXView.h"
19 #include "forms/form_index.h"
20 #include FORMS_H_LOCATION
21
22 typedef FormCB<ControlIndex, FormDB<FD_index> > base_class;
23
24 FormIndex::FormIndex(ControlIndex & c, Dialogs & d)
25         : base_class(c, d, _("Index"))
26 {}
27
28
29 void FormIndex::build()
30 {
31         dialog_.reset(build_index(this));
32
33         fl_set_input_return(dialog_->input_key, FL_RETURN_CHANGED);
34         setPrehandler(dialog_->input_key);
35
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);
41
42         bc().addReadOnly(dialog_->input_key);
43
44 }
45
46
47 void FormIndex::update()
48 {
49         fl_set_input(dialog_->input_key,
50                      controller().params().getContents().c_str());
51 }
52
53
54 void FormIndex::apply()
55 {
56         controller().params().setContents(fl_get_input(dialog_->input_key));
57 }