- myMarkerCombo->insertItem( tr( "NONE_MARKER_LBL" ) );
- myMarkerCombo->insertItem( tr( "CIRCLE_MARKER_LBL" ) );
- myMarkerCombo->insertItem( tr( "RECTANGLE_MARKER_LBL" ) );
- myMarkerCombo->insertItem( tr( "DIAMOND_MARKER_LBL" ) );
- myMarkerCombo->insertItem( tr( "DTRIANGLE_MARKER_LBL" ) );
- myMarkerCombo->insertItem( tr( "UTRIANGLE_MARKER_LBL" ) );
- myMarkerCombo->insertItem( tr( "LTRIANGLE_MARKER_LBL" ) );
- myMarkerCombo->insertItem( tr( "RTRIANGLE_MARKER_LBL" ) );
- myMarkerCombo->insertItem( tr( "CROSS_MARKER_LBL" ) );
- myMarkerCombo->insertItem( tr( "XCROSS_MARKER_LBL" ) );
- myMarkerCombo->setCurrentItem( 1 ); // CIRCLE by default
-
- QLabel* aColorLab = new QLabel( tr( "CURVE_COLOR_LAB" ), TopGroup );
- myColorBtn = new QToolButton( TopGroup );
- myColorBtn->setMinimumSize(25, 25);
-
- TopGroupLayout->addWidget( aLineTypeLab, 0, 0 );
- TopGroupLayout->addMultiCellWidget( myLineCombo, 0, 0, 1, 2 );
- TopGroupLayout->addWidget( aLineWidthLab, 1, 0 );
- TopGroupLayout->addMultiCellWidget( myLineSpin, 1, 1, 1, 2 );
- TopGroupLayout->addWidget( aMarkerLab, 2, 0 );
- TopGroupLayout->addMultiCellWidget( myMarkerCombo, 2, 2, 1, 2 );
- TopGroupLayout->addWidget( aColorLab, 3, 0 );
- TopGroupLayout->addWidget( myColorBtn, 3, 1 );
- TopGroupLayout->setColStretch( 2, 5 );
-
- QGroupBox* GroupButtons = new QGroupBox( this );
- GroupButtons->setColumnLayout( 0, Qt::Vertical );
- GroupButtons->layout()->setSpacing( 0 ); GroupButtons->layout()->setMargin( 0 );
- QHBoxLayout* GroupButtonsLayout = new QHBoxLayout( GroupButtons->layout() );
- GroupButtonsLayout->setAlignment( Qt::AlignTop );
- GroupButtonsLayout->setSpacing( SPACING_SIZE ); GroupButtonsLayout->setMargin( MARGIN_SIZE );
-
- myOkBtn = new QPushButton( tr( "BUT_OK" ), GroupButtons );
- myOkBtn->setAutoDefault( true ); myOkBtn->setDefault( true );
- myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ) , GroupButtons );
- myCancelBtn->setAutoDefault( true );
-
- GroupButtonsLayout->addWidget( myOkBtn );
- GroupButtonsLayout->addStretch();
- GroupButtonsLayout->addWidget( myCancelBtn );
-
- connect( myColorBtn, SIGNAL( clicked() ), this, SLOT( onColorChanged() ) );
- connect( myOkBtn, SIGNAL( clicked() ), this, SLOT( accept() ) );
- connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
- setColor( QColor( 0, 0, 0 ) );
-
- topLayout->addWidget( TopGroup, 0, 0 );
- topLayout->addWidget( GroupButtons, 1, 0 );
+ myMarkerCombo->setIconSize( QSize( 16, 16 ) );
+
+ // curve color
+ QLabel* aColorLab = new QLabel( tr( "CURVE_COLOR_LAB" ), this );
+ myColorBtn = new QtxColorButton( this );
+
+ // preview
+ QLabel* aPreviewLab = new QLabel( tr( "CURVE_PREVIEW_LAB" ), this );
+ myPreview = new QLabel( this );
+ myPreview->setFrameStyle( QLabel::Box | QLabel::Sunken );
+ myPreview->setAlignment( Qt::AlignCenter );
+ myPreview->setScaledContents( false );
+
+ myOkBtn = new QPushButton( tr( "BUT_OK" ), this );
+ myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ), this );
+
+ // layouting widgets
+ QGridLayout* topLayout = new QGridLayout( this );
+ topLayout->setSpacing( SPACING_SIZE );
+ topLayout->setMargin( MARGIN_SIZE );
+
+ topLayout->addWidget( aLineTypeLab, 0, 0 );
+ topLayout->addWidget( myLineCombo, 0, 1, 1, 2 );
+ topLayout->addWidget( aLineWidthLab, 1, 0 );
+ topLayout->addWidget( myLineSpin, 1, 1, 1, 2 );
+ topLayout->addWidget( aMarkerLab, 2, 0 );
+ topLayout->addWidget( myMarkerCombo, 2, 1, 1, 2 );
+ topLayout->addWidget( aColorLab, 3, 0 );
+ topLayout->addWidget( myColorBtn, 3, 1 );
+ topLayout->addWidget( aPreviewLab, 4, 0 );
+ topLayout->addWidget( myPreview, 4, 1, 1, 2 );
+ topLayout->setColumnStretch( 2, 5 );
+
+ QHBoxLayout* btnLayout = new QHBoxLayout;
+ btnLayout->setSpacing( SPACING_SIZE );
+ btnLayout->setMargin( 0 );
+
+ btnLayout->addWidget( myOkBtn );
+ btnLayout->addSpacing( 20 );
+ btnLayout->addStretch();
+ btnLayout->addWidget( myCancelBtn );
+
+ topLayout->addLayout( btnLayout, 5, 0, 1, 3 );
+
+ // fill then combo boxes
+ myLineCombo->addItem( lineIcon( Plot2d::NoPen ), tr( "NONE_LINE_LBL" ) );
+ myLineCombo->addItem( lineIcon( Plot2d::Solid ), tr( "SOLID_LINE_LBL" ) );
+ myLineCombo->addItem( lineIcon( Plot2d::Dash ), tr( "DASH_LINE_LBL" ) );
+ myLineCombo->addItem( lineIcon( Plot2d::Dot ), tr( "DOT_LINE_LBL" ) );
+ myLineCombo->addItem( lineIcon( Plot2d::DashDot ), tr( "DASHDOT_LINE_LBL" ) );
+ myLineCombo->addItem( lineIcon( Plot2d::DashDotDot ), tr( "DAHSDOTDOT_LINE_LBL" ) );
+
+ myMarkerCombo->addItem( markerIcon( Plot2d::None ), tr( "NONE_MARKER_LBL" ) );
+ myMarkerCombo->addItem( markerIcon( Plot2d::Circle ), tr( "CIRCLE_MARKER_LBL" ) );
+ myMarkerCombo->addItem( markerIcon( Plot2d::Rectangle ), tr( "RECTANGLE_MARKER_LBL" ) );
+ myMarkerCombo->addItem( markerIcon( Plot2d::Diamond ), tr( "DIAMOND_MARKER_LBL" ) );
+ myMarkerCombo->addItem( markerIcon( Plot2d::DTriangle ), tr( "DTRIANGLE_MARKER_LBL" ) );
+ myMarkerCombo->addItem( markerIcon( Plot2d::UTriangle ), tr( "UTRIANGLE_MARKER_LBL" ) );
+ myMarkerCombo->addItem( markerIcon( Plot2d::LTriangle ), tr( "LTRIANGLE_MARKER_LBL" ) );
+ myMarkerCombo->addItem( markerIcon( Plot2d::RTriangle ), tr( "RTRIANGLE_MARKER_LBL" ) );
+ myMarkerCombo->addItem( markerIcon( Plot2d::Cross ), tr( "CROSS_MARKER_LBL" ) );
+ myMarkerCombo->addItem( markerIcon( Plot2d::XCross ), tr( "XCROSS_MARKER_LBL" ) );
+
+ // default settings
+ setLine( Plot2d::Solid, 0 ); // solid line, width = 0
+ setMarker( Plot2d::Circle ); // circle
+ setColor( QColor( 0, 0, 0 ) ); // black
+
+ // connections
+ connect( myLineCombo, SIGNAL( activated( int ) ), this, SLOT( updatePreview() ) );
+ connect( myLineSpin, SIGNAL( valueChanged( int ) ), this, SLOT( updatePreview() ) );
+ connect( myMarkerCombo, SIGNAL( activated( int ) ), this, SLOT( updatePreview() ) );
+ connect( myColorBtn, SIGNAL( changed( QColor ) ), this, SLOT( updatePreview() ) );
+ connect( myOkBtn, SIGNAL( clicked() ), this, SLOT( accept() ) );
+ connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );