-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
+// Copyright (C) 2014-2015 EDF-R&D
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
{
if ( myWizard->count() > 0 )
{
- myNext->setVisible( true );
- myFinish->setVisible( false );
+ SetButtonsState(false);
+ /*myNext->setVisible( true );
+ myFinish->setVisible( false );*/
}
return myWizard->addWidget( thePage );
}
myBack->setEnabled( true );
int aCurIdx = myWizard->currentIndex();
- if ( aCurIdx == ( myWizard->count() - 2 ) )
+ if ( IsLastPage() )
{
// Go to the last page
- myNext->setVisible( false );
- myFinish->setVisible( true );
+ SetButtonsState( true );
+ /*myNext->setVisible( false );
+ myFinish->setVisible( true );*/
}
myWizard->setCurrentIndex( aCurIdx + 1 );
if ( myWizard->count() > 1 )
{
- myNext->setVisible( true );
- myFinish->setVisible( false );
+ /*myNext->setVisible( true );
+ myFinish->setVisible( false );*/
+ SetButtonsState( false );
}
else
{
// Wizard has a single page - show finish
- myNext->setVisible( false );
- myFinish->setVisible( true );
+ SetButtonsState( true );
+ /*myNext->setVisible( false );
+ myFinish->setVisible( true );*/
}
int aCurIdx = myWizard->currentIndex();
emit Back( aCurIdx );
}
+void HYDROGUI_Wizard::onFirstPage()
+{
+ if ( myWizard->count() > 1 ) {
+ /*myNext->setVisible( true );
+ myFinish->setVisible( false );*/
+ SetButtonsState( false );
+ myWizard->setCurrentIndex( 0 );
+ myBack->setEnabled( false );
+ emit Back( myWizard->currentIndex() );
+ }
+}
+
bool HYDROGUI_Wizard::acceptCurrent() const
{
return true;
aRes = myHelp;
}
return aRes;
+}
+
+bool HYDROGUI_Wizard::IsLastPage()
+{
+ if ( myWizard->currentIndex() == ( myWizard->count() - 2 ))
+ return true;
+ else
+ return false;
+}
+
+void HYDROGUI_Wizard::SetButtonsState (bool IsLastPage)
+{
+ if (!IsLastPage)
+ {
+ myNext->setVisible( true );
+ myFinish->setVisible( false );
+ }
+ else
+ {
+ myNext->setVisible( false );
+ myFinish->setVisible( true );
+ }
}
\ No newline at end of file