]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormNote.C
6d3c13c61aeb6ba92acf3f15bc83f6484dad337e
[lyx.git] / src / frontends / xforms / FormNote.C
1 /**
2  * \file FormNote.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
12 #include <config.h>
13
14 #include "xformsBC.h"
15 #include "ControlNote.h"
16 #include "FormNote.h"
17 #include "forms/form_note.h"
18 #include "xforms_helpers.h" // formatted
19 #include "lyx_forms.h"
20 #include "insets/insetnote.h"
21 #include "debug.h"
22
23 typedef FormController<ControlNote, FormView<FD_note> > base_class;
24
25 FormNote::FormNote(Dialog & parent)
26         : base_class(parent, _("Note"))
27 {}
28
29
30 void FormNote::build()
31 {
32         dialog_.reset(build_note(this));
33
34         fl_addto_choice(dialog_->choice_type, predefineds().c_str());
35
36         bcview().setOK(dialog_->button_ok);
37         bcview().setApply(dialog_->button_apply);
38         bcview().setCancel(dialog_->button_cancel);
39 }
40
41
42 void FormNote::update()
43 {
44         string type(controller().params().type);
45         fl_set_choice_text(dialog_->choice_type, type.c_str());
46 }
47
48
49 void FormNote::apply()
50 {
51         controller().params().type = fl_get_choice_text(dialog_->choice_type);
52 }
53