LyX file-format changes
-----------------------
+2004-03-29 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * format incremented to 231.
+
+ * Support for sidewaysfigure/sidewaystable (rotating package).
+ insetfloat has now a param \sideways [true|false] (default is false).
+ The param should be erased on downwards conversion, if it was true,
+ the inset should be replaced by
+ \begin{sidewaysfigure} <content> \end{sidewaysfigure}
+ resp.
+ \begin{sidewaystable} <content> \end{sidewaystable}
+ i.e. ERT.
+
2004-02-23 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* format incremented to 230.
+2004-03-29 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * lyx2lyx: up the format to 231.
+
2004-03-26 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* lyxrevert_225.py (convert_frameless_box): fix minipage ERT output
format = re.compile(r"(\d)[\.,]?(\d\d)")
fileformat = re.compile(r"\\lyxformat\s*(\S*)")
-lst_ft = [210, 215, 216, 217, 218, 220, 221, 223, 224, 225, 226, 227, 228, 229, 230]
+lst_ft = [210, 215, 216, 217, 218, 220, 221, 223, 224, 225, 226, 227, 228, 229,
+ 230, 231]
def usage():
print """Usage: lyx2lyx [options] [file]
--- /dev/null
+# This file is part of lyx2lyx
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2003 José Matos <jamatos@fep.up.pt>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+
+import sys
+from parser_tools import find_token
+
+
+def convert(header, body):
+ pass
+
+if __name__ == "__main__":
+ pass
--- /dev/null
+# This file is part of lyx2lyx
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2003 José Matos <jamatos@fep.up.pt>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+
+import sys
+from parser_tools import find_token
+
+
+def convert(header, body):
+ pass
+
+if __name__ == "__main__":
+ pass
src/paragraph.C
src/rowpainter.C
src/support/globbing.C
+src/support/path_defines.C
+src/tex2lyx/lengthcommon.C
src/text.C
src/text2.C
src/text3.C
+2004-03-29 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * buffer.C: increment file format to 231.
2004-03-28 Alfredo Braunstein <abraunst@lyx.org>
* lyxrc.C (setDefaults, getDescription, output, read):
* lyxrc.h: remove ps_command
+>>>>>>> 1.1856
2004-03-22 Angus Leeming <leeming@lyx.org>
* lyx_main.C (error_handler, init): remove handler for SIGPIPE.
namespace {
-const int LYX_FORMAT = 230;
+const int LYX_FORMAT = 231;
} // namespace anon
+2004-03-29 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * QFloat.C:
+ * QFloatDialog.C:
+ * floatplacement.[Ch]: add support for sidewaysfloats
+ fix enabling of placement values (bug 1016)
+
2004-03-28 Angus Leeming <leeming@lyx.org>
* Dialogs.C (build): added print dialog.
{
InsetFloatParams & params = controller().params();
- params.placement = dialog_->floatFP->get(params.wide);
+ params.placement = dialog_->floatFP->get(params.wide, params.sideways);
}
// enable span columns checkbox
floatFP->useWide();
+
+ // enable sideways checkbox
+ floatFP->useSideways();
connect(floatFP, SIGNAL(changed()),
this, SLOT(change_adaptor()));
// FIXME: set disabled doesn't work properly
+// should be fixed now (jspitzm)
FloatPlacement::FloatPlacement(QWidget * parent, char * name)
: QWidget(parent, name)
{
heredefinitelyCB = new QCheckBox(qt_("Here definitely"), options);
ignoreCB = new QCheckBox(qt_("&Ignore LaTeX rules"), options);
spanCB = 0;
+ sidewaysCB = 0;
layout->addWidget(defaultsCB);
}
+void FloatPlacement::useSideways()
+{
+ sidewaysCB = new QCheckBox(qt_("&Rotate sideways"), this);
+ layout->addWidget(sidewaysCB);
+ setTabOrder(spanCB, sidewaysCB);
+ connect(sidewaysCB, SIGNAL(clicked()), this, SLOT(sidewaysClicked()));
+ connect(sidewaysCB, SIGNAL(toggled(bool)), this, SLOT(changedSlot()));
+}
+
+
void FloatPlacement::changedSlot()
{
emit changed();
if (params.wide) {
herepossiblyCB->setChecked(false);
+ heredefinitelyCB->setChecked(false);
bottomCB->setChecked(false);
}
spanCB->setChecked(params.wide);
+ sidewaysCB->setChecked(params.sideways);
+ sidewaysCB->setEnabled(params.type == "figure"
+ || params.type == "table");
}
-string const FloatPlacement::get(bool & wide) const
+string const FloatPlacement::get(bool & wide, bool & sideways) const
{
wide = spanCB->isChecked();
+ sideways = sidewaysCB->isChecked();
return get();
}
if (!defaultsCB->isChecked()) {
herepossiblyCB->setEnabled(!span);
heredefinitelyCB->setEnabled(!span);
+ bottomCB->setEnabled(!span);
}
if (!span)
herepossiblyCB->setChecked(false);
heredefinitelyCB->setChecked(false);
+ bottomCB->setChecked(false);
+}
+
+
+void FloatPlacement::sidewaysClicked()
+{
+ bool const sideways(sidewaysCB->isChecked());
+ bool const span(spanCB->isChecked());
+ bool const defaults(defaultsCB->isChecked());
+ bool ignore(topCB->isChecked());
+ ignore |= bottomCB->isChecked();
+ ignore |= pageCB->isChecked();
+ ignore |= herepossiblyCB->isChecked();
+
+ defaultsCB->setEnabled(!sideways);
+ topCB->setEnabled(!sideways && !defaults);
+ bottomCB->setEnabled(!sideways && !defaults);
+ pageCB->setEnabled(!sideways && !defaults);
+ spanCB->setEnabled(!sideways);
+ ignoreCB->setEnabled(!sideways && !defaults && ignore);
+ herepossiblyCB->setEnabled(!sideways && !defaults);
+ heredefinitelyCB->setEnabled(!sideways && !defaults);
+ if (!sideways && !defaults) {
+ herepossiblyCB->setEnabled(!span);
+ heredefinitelyCB->setEnabled(!span);
+ }
}
FloatPlacement(QWidget * parent, char * name);
void useWide();
+ void useSideways();
void set(InsetFloatParams const & params);
void set(std::string const & placement);
- std::string const get(bool & wide) const;
+ std::string const get(bool & wide, bool & sideways) const;
std::string const get() const;
public slots:
void tbhpClicked();
void heredefinitelyClicked();
void spanClicked();
+ void sidewaysClicked();
void changedSlot();
signals:
QCheckBox * defaultsCB;
QCheckBox * spanCB;
+ QCheckBox * sidewaysCB;
QCheckBox * ignoreCB;
QCheckBox * pageCB;
QCheckBox * heredefinitelyCB;
+2004-03-29 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * FormFloat.C:
+ * forms/form_float.fd:
+ add support for sidewaysfloats
+ fix enabling of placement values (bug 1016)
+
2004-03-28 Angus Leeming <leeming@lyx.org>
* Dialogs.C (build): added print dialog.
bcview().addReadOnly(dialog_->check_here);
bcview().addReadOnly(dialog_->check_force);
bcview().addReadOnly(dialog_->check_wide);
+ bcview().addReadOnly(dialog_->check_sideways);
placement_.init(dialog_->radio_default, DOCUMENT_DEFAULTS);
placement_.init(dialog_->radio_here_definitely, HERE_DEFINITELY);
tooltips().init(dialog_->check_force, str);
str = _("Span float over the columns.");
tooltips().init(dialog_->check_wide, str);
+ str = _("Rotate the float sideways by 90 degs.");
+ tooltips().init(dialog_->check_sideways, str);
}
void FormFloat::apply()
{
bool const wide = fl_get_button(dialog_->check_wide);
+ bool const sideways = fl_get_button(dialog_->check_sideways);
string placement;
switch (placement_.get()) {
controller().params().placement = placement;
controller().params().wide = wide;
+ controller().params().sideways = sideways;
}
{
string placement(controller().params().placement);
bool const wide = controller().params().wide;
+ bool const sideways = controller().params().sideways;
+ bool const sideways_possible = (controller().params().type == "figure"
+ || controller().params().type == "table");
bool const here_definitely = contains(placement, 'H');
fl_set_button(dialog_->check_page, page);
fl_set_button(dialog_->check_here, here);
fl_set_button(dialog_->check_wide, wide);
-
- setEnabled(dialog_->radio_here_definitely, !wide);
- setEnabled(dialog_->check_force, alternatives);
- setEnabled(dialog_->check_top, alternatives);
- setEnabled(dialog_->check_bottom, alternatives);
- setEnabled(dialog_->check_page, alternatives);
- setEnabled(dialog_->check_here, alternatives && !wide);
+ fl_set_button(dialog_->check_sideways, sideways);
+
+ setEnabled(dialog_->radio_here_definitely, !wide && !sideways);
+ setEnabled(dialog_->check_force, alternatives && !sideways);
+ setEnabled(dialog_->check_top, alternatives && !sideways);
+ setEnabled(dialog_->check_bottom, alternatives && !sideways);
+ setEnabled(dialog_->check_page, alternatives && !sideways);
+ setEnabled(dialog_->check_here, alternatives && !wide && !sideways);
+ setEnabled(dialog_->check_wide, !sideways);
+ setEnabled(dialog_->radio_default, !sideways);
+ setEnabled(dialog_->radio_alternatives, !sideways);
+ setEnabled(dialog_->check_sideways, sideways_possible);
}
{
bool const alternatives = placement_.get() == ALTERNATIVES;
bool const wide = fl_get_button(dialog_->check_wide);
+ bool const sideways = fl_get_button(dialog_->check_sideways);
if (ob == dialog_->radio_default ||
ob == dialog_->radio_here_definitely ||
ob == dialog_->radio_alternatives) {
// enable check buttons only for Alternatives
setEnabled(dialog_->check_top, alternatives);
- setEnabled(dialog_->check_bottom, alternatives);
setEnabled(dialog_->check_page, alternatives);
- // wide float doesn't allow 'here' placement
+ // wide float doesn't allow 'here' or 'bottom' placement
setEnabled(dialog_->check_here, alternatives && !wide);
+ setEnabled(dialog_->check_bottom, alternatives && !wide);
} else if (ob == dialog_->check_wide) {
if (wide && placement_.get() == HERE_DEFINITELY) {
}
setEnabled(dialog_->check_here, alternatives && !wide);
setEnabled(dialog_->radio_here_definitely, !wide);
+ setEnabled(dialog_->check_bottom, alternatives && !wide);
+
+ } else if (ob == dialog_->check_sideways) {
+ setEnabled(dialog_->radio_default, !sideways);
+ setEnabled(dialog_->radio_alternatives, !sideways);
+ setEnabled(dialog_->radio_here_definitely, !wide && !sideways);
+ setEnabled(dialog_->check_top, alternatives && !sideways);
+ setEnabled(dialog_->check_bottom,
+ alternatives && !wide && !sideways);
+ setEnabled(dialog_->check_page, alternatives && !sideways);
+ setEnabled(dialog_->check_here, alternatives && !wide && !sideways);
+ setEnabled(dialog_->check_wide, !sideways);
}
// enable force button, if Alternatives is selected and at least
// one of its check buttons
- bool const enable_force = alternatives &&
+ bool const enable_force = alternatives && !sideways &&
(fl_get_button(dialog_->check_top) ||
fl_get_button(dialog_->check_bottom) ||
fl_get_button(dialog_->check_page) ||
=============== FORM ===============
Name: form_float
Width: 395
-Height: 260
-Number of Objects: 17
+Height: 290
+Number of Objects: 18
--------------------
class: FL_BOX
type: FLAT_BOX
-box: 0 0 395 260
+box: 0 0 395 290
boxtype: FL_FLAT_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
-box: 5 230 90 25
+box: 5 260 90 25
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
--------------------
class: FL_BUTTON
type: RETURN_BUTTON
-box: 110 230 90 25
+box: 110 260 90 25
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
-box: 205 230 90 25
+box: 205 260 90 25
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
-box: 300 230 90 25
+box: 300 260 90 25
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
--------------------
class: FL_BEGIN_GROUP
type: 0
-box: 0 10 10 0
+box: 0 0 0 0
boxtype: FL_NO_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_CENTER
callback:
argument:
+--------------------
+class: FL_CHECKBUTTON
+type: PUSH_BUTTON
+box: 5 225 385 25
+boxtype: FL_NO_BOX
+colors: FL_COL1 FL_YELLOW
+alignment: FL_ALIGN_CENTER
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Rotate sideways|#o
+shortcut:
+resize: FL_RESIZE_NONE
+gravity: FL_SouthWest FL_SouthWest
+name: check_sideways
+callback: C_FormDialogView_InputCB
+argument: 0
+
==============================
create_the_forms
+2004-03-29 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * insetfloat.[Ch]: add param \sideways {true|false}
+ (support for sideways floats from rotating.sty).
2004-03-28 Alfredo Braunstein <abraunst@lyx.org>
InsetFloatMailer::string2params(cmd.argument, params);
params_.placement = params.placement;
params_.wide = params.wide;
+ params_.sideways = params.sideways;
wide(params_.wide, cur.bv().buffer()->params());
+ sideways(params_.sideways, cur.bv().buffer()->params());
cur.bv().update();
break;
}
os << "wide true\n";
else
os << "wide false\n";
+
+ if (sideways)
+ os << "sideways true\n";
+ else
+ os << "sideways false\n";
}
// take countermeasures
lex.pushToken(token);
}
+ lex.next();
+ token = lex.getString();
+ if (token == "sideways") {
+ lex.next();
+ string const tmptoken = lex.getString();
+ sideways = (tmptoken == "true");
+ } else {
+ lyxerr << "InsetFloat::Read:: Missing sideways!"
+ << endl;
+ // take countermeasures
+ lex.pushToken(token);
+ }
}
}
{
params_.read(lex);
wide(params_.wide, buf.params());
+ sideways(params_.sideways, buf.params());
InsetCollapsable::read(buf, lex);
}
if (contains(params_.placement, 'H')) {
features.require("float");
}
+
+ if (params_.sideways)
+ features.require("rotating");
features.useFloat(params_.type);
InsetCollapsable::validate(features);
OutputParams const & runparams) const
{
FloatList const & floats = buf.params().getLyXTextClass().floats();
- string const tmptype = (params_.wide ? params_.type + "*" : params_.type);
+ string tmptype = (params_.wide ? params_.type + "*" : params_.type);
+ if (params_.sideways) {
+ if (params_.type == "table")
+ tmptype = "sidewaystable";
+ else if (params_.type == "figure")
+ tmptype = "sidewaysfigure";
+ }
// Figure out the float placement to use.
// From lowest to highest:
// - float default placement
// when the current output line is empty.
os << "%\n\\begin{" << tmptype << '}';
// We only output placement if different from the def_placement.
- if (!placement.empty()) {
+ // sidewaysfloats always use their own page
+ if (!placement.empty() && !params_.sideways) {
os << '[' << placement << ']';
}
os << '\n';
}
+void InsetFloat::sideways(bool s, BufferParams const & bp)
+{
+ params_.sideways = s;
+ string lab = _("float: ") + floatname(params_.type, bp);
+ if (params_.sideways)
+ lab += _(" (sideways)");
+ setLabel(lab);
+}
+
+
void InsetFloat::addToToc(lyx::toc::TocList & toclist, Buffer const & buf) const
{
ParConstIterator pit(*this, 0);
struct InsetFloatParams {
///
- InsetFloatParams() : wide(false) {}
+ InsetFloatParams() : wide(false), sideways(false) {}
///
void write(std::ostream & os) const;
///
std::string placement;
///
bool wide;
+ ///
+ bool sideways;
};
///
void wide(bool w, BufferParams const &);
///
+ void sideways(bool s, BufferParams const &);
+ ///
void addToToc(lyx::toc::TocList &, Buffer const &) const;
///
bool showInsetDialog(BufferView *) const;