* 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
LyX file-format changes
-----------------------
+2006-06-03 Martin Vermeer <martin.vermeer@hut.fi>
+
+ * format incremented to 246. The framed.sty package is
+ now supported with note types framed and shaded.
+
2005-10-12 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* format incremented to 245. The \quotes_times parameter
\TestPackage{fancybox}
\TestPackage{fancyhdr}
\TestPackage{floatflt}
+\TestPackage{framed}
\TestPackage{geometry}
\TestPackage{jurabib}
\TestPackage{latex8}
("1_1_6fix3", [218], ["1.1.6fix3","1.1.6fix4","1.1"]),
("1_2", [220], ["1.2.0","1.2.1","1.2.3","1.2.4","1.2"]),
("1_3", [221], ["1.3.0","1.3.1","1.3.2","1.3.3","1.3.4","1.3.5","1.3.6","1.3"]),
- ("1_4", range(222,246), ["1.4.0cvs","1.4"])]
+ ("1_4", range(222,245), ["1.4.0", "1.4.1", "1.4.2svn"]),
+ ("1_5", [245,246], ["1.5.0svn"])]
def formats_list():
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-# convert = [[246, [convert_function1]]]
-convert = []
-revert = []
+from parser_tools import find_tokens
+##
+# Notes: Framed/Shaded
+#
+
+def revert_framed(file):
+ i = 0
+ while 1:
+ i = find_tokens(file.body, ["\\begin_inset Note Framed", "\\begin_inset Note Shaded"], i)
+
+ if i == -1:
+ return
+ file.body[i] = "\\begin_inset Note"
+ i = i + 1
+
+##
+# Conversion hub
+#
+
+convert = [[246, []]]
+revert = [[245, [revert_framed]]]
if __name__ == "__main__":
pass
{ commentbg, N_("comment background"), "commentbg", "linen", "commentbg" },
{ greyedout, N_("greyedout inset"), "greyedout", "red", "greyedout" },
{ greyedoutbg, N_("greyedout inset background"), "greyedoutbg", "linen", "greyedoutbg" },
+ { shadedbg, N_("shaded box"), "shaded", "#ff0000", "shaded" },
{ depthbar, N_("depth bar"), "depthbar", "IndianRed", "depthbar" },
{ language, N_("language"), "language", "Blue", "language" },
{ command, N_("command inset"), "command", "black", "command" },
greyedout,
/// Background color of greyedout inset
greyedoutbg,
-
+ /// Shaded box background
+ shadedbg,
/// Color for the depth bars in the margin
depthbar,
#include "LaTeXFeatures.h"
#include "bufferparams.h"
+#include "Color.h"
#include "debug.h"
#include "encoding.h"
#include "Floating.h"
#include "FloatList.h"
+#include "LColor.h"
#include "language.h"
#include "lyxlex.h"
#include "lyx_sty.h"
"calc",
"nicefrac",
"tipa",
+ "framed",
};
int const nb_simplefeatures = sizeof(simplefeatures) / sizeof(char const *);
<< params_.graphicsDriver
<< "]{graphicx}\n";
}
+ // shadecolor for shaded
+ if (isRequired("framed")) {
+ lyx::RGBColor c = lyx::RGBColor(lcolor.getX11Name(LColor::shadedbg));
+ packages << "\\definecolor{shadecolor}{rgb}{"
+ << c.r/255 << ',' << c.g/255 << ',' << c.b/255 << "}\n";
+ }
//if (algorithm) {
// packages << "\\usepackage{algorithm}\n";
namespace {
-int const LYX_FORMAT = 245;
+int const LYX_FORMAT = 246;
} // namespace anon
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));
case InsetNoteParams::Greyedout:
greyedoutradio_->set_active(true);
break;
+ // FIXME add Framed, Shaded
}
applylock_ = false;
type = InsetNoteParams::Greyedout;
else
type = InsetNoteParams::Comment;
+ // FIXME add Framed, Shaded
controller().params().type = type;
controller().dispatchParams();
case InsetNoteParams::Greyedout:
rb = dialog_->greyedoutRB;
break;
+ case InsetNoteParams::Framed:
+ rb = dialog_->framedRB;
+ break;
+ case InsetNoteParams::Shaded:
+ rb = dialog_->shadedRB;
+ break;
}
rb->setChecked(true);
type = InsetNoteParams::Greyedout;
else if (dialog_->commentRB->isChecked())
type = InsetNoteParams::Comment;
- else
+ else if (dialog_->noteRB->isChecked())
type = InsetNoteParams::Note;
+ else if (dialog_->framedRB->isChecked())
+ type = InsetNoteParams::Framed;
+ else if (dialog_->shadedRB->isChecked())
+ type = InsetNoteParams::Shaded;
controller().params().type = type;
}
#include "QNote.h"
#include <qpushbutton.h>
+#include <qradiobutton.h>
namespace lyx {
namespace frontend {
form, SLOT(slotOK()));
connect(closePB, SIGNAL(clicked()),
form, SLOT(slotClose()));
+ connect(framedRB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
+ connect(shadedRB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
}
-
void QNoteDialog::closeEvent(QCloseEvent * e)
{
form_->slotWMHide();
<string>Print as grey text</string>
</property>
</widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>framedRB</cstring>
+ </property>
+ <property name="text">
+ <string>&Framed</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Framed box</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>shadedRB</cstring>
+ </property>
+ <property name="text">
+ <string>&Shaded</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Shaded box</string>
+ </property>
+ </widget>
</vbox>
</widget>
</grid>
_("Export to LaTeX/Docbook but don't print"));
tooltips().init(dialog_->radio_greyedout,
_("Print as grey text"));
+ // FIXME add Framed, Shaded
bcview().setOK(dialog_->button_ok);
bcview().setCancel(dialog_->button_cancel);
case InsetNoteParams::Greyedout:
rb = dialog_->radio_greyedout;
break;
+ // FIXME add Framed, Shaded
}
fl_set_button(rb, 1);
NoteTranslator translator("Note", InsetNoteParams::Note);
translator.addPair("Comment", InsetNoteParams::Comment);
translator.addPair("Greyedout", InsetNoteParams::Greyedout);
+ translator.addPair("Framed", InsetNoteParams::Framed);
+ translator.addPair("Shaded", InsetNoteParams::Shaded);
return translator;
}
NoteTranslator translator(_("Note"), InsetNoteParams::Note);
translator.addPair(_("Comment"), InsetNoteParams::Comment);
translator.addPair(_("Greyed out"), InsetNoteParams::Greyedout);
+ translator.addPair(_("Framed"), InsetNoteParams::Framed);
+ translator.addPair(_("Shaded"), InsetNoteParams::Shaded);
return translator;
}
font.setColor(LColor::greyedout);
setBackgroundColor(LColor::greyedoutbg);
break;
+ case InsetNoteParams::Framed:
+ font.setColor(LColor::greyedout);
+ setBackgroundColor(LColor::greyedoutbg);
+ break;
+ case InsetNoteParams::Shaded:
+ font.setColor(LColor::greyedout);
+ setBackgroundColor(LColor::shadedbg);
+ break;
}
setLabelFont(font);
}
runparams.exportdata.reset(new ExportData);
} else if (params_.type == InsetNoteParams::Greyedout)
type = "lyxgreyedout";
+ else if (params_.type == InsetNoteParams::Framed)
+ type = "framed";
+ else if (params_.type == InsetNoteParams::Shaded)
+ type = "shaded";
ostringstream ss;
ss << "%\n\\begin{" << type << "}\n";
features.require("color");
features.require("lyxgreyedout");
}
+ if (params_.type == InsetNoteParams::Shaded) {
+ features.require("color");
+ features.require("framed");
+ }
+ if (params_.type == InsetNoteParams::Framed)
+ features.require("framed");
InsetText::validate(features);
}
enum Type {
Note,
Comment,
- Greyedout
+ Greyedout,
+ Framed,
+ Shaded
};
/// \c type defaults to Note
InsetNoteParams();