//------------------------------------------------------------------------
//------------------------------------------------------------------------
+
+class SetupDlg::LineEdit : public QLineEdit
+{
+public:
+ LineEdit( QWidget* p = 0 ) : QLineEdit( p ) {}
+ virtual ~LineEdit() {}
+
+protected:
+ void focusOutEvent( QFocusEvent* e )
+ {
+ QLineEdit::focusOutEvent( e );
+
+ if ( text().isEmpty() )
+ emit editingFinished();
+ }
+ void keyPressEvent( QKeyEvent* e )
+ {
+ QLineEdit::keyPressEvent( e );
+
+ if ( text().isEmpty() && e->key() == Qt::Key_Return )
+ emit returnPressed();
+ }
+};
+
+
//------------------------------------------------------------------------
+//------------------------------------------------------------------------
+
SetupDlg::SetupDlg (QWidget* theParent,
VisuGUI* theModule,
VISU_TimeAnimation* theAnimator) :
QLabel* aMinLbl = new QLabel("From", myUseRangeBox);
aRangeLayout->addWidget(aMinLbl);
//myMinVal = new QtxDoubleSpinBox( aMinTime, aMaxTime, aStep, myUseRangeBox );
- myMinVal = new QLineEdit(myUseRangeBox);
+ myMinVal = new LineEdit( myUseRangeBox );
myMinVal->setValidator( new QDoubleValidator( myMinVal ) );
- if (myUseRangeBox->isChecked())
- myMinVal->setText( QString::number(myAnimator->getMinRange()) );
+ if ( myUseRangeBox->isChecked() )
+ myMinVal->setText( QString::number( myAnimator->getMinRange() ) );
else
- myMinVal->setText( QString::number(aMinTime) );
+ myMinVal->setText( QString::number( aMinTime ) );
// connect(myMinVal, SIGNAL( valueChanged(double)),
// this, SLOT( onMinValue(double) ));
+ connect( myMinVal, SIGNAL( returnPressed() ), this, SLOT( onMinValue() ) );
connect( myMinVal, SIGNAL( editingFinished() ), this, SLOT( onMinValue() ) );
// connect( myMinVal, SIGNAL( textChanged(const QString&)),
// this, SLOT( onMinValueEdit(const QString&) ));
QLabel* aMaxLbl = new QLabel("To", myUseRangeBox);
aRangeLayout->addWidget(aMaxLbl);
//myMaxVal = new QtxDoubleSpinBox( aMinTime, aMaxTime, aStep, myUseRangeBox );
- myMaxVal = new QLineEdit(myUseRangeBox);
+ myMaxVal = new LineEdit( myUseRangeBox );
myMaxVal->setValidator( new QDoubleValidator( myMaxVal ) );
- if (myUseRangeBox->isChecked())
- myMaxVal->setText( QString::number(myAnimator->getMaxRange()) );
- else {
- myMaxVal->setText( QString::number(aMaxTime) );
- }
+ if ( myUseRangeBox->isChecked() )
+ myMaxVal->setText( QString::number( myAnimator->getMaxRange() ) );
+ else
+ myMaxVal->setText( QString::number( aMaxTime ) );
+
// connect(myMaxVal, SIGNAL( valueChanged(double)),
// this, SLOT( onMaxValue(double) ));
+ connect( myMaxVal, SIGNAL( returnPressed() ), this, SLOT( onMaxValue() ) );
connect( myMaxVal, SIGNAL( editingFinished() ), this, SLOT( onMaxValue() ) );
// connect(myMaxVal, SIGNAL( textChanged(const QString&)),
// this, SLOT( onMaxValueEdit(const QString&) ));
aBtnLayout->setContentsMargins( 5, 5, 0, 5 );
// aBtnLayout->addStretch();
- QPushButton* closeBtn = new QPushButton( tr( "BUT_CLOSE" ), aBtnBox );
+ QPushButton* closeBtn = new QPushButton( tr( "BUT_OK" ), aBtnBox );
closeBtn->setAutoDefault( false );
aBtnLayout->addStretch();
aBtnLayout->addWidget( closeBtn );
class SalomeApp_Module;
class VISU_TimeAnimation;
-namespace VISU
+namespace VISU
{
class Prs3d_i;
class PointMap3d_i;
enum { AutoMode, ManualMode };
enum { XAxis, YAxis, ZAxis };
- ArrangeDlg(QWidget* theParent,
+ ArrangeDlg(QWidget* theParent,
VISU_TimeAnimation* theAnimator);
- ArrangeDlg(QWidget* theParent,
+ ArrangeDlg(QWidget* theParent,
const SalomeApp_Module* theModule,
SVTK_ViewWindow* theViewWindow);
};
-class SetupDlg: public QDialog {
+class SetupDlg : public QDialog
+{
Q_OBJECT
+ class LineEdit;
+
public:
- SetupDlg(QWidget* theParent,
- VisuGUI* theModule,
- VISU_TimeAnimation* theAnimator);
+ SetupDlg( QWidget* theParent, VisuGUI* theModule,
+ VISU_TimeAnimation* theAnimator );
~SetupDlg() {};
public:
Q_OBJECT
public:
VisuGUI_TimeAnimationDlg(VisuGUI* theModule,
- _PTR(Study) theStudy,
+ _PTR(Study) theStudy,
VISU::Animation::AnimationMode theMode = VISU::Animation::PARALLEL);
~VisuGUI_TimeAnimationDlg();
virtual void showEvent(QShowEvent* theEvent);
virtual void keyPressEvent(QKeyEvent* theEvent);
void stopAnimation();
-
+
private slots:
void onTypeChange(int index);
void onPlayPressed();