2 * \file GuiTabularCreate.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "GuiTabularCreate.h"
15 #include "EmptyTable.h"
16 #include "FuncRequest.h"
18 #include "support/convert.h"
21 #include <QPushButton>
28 GuiTabularCreate::GuiTabularCreate(GuiView & lv)
29 : GuiDialog(lv, "tabularcreate", qt_("Insert Table"))
34 columnsSB->setValue(5);
35 table->setMinimumSize(100, 100);
37 connect(table, SIGNAL(rowsChanged(int)),
38 rowsSB, SLOT(setValue(int)));
39 connect(table, SIGNAL(colsChanged(int)),
40 columnsSB, SLOT(setValue(int)));
41 connect(rowsSB, SIGNAL(valueChanged(int)),
42 table, SLOT(setNumberRows(int)));
43 connect(columnsSB, SIGNAL(valueChanged(int)),
44 table, SLOT(setNumberColumns(int)));
46 connect(buttonBox, SIGNAL(clicked(QAbstractButton *)),
47 this, SLOT(slotButtonBox(QAbstractButton *)));
49 connect(rowsSB, SIGNAL(valueChanged(int)),
50 this, SLOT(rowsChanged(int)));
51 connect(columnsSB, SIGNAL(valueChanged(int)),
52 this, SLOT(columnsChanged(int)));
54 bc().setPolicy(ButtonPolicy::OkApplyCancelReadOnlyPolicy);
55 bc().setOK(buttonBox->button(QDialogButtonBox::Ok));
56 bc().setApply(buttonBox->button(QDialogButtonBox::Apply));
57 bc().setCancel(buttonBox->button(QDialogButtonBox::Cancel));
58 bc().setValid(isValid());
62 void GuiTabularCreate::columnsChanged(int)
68 void GuiTabularCreate::rowsChanged(int)
74 void GuiTabularCreate::applyView()
76 params_.first = rowsSB->value();
77 params_.second = columnsSB->value();
81 bool GuiTabularCreate::initialiseParams(string const &)
89 void GuiTabularCreate::clearParams()
96 void GuiTabularCreate::dispatchParams()
99 convert<string>(params().first) + ' ' + convert<string>(params().second);
100 dispatch(FuncRequest(getLfun(), sdata));
104 Dialog * createGuiTabularCreate(GuiView & lv)
106 return new GuiTabularCreate(lv);
110 } // namespace frontend
113 #include "moc_GuiTabularCreate.cpp"