Esempio n. 1
0
//
// Note: Called from both Apply and OK on New Chart dialog
// Must only called when the changes are definately going to
// be applied, so all input validation must be done by now.
//
Chart *PmChart::acceptNewChart()
{
    bool yAutoScale;
    double yMin, yMax;
    QString scheme;
    int sequence;

    Chart *cp = new Chart(activeTab(), activeTab()->splitter());
    activeGroup->addGadget(cp);
    activeTab()->addGadget(cp);

    QString newTitle = my.newchart->title().trimmed();
    if (newTitle.isEmpty() == false)
	cp->changeTitle(newTitle, true);
    cp->setLegendVisible(my.newchart->legend());
    cp->setAntiAliasing(my.newchart->antiAliasing());
    cp->setRateConvert(my.newchart->rateConvert());
    my.newchart->updateChartPlots(cp);
    my.newchart->scale(&yAutoScale, &yMin, &yMax);
    cp->setScale(yAutoScale, yMin, yMax);
    my.newchart->scheme(&scheme, &sequence);
    cp->setScheme(scheme, sequence);

    activeGroup->setupWorldView();
    activeTab()->showGadgets();

    enableUi();
    return cp;
}
Esempio n. 2
0
void PmChart::acceptEditChart()
{
    bool yAutoScale;
    double yMin, yMax;
    QString scheme;
    int sequence;

    Chart *cp = my.newchart->chart();
    QString editTitle = my.newchart->title().trimmed();
    if (editTitle.isEmpty() == false && editTitle != cp->title())
	cp->changeTitle(editTitle, true);
    cp->setLegendVisible(my.newchart->legend());
    cp->setAntiAliasing(my.newchart->antiAliasing());
    cp->setRateConvert(my.newchart->rateConvert());
    my.newchart->scale(&yAutoScale, &yMin, &yMax);
    cp->setScale(yAutoScale, yMin, yMax);
    my.newchart->updateChartPlots(cp);
    my.newchart->scheme(&scheme, &sequence);
    cp->setScheme(scheme, sequence);
    cp->replot();
    cp->show();

    enableUi();
}