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.

kis_wdg_wave.cpp 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * This file is part of Chalk
  3. *
  4. * Copyright (c) 2006 Cyrille Berger <cberger@cberger.net>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. */
  20. #include "kis_wdg_wave.h"
  21. #include <tqlayout.h>
  22. #include <kcombobox.h>
  23. #include <knuminput.h>
  24. #include "wdgwaveoptions.h"
  25. KisWdgWave::KisWdgWave(KisFilter* /*nfilter*/, TQWidget* parent, const char* name)
  26. : KisFilterConfigWidget(parent,name)
  27. {
  28. TQGridLayout *widgetLayout = new TQGridLayout(this, 1, 1);
  29. m_widget = new WdgWaveOptions(this);
  30. widgetLayout -> addWidget(m_widget, 0, 0);
  31. connect( widget()->intHWavelength, TQT_SIGNAL( valueChanged(int)), TQT_SIGNAL(sigPleaseUpdatePreview()));
  32. connect( widget()->intHShift, TQT_SIGNAL( valueChanged(int)), TQT_SIGNAL(sigPleaseUpdatePreview()));
  33. connect( widget()->intHAmplitude, TQT_SIGNAL( valueChanged(int)), TQT_SIGNAL(sigPleaseUpdatePreview()));
  34. connect( widget()->cbHShape, TQT_SIGNAL( activated(int)), TQT_SIGNAL(sigPleaseUpdatePreview()));
  35. connect( widget()->intVWavelength, TQT_SIGNAL( valueChanged(int)), TQT_SIGNAL(sigPleaseUpdatePreview()));
  36. connect( widget()->intVShift, TQT_SIGNAL( valueChanged(int)), TQT_SIGNAL(sigPleaseUpdatePreview()));
  37. connect( widget()->intVAmplitude, TQT_SIGNAL( valueChanged(int)), TQT_SIGNAL(sigPleaseUpdatePreview()));
  38. connect( widget()->cbVShape, TQT_SIGNAL( activated(int)), TQT_SIGNAL(sigPleaseUpdatePreview()));
  39. }
  40. KisWdgWave::~KisWdgWave()
  41. {
  42. }
  43. void KisWdgWave::setConfiguration(KisFilterConfiguration* config)
  44. {
  45. TQVariant value;
  46. if (config->getProperty("horizontalwavelength", value))
  47. {
  48. widget()->intHWavelength->setValue( value.toUInt() );
  49. }
  50. if (config->getProperty("horizontalshift", value))
  51. {
  52. widget()->intHShift->setValue( value.toUInt() );
  53. }
  54. if (config->getProperty("horizontalamplitude", value))
  55. {
  56. widget()->intHAmplitude->setValue( value.toUInt() );
  57. }
  58. if (config->getProperty("horizontalshape", value))
  59. {
  60. widget()->cbHShape->setCurrentItem( value.toUInt() );
  61. }
  62. if (config->getProperty("verticalwavelength", value))
  63. {
  64. widget()->intVWavelength->setValue( value.toUInt() );
  65. }
  66. if (config->getProperty("verticalshift", value))
  67. {
  68. widget()->intVShift->setValue( value.toUInt() );
  69. }
  70. if (config->getProperty("verticalamplitude", value))
  71. {
  72. widget()->intVAmplitude->setValue( value.toUInt() );
  73. }
  74. if (config->getProperty("verticalshape", value))
  75. {
  76. widget()->cbVShape->setCurrentItem( value.toUInt() );
  77. }
  78. }
  79. #include "kis_wdg_wave.moc"