X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_aParameter.cxx;h=cbd22eb3b196e78e890ee90ef29c28a67cdb56cb;hb=35c1f52506e4410fa41ff757e3b859d643dc99f7;hp=7d40358d3758c34747c3dc05c55cc231a088dd29;hpb=e4737e85f0da6d3f90fd08f6be1c2825195fe16f;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_aParameter.cxx b/src/SMESHGUI/SMESHGUI_aParameter.cxx index 7d40358d3..cbd22eb3b 100644 --- a/src/SMESHGUI/SMESHGUI_aParameter.cxx +++ b/src/SMESHGUI/SMESHGUI_aParameter.cxx @@ -29,6 +29,8 @@ #include #include +#include + #include "QAD_SpinBoxDbl.h" SMESHGUI_aParameter::~SMESHGUI_aParameter() {} @@ -58,6 +60,10 @@ bool SMESHGUI_intParameter::GetNewDouble( double & Value ) const { return false; } +bool SMESHGUI_intParameter::GetNewText( QString & Value ) const +{ + return false; +} void SMESHGUI_intParameter::InitializeWidget( QWidget* theQWidget) const { QSpinBox * aSpin = dynamic_cast< QSpinBox *>( theQWidget ); @@ -101,6 +107,10 @@ bool SMESHGUI_doubleParameter::GetNewDouble( double & Value ) const Value = _newValue; return _newValue != _initValue; } +bool SMESHGUI_doubleParameter::GetNewText( QString & Value ) const +{ + return false; +} void SMESHGUI_doubleParameter::InitializeWidget( QWidget* theQWidget) const { QAD_SpinBoxDbl * aSpin = dynamic_cast< QAD_SpinBoxDbl *>( theQWidget ); @@ -117,3 +127,44 @@ void SMESHGUI_doubleParameter::TakeValue( QWidget* theQWidget) if ( aSpin ) _newValue = aSpin->value(); } + +//================================================================================= +// class : SMESHGUI_strParameter +// purpose : +//================================================================================= +SMESHGUI_strParameter::SMESHGUI_strParameter(const QString& theInitValue, + const QString& theLabel) + :SMESHGUI_aParameter(theLabel), + _initValue( theInitValue ) +{ +} +SMESHGUI_aParameter::Type SMESHGUI_strParameter::GetType() const +{ + return SMESHGUI_aParameter::TEXT; +} +bool SMESHGUI_strParameter::GetNewInt( int & theValue ) const +{ + return false; +} +bool SMESHGUI_strParameter::GetNewDouble( double & Value ) const +{ + return false; +} +bool SMESHGUI_strParameter::GetNewText( QString & theValue ) const +{ + theValue = _newValue; + return _newValue != _initValue; +} +void SMESHGUI_strParameter::InitializeWidget( QWidget* theQWidget) const +{ + QTextEdit * anEdit = dynamic_cast< QTextEdit *>( theQWidget ); + if ( anEdit ) { + anEdit->setText( _initValue ); + } +} +void SMESHGUI_strParameter::TakeValue( QWidget* theQWidget) +{ + QTextEdit * anEdit = dynamic_cast< QTextEdit *>( theQWidget ); + if ( anEdit ) + _newValue = anEdit->text(); +}