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
|
|
|
|
|
|
|
#include "ControlTabularCreate.h"
|
2007-04-26 03:53:02 +00:00
|
|
|
#include "EmptyTable.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-09-05 20:33:29 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
GuiTabularCreateDialog::GuiTabularCreateDialog(LyXView & lv)
|
|
|
|
: GuiDialog(lv, "tabularcreate")
|
2007-04-24 17:46:08 +00:00
|
|
|
{
|
|
|
|
setupUi(this);
|
2007-09-05 20:33:29 +00:00
|
|
|
setViewTitle(_("Insert Table"));
|
|
|
|
setController(new ControlTabularCreate(*this));
|
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-09-05 20:33:29 +00:00
|
|
|
ControlTabularCreate & GuiTabularCreateDialog::controller() const
|
2007-04-24 17:46:08 +00:00
|
|
|
{
|
2007-09-10 22:32:59 +00:00
|
|
|
return static_cast<ControlTabularCreate &>(GuiDialog::controller());
|
2007-04-24 17:46:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
void GuiTabularCreateDialog::columnsChanged(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-09-05 20:33:29 +00:00
|
|
|
void GuiTabularCreateDialog::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-09-05 20:33:29 +00:00
|
|
|
void GuiTabularCreateDialog::applyView()
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2007-09-05 20:33:29 +00:00
|
|
|
controller().params().first = rowsSB->value();
|
|
|
|
controller().params().second = columnsSB->value();
|
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"
|