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, lyx::to_utf8(_("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_);
51 // FIXME add Framed, Shaded
53 lyxnoteradio_->signal_toggled().connect(
54 sigc::mem_fun(*this, &GNote::apply));
55 commentradio_->signal_toggled().connect(
56 sigc::mem_fun(*this, &GNote::apply));
57 greyedoutradio_->signal_toggled().connect(
58 sigc::mem_fun(*this, &GNote::apply));
60 bcview().addReadOnly(lyxnoteradio_);
61 bcview().addReadOnly(commentradio_);
62 bcview().addReadOnly(greyedoutradio_);
70 bc().refreshReadOnly();
72 switch (controller().params().type) {
73 case InsetNoteParams::Framed:
74 //framedradio_->set_active(true);
75 greyedoutradio_->set_active(true);
77 case InsetNoteParams::Shaded:
78 //shadedradio_->set_active(true);
79 greyedoutradio_->set_active(true);
81 case InsetNoteParams::Note:
82 lyxnoteradio_->set_active(true);
84 case InsetNoteParams::Comment:
85 commentradio_->set_active(true);
87 case InsetNoteParams::Greyedout:
88 greyedoutradio_->set_active(true);
90 // FIXME: Framed and Shaded not handled properly
102 InsetNoteParams::Type type;
104 if (lyxnoteradio_->get_active())
105 type = InsetNoteParams::Note;
106 else if (greyedoutradio_->get_active())
107 type = InsetNoteParams::Greyedout;
109 type = InsetNoteParams::Comment;
110 // FIXME add Framed, Shaded
112 controller().params().type = type;
113 controller().dispatchParams();
116 } // namespace frontend