#include <QDialogButtonBox>
#include <QPushButton>
-CurveCreator_NewSectionDlg::CurveCreator_NewSectionDlg( QWidget *parent ) :
+CurveCreator_NewSectionDlg::CurveCreator_NewSectionDlg( QWidget *parent, bool enableClosed ) :
QWidget(parent)
{
QFrame* aFrame = new QFrame( this );
myIsClosed = new QCheckBox(this);
aCoordLayout->addWidget(aLbl, 2, 0);
aCoordLayout->addWidget(myIsClosed, 2, 1);
+ if ( !enableClosed ) {
+ aLbl->hide();
+ myIsClosed->hide();
+ }
myBtnFrame = new QFrame( aFrame );
QHBoxLayout* aBtnsLayout = new QHBoxLayout( myBtnFrame );
{
Q_OBJECT
public:
- explicit CurveCreator_NewSectionDlg(QWidget *parent = 0);
+ explicit CurveCreator_NewSectionDlg(QWidget *parent = 0, bool enableClosed = true );
QString getName() const;
bool isClosed() const;
myDragStarted( false ), myDragInteractionStyle( SUIT_ViewModel::STANDARD ),
myOCCViewer( 0 ), myLocalPointRowLimit( theLocalPointRowLimit )
{
- myNewSectionEditor = new CurveCreator_NewSectionDlg( this );
+ bool isToEnableClosed = !( theActionFlags & DisableClosedSection );
+ myNewSectionEditor = new CurveCreator_NewSectionDlg( this, isToEnableClosed );
myNewSectionEditor->hide();
connect( myNewSectionEditor, SIGNAL(addSection()), this, SLOT(onAddNewSection()) );
connect( myNewSectionEditor, SIGNAL(modifySection()), this, SLOT(onModifySection()) );
enum ActionFlags {
NoFlags = 0x00000000,
DisableDetectionMode = 0x00000001,
- DisableNewSection = 0x00000002
+ DisableNewSection = 0x00000002,
+ DisableClosedSection = 0x00000004
};
public:
addLayout(aNameLayout);
int anActionFlags =
- CurveCreator_Widget::DisableNewSection | CurveCreator_Widget::DisableDetectionMode;
+ CurveCreator_Widget::DisableNewSection | CurveCreator_Widget::DisableDetectionMode |
+ CurveCreator_Widget::DisableClosedSection;
myEditorWidget = new CurveCreator_Widget( this, NULL, anActionFlags );
addWidget( myEditorWidget, 3 );