Jürgen,
I have created the branch for the booktabs support. The current diff against
HEAD is attached.
You can update an existing tree with
cvs update -P -r BooktabBranch
TODO list:
1. Disable changing of vertical rules in the frontends if booktabs are
enabled. The output of vertical rules is already suppressed.
2. add GUI for \addlinespace
3. maybe add \morecmidrules somewhere (don't know if this is necessary)
4. documentation
5. testing of course
6. convince Lars to merge it back to HEAD :-)
I will probably look after 1. and 3, but not too soon.
Georg
? build-tree
? conf
? x.diff
Index: lib/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/ChangeLog,v
retrieving revision 1.651
diff -u -p -r1.651 ChangeLog
--- lib/ChangeLog 5 Nov 2004 13:28:01 -0000 1.651
+++ lib/ChangeLog 11 Nov 2004 18:55:12 -0000
@@ -1,3 +1,7 @@
+2004-11-11 Georg Baum <[EMAIL PROTECTED]>
+
+ * chkconfig.ltx: check package booktabs
+
2004-11-05 Bennett Helm <[EMAIL PROTECTED]>
* bind/mac.bind: use <cmd>-Tab and <cmd>-backtab as shortcuts for
Index: lib/chkconfig.ltx
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/chkconfig.ltx,v
retrieving revision 1.14
diff -u -p -r1.14 chkconfig.ltx
--- lib/chkconfig.ltx 14 Sep 2004 10:20:37 -0000 1.14
+++ lib/chkconfig.ltx 11 Nov 2004 18:55:12 -0000
@@ -200,6 +200,7 @@
\TestPackage{a4wide}
\TestPackage{array}
\TestPackage{babel}
+\TestPackage{booktabs}
\TestPackage{color} % this one should be there if graphics.sty is there.
\TestPackage{fancyhdr}
\TestPackage{floatflt}
Index: lib/doc/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/doc/ChangeLog,v
retrieving revision 1.15
diff -u -p -r1.15 ChangeLog
--- lib/doc/ChangeLog 4 Nov 2004 15:42:38 -0000 1.15
+++ lib/doc/ChangeLog 11 Nov 2004 18:55:12 -0000
@@ -1,3 +1,7 @@
+2004-11-11 Georg Baum <[EMAIL PROTECTED]>
+
+ * LaTeXConfig.lyx.in, LyXConfig.lyx.in: add booktabs package
+
2004-11-04 Christian Ridderström <[EMAIL PROTECTED]>
* LaTeXConfig.lyx.in: remove "supported" and "other" from CTAN
Index: lib/doc/LaTeXConfig.lyx.in
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/doc/LaTeXConfig.lyx.in,v
retrieving revision 1.40
diff -u -p -r1.40 LaTeXConfig.lyx.in
--- lib/doc/LaTeXConfig.lyx.in 4 Nov 2004 15:42:38 -0000 1.40
+++ lib/doc/LaTeXConfig.lyx.in 11 Nov 2004 18:55:13 -0000
@@ -2107,6 +2107,32 @@ Table of contents
\begin_layout Subsection
+booktabs
+\end_layout
+
+\begin_layout Description
+
+Found: @chk_booktabs@
+\end_layout
+
+\begin_layout Description
+
+CTAN:
+\family typewriter
+macros/latex/contrib/booktabs/
+\end_layout
+
+\begin_layout Description
+
+Notes: The package
+\family sans
+booktabs
+\family default
+ is needed by LyX to be able to output correctly formal tables.
+\end_layout
+
+\begin_layout Subsection
+
color
\end_layout
Index: lib/doc/LyXConfig.lyx.in
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/doc/LyXConfig.lyx.in,v
retrieving revision 1.4
diff -u -p -r1.4 LyXConfig.lyx.in
--- lib/doc/LyXConfig.lyx.in 17 Jan 2003 13:50:10 -0000 1.4
+++ lib/doc/LyXConfig.lyx.in 11 Nov 2004 18:55:13 -0000
@@ -1135,6 +1135,24 @@ Table of contents
if you want to use non-English quotes.
\layout Subsection
+booktabs
+\layout Description
+
+Found: @chk_booktabs@
+\layout Description
+
+CTAN:
+\family typewriter
+macros/latex/contrib/booktabs/
+\layout Description
+
+Notes: The package
+\family sans
+booktabs
+\family default
+ is needed by LyX to be able to output correctly formal tables.
+\layout Subsection
+
color
\layout Description
Index: lib/lyx2lyx/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/lyx2lyx/ChangeLog,v
retrieving revision 1.49
diff -u -p -r1.49 ChangeLog
--- lib/lyx2lyx/ChangeLog 28 Oct 2004 11:21:26 -0000 1.49
+++ lib/lyx2lyx/ChangeLog 11 Nov 2004 18:55:14 -0000
@@ -1,3 +1,8 @@
+2004-11-11 Georg Baum <[EMAIL PROTECTED]>
+
+ * lyx_1_4.py, LyX.py: handle new format 238
+ * lyx_1_4.py (revert_booktabs): new
+
2004-10-28 José Matos <[EMAIL PROTECTED]>
* LyX.pm: add internal documentation.
Index: lib/lyx2lyx/LyX.py
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/lyx2lyx/LyX.py,v
retrieving revision 1.5
diff -u -p -r1.5 LyX.py
--- lib/lyx2lyx/LyX.py 28 Oct 2004 11:21:27 -0000 1.5
+++ lib/lyx2lyx/LyX.py 11 Nov 2004 18:55:14 -0000
@@ -44,7 +44,7 @@ format_relation = [("0_10", [210], ["0.
("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"]),
- ("1_4", range(223,238), ["1.4.0cvs","1.4"])]
+ ("1_4", range(223,239), ["1.4.0cvs","1.4"])]
def formats_list():
Index: lib/lyx2lyx/lyx_1_4.py
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/lyx2lyx/lyx_1_4.py,v
retrieving revision 1.17
diff -u -p -r1.17 lyx_1_4.py
--- lib/lyx2lyx/lyx_1_4.py 26 Oct 2004 21:16:42 -0000 1.17
+++ lib/lyx2lyx/lyx_1_4.py 11 Nov 2004 18:55:15 -0000
@@ -1362,6 +1362,24 @@ def revert_paperpackage(file):
file.header[i] = replace(file.header[i], paperpackage, packages[paperpackage])
+def revert_booktabs(file):
+# we just remove the booktabs flag, everything else will become a mess.
+ i = 0
+ while 1:
+ i = find_token(file.body, "\\begin_inset Tabular", i)
+ if i == -1:
+ return
+ j = find_end_of_inset(file.body, i + 1)
+ if j == -1:
+ file.warning("Malformed LyX file: Could not find end of tabular.")
+ continue
+ for k in range(i, j):
+ if re.search('^<features.* booktabs="true".*>$', file.body[k]):
+ file.warning("Converting 'booktabs' table to normal table.")
+ file.body[k] = replace(file.body[k], ' booktabs="true"', '')
+ i = i + 1
+
+
##
# Bullets
#
@@ -1526,7 +1544,8 @@ def convert(file):
235 : [convert_paperpackage],
236 : [convert_bullets, add_begin_header, add_begin_body,
normalize_papersize, strip_end_space],
- 237 : [use_x_boolean]}
+ 237 : [use_x_boolean],
+ 238 : []}
chain = table.keys()
chain.sort()
@@ -1542,7 +1561,8 @@ def convert(file):
def revert(file):
- table = { 236: [use_x_binary],
+ table = { 237: [revert_booktabs],
+ 236: [use_x_binary],
235: [denormalize_papersize, remove_begin_body,remove_begin_header,
revert_bullets],
234: [revert_paperpackage],
Index: src/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.2033
diff -u -p -r1.2033 ChangeLog
--- src/ChangeLog 11 Nov 2004 12:32:53 -0000 1.2033
+++ src/ChangeLog 11 Nov 2004 18:55:18 -0000
@@ -1,3 +1,13 @@
+2004-11-11 Georg Baum <[EMAIL PROTECTED]>
+
+ * buffer.C: format up to 238.
+
+2004-11-11 Edwin Leuven
+
+ * LaTeXFeatures.C: add booktabs package
+ * tabular.[Ch] (use_booktabs, setBookTabs, useBookTabs): new members,
+ use them in several places
+
2004-11-11 Jürgen Spitzmüller <[EMAIL PROTECTED]>
* lengthcommon.C: a more general fix for bug 1682
Index: src/LaTeXFeatures.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/LaTeXFeatures.C,v
retrieving revision 1.114
diff -u -p -r1.114 LaTeXFeatures.C
--- src/LaTeXFeatures.C 6 Nov 2004 15:23:09 -0000 1.114
+++ src/LaTeXFeatures.C 11 Nov 2004 18:55:18 -0000
@@ -189,6 +189,7 @@ char const * simplefeatures[] = {
"varioref",
"prettyref",
"float",
+ "booktabs",
"wasy",
"dvipost",
"fancybox",
Index: src/buffer.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.C,v
retrieving revision 1.592
diff -u -p -r1.592 buffer.C
--- src/buffer.C 7 Nov 2004 13:30:51 -0000 1.592
+++ src/buffer.C 11 Nov 2004 18:55:18 -0000
@@ -136,7 +136,7 @@ extern BufferList bufferlist;
namespace {
-const int LYX_FORMAT = 237;
+const int LYX_FORMAT = 238;
} // namespace anon
Index: src/tabular.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/tabular.C,v
retrieving revision 1.215
diff -u -p -r1.215 tabular.C
--- src/tabular.C 2 Nov 2004 11:25:17 -0000 1.215
+++ src/tabular.C 11 Nov 2004 18:55:19 -0000
@@ -369,6 +369,7 @@ void LyXTabular::init(BufferParams const
column_info.back().right_line = true;
is_long_tabular = false;
rotate = false;
+ use_booktabs = false;
}
@@ -538,10 +539,10 @@ int LyXTabular::numberOfCellsInRow(int c
}
-// returns 1 if there is a topline, returns 0 if not
bool LyXTabular::topLine(int cell, bool onlycolumn) const
{
- if (!onlycolumn && isMultiColumn(cell))
+ if (!onlycolumn && isMultiColumn(cell) &&
+ !(use_booktabs && row_of_cell(cell) == 0))
return cellinfo_of_cell(cell).top_line;
return row_info[row_of_cell(cell)].top_line;
}
@@ -549,7 +550,8 @@ bool LyXTabular::topLine(int cell, bool
bool LyXTabular::bottomLine(int cell, bool onlycolumn) const
{
- if (!onlycolumn && isMultiColumn(cell))
+ if (!onlycolumn && isMultiColumn(cell) &&
+ !(use_booktabs && isLastRow(cell)))
return cellinfo_of_cell(cell).bottom_line;
return row_info[row_of_cell(cell)].bottom_line;
}
@@ -557,6 +559,8 @@ bool LyXTabular::bottomLine(int cell, bo
bool LyXTabular::leftLine(int cell, bool onlycolumn) const
{
+ if (use_booktabs)
+ return false;
if (!onlycolumn && isMultiColumn(cell) &&
(isFirstCellInRow(cell) || isMultiColumn(cell-1)))
{
@@ -572,6 +576,8 @@ bool LyXTabular::leftLine(int cell, bool
bool LyXTabular::rightLine(int cell, bool onlycolumn) const
{
+ if (use_booktabs)
+ return false;
if (!onlycolumn && isMultiColumn(cell) &&
(isLastCellInRow(cell) || isMultiColumn(cell + 1)))
{
@@ -1078,6 +1084,7 @@ void LyXTabular::write(Buffer const & bu
// global longtable options
os << "<features"
<< write_attribute("rotate", rotate)
+ << write_attribute("booktabs", use_booktabs)
<< write_attribute("islongtable", is_long_tabular)
<< write_attribute("firstHeadTopDL", endfirsthead.topDL)
<< write_attribute("firstHeadBottomDL", endfirsthead.bottomDL)
@@ -1244,6 +1251,7 @@ void LyXTabular::read(Buffer const & buf
return;
}
getTokenValue(line, "rotate", rotate);
+ getTokenValue(line, "booktabs", use_booktabs);
getTokenValue(line, "islongtable", is_long_tabular);
// compatibility read for old longtable options. Now we can make any
// row part of the header/footer type we want before it was strict
@@ -1424,6 +1432,18 @@ int LyXTabular::unsetMultiColumn(int cel
}
+void LyXTabular::setBookTabs(bool what)
+{
+ use_booktabs = what;
+}
+
+
+bool LyXTabular::useBookTabs() const
+{
+ return use_booktabs;
+}
+
+
void LyXTabular::setLongTabular(bool what)
{
is_long_tabular = what;
@@ -1719,12 +1739,14 @@ int LyXTabular::TeXTopHLine(ostream & os
if (topLine(i))
++tmp;
}
- if (tmp == n - fcell) {
- os << "\\hline ";
+ if (use_booktabs && row == 0) {
+ os << "\\toprule ";
+ } else if (tmp == n - fcell) {
+ os << (use_booktabs ? "\\midrule " : "\\hline ");
} else if (tmp) {
for (int i = fcell; i < n; ++i) {
if (topLine(i)) {
- os << "\\cline{"
+ os << (use_booktabs ? "\\cmidrule{" : "\\cline{")
<< column_of_cell(i) + 1
<< '-'
<< right_column_of_cell(i) + 1
@@ -1752,12 +1774,14 @@ int LyXTabular::TeXBottomHLine(ostream &
if (bottomLine(i))
++tmp;
}
- if (tmp == n - fcell) {
- os << "\\hline";
+ if (use_booktabs && row == rows_ - 1) {
+ os << "\\bottomrule ";
+ } else if (tmp == n - fcell) {
+ os << (use_booktabs ? "\\midrule " : "\\hline ");
} else if (tmp) {
for (int i = fcell; i < n; ++i) {
if (bottomLine(i)) {
- os << "\\cline{"
+ os << (use_booktabs ? "\\cmidrule{" : "\\cline{")
<< column_of_cell(i) + 1
<< '-'
<< right_column_of_cell(i) + 1
@@ -2043,7 +2067,7 @@ int LyXTabular::latex(Buffer const & buf
if (!column_info[i].align_special.empty()) {
os << column_info[i].align_special;
} else {
- if (column_info[i].left_line)
+ if (!use_booktabs && column_info[i].left_line)
os << '|';
if (!column_info[i].p_width.zero()) {
switch (column_info[i].alignment) {
@@ -2090,7 +2114,7 @@ int LyXTabular::latex(Buffer const & buf
break;
}
}
- if (column_info[i].right_line)
+ if (!use_booktabs && column_info[i].right_line)
os << '|';
}
}
@@ -2564,6 +2588,8 @@ int LyXTabular::getCellFromInset(InsetBa
void LyXTabular::validate(LaTeXFeatures & features) const
{
features.require("NeedTabularnewline");
+ if (useBookTabs())
+ features.require("booktabs");
if (isLongTabular())
features.require("longtable");
if (needRotating())
Index: src/tabular.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/tabular.h,v
retrieving revision 1.91
diff -u -p -r1.91 tabular.h
--- src/tabular.h 5 Oct 2004 10:11:30 -0000 1.91
+++ src/tabular.h 11 Nov 2004 18:55:19 -0000
@@ -124,6 +124,10 @@ public:
///
SET_SPECIAL_MULTI,
///
+ SET_BOOKTABS,
+ ///
+ UNSET_BOOKTABS,
+ ///
LAST_ACTION
};
///
@@ -304,6 +308,10 @@ public:
///
int right_column_of_cell(int cell) const;
///
+ void setBookTabs(bool);
+ ///
+ bool useBookTabs() const;
+ ///
void setLongTabular(bool);
///
bool isLongTabular() const;
@@ -486,6 +494,8 @@ public:
mutable cell_vvector cell_info;
///
int width_of_tabular;
+ ///
+ bool use_booktabs;
///
bool rotate;
//
Index: src/frontends/controllers/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ChangeLog,v
retrieving revision 1.455
diff -u -p -r1.455 ChangeLog
--- src/frontends/controllers/ChangeLog 9 Nov 2004 19:08:33 -0000 1.455
+++ src/frontends/controllers/ChangeLog 11 Nov 2004 18:55:19 -0000
@@ -1,3 +1,7 @@
+2004-11-11 Edwin Leuven
+
+ * ControlTabular.[Ch] (booktabs): new
+
2004-11-09 Georg Baum <[EMAIL PROTECTED]>
* ControlInclude.C (browse): Use GetExtension() instead of
Index: src/frontends/controllers/ControlTabular.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlTabular.C,v
retrieving revision 1.20
diff -u -p -r1.20 ControlTabular.C
--- src/frontends/controllers/ControlTabular.C 19 May 2004 15:11:30 -0000 1.20
+++ src/frontends/controllers/ControlTabular.C 11 Nov 2004 18:55:19 -0000
@@ -213,6 +213,15 @@ void ControlTabular::valign(ControlTabul
}
+void ControlTabular::booktabs(bool yes)
+{
+ if (yes)
+ set(LyXTabular::SET_BOOKTABS);
+ else
+ set(LyXTabular::UNSET_BOOKTABS);
+}
+
+
void ControlTabular::longTabular(bool yes)
{
if (yes)
Index: src/frontends/controllers/ControlTabular.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlTabular.h,v
retrieving revision 1.11
diff -u -p -r1.11 ControlTabular.h
--- src/frontends/controllers/ControlTabular.h 19 May 2004 15:11:30 -0000 1.11
+++ src/frontends/controllers/ControlTabular.h 11 Nov 2004 18:55:19 -0000
@@ -67,6 +67,8 @@ public:
void valign(VALIGN h);
+ void booktabs(bool yes);
+
void longTabular(bool yes);
private:
Index: src/frontends/qt2/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/ChangeLog,v
retrieving revision 1.723
diff -u -p -r1.723 ChangeLog
--- src/frontends/qt2/ChangeLog 9 Nov 2004 12:40:33 -0000 1.723
+++ src/frontends/qt2/ChangeLog 11 Nov 2004 18:55:20 -0000
@@ -1,3 +1,9 @@
+2004-11-11 Edwin Leuven
+
+ * QTabular.C (build_dialog, update_contents): handle booktabsCB
+ * QTabularDialog.[Ch] (booktabs_clicked): new
+ * ui/QTabularDialogBase.ui (booktabsCB): new checkbox
+
2004-11-08 Jean-Marc Lasgouttes <[EMAIL PROTECTED]>
* QLToolbar.C (selected): use layoutSelected
Index: src/frontends/qt2/QTabular.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QTabular.C,v
retrieving revision 1.31
diff -u -p -r1.31 QTabular.C
--- src/frontends/qt2/QTabular.C 20 May 2004 09:36:28 -0000 1.31
+++ src/frontends/qt2/QTabular.C 11 Nov 2004 18:55:21 -0000
@@ -59,6 +59,7 @@ void QTabular::build_dialog()
bcview().addReadOnly(dialog_->borderSetPB);
bcview().addReadOnly(dialog_->borderUnsetPB);
bcview().addReadOnly(dialog_->borders);
+ bcview().addReadOnly(dialog_->booktabsCB);
bcview().addReadOnly(dialog_->longTabularCB);
bcview().addReadOnly(dialog_->headerStatusCB);
bcview().addReadOnly(dialog_->headerBorderAboveCB);
@@ -145,6 +146,8 @@ void QTabular::update_contents()
dialog_->rotateTabularCB->setChecked(tabular.getRotateTabular());
dialog_->longTabularCB->setChecked(tabular.isLongTabular());
+
+ dialog_->booktabsCB->setChecked(tabular.useBookTabs());
update_borders();
Index: src/frontends/qt2/QTabularDialog.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QTabularDialog.C,v
retrieving revision 1.24
diff -u -p -r1.24 QTabularDialog.C
--- src/frontends/qt2/QTabularDialog.C 2 Jun 2004 20:13:18 -0000 1.24
+++ src/frontends/qt2/QTabularDialog.C 11 Nov 2004 18:55:21 -0000
@@ -345,5 +345,14 @@ void QTabularDialog::ltLastFooterEmpty_c
form_->changed();
}
+
+void QTabularDialog::booktabs_clicked()
+{
+ if (booktabsCB->isChecked())
+ form_->controller().set(LyXTabular::SET_BOOKTABS);
+ else
+ form_->controller().set(LyXTabular::UNSET_BOOKTABS);
+}
+
} // namespace frontend
} // namespace lyx
Index: src/frontends/qt2/QTabularDialog.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QTabularDialog.h,v
retrieving revision 1.10
diff -u -p -r1.10 QTabularDialog.h
--- src/frontends/qt2/QTabularDialog.h 19 May 2004 15:11:34 -0000 1.10
+++ src/frontends/qt2/QTabularDialog.h 11 Nov 2004 18:55:21 -0000
@@ -59,6 +59,7 @@ protected slots:
virtual void ltLastFooterBorderAbove_clicked();
virtual void ltLastFooterBorderBelow_clicked();
virtual void ltLastFooterEmpty_clicked();
+ virtual void booktabs_clicked();
protected:
virtual void closeEvent(QCloseEvent * e);
Index: src/frontends/qt2/ui/QTabularDialogBase.ui
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/ui/QTabularDialogBase.ui,v
retrieving revision 1.7
diff -u -p -r1.7 QTabularDialogBase.ui
--- src/frontends/qt2/ui/QTabularDialogBase.ui 3 Sep 2003 16:02:57 -0000 1.7
+++ src/frontends/qt2/ui/QTabularDialogBase.ui 11 Nov 2004 18:55:21 -0000
@@ -121,7 +121,26 @@
<string>Horizontal alignment in column</string>
</property>
</widget>
- <widget row="3" column="0" rowspan="1" colspan="4" >
+ <widget row="3" column="0">
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>booktabsCB</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&Formal table</string>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>Print as formal table (different horizontal rules, no vertical rules)</string>
+ </property>
+ </widget>
+ <widget row="4" column="0" rowspan="1" colspan="4" >
<class>QCheckBox</class>
<property stdset="1">
<name>name</name>
@@ -140,7 +159,7 @@
<string>Rotate the table by 90 degrees</string>
</property>
</widget>
- <widget row="4" column="0" rowspan="1" colspan="4" >
+ <widget row="5" column="0" rowspan="1" colspan="4" >
<class>QCheckBox</class>
<property stdset="1">
<name>name</name>
@@ -155,7 +174,7 @@
<string>Rotate this cell by 90 degrees</string>
</property>
</widget>
- <widget row="5" column="0" rowspan="1" colspan="2" >
+ <widget row="6" column="0" rowspan="1" colspan="2" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
@@ -170,7 +189,7 @@
<cstring>specialAlignmentED</cstring>
</property>
</widget>
- <widget row="5" column="2" rowspan="1" colspan="2" >
+ <widget row="6" column="2" rowspan="1" colspan="2" >
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
@@ -181,7 +200,7 @@
<string>Custom column format (LaTeX)</string>
</property>
</widget>
- <spacer row="6" column="2" >
+ <spacer row="7" column="2" >
<property>
<name>name</name>
<cstring>Spacer5</cstring>
@@ -1469,6 +1488,13 @@
<receiver>QTabularDialogBase</receiver>
<slot>longTabular()</slot>
</connection>
+ <connection>
+ <sender>booktabsCB</sender>
+ <signal>clicked()</signal>
+ <receiver>QTabularDialogBase</receiver>
+ <slot>booktabs_clicked()</slot>
+ </connection>
+ <slot access="protected">booktabs_clicked()</slot>
<slot access="protected">borderSet_clicked()</slot>
<slot access="protected">borderUnset_clicked()</slot>
<slot access="protected">bottomBorder_changed()</slot>
@@ -1508,6 +1534,7 @@
<tabstop>widthUnit</tabstop>
<tabstop>vAlignCB</tabstop>
<tabstop>multicolumnCB</tabstop>
+ <tabstop>booktabsCB</tabstop>
<tabstop>rotateTabularCB</tabstop>
<tabstop>rotateCellCB</tabstop>
<tabstop>specialAlignmentED</tabstop>
Index: src/frontends/xforms/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/ChangeLog,v
retrieving revision 1.944
diff -u -p -r1.944 ChangeLog
--- src/frontends/xforms/ChangeLog 9 Nov 2004 12:40:34 -0000 1.944
+++ src/frontends/xforms/ChangeLog 11 Nov 2004 18:55:22 -0000
@@ -1,3 +1,8 @@
+2004-11-11 Edwin Leuven
+
+ * FormTabular.C (update, input): handle check_booktabs
+ * forms/form_tabular.fd (check_booktabs): new checkbox
+
2004-11-08 Jean-Marc Lasgouttes <[EMAIL PROTECTED]>
* XFormsToolbar.C (selected): use layoutSelected
Index: src/frontends/xforms/FormTabular.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormTabular.C,v
retrieving revision 1.83
diff -u -p -r1.83 FormTabular.C
--- src/frontends/xforms/FormTabular.C 19 May 2004 15:11:36 -0000 1.83
+++ src/frontends/xforms/FormTabular.C 11 Nov 2004 18:55:22 -0000
@@ -361,6 +361,9 @@ void FormTabular::update()
setEnabled(column_options_->radio_valign_bottom, !pwidth.zero());
setEnabled(column_options_->radio_valign_middle, !pwidth.zero());
+ fl_set_button(tabular_options_->check_booktabs,
+ tabular.useBookTabs());
+
fl_set_button(tabular_options_->check_longtable,
tabular.isLongTabular());
@@ -622,6 +625,11 @@ ButtonPolicy::SMInput FormTabular::input
num = LyXTabular::SET_LONGTABULAR;
else
num = LyXTabular::UNSET_LONGTABULAR;
+ } else if (ob == tabular_options_->check_booktabs) {
+ if (fl_get_button(tabular_options_->check_booktabs))
+ num = LyXTabular::SET_BOOKTABS;
+ else
+ num = LyXTabular::UNSET_BOOKTABS;
} else if (ob == tabular_options_->check_rotate_tabular) {
s = fl_get_button(tabular_options_->check_rotate_tabular);
if (s)
Index: src/frontends/xforms/forms/form_tabular.fd
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/forms/form_tabular.fd,v
retrieving revision 1.27
diff -u -p -r1.27 form_tabular.fd
--- src/frontends/xforms/forms/form_tabular.fd 21 Nov 2003 11:38:17 -0000 1.27
+++ src/frontends/xforms/forms/form_tabular.fd 11 Nov 2004 18:55:23 -0000
@@ -125,7 +125,7 @@ argument:
Name: form_tabular_options
Width: 505
Height: 225
-Number of Objects: 10
+Number of Objects: 11
--------------------
class: FL_BOX
@@ -292,7 +292,7 @@ argument: 0
--------------------
class: FL_LABELFRAME
type: ENGRAVED_FRAME
-box: 280 20 120 75
+box: 280 20 120 90
boxtype: FL_NO_BOX
colors: FL_BLACK FL_COL1
alignment: FL_ALIGN_TOP_LEFT
@@ -306,6 +306,24 @@ gravity: FL_NoGravity FL_NoGravity
name:
callback:
argument:
+
+--------------------
+class: FL_CHECKBUTTON
+type: PUSH_BUTTON
+box: 280 80 95 25
+boxtype: FL_NO_BOX
+colors: FL_COL1 FL_YELLOW
+alignment: FL_ALIGN_CENTER
+style: FL_NORMAL_STYLE
+size: FL_DEFAULT_SIZE
+lcol: FL_BLACK
+label: Formal table|#F
+shortcut:
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name: check_booktabs
+callback: C_FormDialogView_InputCB
+argument: 0
=============== FORM ===============
Name: form_tabular_column
Index: src/insets/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/ChangeLog,v
retrieving revision 1.1074
diff -u -p -r1.1074 ChangeLog
--- src/insets/ChangeLog 11 Nov 2004 08:18:29 -0000 1.1074
+++ src/insets/ChangeLog 11 Nov 2004 18:55:24 -0000
@@ -1,3 +1,6 @@
+2004-11-11 Edwin Leuven
+
+ * insettabular.C (getStatus, tabularFeatures): handle booktabs feature
2004-11-11 Alfredo Braunstein <[EMAIL PROTECTED]>
Index: src/insets/insettabular.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettabular.C,v
retrieving revision 1.439
diff -u -p -r1.439 insettabular.C
--- src/insets/insettabular.C 2 Nov 2004 11:25:18 -0000 1.439
+++ src/insets/insettabular.C 11 Nov 2004 18:55:24 -0000
@@ -118,6 +118,8 @@ TabularFeature tabularFeature[] =
{ LyXTabular::SET_LTNEWPAGE, "set-ltnewpage" },
{ LyXTabular::SET_SPECIAL_COLUMN, "set-special-column" },
{ LyXTabular::SET_SPECIAL_MULTI, "set-special-multi" },
+ { LyXTabular::SET_BOOKTABS, "set-booktabs" },
+ { LyXTabular::UNSET_BOOKTABS, "unset-booktabs" },
{ LyXTabular::LAST_ACTION, "" }
};
@@ -867,6 +869,14 @@ bool InsetTabular::getStatus(LCursor & c
case LyXTabular::SET_LTNEWPAGE:
status.setOnOff(tabular.getLTNewPage(sel_row_start));
break;
+
+ case LyXTabular::SET_BOOKTABS:
+ status.setOnOff(tabular.useBookTabs());
+ break;
+
+ case LyXTabular::UNSET_BOOKTABS:
+ status.setOnOff(!tabular.useBookTabs());
+ break;
default:
status.clear();
@@ -1442,6 +1452,14 @@ void InsetTabular::tabularFeatures(LCurs
case LyXTabular::SET_LTNEWPAGE:
tabular.setLTNewPage(row, !tabular.getLTNewPage(row));
+ break;
+
+ case LyXTabular::SET_BOOKTABS:
+ tabular.setBookTabs(true);
+ break;
+
+ case LyXTabular::UNSET_BOOKTABS:
+ tabular.setBookTabs(false);
break;
// dummy stuff just to avoid warnings