Ejemplo n.º 1
0
void Plot3DDialog::initGeneralPage()
{
    ApplicationWindow *app = (ApplicationWindow *)parent();
    if (!app)
        return;

    QGridLayout *gl1 = new QGridLayout();
    boxLegend = new QCheckBox(tr("Show Legend"));
    gl1->addWidget(boxLegend, 0, 0);
    boxOrthogonal = new QCheckBox(tr("Orthogonal"));
    gl1->addWidget(boxOrthogonal, 0, 1);

    gl1->addWidget(new QLabel(tr( "Line Width" )), 1, 0);
    boxMeshLineWidth = new QDoubleSpinBox();
    boxMeshLineWidth->setDecimals(1);
    boxMeshLineWidth->setSingleStep(0.1);
    boxMeshLineWidth->setRange(0, 100);
    gl1->addWidget(boxMeshLineWidth, 1, 1);

    gl1->addWidget(new QLabel( tr( "Resolution" )), 2, 0);
    boxResolution = new QSpinBox();
    boxResolution->setRange(1, 100);
    boxResolution->setSpecialValueText( "1 (all data)" );
    gl1->addWidget(boxResolution, 2, 1);

    gl1->addWidget(new QLabel( tr( "Numbers Font" )), 3, 0);
    btnNumbersFont = new QPushButton(tr( "&Font" ));
    btnNumbersFont->setIcon(QIcon(":/font.png"));
    gl1->addWidget(btnNumbersFont, 3, 1);

    gl1->addWidget(new QLabel( tr( "Distance labels - axis" )), 4, 0);
    boxDistance = new QSpinBox();
    boxDistance->setRange(-1000, 1000);
    gl1->addWidget(boxDistance, 4, 1);

    boxZoom = new QSpinBox();
    boxZoom->setRange(1, 10000);
    boxZoom->setSingleStep(10);
    gl1->addWidget(boxZoom, 5, 1);

    QLabel *l1 = new QLabel("&" + tr("Zoom (%)"));
    l1->setBuddy(boxZoom);
    gl1->addWidget(l1, 5, 0);
    gl1->setRowStretch(6, 1);

    QGroupBox *gb1 = new QGroupBox();
    gb1->setLayout(gl1);

    QGridLayout *gl2 = new QGridLayout();

    gl2->addWidget(new QLabel(tr( "Zoom (%)" )), 0, 1);
    gl2->addWidget(new QLabel(tr( "Rotation" )), 0, 2);

    QLabel *xLabel = new QLabel("&" + tr("X"));
    gl2->addWidget(xLabel, 1, 0);
    boxXScale = new QSpinBox();
    boxXScale->setRange(1, 10000);
    boxXScale->setSingleStep(10);
    xLabel->setBuddy(boxXScale);
    gl2->addWidget(boxXScale, 1, 1);

    boxXRotation = new DoubleSpinBox('f');
    boxXRotation->setDecimals(1);
    boxXRotation->setSingleStep(1.0);
    boxXRotation->setLocale(app->locale());
    boxXRotation->setRange(-360, 360);
    gl2->addWidget(boxXRotation, 1, 2);

    QLabel *yLabel = new QLabel("&" + tr("Y"));
    gl2->addWidget(yLabel, 2, 0);
    boxYScale = new QSpinBox();
    boxYScale->setRange(1, 10000);
    boxYScale->setSingleStep(10);
    gl2->addWidget(boxYScale, 2, 1);
    yLabel->setBuddy(boxYScale);

    boxYRotation = new DoubleSpinBox('f');
    boxYRotation->setDecimals(1);
    boxYRotation->setSingleStep(1.0);
    boxYRotation->setLocale(app->locale());
    boxYRotation->setRange(-360, 360);
    gl2->addWidget(boxYRotation, 2, 2);

    QLabel *zLabel = new QLabel("&" + tr("Z"));
    gl2->addWidget(zLabel, 3, 0);
    boxZScale = new QSpinBox();
    boxZScale->setRange(1, 10000);
    boxZScale->setSingleStep(10);
    gl2->addWidget(boxZScale, 3, 1);
    zLabel->setBuddy(boxZScale);

    gl2->setRowStretch(4, 1);

    boxZRotation = new DoubleSpinBox('f');
    boxZRotation->setDecimals(1);
    boxZRotation->setSingleStep(1.0);
    boxZRotation->setLocale(app->locale());
    boxZRotation->setRange(-360, 360);
    gl2->addWidget(boxZRotation, 3, 2);

    QGroupBox *gb2 = new QGroupBox();
    gb2->setLayout(gl2);

    QHBoxLayout* hl = new QHBoxLayout();
    hl->addWidget(gb1);
    hl->addWidget(gb2);

    general = new QWidget();
    general->setLayout(hl);
    generalDialog->insertTab(general, tr("&General"));

    connect( boxZoom, SIGNAL(valueChanged(int)), this, SLOT(changeZoom(int)));
    connect( boxXScale, SIGNAL(valueChanged(int)), this, SLOT(changeZoom(int)));
    connect( boxYScale, SIGNAL(valueChanged(int)), this, SLOT(changeZoom(int)));
    connect( boxZScale, SIGNAL(valueChanged(int)), this, SLOT(changeZoom(int)));
    connect( btnNumbersFont, SIGNAL(clicked()), this, SLOT(pickNumbersFont()));
    connect( boxXRotation, SIGNAL(valueChanged(double)), this, SLOT(updatePlot()));
    connect( boxYRotation, SIGNAL(valueChanged(double)), this, SLOT(updatePlot()));
    connect( boxZRotation, SIGNAL(valueChanged(double)), this, SLOT(updatePlot()));
}
Ejemplo n.º 2
0
void Plot3DDialog::initGeneralPage()
{
    QGridLayout *gl1 = new QGridLayout();
	boxLegend = new QCheckBox(tr("Show Legend"));
    gl1->addWidget(boxLegend, 0, 0);
	boxOrthogonal = new QCheckBox(tr("Orthogonal"));
    gl1->addWidget(boxOrthogonal, 0, 1);

    gl1->addWidget(new QLabel(tr( "Line Width" )), 1, 0);
	boxMeshLineWidth = new QSpinBox();
    boxMeshLineWidth->setRange(1, 100);
    gl1->addWidget(boxMeshLineWidth, 1, 1);

    gl1->addWidget(new QLabel( tr( "Resolution" )), 2, 0);
	boxResolution = new QSpinBox();
    boxResolution->setRange(1, 100);
	boxResolution->setSpecialValueText( "1 (all data)" );
    gl1->addWidget(boxResolution, 2, 1);

    gl1->addWidget(new QLabel( tr( "Numbers Font" )), 3, 0);
	btnNumbersFont=new QPushButton(tr( "&Choose Font" ));
    gl1->addWidget(btnNumbersFont, 3, 1);

    gl1->addWidget(new QLabel( tr( "Distance labels - axis" )), 4, 0);
	boxDistance = new QSpinBox();
    boxDistance->setRange(0, 1000);
    boxDistance->setSingleStep(5);
    gl1->addWidget(boxDistance, 4, 1);
    gl1->setRowStretch(5, 1);

    QGroupBox *gb1 = new QGroupBox();
    gb1->setLayout(gl1);

    QGridLayout *gl2 = new QGridLayout();
    gl2->addWidget(new QLabel(tr( "Zoom (%)" )), 0, 0);
	boxZoom = new QDoubleSpinBox();
	boxZoom->setMinimum(0);
	boxZoom->setMaximum(1e15);
    boxZoom->setSingleStep(10);

    gl2->addWidget(boxZoom, 0, 1);
    gl2->addWidget(new QLabel(tr( "X Zoom (%)" )), 1, 0);
	boxXScale = new QDoubleSpinBox();
	boxXScale->setMinimum(0);
	boxXScale->setMaximum(1e15);
    boxXScale->setSingleStep(10);
    gl2->addWidget(boxXScale, 1, 1);

    gl2->addWidget(new QLabel(tr( "Y Zoom (%)" )), 2, 0);
	boxYScale = new QDoubleSpinBox();
	boxYScale->setMinimum(0);
	boxYScale->setMaximum(1e15);
    boxYScale->setSingleStep(10);
    gl2->addWidget(boxYScale, 2, 1);

    gl2->addWidget(new QLabel(tr( "Z Zoom (%)" )), 3, 0);
	boxZScale = new QDoubleSpinBox();
	boxZScale->setMinimum(0);
	boxZScale->setMaximum(1e15);
    boxZScale->setSingleStep(10);
    gl2->addWidget(boxZScale, 3, 1);
    gl2->setRowStretch(4, 1);

    QGroupBox *gb2 = new QGroupBox();
    gb2->setLayout(gl2);

	QHBoxLayout* hl = new QHBoxLayout();
	hl->addWidget(gb1);
	hl->addWidget(gb2);

    general = new QWidget();
    general->setLayout(hl);
	generalDialog->insertTab(general, tr( "&General" ) );

	connect( boxResolution, SIGNAL(valueChanged(int)), this, SIGNAL(updateResolution(int)));
	connect( boxDistance, SIGNAL(valueChanged(int)), this, SIGNAL(adjustLabels(int)));
	connect( boxMeshLineWidth, SIGNAL(valueChanged(int)), this, SIGNAL(updateMeshLineWidth(int)));
	connect( boxOrthogonal, SIGNAL(toggled(bool)), this, SIGNAL(setOrtho(bool)));
	connect( boxLegend, SIGNAL(toggled(bool)), this, SIGNAL(showColorLegend(bool)));
	connect( boxZoom, SIGNAL(valueChanged(double)), this, SLOT(changeZoom(double)));
	connect( boxXScale, SIGNAL(valueChanged(double)), this, SLOT(changeZoom(double)));
	connect( boxYScale, SIGNAL(valueChanged(double)), this, SLOT(changeZoom(double)));
	connect( boxZScale, SIGNAL(valueChanged(double)), this, SLOT(changeZoom(double)));
	connect( btnNumbersFont, SIGNAL(clicked()), this, SLOT(pickNumbersFont() ) );
}
Ejemplo n.º 3
0
void configDialog::initPlotsPage()
{
ApplicationWindow *app = (ApplicationWindow *)parentWidget();
	
	plotsTabWidget = new QTabWidget(generalDialog);
	plots = new QWidget(plotsTabWidget);

	QHBox  *hbox1 = new QHBox (plots); 
	hbox1->setSpacing(5);

	QButtonGroup *GroupBoxOptions = new QButtonGroup( 2,QGroupBox::Horizontal, QString::null, hbox1);	
	boxAutoscaling = new QCheckBox(GroupBoxOptions,"boxAutoscaling");
	boxAutoscaling->setChecked(app->autoscale2DPlots);

	boxScaleFonts = new QCheckBox(GroupBoxOptions,"boxScaleFonts");
	boxScaleFonts->setChecked(app->autoScaleFonts);

    boxTitle= new QCheckBox(GroupBoxOptions);
	boxTitle->setChecked(app->titleOn);

	boxAllAxes= new QCheckBox(GroupBoxOptions);
	boxAllAxes->setChecked (app->allAxesOn);

	boxFrame= new QCheckBox(GroupBoxOptions);
	boxFrame->setChecked(app->canvasFrameOn);

	boxBackbones= new QCheckBox(GroupBoxOptions);
	boxBackbones->setChecked(app->drawBackbones);

	labelFrameWidth = new QLabel(GroupBoxOptions); 
	boxFrameWidth= new QSpinBox(1, 100, 1,GroupBoxOptions);	
	boxFrameWidth->setValue(app->canvasFrameWidth);
	if (!app->canvasFrameOn)
		{
		labelFrameWidth->hide();
		boxFrameWidth->hide();
		}

	lblLinewidth = new QLabel(GroupBoxOptions);  
	boxLinewidth= new QSpinBox(0, 100, 1,GroupBoxOptions);
	boxLinewidth->setValue(app->axesLineWidth);

	lblMargin = new QLabel(GroupBoxOptions); 
	boxMargin= new QSpinBox(0, 1000, 5, GroupBoxOptions);	
	boxMargin->setValue(app->defaultPlotMargin);

	boxResize = new QCheckBox(plots);
	boxResize->setChecked(!app->autoResizeLayers);
	if(boxResize->isChecked())
		boxScaleFonts->setEnabled(false);

	QVBoxLayout* hlayout2 = new QVBoxLayout(plots,5,5);
    hlayout2->addWidget(hbox1);
	hlayout2->addWidget(boxResize);

	plotsTabWidget->insertTab( plots, tr( "Options" ) );

	initCurvesPage();

	plotTicks = new QWidget(plotsTabWidget);

	QButtonGroup *GroupBox6 = new QButtonGroup(4, QGroupBox::Horizontal,QString::null,plotTicks);

	lblTicks = new QLabel(GroupBox6); 
	boxMajTicks = new QComboBox(GroupBox6);

	lblMajTicks = new QLabel(GroupBox6);  
	boxMajTicksLength = new QSpinBox(0, 100, 1,GroupBox6);
	boxMajTicksLength->setValue (app->majTicksLength);

	lblMinTicks = new QLabel(GroupBox6); 
	boxMinTicks = new QComboBox(GroupBox6);

	lblMinTicksLength = new QLabel(GroupBox6);  
	boxMinTicksLength= new QSpinBox(0, 100, 1,GroupBox6);
	boxMinTicksLength->setValue(app->minTicksLength);

	QHBoxLayout* hl = new QHBoxLayout(plotTicks,5,5);
	hl->addWidget(GroupBox6);

	plotsTabWidget->insertTab(plotTicks, tr( "Ticks" ) );

	plotFonts = new QWidget(plotsTabWidget);

	QButtonGroup *GroupBox2DFonts = new QButtonGroup(1,QGroupBox::Horizontal,QString::null,plotFonts);
	buttonTitleFont= new QPushButton(GroupBox2DFonts, "buttonTitleFont" );  
	buttonLegendFont= new QPushButton(GroupBox2DFonts, "buttonLegendFont" );	 
    buttonAxesFont= new QPushButton(GroupBox2DFonts, "buttonAxesFont" );   
	buttonNumbersFont= new QPushButton(GroupBox2DFonts, "buttonNumbersFont" );

	QHBoxLayout* hl2 = new QHBoxLayout(plotFonts,5,5);
	hl2->addWidget(GroupBox2DFonts);

	plotsTabWidget->insertTab(plotFonts, tr( "Fonts" ) );

	connect( boxResize, SIGNAL( clicked() ), this, SLOT( enableScaleFonts() ) );
	connect( boxFrame, SIGNAL( toggled(bool) ), this, SLOT( showFrameWidth(bool) ) );
	connect( buttonAxesFont, SIGNAL( clicked() ), this, SLOT( pickAxesFont() ) );
	connect( buttonNumbersFont, SIGNAL( clicked() ), this, SLOT( pickNumbersFont() ) );
	connect( buttonLegendFont, SIGNAL( clicked() ), this, SLOT( pickLegendFont() ) );
	connect( buttonTitleFont, SIGNAL( clicked() ), this, SLOT( pickTitleFont() ) );
}