HYDROGUI_CalculationOp.h
HYDROGUI_ColorWidget.h
HYDROGUI_CopyPasteOp.h
+ HYDROGUI_DataBrowser.h
HYDROGUI_DataModel.h
HYDROGUI_DataObject.h
HYDROGUI_DeleteOp.h
HYDROGUI_UpdateFlags.h
HYDROGUI_UpdateImageOp.h
HYDROGUI_VisualStateOp.h
+ HYDROGUI_Wizard.h
)
QT4_WRAP_CPP(PROJECT_HEADERS_MOC ${PROJECT_HEADERS})
HYDROGUI_CalculationOp.cxx
HYDROGUI_ColorWidget.cxx
HYDROGUI_CopyPasteOp.cxx
+ HYDROGUI_DataBrowser.cxx
HYDROGUI_DataModel.cxx
HYDROGUI_DataObject.cxx
HYDROGUI_DeleteOp.cxx
HYDROGUI_TwoImagesOp.cxx
HYDROGUI_UpdateImageOp.cxx
HYDROGUI_VisualStateOp.cxx
+ HYDROGUI_Wizard.cxx
)
add_definitions(
#include "HYDROGUI_ObjSelector.h"
#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_DataBrowser.h"
+#include "HYDROGUI_DataModel.h"
+#include "HYDROGUI_Module.h"
+#include "HYDROGUI_DataObject.h"
+
+#include <HYDROData_Document.h>
+#include <HYDROData_Entity.h>
+#include <HYDROData_Object.h>
+
+#include <CAM_Application.h>
+#include <LightApp_DataObject.h>
#include <SUIT_FileDlg.h>
#include <SUIT_ResourceMgr.h>
#include <SUIT_Session.h>
+#include <SUIT_Study.h>
#include <QGroupBox>
#include <QLabel>
#include <QPicture>
#include <QPushButton>
#include <QToolButton>
+#include <QWizardPage>
+#include <QComboBox>
HYDROGUI_CalculationDlg::HYDROGUI_CalculationDlg( HYDROGUI_Module* theModule, const QString& theTitle )
-: HYDROGUI_InputPanel( theModule, theTitle )
+: HYDROGUI_Wizard( theModule, theTitle )
+{
+ QWizard* aWizard = wizard();
+ aWizard->addPage( createObjectsPage() );
+ aWizard->addPage( createZonesPage() );
+ aWizard->show();
+}
+
+HYDROGUI_CalculationDlg::~HYDROGUI_CalculationDlg()
{
+}
+
+void HYDROGUI_CalculationDlg::reset()
+{
+ myObjectName->clear();
+ myGeomObjects->clear();
+}
+
+QWizardPage* HYDROGUI_CalculationDlg::createObjectsPage() {
+ QWizardPage* aPage = new QWizardPage( wizard() );
+ QFrame* aFrame = new QFrame( aPage );
// Calculation name
- myObjectNameGroup = new QGroupBox( tr( "CALCULATION_NAME" ), mainFrame() );
+// myObjectNameGroup = new QGroupBox( tr( "CALCULATION_NAME" ), aFrame );
- myObjectName = new QLineEdit( myObjectNameGroup );
+// myObjectName = new QLineEdit( myObjectNameGroup );
+ myObjectName = new QLineEdit( aPage );
- QBoxLayout* aNameLayout = new QHBoxLayout( myObjectNameGroup );
- aNameLayout->setMargin( 5 );
- aNameLayout->setSpacing( 5 );
- aNameLayout->addWidget( new QLabel( tr( "NAME" ), myObjectNameGroup ) );
- aNameLayout->addWidget( myObjectName );
+ //QBoxLayout* aNameLayout = new QHBoxLayout( myObjectNameGroup );
+ //aNameLayout->setMargin( 5 );
+ //aNameLayout->setSpacing( 5 );
+ //aNameLayout->addWidget( new QLabel( tr( "NAME" ), myObjectNameGroup ) );
+ //aNameLayout->addWidget( myObjectName );
// Calculation zones
- QFrame* anObjectsFrame = new QFrame( mainFrame() );
+ //QFrame* anObjectsFrame = new QFrame( aFrame );
- myGeomObjects = new QListWidget( anObjectsFrame );
+ //myGeomObjects = new QListWidget( anObjectsFrame );
+ myGeomObjects = new QListWidget( aPage );
myGeomObjects->setSelectionMode( QListWidget::SingleSelection );
myGeomObjects->setEditTriggers( QListWidget::NoEditTriggers );
myGeomObjects->setViewMode( QListWidget::ListMode );
- QGridLayout* aZonesLayout = new QGridLayout( anObjectsFrame );
+ QFrame* aBtnsFrame = new QFrame( aPage );
+ QVBoxLayout* aBtnsLayout = new QVBoxLayout( aBtnsFrame );
+ aBtnsLayout->setMargin( 5 );
+ aBtnsLayout->setSpacing( 5 );
+ aBtnsFrame->setLayout( aBtnsLayout );
+ QPushButton* anAddBtn = new QPushButton( tr("ADD"), aBtnsFrame );
+ QPushButton* aRemoveBtn = new QPushButton( tr("REMOVE"), aBtnsFrame );
+ aBtnsLayout->addWidget( anAddBtn );
+ aBtnsLayout->addWidget( aRemoveBtn );
+ aBtnsLayout->addStretch( 1 );
+
+ QLabel* aNameLabel = new QLabel( tr( "NAME" ), aPage );
+ QLabel* anObjectsLabel = new QLabel( tr( "CALCULATION_REFERENCE_OBJECTS" ), aPage );
+
+ QGridLayout* aZonesLayout = new QGridLayout( aPage );
aZonesLayout->setMargin( 5 );
aZonesLayout->setSpacing( 5 );
- aZonesLayout->addWidget( new QLabel( tr( "CALCULATION_REFERENCE_OBJECTS" ), myGeomObjects ), 0, 0 );
- aZonesLayout->addWidget( myGeomObjects, 0, 1 );
-
- // Common
- addWidget( myObjectNameGroup );
- addWidget( anObjectsFrame );
- addStretch();
+ aZonesLayout->setVerticalSpacing( 10 );
+ aZonesLayout->addWidget( aNameLabel, 0, 0, Qt::AlignHCenter );
+ aZonesLayout->addWidget( myObjectName, 0, 1 );
+ aZonesLayout->addWidget( anObjectsLabel, 1, 0, Qt::AlignHCenter );
+ aZonesLayout->addWidget( myGeomObjects, 1, 1, 2, 1 );
+ aZonesLayout->addWidget( aBtnsFrame, 2, 0, Qt::AlignHCenter );
+
+ //QBoxLayout* aMainLayout = new QVBoxLayout( aFrame );
+ //aMainLayout->setMargin( 0 );
+ //aMainLayout->setSpacing( 5 );
+ //aMainLayout->addWidget( myObjectNameGroup );
+ //aMainLayout->addWidget( anObjectsFrame );
+ //aMainLayout->addStretch();
+
+ //aPage->setLayout( aMainLayout );
+ aPage->setLayout( aZonesLayout );
+
+ return aPage;
}
-HYDROGUI_CalculationDlg::~HYDROGUI_CalculationDlg()
-{
-}
+QWizardPage* HYDROGUI_CalculationDlg::createZonesPage() {
+ QWizardPage* aPage = new QWizardPage( wizard() );
+ QFrame* aFrame = new QFrame( aPage );
-void HYDROGUI_CalculationDlg::reset()
-{
- myObjectName->clear();
+ QGridLayout* aLayout = new QGridLayout( aPage );
+ //Handle(HYDROData_Entity) anEntity = module()->getDataModel()->getDocument()->CreateObject( KIND_CALCULATION );
+
+ myBrowser = new HYDROGUI_DataBrowser( module(), 0/*module()->application()->activeStudy()->root()*/, aPage );
+ myBrowser->setAutoOpenLevel( 3 );
+ aLayout->setMargin( 5 );
+ aLayout->setSpacing( 5 );
- myGeomObjects->clear();
+ aLayout->addWidget( myBrowser, 0, 0, 1, 2 );
+
+ QLabel* aBatimetryLabel = new QLabel( tr( "BATHYMETRY" ), aFrame );
+ myBathymetryChoice = new QComboBox( aFrame );
+ myBathymetryChoice->addItem( tr( "ZMIN" ) );
+ myBathymetryChoice->addItem( tr( "ZMAX" ) );
+
+ aLayout->addWidget( aBatimetryLabel, 1, 0 );
+ aLayout->addWidget( myBathymetryChoice, 1, 1 );
+
+ aPage->setLayout( aLayout );
+
+ return aPage;
}
void HYDROGUI_CalculationDlg::setObjectName( const QString& theName )
return aResList;
}
-
+void HYDROGUI_CalculationDlg::setEditedObject( const Handle(HYDROData_Calculation) theCase )
+{
+ myEditedObject = theCase;
+ ///////////////////
+ Handle(HYDROData_Object) anEntity = Handle(HYDROData_Object)::DownCast(
+ module()->getDataModel()->getDocument()->CreateObject( KIND_IMMERSIBLE_ZONE ) );
+ myEditedObject->AddGeometryObject( anEntity );
+ ////////////////
+
+ HYDROGUI_DataObject* anobj = new HYDROGUI_DataObject( 0, NULL, "" );
+ myBrowser->setRoot(anobj);
+
+ LightApp_DataObject* aCaseItem = module()->getDataModel()->createObject( anobj,
+ myEditedObject, "", true );
+
+ myBrowser->updateTree();
+ myBrowser->openLevels();
+}
#ifndef HYDROGUI_CALCULATIONDLG_H
#define HYDROGUI_CALCULATIONDLG_H
-#include "HYDROGUI_InputPanel.h"
+#include "HYDROGUI_Wizard.h"
+#include <HYDROData_Calculation.h>
class HYDROGUI_ObjSelector;
class QGroupBox;
class QLineEdit;
class QListWidget;
+class QComboBox;
+class HYDROGUI_DataBrowser;
-class HYDROGUI_CalculationDlg : public HYDROGUI_InputPanel
+class HYDROGUI_CalculationDlg : public HYDROGUI_Wizard
{
Q_OBJECT
void setObjectName( const QString& theName );
QString getObjectName() const;
+ void setEditedObject( const Handle(HYDROData_Calculation) theCase );
+
void setGeomObjects( const QStringList& theObjects );
void setSelectedGeomObjects( const QStringList& theObjects );
QStringList getSelectedGeomObjects() const;
private:
+
+ QWizardPage* createObjectsPage();
+ QWizardPage* createZonesPage();
+
QGroupBox* myObjectNameGroup;
QLineEdit* myObjectName;
QListWidget* myGeomObjects;
+
+ HYDROGUI_DataBrowser* myBrowser;
+ Handle(HYDROData_Calculation) myEditedObject;
+ QComboBox* myBathymetryChoice;
};
#endif
}
}
}
+ else
+ {
+ myEditedObject =
+ Handle(HYDROData_Calculation)::DownCast( doc()->CreateObject( KIND_CALCULATION ) );
+ }
aPanel->setObjectName( anObjectName );
+ aPanel->setEditedObject( myEditedObject );
aPanel->setSelectedGeomObjects( aSelectedObjects );
createPreview();
--- /dev/null
+// 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
+//
+// 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.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "HYDROGUI_DataBrowser.h"
+#include "HYDROGUI_Module.h"
+#include "HYDROGUI_DataObject.h"
+
+#include <LightApp_Application.h>
+#include <LightApp_OBSelector.h>
+#include <LightApp_SelectionMgr.h>
+#include <QHeaderView>
+#include <QtxSearchTool.h>
+#include <QtxTreeView.h>
+#include <SUIT_DataObject.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_SelectionMgr.h>
+
+#define VISIBILITY_COLUMN_WIDTH 25
+
+HYDROGUI_DataBrowser::HYDROGUI_DataBrowser( HYDROGUI_Module* theModule, SUIT_DataObject* theRoot, QWidget* theParent )
+: SUIT_DataBrowser( theRoot, theParent ), myModule( theModule )
+{
+ SUIT_ResourceMgr* resMgr = theModule->getApp()->resourceMgr();
+
+ setSortMenuEnabled( true );
+ setAutoUpdate( true );
+
+ if ( resMgr->hasValue( "ObjectBrowser", "auto_hide_search_tool" ) )
+ searchTool()->enableAutoHide( resMgr->booleanValue( "ObjectBrowser", "auto_hide_search_tool" ) );
+
+ setWindowTitle( tr( "OBJECT_BROWSER" ) );
+ connect( this, SIGNAL( requestUpdate() ), theModule->getApp(), SLOT( onRefresh() ) );
+
+ QString RefObjCol = tr( "REF_OBJECT_COLUMN" );
+ QString BathymetryCol = tr( "BATHYMETRY_COLUMN" );
+ SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>( model() );
+ treeModel->setSearcher( theModule->getApp() );
+ treeModel->registerColumn( 0, RefObjCol, HYDROGUI_DataObject::RefObjectId );
+ treeModel->setAppropriate( RefObjCol, Qtx::Toggled );
+ treeModel->registerColumn( 0, BathymetryCol, HYDROGUI_DataObject::BathymetryId );
+ treeModel->setAppropriate( BathymetryCol, Qtx::Toggled );
+
+ // Mantis issue 0020136: Drag&Drop in OB
+ //RKV: TODO: Uncomment for drag and drop
+ //RKV: SUIT_ProxyModel* proxyModel = dynamic_cast<SUIT_ProxyModel*>(treeModel);
+ //RKV: if ( proxyModel ) {
+ //RKV: connect( proxyModel, SIGNAL( dropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ),
+ //RKV: theModule->getApp(), SLOT( onDropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ) );
+ //RKV: }
+
+ // temporary commented
+ /*
+ OB_ListView* ob_list = dynamic_cast<OB_ListView*>( const_cast<QListView*>( listView() ) );
+ if( ob_list )
+ ob_list->setColumnMaxWidth( 0, theModule->getApp()->desktop()->width()/4 );
+
+ setFilter( new LightApp_OBFilter( theModule->getApp()->selectionMgr() ) );
+ */
+
+ // Create OBSelector
+ new LightApp_OBSelector( this, theModule->getApp()->selectionMgr() );
+
+ treeView()->header()->setResizeMode(SUIT_DataObject::VisibilityId, QHeaderView::Fixed);
+ treeView()->header()->moveSection(SUIT_DataObject::NameId,SUIT_DataObject::VisibilityId);
+ treeView()->setColumnWidth(SUIT_DataObject::VisibilityId, VISIBILITY_COLUMN_WIDTH);
+ //RKV: connectPopupRequest( theModule->getApp(), SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
+}
+
+HYDROGUI_DataBrowser::~HYDROGUI_DataBrowser()
+{
+}
--- /dev/null
+// 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
+//
+// 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.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDROGUI_DATABROWSER_H
+#define HYDROGUI_DATABROWSER_H
+
+#include <SUIT_DataBrowser.h>
+
+class HYDROGUI_Module;
+
+/**\class HYDROGUI_DataBrowser
+ *\brief The data model browser widget implementation
+ */
+class HYDROGUI_DataBrowser : public SUIT_DataBrowser
+{
+ Q_OBJECT
+
+public:
+ HYDROGUI_DataBrowser( HYDROGUI_Module* theModule, SUIT_DataObject*, QWidget* = 0 );
+ ~HYDROGUI_DataBrowser();
+
+ HYDROGUI_Module* module() const;
+
+private:
+ HYDROGUI_Module* myModule;
+};
+
+#endif
*/
static QString partitionName( const ObjectKind theObjectKind );
-protected:
/**
* Returns the document for the current study
*/
const QString& theParentEntry = QString(),
const bool theIsBuildTree = true );
+protected:
/**
* Creates the GUI data object without corresponding model object: just by name
* \param theParent a created object will be appended as a child of this object
#include "HYDROGUI_DataObject.h"
#include <HYDROData_Image.h>
+#include <HYDROData_Zone.h>
+#include <HYDROData_Object.h>
#include <SUIT_DataObject.h>
return aFont;
}
+QString HYDROGUI_DataObject::text( const int theColumnId ) const
+{
+ QString aRes;
+ if( !myData.IsNull() )
+ {
+ if ( theColumnId == RefObjectId || theColumnId == BathymetryId )
+ {
+ Handle(HYDROData_Zone) aZone = Handle(HYDROData_Zone)::DownCast( myData );
+ if ( !aZone.IsNull() )
+ {
+ HYDROData_SequenceOfObjects::Iterator anIter( aZone->GetGeometryObjects() );
+ for ( ; anIter.More(); anIter.Next() )
+ {
+ Handle(HYDROData_Object) aRefGeomObj =
+ Handle(HYDROData_Object)::DownCast( anIter.Value() );
+ if ( !aRefGeomObj.IsNull() )
+ {
+ switch ( theColumnId )
+ {
+ case RefObjectId:
+ aRes += aRefGeomObj->GetName() + ", ";
+ break;
+ case BathymetryId:
+ //TODO: Get bathymetry name
+ //aRes += aRefGeomObj->
+ ;
+ }
+ }
+ }
+ }
+ if ( aRes.length() > 1 )
+ {
+ aRes.remove( aRes.length() - 2, 2 );
+ }
+ }
+ else
+ {
+ aRes = LightApp_DataObject::text( theColumnId );
+ }
+ }
+ return aRes;
+}
+
+QColor HYDROGUI_DataObject::color( const ColorRole theColorRole, const int theColumnId ) const
+{
+ //TODO: Implement red color for bathymetry conflicts in case creation dialog
+ return LightApp_DataObject::color( theColorRole, theColumnId );
+}
+
+
QString HYDROGUI_DataObject::dataObjectEntry( const Handle(HYDROData_Entity)& theObject,
const bool theWithPrefix )
{
#include <QString>
#include <QMap>
#include <QPixmap>
+#include <QColor>
/**
* \class HYDROGUI_DataObject
class HYDROGUI_DataObject : public LightApp_DataObject
{
public:
+ //! Column id
+ enum {
+ RefObjectId = RefEntryId + 1, //!< Ref.Object column
+ BathymetryId //!< Bathymetry column
+ };
+
/**
* Constructor.
* \param theParent parent data object
static QString dataObjectEntry( const Handle(HYDROData_Entity)& theObject,
const bool theWithPrefix = true );
+ /**
+ * Returns the text for the specified column.
+ */
+ virtual QString text( const int = NameId ) const;
+
+ /**
+ * Returns the color for the specified column.
+ */
+ virtual QColor color( const ColorRole, const int = NameId ) const;
+
protected:
Handle(HYDROData_Entity) myData; ///< object from data model
QString myParentEntry;
#include <QLayout>
#include <QPushButton>
-HYDROGUI_InputPanel::HYDROGUI_InputPanel( HYDROGUI_Module* theModule, const QString& theTitle )
+HYDROGUI_InputPanel::HYDROGUI_InputPanel( HYDROGUI_Module* theModule, const QString& theTitle, bool doInitLayout )
: QDockWidget( theModule->application()->desktop() ),
myModule( theModule )
{
setWindowTitle( theTitle );
setAllowedAreas( Qt::RightDockWidgetArea );
- QFrame* aFrame = new QFrame( this );
- setWidget( aFrame );
- QVBoxLayout* aLayout = new QVBoxLayout( aFrame );
-
- myMainFrame = new QFrame( aFrame );
- QBoxLayout* aMainLayout = new QVBoxLayout( myMainFrame );
- aMainLayout->setMargin( 0 );
- aMainLayout->setSpacing( 5 );
-
- myBtnFrame = new QFrame( aFrame );
-
- aLayout->addWidget( myMainFrame, 1 );
- aLayout->addWidget( myBtnFrame, 0 );
-
- QHBoxLayout* aBtnsLayout = new QHBoxLayout( myBtnFrame );
- aBtnsLayout->setMargin( 5 );
- aBtnsLayout->setSpacing( 5 );
-
- myApply = new QPushButton( tr( "APPLY" ), myBtnFrame );
- myCancel = new QPushButton( tr( "CANCEL" ), myBtnFrame );
- myHelp = new QPushButton( tr( "HELP" ), myBtnFrame );
-
- aBtnsLayout->addWidget( myApply, 0 );
- aBtnsLayout->addWidget( myCancel, 0 );
- aBtnsLayout->addStretch( 1 );
- aBtnsLayout->addWidget( myHelp, 0 );
-
- connect( myApply, SIGNAL( clicked() ), this, SLOT( onApply() ) );
- connect( myCancel, SIGNAL( clicked() ), this, SLOT( onCancel() ) );
- connect( myHelp, SIGNAL( clicked() ), this, SLOT( onHelp() ) );
+ if ( doInitLayout ) {
+
+ QFrame* aFrame = new QFrame( this );
+ setWidget( aFrame );
+ QVBoxLayout* aLayout = new QVBoxLayout( aFrame );
+
+ myMainFrame = new QFrame( aFrame );
+ QBoxLayout* aMainLayout = new QVBoxLayout( myMainFrame );
+ aMainLayout->setMargin( 0 );
+ aMainLayout->setSpacing( 5 );
+
+ aLayout->addWidget( myMainFrame, 1 );
+
+ myBtnFrame = new QFrame( aFrame );
+ aLayout->addWidget( myBtnFrame, 0 );
+
+ QHBoxLayout* aBtnsLayout = new QHBoxLayout( myBtnFrame );
+ aBtnsLayout->setMargin( 5 );
+ aBtnsLayout->setSpacing( 5 );
+
+ myApply = new QPushButton( tr( "APPLY" ), myBtnFrame );
+ myCancel = new QPushButton( tr( "CANCEL" ), myBtnFrame );
+ myHelp = new QPushButton( tr( "HELP" ), myBtnFrame );
+
+ aBtnsLayout->addWidget( myApply, 0 );
+ aBtnsLayout->addWidget( myCancel, 0 );
+ aBtnsLayout->addStretch( 1 );
+ aBtnsLayout->addWidget( myHelp, 0 );
+
+ connect( myApply, SIGNAL( clicked() ), this, SLOT( onApply() ) );
+ connect( myCancel, SIGNAL( clicked() ), this, SLOT( onCancel() ) );
+ connect( myHelp, SIGNAL( clicked() ), this, SLOT( onHelp() ) );
+ }
}
HYDROGUI_InputPanel::~HYDROGUI_InputPanel()
{
}
+void HYDROGUI_InputPanel::closeEvent ( QCloseEvent * event )
+{
+ emit panelCancel();
+}
+
void HYDROGUI_InputPanel::addWidget( QWidget* theWidget, int theStretch )
{
QBoxLayout* aMainLayout = dynamic_cast<QBoxLayout*>( myMainFrame->layout() );
class QFrame;
class QPushButton;
class QLayout;
+class QCloseEvent;
class HYDROGUI_Module;
Q_OBJECT
public:
- HYDROGUI_InputPanel( HYDROGUI_Module* theModule, const QString& theTitle );
+ HYDROGUI_InputPanel( HYDROGUI_Module* theModule, const QString& theTitle, bool doInitLayout = true );
virtual ~HYDROGUI_InputPanel();
void addWidget( QWidget* theWidget, int theStretch = 0 );
protected:
QFrame* mainFrame() const;
+ virtual void closeEvent ( QCloseEvent * event );
private:
HYDROGUI_Module* myModule;
closeInputPanel();
}
+void HYDROGUI_Operation::setDialogActive( const bool active )
+{
+ LightApp_Operation::setDialogActive( active );
+ if( myPanel )
+ {
+ if( active )
+ {
+ myPanel->show();
+ }
+ }
+}
+
HYDROGUI_InputPanel* HYDROGUI_Operation::createInputPanel() const
{
return NULL;
virtual void startOperation();
virtual void abortOperation();
virtual void commitOperation();
+ virtual void setDialogActive( const bool );
virtual HYDROGUI_InputPanel* createInputPanel() const;
virtual void closeInputPanel();
--- /dev/null
+// 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
+//
+// 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.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "HYDROGUI_Wizard.h"
+#include "HYDROGUI_Module.h"
+#include <CAM_Application.h>
+#include <SUIT_Desktop.h>
+#include <QFrame>
+#include <QVBoxLayout>
+#include <QWidget>
+
+HYDROGUI_Wizard::HYDROGUI_Wizard( HYDROGUI_Module* theModule, const QString& theTitle )
+: HYDROGUI_InputPanel( theModule, theTitle, false )
+{
+
+ myWizard = new QWizard( theModule->application()->desktop() );
+ myWizard->setOption( QWizard::HaveHelpButton );
+ setWidget( myWizard );
+
+ connect( myWizard, SIGNAL( accepted() ), this, SLOT( onApply() ) );
+ connect( myWizard, SIGNAL( rejected() ), this, SLOT( onCancel() ) );
+ connect( myWizard, SIGNAL( helpRequested() ), this, SLOT( onHelp() ) );
+}
+
+HYDROGUI_Wizard::~HYDROGUI_Wizard()
+{
+}
+
+QWizard* HYDROGUI_Wizard::wizard() const
+{
+ return myWizard;
+}
+
+void HYDROGUI_Wizard::show()
+{
+ HYDROGUI_InputPanel::show();
+ myWizard->show();
+}
\ No newline at end of file
--- /dev/null
+// 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
+//
+// 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.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDROGUI_WIZARD_H
+#define HYDROGUI_WIZARD_H
+
+#include "HYDROGUI_InputPanel.h"
+#include <QWizard>
+
+/**\class HYDROGUI_Wizard
+ *\brief The base class representing base wizard for HYDROGUI module
+ */
+class HYDROGUI_Wizard : public HYDROGUI_InputPanel
+{
+ Q_OBJECT
+
+public:
+ HYDROGUI_Wizard( HYDROGUI_Module* theModule, const QString& theTitle );
+ virtual ~HYDROGUI_Wizard();
+
+ void show();
+
+protected:
+ QWizard* wizard() const;
+
+private:
+ QWizard* myWizard;
+};
+
+#endif
<source>NAME</source>
<translation>Name</translation>
</message>
+ <message>
+ <source>BATHYMETRY</source>
+ <translation>Bathymetry</translation>
+ </message>
+ <message>
+ <source>ADD</source>
+ <translation>Add</translation>
+ </message>
+ <message>
+ <source>REMOVE</source>
+ <translation>Remove</translation>
+ </message>
</context>
<context>
</message>
</context>
+ <context>
+ <name>HYDROGUI_DataBrowser</name>
+ <message>
+ <source>REF_OBJECT_COLUMN</source>
+ <translation>Ref.Object</translation>
+ </message>
+ <message>
+ <source>BATHYMETRY_COLUMN</source>
+ <translation>Bathymetry</translation>
+ </message>
+ </context>
+
<context>
<name>HYDROGUI_CopyPasteOp</name>
<message>