2006-03-05 17:24:44 +00:00
|
|
|
/**
|
2007-04-26 03:53:02 +00:00
|
|
|
* \file QTabularCreate.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>
|
|
|
|
|
|
|
|
#include "QTabularCreate.h"
|
|
|
|
#include "Qt2BC.h"
|
2007-04-26 03:53:02 +00:00
|
|
|
#include "EmptyTable.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
#include "controllers/ControlTabularCreate.h"
|
|
|
|
|
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
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// QTabularCreateDialog
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
QTabularCreateDialog::QTabularCreateDialog(QTabularCreate * form)
|
|
|
|
: form_(form)
|
|
|
|
{
|
|
|
|
setupUi(this);
|
|
|
|
|
|
|
|
rowsSB->setValue(5);
|
|
|
|
columnsSB->setValue(5);
|
|
|
|
|
|
|
|
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)),
|
|
|
|
this, SLOT(columnsChanged(int)));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QTabularCreateDialog::columnsChanged(int)
|
|
|
|
{
|
|
|
|
form_->changed();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QTabularCreateDialog::rowsChanged(int)
|
|
|
|
{
|
|
|
|
form_->changed();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// QTabularCreate
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
typedef QController<ControlTabularCreate, QView<QTabularCreateDialog> >
|
|
|
|
TabularCreateBase;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
QTabularCreate::QTabularCreate(Dialog & parent)
|
2007-04-24 17:46:08 +00:00
|
|
|
: TabularCreateBase(parent, _("Insert Table"))
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QTabularCreate::build_dialog()
|
|
|
|
{
|
|
|
|
dialog_.reset(new QTabularCreateDialog(this));
|
|
|
|
|
|
|
|
bcview().setOK(dialog_->okPB);
|
|
|
|
bcview().setCancel(dialog_->closePB);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QTabularCreate::apply()
|
|
|
|
{
|
|
|
|
controller().params().first = dialog_->rowsSB->value();
|
|
|
|
controller().params().second = dialog_->columnsSB->value();
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
2007-04-24 17:46:08 +00:00
|
|
|
|
|
|
|
#include "QTabularCreate_moc.cpp"
|