X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_PolylineDlg.cxx;h=74c3dd50859a9edc695472efe11e4468865133ab;hb=36005df362d7bee6db949b079960cec90333aed2;hp=de14235fd5f3fefa5b1bdff0cbb6b0baf92e54d8;hpb=a34b423a7b1c26957b15dcb6b82f6e81e57235f5;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_PolylineDlg.cxx b/src/HYDROGUI/HYDROGUI_PolylineDlg.cxx index de14235f..74c3dd50 100755 --- a/src/HYDROGUI/HYDROGUI_PolylineDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_PolylineDlg.cxx @@ -1,12 +1,8 @@ -// 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 @@ -32,30 +28,42 @@ #include #include #include +#include HYDROGUI_PolylineDlg::HYDROGUI_PolylineDlg( HYDROGUI_Module* theModule, const QString& theTitle ) : HYDROGUI_InputPanel( theModule, theTitle ), myName(NULL) { + QScrollArea* aScrollView = new QScrollArea( this ); + aScrollView->setFrameStyle( QFrame::NoFrame ); + addWidget( aScrollView ); + + QWidget* aContent = new QWidget( aScrollView ); + QVBoxLayout* aCLayout = new QVBoxLayout( aContent ); + aCLayout->setMargin( 0 ); + + aScrollView->setWidget( aContent ); + aScrollView->setWidgetResizable( true ); + QHBoxLayout* aNameLayout = new QHBoxLayout(); - QLabel* aNameLabel = new QLabel(tr("CURVE_NAME_TLT"), this); + QLabel* aNameLabel = new QLabel(tr("POLYLINE_NAME_TLT"), aContent); aNameLayout->addWidget(aNameLabel); - myName = new QLineEdit(this); + myName = new QLineEdit(aContent); aNameLayout->addWidget(myName); - addLayout(aNameLayout); + aCLayout->addLayout(aNameLayout); - myEditorWidget = new CurveCreator_Widget( this, NULL ); - addWidget( myEditorWidget, 3 ); + myEditorWidget = new CurveCreator_Widget( aContent, NULL ); + aCLayout->addWidget( myEditorWidget, 3 ); - myAddElementBox = new QGroupBox( tr( "ADD_ELEMENT" ), this ); - addWidget( myAddElementBox, 2 ); + myAddElementBox = new QGroupBox( tr( "ADD_ELEMENT" ), aContent ); + aCLayout->addWidget( myAddElementBox, 2 ); QBoxLayout* anAddElementLayout = new QVBoxLayout( myAddElementBox ); anAddElementLayout->setMargin( 0 ); anAddElementLayout->setSpacing( 5 ); connect( myEditorWidget, SIGNAL( selectionChanged() ), this, SIGNAL( selectionChanged() ) ); - connect( myEditorWidget, SIGNAL( subOperationStarted(QWidget*) ), this, SLOT( processStartedSubOperation(QWidget*) ) ); + connect( myEditorWidget, SIGNAL( subOperationStarted(QWidget*, bool) ), this, SLOT( processStartedSubOperation(QWidget*, bool) ) ); connect( myEditorWidget, SIGNAL( subOperationFinished(QWidget*) ), this, SLOT( processFinishedSubOperation(QWidget*) ) ); myAddElementBox->hide(); @@ -70,10 +78,11 @@ void HYDROGUI_PolylineDlg::setOCCViewer( OCCViewer_Viewer* theViewer ) myEditorWidget->setOCCViewer( theViewer ); } -void HYDROGUI_PolylineDlg::processStartedSubOperation( QWidget* theWidget ) +void HYDROGUI_PolylineDlg::processStartedSubOperation( QWidget* theWidget, bool theIsEdit ) { myEditorWidget->setEnabled( false ); + myAddElementBox->setTitle( theIsEdit ? tr( "EDIT_ELEMENT" ) : tr( "ADD_ELEMENT" ) ); QBoxLayout* anAddElementLayout = dynamic_cast( myAddElementBox->layout() ); anAddElementLayout->addWidget( theWidget ); @@ -116,11 +125,6 @@ QList HYDROGUI_PolylineDlg::getSelectedSections() return myEditorWidget->getSelectedSections(); } -QList< QPair< int, int > > HYDROGUI_PolylineDlg::getSelectedPoints() -{ - return myEditorWidget->getSelectedPoints(); -} - /** * Redirect the delete action to editor widget */