lyx_mirror/src/frontends/qt4/GuiTabularCreate.cpp
André Pönitz fc36725282 Merge QController into individual dialogs. Also various cleanup
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19961 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-31 22:16:11 +00:00

92 lines
1.8 KiB
C++

/**
* \file GuiTabularCreate.cpp
* 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 "GuiTabularCreate.h"
#include "Qt2BC.h"
#include "EmptyTable.h"
#include <QCloseEvent>
#include <QSpinBox>
#include <QPushButton>
namespace lyx {
namespace frontend {
/////////////////////////////////////////////////////////////////////
//
// GuiTabularCreateDialog
//
/////////////////////////////////////////////////////////////////////
GuiTabularCreateDialog::GuiTabularCreateDialog(GuiTabularCreate * 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 GuiTabularCreateDialog::columnsChanged(int)
{
form_->changed();
}
void GuiTabularCreateDialog::rowsChanged(int)
{
form_->changed();
}
/////////////////////////////////////////////////////////////////////
//
// GuiTabularCreate
//
/////////////////////////////////////////////////////////////////////
GuiTabularCreate::GuiTabularCreate(Dialog & parent)
: GuiView<GuiTabularCreateDialog>(parent, _("Insert Table"))
{
}
void GuiTabularCreate::build_dialog()
{
dialog_.reset(new GuiTabularCreateDialog(this));
bcview().setOK(dialog_->okPB);
bcview().setCancel(dialog_->closePB);
}
void GuiTabularCreate::apply()
{
controller().params().first = dialog_->rowsSB->value();
controller().params().second = dialog_->columnsSB->value();
}
} // namespace frontend
} // namespace lyx
#include "GuiTabularCreate_moc.cpp"