- QValueList< QLabel* > aLabels;
-
- // "Name" grp
-
- myNameGrp = new QGroupBox(3, Qt::Vertical, tr("AXIS_NAME"), this);
- myIsNameVisible = new QCheckBox(tr("IS_VISIBLE"), myNameGrp);
-
- QHBox* aHBox = new QHBox(myNameGrp);
- aHBox->setSpacing(5);
- QLabel* aLabel = new QLabel(tr("NAME"), aHBox);
- myAxisName = new QLineEdit(aHBox);
- aLabels.append(aLabel);
-
- aHBox = new QHBox(myNameGrp);
- aHBox->setSpacing(5);
- aLabel = new QLabel(tr("FONT"), aHBox);
- myNameFont = new SVTK_FontWidget(aHBox);
- aLabels.append(aLabel);
-
-
- // "Labels" grp
-
- myLabelsGrp = new QGroupBox(4, Qt::Vertical, tr("LABELS"), this);
- myIsLabelsVisible = new QCheckBox(tr("IS_VISIBLE"), myLabelsGrp);
-
- aHBox = new QHBox(myLabelsGrp);
- aHBox->setSpacing(5);
- aLabel = new QLabel(tr("NUMBER"), aHBox);
- myLabelNumber = new QtxIntSpinBox(0,25,1,aHBox,"SpinBoxLabelNumber");
- aLabels.append(aLabel);
-
- aHBox = new QHBox(myLabelsGrp);
- aHBox->setSpacing(5);
- aLabel = new QLabel(tr("OFFSET"), aHBox);
- myLabelOffset = new QtxIntSpinBox(0,100,1,aHBox,"SpinBoxLabellOffset");
- aLabels.append(aLabel);
-
- aHBox = new QHBox(myLabelsGrp);
- aHBox->setSpacing(5);
- aLabel = new QLabel(tr("FONT"), aHBox);
- myLabelsFont = new SVTK_FontWidget(aHBox);
- aLabels.append(aLabel);
-
- // "Tick marks" grp
-
- myTicksGrp = new QGroupBox(2, Qt::Vertical, tr("TICK_MARKS"), this);
- myIsTicksVisible = new QCheckBox(tr("IS_VISIBLE"), myTicksGrp);
-
- aHBox = new QHBox(myTicksGrp);
- aHBox->setSpacing(5);
- aLabel = new QLabel(tr("LENGTH"), aHBox);
- myTickLength = new QtxIntSpinBox(0,100,1,aHBox,"SpinBoxTickLength");
-
- aLabels.append(aLabel);
-
- // Layout
-
- QVBoxLayout* aLay = new QVBoxLayout(this, 0, 5);
- aLay->addWidget(myNameGrp);
- aLay->addWidget(myLabelsGrp);
- aLay->addWidget(myTicksGrp);
-
- // init
- myIsNameVisible->setChecked(true);
- myIsLabelsVisible->setChecked(true);
- myIsTicksVisible->setChecked(true);
- updateControlState();
-
- // Adjust label widths
- QValueList< QLabel* >::iterator anIter;
- int aMaxWidth = 0;
- for (anIter = aLabels.begin(); anIter != aLabels.end(); anIter++)
- aMaxWidth = QMAX(aMaxWidth, (*anIter)->sizeHint().width());
- for (anIter = aLabels.begin(); anIter != aLabels.end(); anIter++)
- (*anIter)->setFixedWidth(aMaxWidth);
-
- // connect signals and slots
- connect(myIsNameVisible, SIGNAL(stateChanged(int)), SLOT(onNameChecked()));
- connect(myIsLabelsVisible, SIGNAL(stateChanged(int)), SLOT(onLabelsChecked()));
- connect(myIsTicksVisible, SIGNAL(stateChanged(int)), SLOT(onTicksChecked()));