CurveCreator_Widget::CurveCreator_Widget(QWidget* parent,
CurveCreator_ICurve *theCurve,
+ const int theActionFlags,
Qt::WindowFlags fl,
int theLocalPointRowLimit )
: QWidget(parent), myNewSectionEditor(NULL), myCurve(theCurve), mySection(0),
aTB->addAction(anAct);
aTB->addSeparator();
-
+
anAct = createAction( NEW_SECTION_ID, tr("NEW_SECTION"), aNewSectionPixmap, tr("NEW_SECTION_TLT"),
QKeySequence(Qt::ControlModifier|Qt::Key_N) );
connect(anAct, SIGNAL(triggered()), this, SLOT(onNewSection()) );
- aTB->addAction(anAct);
- aTB->addSeparator();
+ if ( !(theActionFlags & DisableNewSection) ) {
+ aTB->addAction(anAct);
+ aTB->addSeparator();
+ }
anAct = createAction( ADDITION_MODE_ID, tr("ADDITION_MODE"), aNewPointPixmap, tr("ADDITION_MODE_TLT"),
QKeySequence() );
anAct->setCheckable(true);
connect(anAct, SIGNAL(triggered(bool)), this, SLOT(onDetectionMode(bool)) );
connect(anAct, SIGNAL(toggled(bool)), this, SLOT(onModeChanged(bool)) );
- aTB->addAction(anAct);
-
+ if ( !(theActionFlags & DisableDetectionMode) ) {
+ aTB->addAction(anAct);
+ }
+
anAct = createAction( CLOSE_SECTIONS_ID, tr("CLOSE_SECTIONS"), QPixmap(), tr("CLOSE_SECTIONS_TLT"),
QKeySequence(Qt::ControlModifier|Qt::Key_W) );
connect(anAct, SIGNAL(triggered()), this, SLOT(onCloseSections()) );
QKeySequence(Qt::ControlModifier|Qt::Key_Delete ) );
connect(anAct, SIGNAL(triggered()), this, SLOT(onRemove()) );
aTB->addAction(anAct);
+
// TODO join
//aTB->addSeparator();
CurveCreator_Utils::getSelectedPoints( aContext, myCurve, myLocalPoints );
int aNbPoints = myLocalPoints.size();
bool isRowLimit = aNbPoints > myLocalPointRowLimit;
- myLocalPointView->setVisible( !isRowLimit );
+ myLocalPointView->setVisible( getActionMode() == ModificationMode && !isRowLimit );
if ( !isRowLimit ) {
bool isBlocked = myLocalPointView->blockSignals(true);