lib
MatrixDialog.cc00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "MatrixDialog.h"
00021 #include <qpushbutton.h>
00022 #include <qspinbox.h>
00023 #include <qlabel.h>
00024 #include <qcheckbox.h>
00025 #include <qlayout.h>
00026 #include <klocale.h>
00027
00028 KFORMULA_NAMESPACE_BEGIN
00029
00030 const int DEFAULT_SIZE = 3;
00031 const int MAX_SIZE = 200;
00032
00033 MatrixDialog::MatrixDialog( QWidget *parent, int _width, int _height )
00034 : KDialogBase(parent, "Matrix Dialog", true,i18n("Add Matrix"),Ok|Cancel)
00035 {
00036 w = _width;
00037 h = _height;
00038
00039 QLabel *rows, *columns;
00040 QWidget *page = new QWidget( this );
00041 setMainWidget(page);
00042 QGridLayout *grid = new QGridLayout(page, 4, 2, 10);
00043
00044 rows = new QLabel(i18n("Rows:"), page);
00045 columns = new QLabel(i18n("Columns:"), page);
00046
00047 grid->addWidget(rows, 0, 0);
00048 grid->addWidget(columns, 0, 1);
00049
00050 QSpinBox *width, *height;
00051
00052 height = new QSpinBox(1, MAX_SIZE, 1, page);
00053 grid->addWidget(height, 1, 0);
00054 height->setValue(h);
00055 connect(height, SIGNAL(valueChanged(int)), SLOT(setHeight(int)));
00056
00057 width = new QSpinBox(1, MAX_SIZE, 1, page);
00058 grid->addWidget(width, 1, 1);
00059 width->setValue(w);
00060 connect(width, SIGNAL(valueChanged(int)), SLOT(setWidth(int)));
00061 height->setFocus();
00062 }
00063
00064 void MatrixDialog::setHeight(int value)
00065 {
00066 h = value;
00067 }
00068
00069 void MatrixDialog::setWidth(int value)
00070 {
00071 w = value;
00072 }
00073
00074 KFORMULA_NAMESPACE_END
00075
00076 using namespace KFormula;
00077 #include "MatrixDialog.moc"
|