3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 // Too hard to make concept checks work with this file
14 #ifdef _GLIBCXX_CONCEPT_CHECKS
15 #undef _GLIBCXX_CONCEPT_CHECKS
17 #ifdef _GLIBCPP_CONCEPT_CHECKS
18 #undef _GLIBCPP_CONCEPT_CHECKS
22 #include "ControlNote.h"
25 #include "insets/insetnote.h"
27 #include <libglademm.h>
34 GNote::GNote(Dialog & parent)
35 : GViewCB<ControlNote, GViewGladeB>(parent, _("Note Settings"), false)
41 string const gladeName = findGladeFile("note");
42 xml_ = Gnome::Glade::Xml::create(gladeName);
44 Gtk::Button * cancelbutton;
45 xml_->get_widget("Close", cancelbutton);
46 setCancel(cancelbutton);
48 xml_->get_widget("LyXNote", lyxnoteradio_);
49 xml_->get_widget("Comment", commentradio_);
50 xml_->get_widget("GreyedOut", greyedoutradio_);
52 lyxnoteradio_->signal_toggled().connect(
53 sigc::mem_fun(*this, &GNote::apply));
54 commentradio_->signal_toggled().connect(
55 sigc::mem_fun(*this, &GNote::apply));
56 greyedoutradio_->signal_toggled().connect(
57 sigc::mem_fun(*this, &GNote::apply));
59 bcview().addReadOnly(lyxnoteradio_);
60 bcview().addReadOnly(commentradio_);
61 bcview().addReadOnly(greyedoutradio_);
69 bc().refreshReadOnly();
71 switch (controller().params().type) {
72 case InsetNoteParams::Note:
73 lyxnoteradio_->set_active(true);
75 case InsetNoteParams::Comment:
76 commentradio_->set_active(true);
78 case InsetNoteParams::Greyedout:
79 greyedoutradio_->set_active(true);
92 InsetNoteParams::Type type;
94 if (lyxnoteradio_->get_active())
95 type = InsetNoteParams::Note;
96 else if (greyedoutradio_->get_active())
97 type = InsetNoteParams::Greyedout;
99 type = InsetNoteParams::Comment;
101 controller().params().type = type;
102 controller().dispatchParams();
105 } // namespace frontend