137
140
connect(btnMore, SIGNAL(toggled(bool)), this, SLOT(showAll(bool)));
139
connect( buttonOk, SIGNAL(clicked()), this, SLOT(quit() ) );
142
connect( buttonOk, SIGNAL(clicked()), this, SLOT(quit()));
140
143
connect( buttonCancel, SIGNAL(clicked()), this, SLOT(close()));
141
connect( buttonApply, SIGNAL(clicked() ), this, SLOT(acceptParams() ) );
144
connect( buttonApply, SIGNAL(clicked() ), this, SLOT(acceptParams()));
142
145
connect( btnWorksheet, SIGNAL(clicked()), this, SLOT(showWorksheet()));
143
146
connect( btnEditCurve, SIGNAL(clicked()), this, SLOT(editCurve()));
144
147
connect(listBox, SIGNAL(itemDoubleClicked( QTreeWidgetItem *, int)),
505
507
hl->addWidget(gb2);
506
508
piePage->setLayout(hl);
508
privateTabWidget->addTab(piePage, tr( "Pie" ) );
510
privateTabWidget->addTab(piePage, tr( "Pattern" ) );
513
void PlotDialog::initPieGeometryPage()
515
pieGeometryPage = new QWidget();
517
QLocale locale = ((ApplicationWindow *)this->parent())->locale();
519
QGroupBox *gb3 = new QGroupBox(tr( "3D View" ));
520
QGridLayout *gl3 = new QGridLayout(gb3);
521
gl3->addWidget(new QLabel( tr( "View Angle (deg)" )), 0, 0);
522
boxPieViewAngle = new DoubleSpinBox('f');
523
boxPieViewAngle->setWrapping(true);
524
boxPieViewAngle->setRange(0.0, 90.0);
525
boxPieViewAngle->setLocale(locale);
526
gl3->addWidget(boxPieViewAngle, 0, 1);
528
gl3->addWidget(new QLabel( tr( "Thickness (% of radius)" )), 1, 0);
529
boxPieThickness = new DoubleSpinBox('f');
530
boxPieThickness->setLocale(locale);
531
boxPieThickness->setRange(0.0, 300.0);
532
gl3->addWidget(boxPieThickness, 1, 1);
533
gl3->setRowStretch(2, 1);
535
QGroupBox *gb1 = new QGroupBox(tr( "Rotation" ));
536
QGridLayout *gl1 = new QGridLayout(gb1);
537
gl1->addWidget(new QLabel( tr( "Starting Azimuth (deg)" )), 0, 0);
538
boxPieStartAzimuth = new DoubleSpinBox('f');
539
boxPieStartAzimuth->setRange(0.0, 360.0);
540
boxPieStartAzimuth->setWrapping(true);
541
boxPieStartAzimuth->setSingleStep(10.0);
542
boxPieStartAzimuth->setLocale(locale);
543
gl1->addWidget(boxPieStartAzimuth, 0, 1);
545
boxPieConterClockwise = new QCheckBox(tr("Counter cloc&kwise"));
546
gl1->addWidget(boxPieConterClockwise, 1, 0);
547
gl1->setRowStretch(2, 1);
549
QGroupBox *gb2 = new QGroupBox(tr( "Radius/Center" ));
550
QGridLayout *gl2 = new QGridLayout(gb2);
551
gl2->addWidget(new QLabel( tr( "Radius (% of frame)" )), 0, 0);
552
boxRadius = new QSpinBox();
553
boxRadius->setRange(0, 300);
554
boxRadius->setSingleStep(5);
555
gl2->addWidget(boxRadius, 0, 1);
556
gl2->addWidget(new QLabel( tr( "Horizontal Offset (% of frame)" )), 1, 0);
557
boxPieOffset = new QSpinBox();
558
boxPieOffset->setRange(-100, 100);
559
gl2->addWidget(boxPieOffset, 1, 1);
560
gl2->setRowStretch(2, 1);
562
QVBoxLayout* vl = new QVBoxLayout(pieGeometryPage);
567
privateTabWidget->addTab(pieGeometryPage, tr( "Pie Geometry" ) );
569
connect(boxPieConterClockwise, SIGNAL(toggled(bool)), this, SLOT(acceptParams()));
570
connect(boxPieViewAngle, SIGNAL(valueChanged(double)), this, SLOT(acceptParams()));
571
connect(boxPieThickness, SIGNAL(valueChanged(double)), this, SLOT(acceptParams()));
572
connect(boxPieStartAzimuth, SIGNAL(valueChanged(double)), this, SLOT(acceptParams()));
573
connect(boxRadius, SIGNAL(valueChanged(int)), this, SLOT(acceptParams()));
574
connect(boxPieOffset, SIGNAL(valueChanged(int)), this, SLOT(acceptParams()));
577
void PlotDialog::initPieLabelsPage()
579
pieLabelsPage = new QWidget();
581
pieAutoLabelsBox = new QGroupBox(tr("Automatic &Format"));
582
pieAutoLabelsBox->setCheckable(true);
584
QGridLayout *gl1 = new QGridLayout(pieAutoLabelsBox);
585
boxPieValues = new QCheckBox(tr("&Values"));
586
gl1->addWidget(boxPieValues, 0, 0);
588
boxPiePercentages = new QCheckBox(tr("&Percentages"));
589
gl1->addWidget(boxPiePercentages, 1, 0);
591
boxPieCategories = new QCheckBox(tr("Categories/&Rows"));
592
gl1->addWidget(boxPieCategories, 2, 0);
594
gl1->setRowStretch(3, 1);
596
boxPieWedge = new QGroupBox(tr( "Associate Position with &Wedge" ));
597
boxPieWedge->setCheckable(true);
599
QGridLayout *gl2 = new QGridLayout(boxPieWedge);
600
gl2->addWidget(new QLabel( tr( "Dist. from Pie Edge" )), 0, 0);
601
boxPieEdgeDist = new DoubleSpinBox('f');
602
boxPieEdgeDist->setRange(-100, 100);
603
boxPieEdgeDist->setLocale(((ApplicationWindow *)this->parent())->locale());
604
gl2->addWidget(boxPieEdgeDist, 0, 1);
605
gl2->setRowStretch(1, 1);
607
QVBoxLayout* vl = new QVBoxLayout(pieLabelsPage);
608
vl->addWidget(pieAutoLabelsBox);
609
vl->addWidget(boxPieWedge);
611
privateTabWidget->addTab(pieLabelsPage, tr( "Labels" ) );
613
connect(boxPieEdgeDist, SIGNAL(valueChanged(double)), this, SLOT(acceptParams()));
511
616
void PlotDialog::initPrintPage()
1010
1125
gl->addWidget(colorBox, 0, 1);
1012
1127
gl->addWidget(new QLabel(tr( "Line Width" )), 1, 0);
1013
widthBox = new QComboBox();
1014
widthBox->addItem( tr( "1" ) );
1015
widthBox->addItem( tr( "2" ) );
1016
widthBox->addItem( tr( "3" ) );
1017
widthBox->addItem( tr( "4" ) );
1018
widthBox->addItem( tr( "5" ) );
1019
widthBox->setEditable (true);
1128
widthBox = new DoubleSpinBox('f');
1129
widthBox->setLocale(((ApplicationWindow *)parent())->locale());
1130
widthBox->setSingleStep(0.1);
1131
widthBox->setRange(0, 100);
1020
1132
gl->addWidget(widthBox, 1, 1);
1022
1134
gl->addWidget(new QLabel(tr( "Cap Width" )), 2, 0);
1764
1856
PlotCurve *c = (PlotCurve*)i;
1857
if (c->type() == Graph::Function)
1858
btnEditCurve->setText(tr("&Edit..."));
1860
btnEditCurve->setText(tr("&Plot Associations..."));
1862
int curveType = item->plotItemType();
1863
if (curveType == Graph::Pie){
1864
QwtPieCurve *pie = (QwtPieCurve*)i;
1865
boxPiePattern->setPattern(pie->pattern());
1866
boxPieLineWidth->setValue(pie->pen().widthF());
1867
boxPieLineColor->setColor(pie->pen().color());
1868
setPiePenStyle(pie->pen().style());
1869
boxFirstColor->setCurrentIndex(pie->firstColor());
1871
boxPieViewAngle->blockSignals(true);
1872
boxPieViewAngle->setValue(pie->viewAngle());
1873
boxPieViewAngle->blockSignals(false);
1874
boxPieThickness->blockSignals(true);
1875
boxPieThickness->setValue(pie->thickness());
1876
boxPieThickness->blockSignals(false);
1877
boxPieStartAzimuth->blockSignals(true);
1878
boxPieStartAzimuth->setValue(pie->startAzimuth());
1879
boxPieStartAzimuth->blockSignals(false);
1880
boxPieConterClockwise->blockSignals(true);
1881
boxPieConterClockwise->setChecked(pie->counterClockwise());
1882
boxPieConterClockwise->blockSignals(false);
1883
boxRadius->blockSignals(true);
1884
boxRadius->setValue(pie->radius());
1885
boxRadius->blockSignals(false);
1886
boxPieOffset->blockSignals(true);
1887
boxPieOffset->setValue((int)pie->horizontalOffset());
1888
boxPieOffset->blockSignals(false);
1890
pieAutoLabelsBox->setChecked(pie->labelsAutoFormat());
1891
boxPieValues->setChecked(pie->labelsValuesFormat());
1892
boxPiePercentages->setChecked(pie->labelsPercentagesFormat());
1893
boxPieCategories->setChecked(pie->labelCategories());
1894
boxPieEdgeDist->blockSignals(true);
1895
boxPieEdgeDist->setValue(pie->labelsEdgeDistance());
1896
boxPieEdgeDist->blockSignals(false);
1897
boxPieWedge->setChecked(pie->fixedLabelsPosition());
1767
1902
int style = c->style();
1826
1966
if (curveType == Graph::ErrorBars){
1827
1967
QwtErrorPlotCurve *err = (QwtErrorPlotCurve*)i;
1829
xBox->setChecked(err->xErrors());
1830
widthBox->setEditText(QString::number(err->width()));
1969
widthBox->blockSignals(true);
1970
widthBox->setValue(err->width());
1971
widthBox->blockSignals(false);
1831
1972
capBox->setEditText(QString::number(err->capLength()));
1974
colorBox->blockSignals(true);
1832
1975
colorBox->setColor(err->color());
1976
colorBox->blockSignals(false);
1978
throughBox->blockSignals(true);
1833
1979
throughBox->setChecked(err->throughSymbol());
1980
throughBox->blockSignals(false);
1981
plusBox->blockSignals(true);
1834
1982
plusBox->setChecked(err->plusSide());
1983
plusBox->blockSignals(false);
1984
minusBox->blockSignals(true);
1835
1985
minusBox->setChecked(err->minusSide());
1986
minusBox->blockSignals(false);
1987
xBox->blockSignals(true);
1988
xBox->setChecked(err->xErrors());
1989
xBox->blockSignals(false);
1946
2098
if (!boxAll->isChecked())
1949
QWidgetList allPlots = d_ml->graphPtrs();
1950
for (int i=0; i<allPlots.count();i++){
1951
Graph* g = (Graph*)allPlots.at(i);
1953
g->setFrame(boxBorderWidth->value(), boxBorderColor->color());
1954
g->setMargin(boxMargin->value());
1956
QColor c = boxBackgroundColor->color();
1957
c.setAlpha(boxBackgroundTransparency->value());
1958
g->setBackgroundColor(c);
1960
c = boxCanvasColor->color();
1961
c.setAlpha(boxCanvasTransparency->value());
1962
g->setCanvasBackground(c);
1964
g->setAntialiasing(boxAntialiasing->isChecked());
2101
QList<Graph *> layers = d_ml->layersList();
2102
foreach(Graph *g, layers){
2103
g->setFrame(boxBorderWidth->value(), boxBorderColor->color());
2104
g->setMargin(boxMargin->value());
2106
QColor c = boxBackgroundColor->color();
2107
c.setAlpha(boxBackgroundTransparency->value());
2108
g->setBackgroundColor(c);
2110
c = boxCanvasColor->color();
2111
c.setAlpha(boxCanvasTransparency->value());
2112
g->setCanvasBackground(c);
2114
g->setAntialiasing(boxAntialiasing->isChecked());
1968
2117
} else if (privateTabWidget->currentWidget() == layerGeometryPage){
2114
2263
QwtPieCurve *pie = (QwtPieCurve*)plotItem;
2115
2264
pie->setPen(QPen(boxPieLineColor->color(), boxPieLineWidth->value(),
2116
2265
Graph::getPenStyle(boxPieLineStyle->currentIndex())));
2117
pie->setRay(boxRadius->value());
2118
2266
pie->setBrushStyle(boxPiePattern->getSelectedPattern());
2119
2267
pie->setFirstColor(boxFirstColor->currentIndex());
2268
} else if (privateTabWidget->currentPage() == pieGeometryPage){
2269
QwtPieCurve *pie = (QwtPieCurve*)plotItem;
2270
pie->setViewAngle(boxPieViewAngle->value());
2271
pie->setThickness(boxPieThickness->value());
2272
pie->setRadius(boxRadius->value());
2273
pie->setHorizontalOffset(boxPieOffset->value());
2274
pie->setStartAzimuth(boxPieStartAzimuth->value());
2275
pie->setCounterClockwise(boxPieConterClockwise->isChecked());
2276
} else if (privateTabWidget->currentPage() == pieLabelsPage){
2277
QwtPieCurve *pie = (QwtPieCurve*)plotItem;
2278
pie->setLabelsAutoFormat(pieAutoLabelsBox->isChecked());
2279
pie->setLabelValuesFormat(boxPieValues->isChecked());
2280
pie->setLabelPercentagesFormat(boxPiePercentages->isChecked());
2281
pie->setLabelCategories(boxPieCategories->isChecked());
2282
pie->setFixedLabelsPosition(boxPieWedge->isChecked());
2283
pie->setLabelsEdgeDistance(boxPieEdgeDist->value());
2120
2285
} else if (privateTabWidget->currentPage() == percentilePage){
2121
2286
BoxCurve *b = (BoxCurve*)plotItem;
2459
2624
void PlotDialog::updateBackgroundTransparency(int alpha)
2461
2626
boxBackgroundColor->setEnabled(alpha);
2627
QColor c = boxBackgroundColor->color();
2628
c.setAlpha(boxBackgroundTransparency->value());
2463
if (boxAll->isChecked())
2465
QWidgetList allPlots = d_ml->graphPtrs();
2466
for (int i=0; i<allPlots.count();i++)
2468
Graph* g = (Graph*)allPlots.at(i);
2471
QColor c = boxBackgroundColor->color();
2472
c.setAlpha(boxBackgroundTransparency->value());
2473
g->setBackgroundColor(c);
2630
if (boxAll->isChecked()){
2631
QList<Graph *> layers = d_ml->layersList();
2632
foreach(Graph *g, layers)
2633
g->setBackgroundColor(c);
2479
2635
LayerItem *item = (LayerItem *)listBox->currentItem();
2482
2638
Graph *g = item->graph();
2485
QColor c = boxBackgroundColor->color();
2486
c.setAlpha(boxBackgroundTransparency->value());
2487
2640
g->setBackgroundColor(c);
2492
2644
void PlotDialog::updateCanvasTransparency(int alpha)
2494
2646
boxCanvasColor->setEnabled(alpha);
2647
QColor c = boxCanvasColor->color();
2648
c.setAlpha(boxCanvasTransparency->value());
2496
if (boxAll->isChecked())
2498
QWidgetList allPlots = d_ml->graphPtrs();
2499
for (int i=0; i<allPlots.count();i++)
2501
Graph* g = (Graph*)allPlots.at(i);
2504
QColor c = boxCanvasColor->color();
2505
c.setAlpha(boxCanvasTransparency->value());
2506
g->setCanvasBackground(c);
2650
if (boxAll->isChecked()){
2651
QList<Graph *> layers = d_ml->layersList();
2652
foreach(Graph *g, layers)
2653
g->setCanvasBackground(c);
2512
2655
LayerItem *item = (LayerItem *)listBox->currentItem();
2515
2658
Graph *g = item->graph();
2518
QColor c = boxCanvasColor->color();
2519
c.setAlpha(boxCanvasTransparency->value());
2520
2660
g->setCanvasBackground(c);
2525
2664
void PlotDialog::pickCanvasColor()
2527
QColor c = boxCanvasColor->color();
2666
QColor c = boxCanvasColor->color();
2667
c.setAlpha(boxCanvasTransparency->value());
2528
2669
if (boxAll->isChecked()){
2529
QWidgetList allPlots = d_ml->graphPtrs();
2530
for (int i=0; i<allPlots.count();i++){
2531
Graph* g=(Graph*)allPlots.at(i);
2533
c.setAlpha(boxCanvasTransparency->value());
2534
g->setCanvasBackground(c);
2670
QList<Graph *> layers = d_ml->layersList();
2671
foreach(Graph *g, layers){
2672
g->setCanvasBackground(c);
2539
2676
LayerItem *item = (LayerItem *)listBox->currentItem();
2542
2679
Graph *g = item->graph();
2544
c.setAlpha(boxCanvasTransparency->value());
2545
2681
g->setCanvasBackground(c);