KOffice – TDE office suite
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

  1. /* This file is part of the KDE libraries
  2. Copyright (C) 1999 Ilya Baran (ibaran@mit.edu)
  3. This library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Library General Public
  5. License as published by the Free Software Foundation; either
  6. version 2 of the License, or (at your option) any later version.
  7. This library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Library General Public License for more details.
  11. You should have received a copy of the GNU Library General Public License
  12. along with this library; see the file COPYING.LIB. If not, write to
  13. the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  14. * Boston, MA 02110-1301, USA.
  15. */
  16. #include "MatrixDialog.h"
  17. #include <tqpushbutton.h>
  18. #include <tqspinbox.h>
  19. #include <tqlabel.h>
  20. #include <tqcheckbox.h>
  21. #include <tqlayout.h>
  22. #include <tdelocale.h>
  23. KFORMULA_NAMESPACE_BEGIN
  24. const int DEFAULT_SIZE = 3;
  25. const int MAX_SIZE = 200;
  26. MatrixDialog::MatrixDialog( TQWidget *parent, int _width, int _height )
  27. : KDialogBase(parent, "Matrix Dialog", true,i18n("Add Matrix"),Ok|Cancel)
  28. {
  29. w = _width;
  30. h = _height;
  31. TQLabel *rows, *columns;
  32. TQWidget *page = new TQWidget( this );
  33. setMainWidget(page);
  34. TQGridLayout *grid = new TQGridLayout(page, 4, 2, 10);
  35. rows = new TQLabel(i18n("Rows:"), page);
  36. columns = new TQLabel(i18n("Columns:"), page);
  37. grid->addWidget(rows, 0, 0);
  38. grid->addWidget(columns, 0, 1);
  39. TQSpinBox *width, *height;
  40. height = new TQSpinBox(1, MAX_SIZE, 1, page);
  41. grid->addWidget(height, 1, 0);
  42. height->setValue(h);
  43. connect(height, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(setHeight(int)));
  44. width = new TQSpinBox(1, MAX_SIZE, 1, page);
  45. grid->addWidget(width, 1, 1);
  46. width->setValue(w);
  47. connect(width, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(setWidth(int)));
  48. height->setFocus();
  49. }
  50. void MatrixDialog::setHeight(int value)
  51. {
  52. h = value;
  53. }
  54. void MatrixDialog::setWidth(int value)
  55. {
  56. w = value;
  57. }
  58. KFORMULA_NAMESPACE_END
  59. using namespace KFormula;
  60. #include "MatrixDialog.moc"