void Widget::getDomChanges(std::vector<DomElement *>& result, WApplication *app) { std::string el = elRef() + ".el.dom"; DomElement *e = DomElement::updateGiven(el, domElementType()); updateExt(); if (!jsUpdates_.empty()) { e->callJavaScript("var " + elVar() + "=" + elRef() + ";" + jsUpdates_); jsUpdates_.clear(); } updateDom(*e, false); e->removeProperty(PropertyStyleDisplay); result.push_back(e); }
void QDiagramWidget::build() { double xMin, xMax, CurveMainMin, CurveMainMax, CurveSecondaryMin, CurveSecondaryMax; // clear old values clear(); // get start time of track const GPX_wptType *trkpt = gpxmw->getPoint(gpxmw->getSelectedTrackNumber(), 0, 0); if (trkpt) startTimestamp = gpxmw->getTrackPointPropertyAsDouble(trkpt, GPX_wrapper::timestamp); else startTimestamp = 0; // generate new values gpxmw->generateDiagramValues(gpxmw->getSelectedTrackNumber(), gpxmw->getSelectedTrackSegmentNumber(), curveMain, curveSecondary); // get range getMinMax(gpxmw->getTimeValues(), xMin, xMax); getMinMax(gpxmw->getCurveMainValues(), CurveMainMin, CurveMainMax); getMinMax(gpxmw->getCurveSecondaryValues(), CurveSecondaryMin, CurveSecondaryMax); // set new values xAxis->setRange(xMin, xMax); yAxis->setLabel(gpxmw->getTrackPointPropertyLabel(curveMain)); yAxis->setRange(CurveMainMin, CurveMainMax); yAxis2->setLabel(gpxmw->getTrackPointPropertyLabel(curveSecondary)); yAxis2->setRange(CurveSecondaryMin, CurveSecondaryMax); graph(1)->setData(gpxmw->getTimeValues(), gpxmw->getCurveMainValues()); graph(0)->setData(gpxmw->getTimeValues(), gpxmw->getCurveSecondaryValues()); yAxis->setVisible((curveMain == GPX_wrapper::none) ? false : true); yAxis2->setVisible((curveSecondary == GPX_wrapper::none) ? false : true); // update extensions updateExt(); // replot replot(); }