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"
29 typedef FormController<ControlNote, FormView<FD_note> > base_class;
31 FormNote::FormNote(Dialog & parent)
32 : base_class(parent, _("LyX: Note Settings"))
36 void FormNote::build()
38 dialog_.reset(build_note(this));
41 tooltips().init(dialog_->radio_note,
42 _("LyX internal only"));
43 tooltips().init(dialog_->radio_comment,
44 _("Export to LaTeX/Docbook but don't print"));
45 tooltips().init(dialog_->radio_greyedout,
46 _("Print as grey text"));
48 bcview().setOK(dialog_->button_ok);
49 bcview().setCancel(dialog_->button_cancel);
53 void FormNote::update()
57 switch (controller().params().type) {
58 case InsetNoteParams::Note:
59 rb = dialog_->radio_note;
61 case InsetNoteParams::Comment:
62 rb = dialog_->radio_comment;
64 case InsetNoteParams::Greyedout:
65 rb = dialog_->radio_greyedout;
73 void FormNote::apply()
75 InsetNoteParams::Type type;
77 if (fl_get_button(dialog_->radio_greyedout))
78 type = InsetNoteParams::Greyedout;
79 else if (fl_get_button(dialog_->radio_comment))
80 type = InsetNoteParams::Comment;
82 type = InsetNoteParams::Note;
84 controller().params().type = type;
87 } // namespace frontend