lyx_mirror/src/frontends/gtk/GNote.C
Martin Vermeer 1a77233c5f Add support for framed.sty
* src/LaTeXFeatures.C: add framed.sty

	(const * simplefeatures[]: add framed.sty
	(const LaTeXFeatures::getPackages): define shadecolor

	* src/insets/insetnote.h

	* src/insets/insetnote.C
	(const init_notetranslator):
	(InsetNote::setButtonLabel): add Framed and Shaded
	(InsetNote::latex): add output
	(InsetNote::validate): require framed.sty

	* src/buffer.C
	(BufferList bufferlist): new LyX version 246

	* src/frontends/qt3/ui/QNoteDialogBase.ui: add

	* src/frontends/qt3/QNoteDialog.C: add

	* src/frontends/qt3/QNote.C
	(QNote::update_contents): add framed, shaded
	(QNote::apply): add framed, shaded

	* src/LColor.[Ch]: add background colour for shaded

	* lib/lyx2lyx/LyX.py: New version support

	* lib/lyx2lyx/lyx_1_5.py: convert/revert

	* lib/chkconfig.ltx: add framed.sty

	* src/frontends/xforms/FormNote.C
	(FormNote::build):
	(FormNote::update): add FIXME

	* src/frontends/gtk/GNote.C
	(GNote::doBuild):
	(GNote::update):
	(GNote::apply): add FIXME

	* development/FORMAT: document format increase



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13993 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-03 16:46:27 +00:00

110 lines
2.2 KiB
C

/**
* \file GNote.C
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author John Spray
*
* Full author contact details are available in file CREDITS.
*/
#include <config.h>
// Too hard to make concept checks work with this file
#ifdef _GLIBCXX_CONCEPT_CHECKS
#undef _GLIBCXX_CONCEPT_CHECKS
#endif
#ifdef _GLIBCPP_CONCEPT_CHECKS
#undef _GLIBCPP_CONCEPT_CHECKS
#endif
#include "GNote.h"
#include "ControlNote.h"
#include "ghelpers.h"
#include "insets/insetnote.h"
#include <libglademm.h>
using std::string;
namespace lyx {
namespace frontend {
GNote::GNote(Dialog & parent)
: GViewCB<ControlNote, GViewGladeB>(parent, _("Note Settings"), false)
{}
void GNote::doBuild()
{
string const gladeName = findGladeFile("note");
xml_ = Gnome::Glade::Xml::create(gladeName);
Gtk::Button * cancelbutton;
xml_->get_widget("Close", cancelbutton);
setCancel(cancelbutton);
xml_->get_widget("LyXNote", lyxnoteradio_);
xml_->get_widget("Comment", commentradio_);
xml_->get_widget("GreyedOut", greyedoutradio_);
// FIXME add Framed, Shaded
lyxnoteradio_->signal_toggled().connect(
sigc::mem_fun(*this, &GNote::apply));
commentradio_->signal_toggled().connect(
sigc::mem_fun(*this, &GNote::apply));
greyedoutradio_->signal_toggled().connect(
sigc::mem_fun(*this, &GNote::apply));
bcview().addReadOnly(lyxnoteradio_);
bcview().addReadOnly(commentradio_);
bcview().addReadOnly(greyedoutradio_);
}
void GNote::update()
{
applylock_ = true;
bc().refreshReadOnly();
switch (controller().params().type) {
case InsetNoteParams::Note:
lyxnoteradio_->set_active(true);
break;
case InsetNoteParams::Comment:
commentradio_->set_active(true);
break;
case InsetNoteParams::Greyedout:
greyedoutradio_->set_active(true);
break;
// FIXME add Framed, Shaded
}
applylock_ = false;
}
void GNote::apply()
{
if (applylock_)
return;
InsetNoteParams::Type type;
if (lyxnoteradio_->get_active())
type = InsetNoteParams::Note;
else if (greyedoutradio_->get_active())
type = InsetNoteParams::Greyedout;
else
type = InsetNoteParams::Comment;
// FIXME add Framed, Shaded
controller().params().type = type;
controller().dispatchParams();
}
} // namespace frontend
} // namespace lyx