You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
2.2 KiB
78 lines
2.2 KiB
15 years ago
|
/* This file is part of the KDE libraries
|
||
|
Copyright (C) 1999 Ilya Baran (ibaran@mit.edu)
|
||
|
|
||
|
This library is free software; you can redistribute it and/or
|
||
|
modify it under the terms of the GNU Library General Public
|
||
|
License as published by the Free Software Foundation; either
|
||
|
version 2 of the License, or (at your option) any later version.
|
||
|
|
||
|
This library is distributed in the hope that it will be useful,
|
||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
Library General Public License for more details.
|
||
|
|
||
|
You should have received a copy of the GNU Library General Public License
|
||
|
along with this library; see the file COPYING.LIB. If not, write to
|
||
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
|
* Boston, MA 02110-1301, USA.
|
||
|
*/
|
||
|
|
||
|
#include "MatrixDialog.h"
|
||
14 years ago
|
#include <tqpushbutton.h>
|
||
|
#include <tqspinbox.h>
|
||
|
#include <tqlabel.h>
|
||
|
#include <tqcheckbox.h>
|
||
13 years ago
|
#include <tqlayout.h>
|
||
12 years ago
|
#include <tdelocale.h>
|
||
15 years ago
|
|
||
|
KFORMULA_NAMESPACE_BEGIN
|
||
|
|
||
|
const int DEFAULT_SIZE = 3;
|
||
|
const int MAX_SIZE = 200;
|
||
|
|
||
13 years ago
|
MatrixDialog::MatrixDialog( TQWidget *parent, int _width, int _height )
|
||
|
: KDialogBase(parent, "Matrix Dialog", true,i18n("Add Matrix"),Ok|Cancel)
|
||
15 years ago
|
{
|
||
|
w = _width;
|
||
|
h = _height;
|
||
|
|
||
14 years ago
|
TQLabel *rows, *columns;
|
||
|
TQWidget *page = new TQWidget( this );
|
||
15 years ago
|
setMainWidget(page);
|
||
14 years ago
|
TQGridLayout *grid = new TQGridLayout(page, 4, 2, 10);
|
||
15 years ago
|
|
||
14 years ago
|
rows = new TQLabel(i18n("Rows:"), page);
|
||
|
columns = new TQLabel(i18n("Columns:"), page);
|
||
15 years ago
|
|
||
|
grid->addWidget(rows, 0, 0);
|
||
|
grid->addWidget(columns, 0, 1);
|
||
|
|
||
14 years ago
|
TQSpinBox *width, *height;
|
||
15 years ago
|
|
||
14 years ago
|
height = new TQSpinBox(1, MAX_SIZE, 1, page);
|
||
15 years ago
|
grid->addWidget(height, 1, 0);
|
||
|
height->setValue(h);
|
||
14 years ago
|
connect(height, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(setHeight(int)));
|
||
15 years ago
|
|
||
14 years ago
|
width = new TQSpinBox(1, MAX_SIZE, 1, page);
|
||
15 years ago
|
grid->addWidget(width, 1, 1);
|
||
|
width->setValue(w);
|
||
14 years ago
|
connect(width, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(setWidth(int)));
|
||
15 years ago
|
height->setFocus();
|
||
|
}
|
||
|
|
||
|
void MatrixDialog::setHeight(int value)
|
||
|
{
|
||
|
h = value;
|
||
|
}
|
||
|
|
||
|
void MatrixDialog::setWidth(int value)
|
||
|
{
|
||
|
w = value;
|
||
|
}
|
||
|
|
||
|
KFORMULA_NAMESPACE_END
|
||
|
|
||
|
using namespace KFormula;
|
||
|
#include "MatrixDialog.moc"
|