3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Martin Vermeer
8 * Full author contact details are available in file CREDITS.
14 #include "ControlNote.h"
15 #include "forms/form_note.h"
20 #include "insets/insetnote.h"
22 #include "lyx_forms.h"
28 typedef FormController<ControlNote, FormView<FD_note> > base_class;
30 FormNote::FormNote(Dialog & parent)
31 : base_class(parent, _("Note"))
35 void FormNote::build()
37 dialog_.reset(build_note(this));
39 note_gui_tokens(ids_, gui_names_);
41 for (string::size_type i = 0; i < gui_names_.size(); ++i) {
42 fl_addto_choice(dialog_->choice_type, gui_names_[i].c_str());
45 string str = _("Lyx Note: LyX internal only\n"
46 "Comment: Export to LaTeX but don't print\n"
47 "Greyed Out: Print as grey text");
48 tooltips().init(dialog_->choice_type, str);
50 bcview().setOK(dialog_->button_ok);
51 bcview().setApply(dialog_->button_apply);
52 bcview().setCancel(dialog_->button_cancel);
56 void FormNote::update()
58 string type(controller().params().type);
59 for (string::size_type i = 0; i < gui_names_.size(); ++i) {
61 fl_set_choice_text(dialog_->choice_type, gui_names_[i].c_str());
66 void FormNote::apply()
68 int i = fl_get_choice(dialog_->choice_type);
69 controller().params().type = ids_[i - 1];