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-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
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
2007-04-24 17:46:08 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2007-08-31 05:53:55 +00:00
|
|
|
// GuiTabularCreateDialog
|
2007-04-24 17:46:08 +00:00
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
GuiTabularCreateDialog::GuiTabularCreateDialog(GuiTabularCreate * form)
|
2007-04-24 17:46:08 +00:00
|
|
|
: form_(form)
|
|
|
|
{
|
|
|
|
setupUi(this);
|
|
|
|
|
|
|
|
rowsSB->setValue(5);
|
|
|
|
columnsSB->setValue(5);
|
|
|
|
|
2007-08-12 12:51:00 +00:00
|
|
|
connect(okPB, SIGNAL(clicked()), form_, SLOT(slotOK()));
|
|
|
|
connect(closePB, SIGNAL(clicked()), form_, SLOT(slotClose()));
|
|
|
|
|
|
|
|
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-08-31 05:53:55 +00:00
|
|
|
void GuiTabularCreateDialog::columnsChanged(int)
|
2007-04-24 17:46:08 +00:00
|
|
|
{
|
|
|
|
form_->changed();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
void GuiTabularCreateDialog::rowsChanged(int)
|
2007-04-24 17:46:08 +00:00
|
|
|
{
|
|
|
|
form_->changed();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2007-08-31 05:53:55 +00:00
|
|
|
// GuiTabularCreate
|
2007-04-24 17:46:08 +00:00
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-09-03 05:59:32 +00:00
|
|
|
GuiTabularCreate::GuiTabularCreate(GuiDialog & parent)
|
2007-08-31 22:16:11 +00:00
|
|
|
: GuiView<GuiTabularCreateDialog>(parent, _("Insert Table"))
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
void GuiTabularCreate::build_dialog()
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog_.reset(new GuiTabularCreateDialog(this));
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-09-03 05:59:32 +00:00
|
|
|
bc().setOK(dialog_->okPB);
|
|
|
|
bc().setCancel(dialog_->closePB);
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-09-03 20:28:26 +00:00
|
|
|
void GuiTabularCreate::applyView()
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
|
|
|
controller().params().first = dialog_->rowsSB->value();
|
|
|
|
controller().params().second = dialog_->columnsSB->value();
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
2007-04-24 17:46:08 +00:00
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
#include "GuiTabularCreate_moc.cpp"
|