]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormERT.C
Change glob() API to accept a dir parameter.
[lyx.git] / src / frontends / xforms / FormERT.C
1 /**
2  * \file FormERT.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Jürgen Vigna
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "FormERT.h"
14 #include "ControlERT.h"
15 #include "forms/form_ert.h"
16
17 #include "xformsBC.h"
18
19 #include "lyx_forms.h"
20
21 namespace lyx {
22 namespace frontend {
23
24 typedef  FormController<ControlERT, FormView<FD_ert> > base_class;
25
26 FormERT::FormERT(Dialog & parent)
27         : base_class(parent, _("TeX Settings"))
28 {}
29
30
31 void FormERT::build()
32 {
33         dialog_.reset(build_ert(this));
34
35         // Manage the ok, apply and cancel/close buttons
36         bcview().setOK(dialog_->button_ok);
37         bcview().setApply(dialog_->button_apply);
38         bcview().setCancel(dialog_->button_close);
39
40         bcview().addReadOnly(dialog_->radio_open);
41         bcview().addReadOnly(dialog_->radio_collapsed);
42         bcview().addReadOnly(dialog_->radio_inlined);
43 }
44
45
46 void FormERT::apply()
47 {
48         if (fl_get_button(dialog_->radio_open))
49                 controller().setStatus(InsetERT::Open);
50         else if (fl_get_button(dialog_->radio_collapsed))
51                 controller().setStatus(InsetERT::Collapsed);
52         else
53                 controller().setStatus(InsetERT::Inlined);
54 }
55
56
57 void FormERT::update()
58 {
59         switch (controller().status()) {
60         case InsetERT::Open:
61                 fl_set_button(dialog_->radio_open, 1);
62                 break;
63         case InsetERT::Collapsed:
64                 fl_set_button(dialog_->radio_collapsed, 1);
65                 break;
66         case InsetERT::Inlined:
67                 fl_set_button(dialog_->radio_inlined, 1);
68                 break;
69         }
70 }
71
72 } // namespace frontend
73 } // namespace lyx