void TabHeaderControl::addTab(const TabHeader& tabHeader) { tabHeaders.add(new TabHeader(tabHeader)); setNumTabs(tabHeaders.size()); setSelectedTab(tabHeaders.size()-1); adjustLabels(); }
void TabHeaderControl::shiftTabs(pp_int32 offset/* = 1*/, bool repaint/* = true*/) { pp_int32 startIndex = this->startIndex + offset; if (startIndex + tabButtons.size() > tabHeaders.size()) startIndex-= (startIndex + tabButtons.size()) - tabHeaders.size(); if (startIndex < 0) startIndex = 0; if (startIndex != this->startIndex) { for (pp_int32 i = 0; i < tabButtons.size(); i++) tabButtons.get(i)->setPressed(false); pp_int32 newIndex = (signed)hitIndex - startIndex; if (newIndex >= 0 && newIndex < tabButtons.size()) { tabButtons.get(newIndex)->setPressed(true); } this->startIndex = startIndex; adjustLabels(); if (repaint) parentScreen->paintControl(this); } }
void TabHeaderControl::setTabHeaderText(pp_int32 index, const PPString& text) { if (index < 0 || index >= tabHeaders.size()) return; tabHeaders.get(index)->text = text; adjustLabels(); }
bool Plot3DDialog::updatePlot() { int axis=-1; if (generalDialog->currentWidget()==(QWidget*)bars) { emit updateBars(boxBarsRad->text().toDouble()); } if (generalDialog->currentWidget()==(QWidget*)points) { if (boxPointStyle->currentItem() == 0) emit updatePoints(boxSize->text().toDouble(), boxSmooth->isChecked()); else if (boxPointStyle->currentItem() == 1) emit updateCross(boxCrossRad->text().toDouble(), boxCrossLinewidth->text().toDouble(), boxCrossSmooth->isChecked(), boxBoxed->isChecked()); else if (boxPointStyle->currentItem() == 2) emit updateCones(boxConesRad->text().toDouble(), boxQuality->value()); } if (generalDialog->currentWidget()==(QWidget*)title) { emit updateTitle(boxTitle->text(),titleColor,titleFont); } if (generalDialog->currentWidget()==(QWidget*)colors) { emit updateTransparency(boxTransparency->value()*0.01); emit updateDataColors(fromColor,toColor); emit updateColors(meshColor,axesColor,numColor,labelColor,bgColor,gridColor); } if (generalDialog->currentWidget()==(QWidget*)general) { emit showColorLegend(boxLegend->isChecked()); emit updateMeshLineWidth(boxMeshLineWidth->value()); emit adjustLabels(boxDistance->value()); emit updateResolution (boxResolution->value()); emit showColorLegend(boxLegend->isChecked()); emit setNumbersFont(numbersFont); emit updateZoom(boxZoom->value()*0.01); emit updateScaling(boxXScale->value()*0.01,boxYScale->value()*0.01, boxZScale->value()*0.01); } if (generalDialog->currentWidget()==(QWidget*)scale) { axis=axesList->currentRow(); QString from=boxFrom->text().toLower(); QString to=boxTo->text().toLower(); double start,end; bool error=false; try { MyParser parser; parser.SetExpr(from.toAscii().constData()); start=parser.Eval(); } catch(mu::ParserError &e) { QMessageBox::critical(0,tr("Start limit error"), QString::fromStdString(e.GetMsg())); boxFrom->setFocus(); error=true; return false; } try { MyParser parser; parser.SetExpr(to.toAscii().constData()); end=parser.Eval(); } catch(mu::ParserError &e) { QMessageBox::critical(0,tr("End limit error"), QString::fromStdString(e.GetMsg())); boxTo->setFocus(); error=true; return false; } if (start>=end) { QMessageBox::critical(0,tr("Input error"), tr("Please enter scale limits that satisfy: from < to!")); boxTo->setFocus(); return false; } if (! error) emit updateScale(axis,scaleOptions(axis, start, end, boxMajors->text(), boxMinors->text())); } if (generalDialog->currentWidget()==(QWidget*)axes) { axis=axesList2->currentRow(); labels[axis] = boxLabel->text(); emit updateLabel(axis, boxLabel->text(),axisFont(axis)); emit updateTickLength(axis,boxMajorLength->text().toDouble(), boxMinorLength->text().toDouble()); } return true; }