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();
class CURVECREATOR_EXPORT CurveCreator_Widget : public QWidget
{
Q_OBJECT
+
+public:
+ enum ActionFlags {
+ NoFlags = 0x00000000,
+ DisableDetectionMode = 0x00000001,
+ DisableNewSection = 0x00000002
+ };
+
public:
explicit CurveCreator_Widget( QWidget* parent,
CurveCreator_ICurve *theCurve,
+ const int theActionFlags = NoFlags,
Qt::WindowFlags fl=0,
int theLocalPointRowLimit = 20);
addLayout(aNameLayout);
- myEditorWidget = new CurveCreator_Widget( this, NULL );
+ int anActionFlags =
+ CurveCreator_Widget::DisableNewSection | CurveCreator_Widget::DisableDetectionMode;
+ myEditorWidget = new CurveCreator_Widget( this, NULL, anActionFlags );
addWidget( myEditorWidget, 3 );
myAddElementBox = new QGroupBox( tr( "ADD_ELEMENT" ), this );