2006-03-05 17:24:44 +00:00
|
|
|
/**
|
2007-08-31 05:53:55 +00:00
|
|
|
* \file GuiTabularCreate.cpp
|
2006-03-05 17:24:44 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author John Levon
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
#include "GuiTabularCreate.h"
|
2007-09-05 20:33:29 +00:00
|
|
|
|
2007-04-26 03:53:02 +00:00
|
|
|
#include "EmptyTable.h"
|
2007-10-06 09:39:29 +00:00
|
|
|
#include "FuncRequest.h"
|
|
|
|
|
|
|
|
#include "support/convert.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
#include <QCloseEvent>
|
2007-04-24 17:46:08 +00:00
|
|
|
#include <QSpinBox>
|
|
|
|
#include <QPushButton>
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-10-06 09:39:29 +00:00
|
|
|
using std::string;
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
2007-10-06 09:39:29 +00:00
|
|
|
GuiTabularCreate::GuiTabularCreate(LyXView & lv)
|
2007-10-09 19:34:27 +00:00
|
|
|
: GuiDialog(lv, "tabularcreate")
|
2007-04-24 17:46:08 +00:00
|
|
|
{
|
|
|
|
setupUi(this);
|
2007-09-05 20:33:29 +00:00
|
|
|
setViewTitle(_("Insert Table"));
|
2007-04-24 17:46:08 +00:00
|
|
|
|
|
|
|
rowsSB->setValue(5);
|
|
|
|
columnsSB->setValue(5);
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
|
|
|
|
connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
|
2007-08-12 12:51:00 +00:00
|
|
|
|
|
|
|
connect(rowsSB, SIGNAL(valueChanged(int)),
|
|
|
|
this, SLOT(rowsChanged(int)));
|
|
|
|
connect(columnsSB, SIGNAL(valueChanged(int)),
|
2007-04-24 17:46:08 +00:00
|
|
|
this, SLOT(columnsChanged(int)));
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
bc().setPolicy(ButtonPolicy::IgnorantPolicy);
|
|
|
|
bc().setOK(okPB);
|
|
|
|
bc().setCancel(closePB);
|
2007-04-24 17:46:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-10-06 09:39:29 +00:00
|
|
|
void GuiTabularCreate::columnsChanged(int)
|
2007-04-24 17:46:08 +00:00
|
|
|
{
|
2007-10-06 09:39:29 +00:00
|
|
|
changed();
|
2007-04-24 17:46:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-10-06 09:39:29 +00:00
|
|
|
void GuiTabularCreate::rowsChanged(int)
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2007-09-05 20:33:29 +00:00
|
|
|
changed();
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-10-06 09:39:29 +00:00
|
|
|
void GuiTabularCreate::applyView()
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2007-10-06 09:39:29 +00:00
|
|
|
params_.first = rowsSB->value();
|
|
|
|
params_.second = columnsSB->value();
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-10-06 09:39:29 +00:00
|
|
|
bool GuiTabularCreate::initialiseParams(string const &)
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2007-10-06 09:39:29 +00:00
|
|
|
params_.first = 5;
|
|
|
|
params_.second = 5;
|
|
|
|
return true;
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
2007-10-06 09:39:29 +00:00
|
|
|
|
|
|
|
void GuiTabularCreate::clearParams()
|
|
|
|
{
|
|
|
|
params_.first = 0;
|
|
|
|
params_.second = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GuiTabularCreate::dispatchParams()
|
|
|
|
{
|
|
|
|
string const data = convert<string>(params().first) + ' ' + convert<string>(params().second);
|
|
|
|
dispatch(FuncRequest(getLfun(), data));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Dialog * createGuiTabularCreate(LyXView & lv)
|
|
|
|
{
|
|
|
|
return new GuiTabularCreate(lv);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
2007-04-24 17:46:08 +00:00
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
#include "GuiTabularCreate_moc.cpp"
|