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, _("LyX: Note Settings"))
35 void FormNote::build()
37 dialog_.reset(build_note(this));
40 tooltips().init(dialog_->radio_note,
41 _("LyX internal only"));
42 tooltips().init(dialog_->radio_comment,
43 _("Export to LaTeX/Docbook but don't print"));
44 tooltips().init(dialog_->radio_greyedout,
45 _("Print as grey text"));
47 bcview().setOK(dialog_->button_ok);
48 bcview().setCancel(dialog_->button_cancel);
52 void FormNote::update()
56 switch (controller().params().type) {
57 case InsetNoteParams::Note:
58 rb = dialog_->radio_note;
60 case InsetNoteParams::Comment:
61 rb = dialog_->radio_comment;
63 case InsetNoteParams::Greyedout:
64 rb = dialog_->radio_greyedout;
72 void FormNote::apply()
74 InsetNoteParams::Type type;
76 if (fl_get_button(dialog_->radio_greyedout))
77 type = InsetNoteParams::Greyedout;
78 else if (fl_get_button(dialog_->radio_comment))
79 type = InsetNoteParams::Comment;
81 type = InsetNoteParams::Note;
83 controller().params().type = type;