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(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
47 connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
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::IgnorantPolicy);
56 bc().setCancel(closePB);
60 void GuiTabularCreate::columnsChanged(int)
66 void GuiTabularCreate::rowsChanged(int)
72 void GuiTabularCreate::applyView()
74 params_.first = rowsSB->value();
75 params_.second = columnsSB->value();
79 bool GuiTabularCreate::initialiseParams(string const &)
87 void GuiTabularCreate::clearParams()
94 void GuiTabularCreate::dispatchParams()
96 string const data = convert<string>(params().first) + ' ' + convert<string>(params().second);
97 dispatch(FuncRequest(getLfun(), data));
101 Dialog * createGuiTabularCreate(GuiView & lv)
103 return new GuiTabularCreate(lv);
107 } // namespace frontend
110 #include "moc_GuiTabularCreate.cpp"