3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
7 * \author Jürgen Spitzmüller
11 * Full author contact details are available in file CREDITS.
16 #include "GuiTabular.h"
18 #include "GuiApplication.h"
19 #include "GuiSetBorder.h"
21 #include "LengthCombo.h"
22 #include "qt_helpers.h"
23 #include "Validator.h"
26 #include "BufferView.h"
28 #include "FuncRequest.h"
29 #include "FuncStatus.h"
34 #include "support/convert.h"
35 #include "support/debug.h"
36 #include "support/lstrings.h"
39 #include <QPushButton>
40 #include <QRadioButton>
48 GuiTabular::GuiTabular(QWidget * parent)
49 : InsetParamsWidget(parent), firstheader_suppressable_(false),
50 lastfooter_suppressable_(false), orig_leftborder_(GuiSetBorder::LINE_UNDEF),
51 orig_rightborder_(GuiSetBorder::LINE_UNDEF), lastrow_(0)
56 tabularWidthED->setValidator(unsignedLengthValidator(tabularWidthED));
57 columnWidthED->setValidator(unsignedLengthValidator(columnWidthED));
58 multirowOffsetED->setValidator(new LengthValidator(multirowOffsetED));
59 topspaceED->setValidator(new LengthValidator(topspaceED));
60 bottomspaceED->setValidator(new LengthValidator(bottomspaceED));
61 interlinespaceED->setValidator(new LengthValidator(interlinespaceED));
63 tabularWidthUnitLC->setCurrentItem(Length::defaultUnit());
64 columnWidthUnitLC->setCurrentItem(Length::defaultUnit());
65 multirowOffsetUnitLC->setCurrentItem(Length::defaultUnit());
66 topspaceUnitLC->setCurrentItem(Length::defaultUnit());
67 bottomspaceUnitLC->setCurrentItem(Length::defaultUnit());
68 interlinespaceUnitLC->setCurrentItem(Length::defaultUnit());
70 connect(topspaceED, SIGNAL(textEdited(const QString &)),
71 this, SLOT(checkEnabled()));
72 connect(topspaceUnitLC, SIGNAL(selectionChanged(lyx::Length::UNIT)),
73 this, SLOT(checkEnabled()));
74 connect(bottomspaceED, SIGNAL(textEdited(const QString &)),
75 this, SLOT(checkEnabled()));
76 connect(bottomspaceUnitLC, SIGNAL(selectionChanged(lyx::Length::UNIT)),
77 this, SLOT(checkEnabled()));
78 connect(interlinespaceED, SIGNAL(textEdited(const QString &)),
79 this, SLOT(checkEnabled()));
80 connect(interlinespaceUnitLC, SIGNAL(selectionChanged(lyx::Length::UNIT)),
81 this, SLOT(checkEnabled()));
82 connect(booktabsRB, SIGNAL(clicked(bool)),
83 this, SLOT(booktabs_toggled(bool)));
84 connect(borderDefaultRB, SIGNAL(clicked(bool)),
85 this, SLOT(nonbooktabs_toggled(bool)));
86 connect(borderSetPB, SIGNAL(clicked()),
87 this, SLOT(borderSet_clicked()));
88 connect(borderUnsetPB, SIGNAL(clicked()),
89 this, SLOT(borderUnset_clicked()));
90 connect(resetFormalCB, SIGNAL(clicked()),
91 this, SLOT(checkEnabled()));
92 connect(hAlignCO, SIGNAL(activated(int)),
93 this, SLOT(checkEnabled()));
94 connect(vAlignCO, SIGNAL(activated(int)),
95 this, SLOT(checkEnabled()));
96 connect(multicolumnCB, SIGNAL(clicked()),
97 this, SLOT(checkEnabled()));
98 connect(multirowCB, SIGNAL(clicked()),
99 this, SLOT(checkEnabled()));
100 connect(multirowOffsetED, SIGNAL(textEdited(const QString &)),
101 this, SLOT(checkEnabled()));
102 connect(multirowOffsetUnitLC, SIGNAL(selectionChanged(lyx::Length::UNIT)),
103 this, SLOT(checkEnabled()));
104 connect(newpageCB, SIGNAL(clicked()),
105 this, SLOT(checkEnabled()));
106 connect(headerStatusCB, SIGNAL(clicked()),
107 this, SLOT(checkEnabled()));
108 connect(headerBorderAboveCB, SIGNAL(clicked()),
109 this, SLOT(checkEnabled()));
110 connect(headerBorderBelowCB, SIGNAL(clicked()),
111 this, SLOT(checkEnabled()));
112 connect(firstheaderStatusCB, SIGNAL(clicked()),
113 this, SLOT(checkEnabled()));
114 connect(firstheaderBorderAboveCB, SIGNAL(clicked()),
115 this, SLOT(checkEnabled()));
116 connect(firstheaderBorderBelowCB, SIGNAL(clicked()),
117 this, SLOT(checkEnabled()));
118 connect(firstheaderNoContentsCB, SIGNAL(clicked()),
119 this, SLOT(checkEnabled()));
120 connect(footerStatusCB, SIGNAL(clicked()),
121 this, SLOT(checkEnabled()));
122 connect(footerBorderAboveCB, SIGNAL(clicked()),
123 this, SLOT(checkEnabled()));
124 connect(footerBorderBelowCB, SIGNAL(clicked()),
125 this, SLOT(checkEnabled()));
126 connect(lastfooterStatusCB, SIGNAL(clicked()),
127 this, SLOT(checkEnabled()));
128 connect(lastfooterBorderAboveCB, SIGNAL(clicked()),
129 this, SLOT(checkEnabled()));
130 connect(lastfooterBorderBelowCB, SIGNAL(clicked()),
131 this, SLOT(checkEnabled()));
132 connect(lastfooterNoContentsCB, SIGNAL(clicked()),
133 this, SLOT(checkEnabled()));
134 connect(captionStatusCB, SIGNAL(clicked()),
135 this, SLOT(checkEnabled()));
136 connect(specialAlignmentED, SIGNAL(textEdited(const QString &)),
137 this, SLOT(checkEnabled()));
138 connect(columnWidthED, SIGNAL(textEdited(const QString &)),
139 this, SLOT(checkEnabled()));
140 connect(columnWidthUnitLC, SIGNAL(selectionChanged(lyx::Length::UNIT)),
141 this, SLOT(checkEnabled()));
142 connect(borders, SIGNAL(topSet()),
143 this, SLOT(checkEnabled()));
144 connect(borders, SIGNAL(bottomSet()),
145 this, SLOT(checkEnabled()));
146 connect(borders, SIGNAL(rightSet()),
147 this, SLOT(checkEnabled()));
148 connect(borders, SIGNAL(leftSet()),
149 this, SLOT(checkEnabled()));
150 connect(borders, SIGNAL(topLTSet()),
151 this, SLOT(checkEnabled()));
152 connect(borders, SIGNAL(topRTSet()),
153 this, SLOT(checkEnabled()));
154 connect(borders, SIGNAL(bottomLTSet()),
155 this, SLOT(checkEnabled()));
156 connect(borders, SIGNAL(bottomRTSet()),
157 this, SLOT(checkEnabled()));
158 connect(rotateTabularCB, SIGNAL(clicked()),
159 this, SLOT(checkEnabled()));
160 connect(rotateTabularAngleSB, SIGNAL(valueChanged(int)),
161 this, SLOT(checkEnabled()));
162 connect(rotateCellCB, SIGNAL(clicked()),
163 this, SLOT(checkEnabled()));
164 connect(rotateCellAngleSB, SIGNAL(valueChanged(int)),
165 this, SLOT(checkEnabled()));
166 connect(TableAlignCO, SIGNAL(activated(int)),
167 this, SLOT(checkEnabled()));
168 connect(longTabularCB, SIGNAL(clicked()),
169 this, SLOT(checkEnabled()));
170 connect(leftRB, SIGNAL(clicked()),
171 this, SLOT(checkEnabled()));
172 connect(centerRB, SIGNAL(clicked()),
173 this, SLOT(checkEnabled()));
174 connect(rightRB, SIGNAL(clicked()),
175 this, SLOT(checkEnabled()));
176 connect(tabularWidthED, SIGNAL(textEdited(const QString &)),
177 this, SLOT(checkEnabled()));
179 decimalPointED->setValidator(new QRegExpValidator(QRegExp("\\S"), this));
180 decimalPointED->setMaxLength(1);
182 // initialize the length validator
183 addCheckedWidget(columnWidthED, columnWidthLA);
184 addCheckedWidget(multirowOffsetED, multirowOffsetLA);
185 addCheckedWidget(topspaceED, topspaceLA);
186 addCheckedWidget(bottomspaceED, bottomspaceLA);
187 addCheckedWidget(interlinespaceED, interlinespaceLA);
188 addCheckedWidget(tabularWidthED, tabularWidthLA);
192 void GuiTabular::on_topspaceCO_activated(int index)
194 bool const enable = (index == 2);
195 topspaceED->setEnabled(enable);
196 topspaceUnitLC->setEnabled(enable);
200 void GuiTabular::on_bottomspaceCO_activated(int index)
202 bool const enable = (index == 2);
203 bottomspaceED->setEnabled(enable);
204 bottomspaceUnitLC->setEnabled(enable);
208 void GuiTabular::on_interlinespaceCO_activated(int index)
210 bool const enable = (index == 2);
211 interlinespaceED->setEnabled(enable);
212 interlinespaceUnitLC->setEnabled(enable);
216 void GuiTabular::on_columnTypeCO_activated(int index)
220 columnWidthED->setFocus();
224 void GuiTabular::enableWidgets() const
226 // if there is a LaTeX argument, the width and alignment will be overwritten
227 // therefore disable them in this case
228 bool const fixed = specialAlignmentED->text().isEmpty()
229 && columnTypeCO->currentIndex() == 2;
230 columnWidthED->setEnabled(fixed);
231 columnWidthUnitLC->setEnabled(fixed);
232 // if the column has a width, multirows are always left-aligned
233 // therefore disable hAlignCB in this case
234 hAlignCO->setEnabled(!(multirowCB->isChecked()
235 && !widgetsToLength(columnWidthED, columnWidthUnitLC).empty())
236 && specialAlignmentED->text().isEmpty());
237 // decimal alignment is only possible for non-multicol and non-multirow cells
238 if ((multicolumnCB->isChecked() || multirowCB->isChecked() || columnTypeCO->currentIndex() == 1)
239 && hAlignCO->findData(toqstr("decimal")))
240 hAlignCO->removeItem(hAlignCO->findData(toqstr("decimal")));
241 else if (!multicolumnCB->isChecked() && !multirowCB->isChecked()
242 && hAlignCO->findData(toqstr("decimal")) == -1)
243 hAlignCO->addItem(qt_("At Decimal Separator"), toqstr("decimal"));
245 hAlignCO->itemData(hAlignCO->currentIndex()).toString() == QString("decimal");
246 decimalPointED->setEnabled(dalign);
247 decimalLA->setEnabled(dalign);
248 resetFormalCB->setEnabled(booktabsRB->isChecked());
250 bool const setwidth = TableAlignCO->currentText() == qt_("Middle");
251 tabularWidthLA->setEnabled(setwidth);
252 tabularWidthED->setEnabled(setwidth);
253 tabularWidthUnitLC->setEnabled(setwidth);
255 rotateTabularAngleSB->setEnabled(rotateTabularCB->isChecked()
256 && !longTabularCB->isChecked());
257 rotateCellAngleSB->setEnabled(rotateCellCB->isChecked());
259 bool const enable_valign =
260 !multirowCB->isChecked()
261 && !widgetsToLength(columnWidthED, columnWidthUnitLC).empty()
262 && specialAlignmentED->text().isEmpty();
263 vAlignCO->setEnabled(enable_valign);
264 vAlignLA->setEnabled(enable_valign);
266 topspaceED->setEnabled(topspaceCO->currentIndex() == 2);
267 topspaceED->setEnabled(topspaceCO->currentIndex() == 2);
268 topspaceUnitLC->setEnabled(topspaceCO->currentIndex() == 2);
269 bottomspaceED->setEnabled(bottomspaceCO->currentIndex() == 2);
270 bottomspaceUnitLC->setEnabled(bottomspaceCO->currentIndex() == 2);
271 interlinespaceED->setEnabled(interlinespaceCO->currentIndex() == 2);
272 interlinespaceUnitLC->setEnabled(interlinespaceCO->currentIndex() == 2);
274 // setting as longtable is not allowed when table is inside a float
275 bool const is_tabular_star = !tabularWidthED->text().isEmpty();
276 longTabularCB->setEnabled(funcEnabled(Tabular::SET_LONGTABULAR));
277 bool const longtabular = longTabularCB->isChecked();
278 longtableGB->setEnabled(true);
279 newpageCB->setEnabled(longtabular);
280 alignmentGB->setEnabled(longtabular);
281 // longtables and tabular* cannot have a vertical alignment
282 TableAlignLA->setDisabled(is_tabular_star || longtabular);
283 TableAlignCO->setDisabled(is_tabular_star || longtabular);
284 // longtable cannot be rotated with rotating package, only
285 // with [pdf]lscape, which only supports 90 deg.
286 rotateTabularAngleSB->setDisabled(longtabular);
288 // FIXME: This Dialog is really horrible, disabling/enabling a checkbox
289 // depending on the cursor position is very very unintuitive...
290 // We need some edit boxes to show which rows are header/footer/etc
291 // without having to move the cursor first.
292 headerStatusCB->setEnabled(longtabular
293 && (headerStatusCB->isChecked() ?
294 funcEnabled(Tabular::UNSET_LTHEAD) :
295 funcEnabled(Tabular::SET_LTHEAD)));
296 headerBorderAboveCB->setEnabled(longtabular
297 && headerStatusCB->isChecked());
298 headerBorderBelowCB->setEnabled(longtabular
299 && headerStatusCB->isChecked());
301 // first header can only be suppressed when there is a header
302 // firstheader_suppressable_ is set in paramsToDialog
303 firstheaderNoContentsCB->setEnabled(longtabular && firstheader_suppressable_);
304 // check if setting a first header is allowed
305 // additionally check firstheaderNoContentsCB because when this is
306 // the case a first header makes no sense
307 firstheaderStatusCB->setEnabled((firstheaderStatusCB->isChecked() ?
308 funcEnabled(Tabular::UNSET_LTFIRSTHEAD) :
309 funcEnabled(Tabular::SET_LTFIRSTHEAD))
310 && longtabular && !firstheaderNoContentsCB->isChecked());
311 firstheaderBorderAboveCB->setEnabled(longtabular
312 && firstheaderStatusCB->isChecked());
313 firstheaderBorderBelowCB->setEnabled(longtabular
314 && firstheaderStatusCB->isChecked());
316 footerStatusCB->setEnabled(longtabular
317 && (footerStatusCB->isChecked() ?
318 funcEnabled(Tabular::UNSET_LTFOOT) :
319 funcEnabled(Tabular::SET_LTFOOT)));
320 footerBorderAboveCB->setEnabled(longtabular
321 && footerBorderAboveCB->isChecked());
322 footerBorderBelowCB->setEnabled(longtabular
323 && footerBorderAboveCB->isChecked());
325 // last footer can only be suppressed when there is a footer
326 // lastfooter_suppressable_ is set in paramsToDialog
327 lastfooterNoContentsCB->setEnabled(longtabular && lastfooter_suppressable_);
328 // check if setting a last footer is allowed
329 // additionally check lastfooterNoContentsCB because when this is
330 // the case a last footer makes no sense
331 lastfooterStatusCB->setEnabled((lastfooterStatusCB->isChecked() ?
332 funcEnabled(Tabular::UNSET_LTLASTFOOT) :
333 funcEnabled(Tabular::SET_LTLASTFOOT))
334 && longtabular && !lastfooterNoContentsCB->isChecked());
335 lastfooterBorderAboveCB->setEnabled(longtabular
336 && lastfooterBorderAboveCB->isChecked());
337 lastfooterBorderBelowCB->setEnabled(longtabular
338 && lastfooterBorderAboveCB->isChecked());
340 captionStatusCB->setEnabled(funcEnabled(Tabular::TOGGLE_LTCAPTION)
343 multicolumnCB->setEnabled(funcEnabled(Tabular::MULTICOLUMN)
344 && !dalign && !multirowCB->isChecked());
345 multirowCB->setEnabled(funcEnabled(Tabular::MULTIROW)
346 && !dalign && !multicolumnCB->isChecked());
347 bool const enable_mr = multirowCB->isChecked();
348 multirowOffsetLA->setEnabled(enable_mr);
349 multirowOffsetED->setEnabled(enable_mr);
350 multirowOffsetUnitLC->setEnabled(enable_mr);
352 // Vertical lines cannot be set in formal tables
353 borders->setLeftEnabled(!booktabsRB->isChecked());
354 borders->setRightEnabled(!booktabsRB->isChecked());
355 // Trimming is only allowed in booktabs and if the line is set
356 int const row = tabularRowED->text().toInt();
357 borders->setTopLeftTrimEnabled(booktabsRB->isChecked()
358 && borders->topLineSet()
360 borders->setTopRightTrimEnabled(booktabsRB->isChecked()
361 && borders->topLineSet()
363 borders->setBottomLeftTrimEnabled(booktabsRB->isChecked()
364 && borders->bottomLineSet()
366 borders->setBottomRightTrimEnabled(booktabsRB->isChecked()
367 && borders->bottomLineSet()
372 void GuiTabular::checkEnabled()
379 void GuiTabular::borderSet_clicked()
381 borders->setTop(GuiSetBorder::LINE_SET);
382 borders->setBottom(GuiSetBorder::LINE_SET);
383 borders->setLeft(GuiSetBorder::LINE_SET);
384 borders->setRight(GuiSetBorder::LINE_SET);
385 borders->setTopLeftTrim(GuiSetBorder::LINE_SET);
386 borders->setBottomLeftTrim(GuiSetBorder::LINE_SET);
387 borders->setTopRightTrim(GuiSetBorder::LINE_SET);
388 borders->setBottomRightTrim(GuiSetBorder::LINE_SET);
389 // repaint the setborder widget
395 void GuiTabular::borderUnset_clicked()
397 borders->setTop(GuiSetBorder::LINE_UNSET);
398 borders->setBottom(GuiSetBorder::LINE_UNSET);
399 borders->setLeft(GuiSetBorder::LINE_UNSET);
400 borders->setRight(GuiSetBorder::LINE_UNSET);
401 borders->setTopLeftTrim(GuiSetBorder::LINE_UNSET);
402 borders->setBottomLeftTrim(GuiSetBorder::LINE_UNSET);
403 borders->setTopRightTrim(GuiSetBorder::LINE_UNSET);
404 borders->setBottomRightTrim(GuiSetBorder::LINE_UNSET);
405 // repaint the setborder widget
411 void GuiTabular::booktabs_toggled(bool const check)
413 // when switching from formal, restore the left/right lines
415 borders->setLeft(orig_leftborder_);
416 borders->setRight(orig_rightborder_);
418 // repaint the setborder widget
424 void GuiTabular::nonbooktabs_toggled(bool const check)
426 booktabs_toggled(!check);
430 static void addParam(set<string> & params, Tabular::Feature f,
431 string const & arg = string())
434 params.insert(featureAsString(f));
436 params.insert(featureAsString(f) + ' ' + arg);
440 void GuiTabular::setHAlign(set<string> & params) const
442 Tabular::Feature num = Tabular::ALIGN_LEFT;
443 Tabular::Feature multi_num = Tabular::M_ALIGN_LEFT;
445 fromqstr(hAlignCO->itemData(hAlignCO->currentIndex()).toString());
446 if (align == "left") {
447 num = Tabular::ALIGN_LEFT;
448 multi_num = Tabular::M_ALIGN_LEFT;
449 } else if (align == "center") {
450 num = Tabular::ALIGN_CENTER;
451 multi_num = Tabular::M_ALIGN_CENTER;
452 } else if (align == "right") {
453 num = Tabular::ALIGN_RIGHT;
454 multi_num = Tabular::M_ALIGN_RIGHT;
455 } else if (align == "justified") {
456 num = Tabular::ALIGN_BLOCK;
457 //multi_num: no equivalent
458 } else if (align == "decimal") {
459 num = Tabular::ALIGN_DECIMAL;
460 //multi_num: no equivalent
463 if (multicolumnCB->isChecked())
464 addParam(params, multi_num);
466 addParam(params, num);
470 void GuiTabular::setVAlign(set<string> & params) const
472 int const align = vAlignCO->currentIndex();
473 enum VALIGN { TOP, MIDDLE, BOTTOM };
477 case 0: v = TOP; break;
478 case 1: v = MIDDLE; break;
479 case 2: v = BOTTOM; break;
482 Tabular::Feature num = Tabular::VALIGN_MIDDLE;
483 Tabular::Feature multi_num = Tabular::M_VALIGN_MIDDLE;
487 num = Tabular::VALIGN_TOP;
488 multi_num = Tabular::M_VALIGN_TOP;
491 num = Tabular::VALIGN_MIDDLE;
492 multi_num = Tabular::M_VALIGN_MIDDLE;
495 num = Tabular::VALIGN_BOTTOM;
496 multi_num = Tabular::M_VALIGN_BOTTOM;
499 if (multicolumnCB->isChecked() || multirowCB->isChecked())
500 addParam(params, multi_num);
502 addParam(params, num);
506 void GuiTabular::setTableAlignment(set<string> & params) const
508 int const align = TableAlignCO->currentIndex();
510 case 0: addParam(params, Tabular::TABULAR_VALIGN_TOP);
512 case 1: addParam(params, Tabular::TABULAR_VALIGN_MIDDLE);
514 case 2: addParam(params, Tabular::TABULAR_VALIGN_BOTTOM);
520 set<string> const GuiTabular::getTabFeatures() const
524 string tabwidth = widgetsToLength(tabularWidthED, tabularWidthUnitLC);
525 if (tabwidth.empty())
527 addParam(res, Tabular::SET_TABULAR_WIDTH, tabwidth);
529 // apply the fixed width values
530 // this must be done before applying the column alignment
531 // because its value influences the alignment of multirow cells
532 string width = widgetsToLength(columnWidthED, columnWidthUnitLC);
533 if (width.empty() || columnTypeCO->currentIndex() != 2)
535 if (multicolumnCB->isChecked())
536 addParam(res, Tabular::SET_MPWIDTH, width);
538 addParam(res, Tabular::SET_PWIDTH, width);
540 bool const varwidth = specialAlignmentED->text().isEmpty()
541 && columnTypeCO->currentIndex() == 1;
543 addParam(res, Tabular::TOGGLE_VARWIDTH_COLUMN, "on");
545 addParam(res, Tabular::TOGGLE_VARWIDTH_COLUMN, "off");
547 // apply the column alignment
548 // multirows inherit the alignment from the column; if a column width
549 // is set, multirows are always left-aligned so that in this case
550 // its alignment must not be applied (see bug #8084)
551 if (!(multirowCB->isChecked() && width != "0pt"))
554 // SET_DECIMAL_POINT must come after setHAlign() (ALIGN_DECIMAL)
555 string decimal_sep = fromqstr(decimalPointED->text());
556 if (decimal_sep.empty())
557 decimal_sep = to_utf8(decimal_sep_);
558 addParam(res, Tabular::SET_DECIMAL_POINT, decimal_sep);
561 setTableAlignment(res);
563 if (booktabsRB->isChecked())
564 addParam(res, Tabular::SET_BOOKTABS);
566 addParam(res, Tabular::UNSET_BOOKTABS);
569 switch (topspaceCO->currentIndex()) {
571 addParam(res, Tabular::SET_TOP_SPACE, "none");
574 addParam(res, Tabular::SET_TOP_SPACE, "default");
577 if (!topspaceED->text().isEmpty())
578 addParam(res, Tabular::SET_TOP_SPACE,
579 widgetsToLength(topspaceED, topspaceUnitLC));
584 switch (bottomspaceCO->currentIndex()) {
586 addParam(res, Tabular::SET_BOTTOM_SPACE, "none");
589 addParam(res, Tabular::SET_BOTTOM_SPACE, "default");
592 if (!bottomspaceED->text().isEmpty())
593 addParam(res, Tabular::SET_BOTTOM_SPACE,
594 widgetsToLength(bottomspaceED,
600 switch (interlinespaceCO->currentIndex()) {
602 addParam(res, Tabular::SET_INTERLINE_SPACE, "none");
605 addParam(res, Tabular::SET_INTERLINE_SPACE, "default");
608 if (!interlinespaceED->text().isEmpty())
609 addParam(res, Tabular::SET_INTERLINE_SPACE,
610 widgetsToLength(interlinespaceED,
611 interlinespaceUnitLC));
616 if (resetFormalCB->isChecked())
617 addParam(res, Tabular::RESET_FORMAL_DEFAULT);
618 else if (borders->topLineSet() && borders->bottomLineSet() && borders->leftLineSet()
619 && borders->rightLineSet())
620 addParam(res, Tabular::SET_ALL_LINES);
621 else if (borders->topLineUnset() && borders->bottomLineUnset() && borders->leftLineUnset()
622 && borders->rightLineUnset())
623 addParam(res, Tabular::UNSET_ALL_LINES);
625 if (borders->getLeft() != GuiSetBorder::LINE_UNDECIDED)
626 addParam(res, Tabular::SET_LINE_LEFT,
627 borders->leftLineSet() ? "true" : "false");
628 if (borders->getRight() != GuiSetBorder::LINE_UNDECIDED)
629 addParam(res, Tabular::SET_LINE_RIGHT,
630 borders->rightLineSet() ? "true" : "false");
631 if (borders->getTop() != GuiSetBorder::LINE_UNDECIDED)
632 addParam(res, Tabular::SET_LINE_TOP,
633 borders->topLineSet() ? "true" : "false");
634 if (borders->getBottom() != GuiSetBorder::LINE_UNDECIDED)
635 addParam(res, Tabular::SET_LINE_BOTTOM,
636 borders->bottomLineSet() ? "true" : "false");
638 if (borders->topLineLTSet())
639 addParam(res, Tabular::SET_LTRIM_TOP, "false");
640 else if (borders->topLineLTUnset())
641 addParam(res, Tabular::SET_LTRIM_TOP, "true");
642 if (borders->topLineRTSet())
643 addParam(res, Tabular::SET_RTRIM_TOP, "false");
644 else if (borders->topLineRTUnset())
645 addParam(res, Tabular::SET_RTRIM_TOP, "true");
646 if (borders->bottomLineLTSet())
647 addParam(res, Tabular::SET_LTRIM_BOTTOM, "false");
648 else if (borders->bottomLineLTUnset())
649 addParam(res, Tabular::SET_LTRIM_BOTTOM, "true");
650 if (borders->bottomLineRTSet())
651 addParam(res, Tabular::SET_RTRIM_BOTTOM, "false");
652 else if (borders->bottomLineRTUnset())
653 addParam(res, Tabular::SET_RTRIM_BOTTOM, "true");
655 // apply the special alignment
656 string special = fromqstr(specialAlignmentED->text());
657 if (support::trim(special).empty())
659 if (multicolumnCB->isChecked())
660 addParam(res, Tabular::SET_SPECIAL_MULTICOLUMN, special);
662 addParam(res, Tabular::SET_SPECIAL_COLUMN, special);
665 if (multicolumnCB->isChecked())
666 addParam(res, Tabular::SET_MULTICOLUMN);
668 addParam(res, Tabular::UNSET_MULTICOLUMN);
670 // apply the multirow offset
671 string mroffset = widgetsToLength(multirowOffsetED, multirowOffsetUnitLC);
672 if (mroffset.empty())
674 if (multirowCB->isChecked())
675 addParam(res, Tabular::SET_MROFFSET, mroffset);
677 if (multirowCB->isChecked())
678 addParam(res, Tabular::SET_MULTIROW);
680 addParam(res, Tabular::UNSET_MULTIROW);
681 // store the table rotation angle
682 string const tabular_angle = convert<string>(rotateTabularAngleSB->value());
683 if (rotateTabularCB->isChecked())
684 addParam(res, Tabular::SET_ROTATE_TABULAR, tabular_angle);
686 addParam(res, Tabular::UNSET_ROTATE_TABULAR, tabular_angle);
687 // store the cell rotation angle
688 string const cell_angle = convert<string>(rotateCellAngleSB->value());
689 if (rotateCellCB->isChecked())
690 addParam(res, Tabular::SET_ROTATE_CELL, cell_angle);
692 addParam(res, Tabular::UNSET_ROTATE_CELL, cell_angle);
694 if (longTabularCB->isChecked())
695 addParam(res, Tabular::SET_LONGTABULAR);
697 addParam(res, Tabular::UNSET_LONGTABULAR);
699 if (newpageCB->isChecked())
700 addParam(res, Tabular::SET_LTNEWPAGE);
702 addParam(res, Tabular::UNSET_LTNEWPAGE);
704 if (captionStatusCB->isChecked())
705 addParam(res, Tabular::SET_LTCAPTION);
707 addParam(res, Tabular::UNSET_LTCAPTION);
709 if (headerStatusCB->isChecked())
710 addParam(res, Tabular::SET_LTHEAD, "none");
712 addParam(res, Tabular::UNSET_LTHEAD, "none");
714 if (headerBorderAboveCB->isChecked())
715 addParam(res, Tabular::SET_LTHEAD, "dl_above");
717 addParam(res, Tabular::UNSET_LTHEAD, "dl_above");
719 if (headerBorderBelowCB->isChecked())
720 addParam(res, Tabular::SET_LTHEAD, "dl_below");
722 addParam(res, Tabular::UNSET_LTHEAD, "dl_below");
723 if (firstheaderBorderAboveCB->isChecked())
724 addParam(res, Tabular::SET_LTFIRSTHEAD, "dl_above");
726 addParam(res, Tabular::UNSET_LTFIRSTHEAD, "dl_above");
727 if (firstheaderBorderBelowCB->isChecked())
728 addParam(res, Tabular::SET_LTFIRSTHEAD, "dl_below");
730 addParam(res, Tabular::UNSET_LTFIRSTHEAD, "dl_below");
731 if (firstheaderStatusCB->isChecked())
732 addParam(res, Tabular::SET_LTFIRSTHEAD, "none");
734 addParam(res, Tabular::UNSET_LTFIRSTHEAD, "none");
735 if (firstheaderNoContentsCB->isChecked())
736 addParam(res, Tabular::SET_LTFIRSTHEAD, "empty");
738 addParam(res, Tabular::UNSET_LTFIRSTHEAD, "empty");
739 if (footerStatusCB->isChecked())
740 addParam(res, Tabular::SET_LTFOOT, "none");
742 addParam(res, Tabular::UNSET_LTFOOT, "none");
743 if (footerBorderAboveCB->isChecked())
744 addParam(res, Tabular::SET_LTFOOT, "dl_above");
746 addParam(res, Tabular::UNSET_LTFOOT, "dl_above");
747 if (footerBorderBelowCB->isChecked())
748 addParam(res, Tabular::SET_LTFOOT, "dl_below");
750 addParam(res, Tabular::UNSET_LTFOOT, "dl_below");
751 if (lastfooterStatusCB->isChecked())
752 addParam(res, Tabular::SET_LTLASTFOOT, "none");
754 addParam(res, Tabular::UNSET_LTLASTFOOT, "none");
755 if (lastfooterBorderAboveCB->isChecked())
756 addParam(res, Tabular::SET_LTLASTFOOT, "dl_above");
758 addParam(res, Tabular::UNSET_LTLASTFOOT, "dl_above");
759 if (lastfooterBorderBelowCB->isChecked())
760 addParam(res, Tabular::SET_LTLASTFOOT, "dl_below");
762 addParam(res, Tabular::UNSET_LTLASTFOOT, "dl_below");
763 if (lastfooterNoContentsCB->isChecked())
764 addParam(res, Tabular::SET_LTLASTFOOT, "empty");
766 addParam(res, Tabular::UNSET_LTLASTFOOT, "empty");
768 if (leftRB->isChecked())
769 addParam(res, Tabular::LONGTABULAR_ALIGN_LEFT);
770 else if (centerRB->isChecked())
771 addParam(res, Tabular::LONGTABULAR_ALIGN_CENTER);
772 else if (rightRB->isChecked())
773 addParam(res, Tabular::LONGTABULAR_ALIGN_RIGHT);
779 docstring GuiTabular::dialogToParams() const
781 set<string> features = getTabFeatures();
782 // Only modify features that have changed
783 vector<string> changed_features;
784 for (auto const & f : features) {
785 if (features_.find(f) == features_.end())
786 changed_features.push_back(f);
788 if (changed_features.empty())
791 return from_utf8("tabular " + support::getStringFromVector(changed_features, " "));
795 static Length getColumnPWidth(Tabular const & t, size_t cell)
797 return t.column_info[t.cellColumn(cell)].p_width;
801 static Length getMColumnPWidth(Tabular const & t, size_t cell)
803 if (t.isMultiColumn(cell) || t.isMultiRow(cell))
804 return t.cellInfo(cell).p_width;
809 static Length getMROffset(Tabular const & t, size_t cell)
811 if (t.isMultiRow(cell))
812 return t.cellInfo(cell).mroffset;
817 static docstring getAlignSpecial(Tabular const & t, size_t cell, int what)
819 if (what == Tabular::SET_SPECIAL_MULTICOLUMN)
820 return t.cellInfo(cell).align_special;
821 return t.column_info[t.cellColumn(cell)].align_special;
825 GuiSetBorder::BorderState GuiTabular::borderState(GuiSetBorder::BorderState bs,
828 if (bs == GuiSetBorder::LINE_UNDEF)
829 bs = line ? GuiSetBorder::LINE_SET : GuiSetBorder::LINE_UNSET;
830 else if ((bs == GuiSetBorder::LINE_SET && !line)
831 || (bs == GuiSetBorder::LINE_UNSET && line))
832 bs = GuiSetBorder::LINE_UNDECIDED;
837 void GuiTabular::paramsToDialog(Inset const * inset)
839 InsetTabular const * itab = static_cast<InsetTabular const *>(inset);
840 // Copy Tabular of current inset.
841 Tabular const & tabular = itab->tabular;
843 BufferView const * bv = guiApp->currentView()->currentBufferView();
844 size_t const cell = bv->cursor().idx();
846 row_type const row = tabular.cellRow(cell);
847 col_type const col = tabular.cellColumn(cell);
849 tabularRowED->setText(QString::number(row + 1));
850 tabularColumnED->setText(QString::number(col + 1));
851 lastrow_ = int(tabular.nrows());
853 bool const multicol = tabular.isMultiColumn(cell);
854 multicolumnCB->setChecked(multicol);
856 bool const multirow = tabular.isMultiRow(cell);
857 multirowCB->setChecked(multirow);
859 rotateCellCB->setChecked(tabular.getRotateCell(cell) != 0);
860 if (rotateCellCB->isChecked()) {
861 if (tabular.getRotateCell(cell) != 0)
862 rotateCellAngleSB->setValue(tabular.getRotateCell(cell));
864 rotateCellAngleSB->setValue(90);
867 longTabularCB->setChecked(tabular.is_long_tabular);
869 rotateTabularCB->setChecked(tabular.rotate != 0);
870 if (rotateTabularCB->isChecked()) {
871 if (longTabularCB->isChecked())
872 rotateTabularAngleSB->setValue(90);
874 rotateTabularAngleSB->setValue(tabular.rotate != 0 ? tabular.rotate : 90);
877 // In what follows, we check the borders of all selected cells,
878 // and if there are diverging settings, we use the LINE_UNDECIDED
880 GuiSetBorder::BorderState ltop = GuiSetBorder::LINE_UNDEF;
881 GuiSetBorder::BorderState lbottom = GuiSetBorder::LINE_UNDEF;
882 GuiSetBorder::BorderState lleft = GuiSetBorder::LINE_UNDEF;
883 GuiSetBorder::BorderState lright = GuiSetBorder::LINE_UNDEF;
884 GuiSetBorder::BorderState ltop_ltrim = GuiSetBorder::LINE_UNDEF;
885 GuiSetBorder::BorderState ltop_rtrim = GuiSetBorder::LINE_UNDEF;
886 GuiSetBorder::BorderState lbottom_ltrim = GuiSetBorder::LINE_UNDEF;
887 GuiSetBorder::BorderState lbottom_rtrim = GuiSetBorder::LINE_UNDEF;
888 CursorSlice const & beg = bv->cursor().selBegin();
889 CursorSlice const & end = bv->cursor().selEnd();
891 col_type cs = tabular.cellColumn(beg.idx());
892 col_type ce = tabular.cellColumn(end.idx());
895 row_type rs = tabular.cellRow(beg.idx());
896 row_type re = tabular.cellRow(end.idx());
899 for (row_type r = rs; r <= re; ++r)
900 for (col_type c = cs; c <= ce; ++c) {
901 idx_type const cc = tabular.cellIndex(r, c);
902 ltop = borderState(ltop, tabular.topLine(cc));
903 lbottom = borderState(lbottom, tabular.bottomLine(cc));
904 lleft = borderState(lleft, tabular.leftLine(cc));
905 lright = borderState(lright, tabular.rightLine(cc));
906 ltop_ltrim = borderState(ltop_ltrim, !tabular.topLineTrim(cc).first);
907 ltop_rtrim = borderState(ltop_rtrim, !tabular.topLineTrim(cc).second);
908 lbottom_ltrim = borderState(lbottom_ltrim, !tabular.bottomLineTrim(cc).first);
909 lbottom_rtrim = borderState(lbottom_rtrim, !tabular.bottomLineTrim(cc).second);
910 // store left/right borders for the case of formal/nonformal switch
911 orig_leftborder_ = borderState(lleft, tabular.leftLine(cc, true));
912 orig_rightborder_ = borderState(lright, tabular.rightLine(cc, true));
915 ltop = tabular.topLine(cell) ? GuiSetBorder::LINE_SET : GuiSetBorder::LINE_UNSET;
916 lbottom = tabular.bottomLine(cell) ? GuiSetBorder::LINE_SET : GuiSetBorder::LINE_UNSET;
917 lleft = tabular.leftLine(cell) ? GuiSetBorder::LINE_SET : GuiSetBorder::LINE_UNSET;
918 lright = tabular.rightLine(cell) ? GuiSetBorder::LINE_SET : GuiSetBorder::LINE_UNSET;
919 ltop_ltrim = tabular.topLineTrim(cell).first ? GuiSetBorder::LINE_UNSET : GuiSetBorder::LINE_SET;
920 ltop_rtrim = tabular.topLineTrim(cell).second ? GuiSetBorder::LINE_UNSET : GuiSetBorder::LINE_SET;
921 lbottom_ltrim = tabular.bottomLineTrim(cell).first ? GuiSetBorder::LINE_UNSET : GuiSetBorder::LINE_SET;
922 lbottom_rtrim = tabular.bottomLineTrim(cell).second ? GuiSetBorder::LINE_UNSET : GuiSetBorder::LINE_SET;
923 // store left/right borders for the case of formal/nonformal switch
924 orig_leftborder_ = tabular.leftLine(cell, true) ? GuiSetBorder::LINE_SET : GuiSetBorder::LINE_UNSET;
925 orig_rightborder_ = tabular.rightLine(cell, true) ? GuiSetBorder::LINE_SET : GuiSetBorder::LINE_UNSET;
927 borders->setTop(ltop);
928 borders->setBottom(lbottom);
929 borders->setLeft(lleft);
930 borders->setRight(lright);
931 borders->setTopLeftTrim(ltop_ltrim);
932 borders->setTopRightTrim(ltop_rtrim);
933 borders->setBottomLeftTrim(lbottom_ltrim);
934 borders->setBottomRightTrim(lbottom_rtrim);
935 // repaint the setborder widget
938 Length::UNIT const default_unit = Length::defaultUnit();
940 ///////////////////////////////////
941 // Set width and alignment
943 Length const tabwidth = tabular.tabularWidth();
945 && !(tabularWidthED->hasFocus() && tabularWidthED->text() == "0"))
946 tabularWidthED->clear();
948 lengthToWidgets(tabularWidthED, tabularWidthUnitLC,
949 tabwidth.asString(), default_unit);
954 special = getAlignSpecial(tabular, cell,
955 Tabular::SET_SPECIAL_MULTICOLUMN);
956 pwidth = getMColumnPWidth(tabular, cell);
958 special = getAlignSpecial(tabular, cell,
959 Tabular::SET_SPECIAL_COLUMN);
960 pwidth = getColumnPWidth(tabular, cell);
962 bool const varwidth = tabular.column_info[tabular.cellColumn(cell)].varwidth;
964 columnTypeCO->setCurrentIndex(1);
967 && !(columnWidthED->hasFocus() && columnWidthED->text() == "0")) {
968 columnWidthED->clear();
970 columnTypeCO->setCurrentIndex(0);
972 colwidth = pwidth.asString();
973 lengthToWidgets(columnWidthED, columnWidthUnitLC,
974 colwidth, default_unit);
975 columnTypeCO->setCurrentIndex(2);
979 mroffset = getMROffset(tabular, cell);
982 && !(multirowOffsetED->hasFocus() && multirowOffsetED->text() == "0"))
983 multirowOffsetED->clear();
985 offset = mroffset.asString();
986 lengthToWidgets(multirowOffsetED, multirowOffsetUnitLC,
987 offset, default_unit);
989 specialAlignmentED->setText(toqstr(special));
990 ///////////////////////////////////
993 borderDefaultRB->setChecked(!tabular.use_booktabs);
994 booktabsRB->setChecked(tabular.use_booktabs);
996 if (tabular.row_info[row].top_space.empty()
997 && !tabular.row_info[row].top_space_default) {
998 topspaceCO->setCurrentIndex(0);
999 } else if (tabular.row_info[row].top_space_default) {
1000 topspaceCO->setCurrentIndex(1);
1002 topspaceCO->setCurrentIndex(2);
1003 lengthToWidgets(topspaceED,
1005 tabular.row_info[row].top_space.asString(),
1009 if (tabular.row_info[row].bottom_space.empty()
1010 && !tabular.row_info[row].bottom_space_default) {
1011 bottomspaceCO->setCurrentIndex(0);
1012 } else if (tabular.row_info[row].bottom_space_default) {
1013 bottomspaceCO->setCurrentIndex(1);
1015 bottomspaceCO->setCurrentIndex(2);
1016 lengthToWidgets(bottomspaceED,
1018 tabular.row_info[row].bottom_space.asString(),
1022 if (tabular.row_info[row].interline_space.empty()
1023 && !tabular.row_info[row].interline_space_default) {
1024 interlinespaceCO->setCurrentIndex(0);
1025 } else if (tabular.row_info[row].interline_space_default) {
1026 interlinespaceCO->setCurrentIndex(1);
1028 interlinespaceCO->setCurrentIndex(2);
1029 lengthToWidgets(interlinespaceED,
1030 interlinespaceUnitLC,
1031 tabular.row_info[row].interline_space.asString(),
1036 hAlignCO->addItem(qt_("Left"), toqstr("left"));
1037 hAlignCO->addItem(qt_("Center"), toqstr("center"));
1038 hAlignCO->addItem(qt_("Right"), toqstr("right"));
1039 if (!multicol && !pwidth.zero())
1040 hAlignCO->addItem(qt_("Justified"), toqstr("justified"));
1041 if (!multicol && !multirow)
1042 hAlignCO->addItem(qt_("At Decimal Separator"), toqstr("decimal"));
1045 switch (tabular.getAlignment(cell)) {
1046 case LYX_ALIGN_LEFT:
1049 case LYX_ALIGN_CENTER:
1052 case LYX_ALIGN_RIGHT:
1055 case LYX_ALIGN_BLOCK:
1057 if (!multicol && !pwidth.zero())
1058 align = "justified";
1061 case LYX_ALIGN_DECIMAL:
1063 if (!multicol && !multirow)
1068 // we should never end up here
1071 hAlignCO->setCurrentIndex(hAlignCO->findData(toqstr(align)));
1074 decimal_sep_ = tabular.column_info[col].decimal_point;
1075 if (decimal_sep_.empty()) {
1076 Language const * lang = itab->buffer().paragraphs().front().getParLanguage(itab->buffer().params());
1077 decimal_sep_ = lang->decimalSeparator();
1079 decimalPointED->setText(toqstr(decimal_sep_));
1082 switch (tabular.getVAlignment(cell)) {
1083 case Tabular::LYX_VALIGN_TOP:
1086 case Tabular::LYX_VALIGN_MIDDLE:
1089 case Tabular::LYX_VALIGN_BOTTOM:
1098 vAlignCO->setCurrentIndex(valign);
1100 int tableValign = 1;
1101 switch (tabular.tabular_valignment) {
1102 case Tabular::LYX_VALIGN_TOP:
1105 case Tabular::LYX_VALIGN_MIDDLE:
1108 case Tabular::LYX_VALIGN_BOTTOM:
1115 TableAlignCO->setCurrentIndex(tableValign);
1117 if (!tabular.is_long_tabular) {
1118 headerStatusCB->setChecked(false);
1119 headerBorderAboveCB->setChecked(false);
1120 headerBorderBelowCB->setChecked(false);
1121 firstheaderStatusCB->setChecked(false);
1122 firstheaderBorderAboveCB->setChecked(false);
1123 firstheaderBorderBelowCB->setChecked(false);
1124 firstheaderNoContentsCB->setChecked(false);
1125 footerStatusCB->setChecked(false);
1126 footerBorderAboveCB->setChecked(false);
1127 footerBorderBelowCB->setChecked(false);
1128 lastfooterStatusCB->setChecked(false);
1129 lastfooterBorderAboveCB->setChecked(false);
1130 lastfooterBorderBelowCB->setChecked(false);
1131 lastfooterNoContentsCB->setChecked(false);
1132 newpageCB->setChecked(false);
1133 captionStatusCB->blockSignals(true);
1134 captionStatusCB->setChecked(false);
1135 captionStatusCB->blockSignals(false);
1137 // Store feature status
1138 features_ = getTabFeatures();
1141 // longtables cannot have a vertical alignment
1142 TableAlignCO->setCurrentIndex(Tabular::LYX_VALIGN_MIDDLE);
1144 switch (tabular.longtabular_alignment) {
1145 case Tabular::LYX_LONGTABULAR_ALIGN_LEFT:
1146 leftRB->setChecked(true);
1148 case Tabular::LYX_LONGTABULAR_ALIGN_CENTER:
1149 centerRB->setChecked(true);
1151 case Tabular::LYX_LONGTABULAR_ALIGN_RIGHT:
1152 rightRB->setChecked(true);
1155 centerRB->setChecked(true);
1158 captionStatusCB->blockSignals(true);
1159 captionStatusCB->setChecked(tabular.ltCaption(row));
1160 captionStatusCB->blockSignals(false);
1162 Tabular::ltType ltt;
1164 bool row_set = tabular.getRowOfLTHead(row, ltt);
1165 headerStatusCB->setChecked(row_set);
1167 headerBorderAboveCB->setChecked(ltt.topDL);
1168 headerBorderBelowCB->setChecked(ltt.bottomDL);
1171 headerBorderAboveCB->setChecked(false);
1172 headerBorderBelowCB->setChecked(false);
1173 firstheaderNoContentsCB->setChecked(false);
1177 row_set = tabular.getRowOfLTFirstHead(row, ltt);
1178 firstheaderStatusCB->setChecked(row_set);
1179 if (ltt.set && (!ltt.empty || !use_empty)) {
1180 firstheaderBorderAboveCB->setChecked(ltt.topDL);
1181 firstheaderBorderBelowCB->setChecked(ltt.bottomDL);
1183 firstheaderBorderAboveCB->setChecked(false);
1184 firstheaderBorderBelowCB->setChecked(false);
1187 row_set = tabular.getRowOfLTFoot(row, ltt);
1188 footerStatusCB->setChecked(row_set);
1190 footerBorderAboveCB->setChecked(ltt.topDL);
1191 footerBorderBelowCB->setChecked(ltt.bottomDL);
1194 footerBorderAboveCB->setChecked(false);
1195 footerBorderBelowCB->setChecked(false);
1196 lastfooterNoContentsCB->setChecked(false);
1200 row_set = tabular.getRowOfLTLastFoot(row, ltt);
1201 lastfooterStatusCB->setChecked(row_set);
1202 if (ltt.set && (!ltt.empty || !use_empty)) {
1203 lastfooterBorderAboveCB->setChecked(ltt.topDL);
1204 lastfooterBorderBelowCB->setChecked(ltt.bottomDL);
1206 lastfooterBorderAboveCB->setChecked(false);
1207 lastfooterBorderBelowCB->setChecked(false);
1209 newpageCB->setChecked(tabular.getLTNewPage(row));
1211 // first header can only be suppressed when there is a header
1212 firstheader_suppressable_ = tabular.haveLTHead()
1213 && !tabular.haveLTFirstHead();
1214 // last footer can only be suppressed when there is a footer
1215 lastfooter_suppressable_ = tabular.haveLTFoot()
1216 && !tabular.haveLTLastFoot();
1218 // after setting the features, check if they are enabled
1221 // Finally, store feature status
1222 features_ = getTabFeatures();
1226 bool GuiTabular::checkWidgets(bool readonly) const
1228 tabularRowED->setReadOnly(readonly);
1229 tabularColumnED->setReadOnly(readonly);
1230 tabularWidthED->setReadOnly(readonly);
1231 specialAlignmentED->setReadOnly(readonly);
1232 columnWidthED->setReadOnly(readonly);
1233 multirowOffsetED->setReadOnly(readonly);
1234 decimalPointED->setReadOnly(readonly);
1237 multicolumnCB->setEnabled(false);
1238 multirowCB->setEnabled(false);
1239 rotateCellCB->setEnabled(false);
1240 rotateCellAngleSB->setEnabled(false);
1241 rotateTabularCB->setEnabled(false);
1242 rotateTabularAngleSB->setEnabled(false);
1243 longTabularCB->setEnabled(false);
1244 borders->setEnabled(false);
1245 tabularWidthUnitLC->setEnabled(false);
1246 columnWidthUnitLC->setEnabled(false);
1247 columnTypeCO->setEnabled(false);
1248 multirowOffsetUnitLC->setEnabled(false);
1249 setBordersGB->setEnabled(false);
1250 allBordersGB->setEnabled(false);
1251 borderStyleGB->setEnabled(false);
1252 booktabsRB->setEnabled(false);
1253 topspaceCO->setEnabled(false);
1254 topspaceUnitLC->setEnabled(false);
1255 bottomspaceCO->setEnabled(false);
1256 bottomspaceUnitLC->setEnabled(false);
1257 interlinespaceCO->setEnabled(false);
1258 interlinespaceUnitLC->setEnabled(false);
1259 hAlignCO->setEnabled(false);
1260 vAlignCO->setEnabled(false);
1261 TableAlignCO->setEnabled(false);
1262 longtableGB->setEnabled(false);
1263 alignmentGB->setEnabled(false);
1267 return InsetParamsWidget::checkWidgets();
1271 bool GuiTabular::funcEnabled(Tabular::Feature f) const
1273 FuncRequest r(LFUN_INSET_MODIFY, "tabular for-dialog" + featureAsString(f));
1274 return getStatus(r).enabled();
1278 } // namespace frontend
1281 #include "moc_GuiTabular.cpp"