void HorizontalLine::pointerMoving (QPixmap &, QPoint &, QDateTime &, double y) { if (status != Moving) return; setValue(y); setSaveFlag(TRUE); emit signalDraw(); QString s = QString::number(y); emit message(s); }
void VerticalLine::pointerMoving (QPixmap &, QPoint &, QDateTime &x, double) { if (status != Moving) return; setDate(x); setSaveFlag(TRUE); emit signalDraw(); QString s = x.toString("yyyy-MM-dd hh:mm:ss"); emit message(s); }
void Text::pointerMoving (QPixmap &, QPoint &, QDateTime &x, double y) { if (status != Moving) return; setDate(x); setValue(y); setSaveFlag(TRUE); emit signalDraw(); QString s = x.toString("yyyy-MM-dd hh:mm:ss") + " " + QString::number(y); emit message(s); }
void Text::prefDialog () { QString pl = tr("Details"); QString cl = tr("Color"); QString sd = tr("Set Default"); QString fl = tr("Font"); QString ll = tr("Label"); QString vl = tr("Value"); PrefDialog *dialog = new PrefDialog(); dialog->setCaption(tr("Edit Text")); dialog->createPage (pl); dialog->setHelpFile (helpFile); dialog->addColorPrefItem(cl, pl, color); dialog->addFontItem(fl, pl, font); dialog->addTextItem(ll, pl, label); dialog->addDoubleItem(vl, pl, getValue()); dialog->addCheckItem(sd, pl, FALSE); int rc = dialog->exec(); if (rc == QDialog::Accepted) { dialog->getColor(cl, color); dialog->getText(ll, label); dialog->getFont(fl, font); value = dialog->getDouble(vl); setSaveFlag(TRUE); bool f = dialog->getCheck(sd); if (f) { dialog->getColor(cl, defaultColor); dialog->getFont(fl, dfont); saveDefaults(); } emit signalDraw(); } delete dialog; }
COBase::Status Text::pointerClick (QPoint &point, QDateTime &x, double y) { switch (status) { case None: if (isSelected(point)) { status = Selected; emit signalDraw(); } break; case Selected: if (isGrabSelected(point)) status = Moving; else { if (! isSelected(point)) { status = None; emit signalDraw(); } } break; case Moving: status = Selected; break; case ClickWait: setDate(x); setValue(y); setSaveFlag(TRUE); setColor(defaultColor); emit signalDraw(); status = None; emit message(""); emit signalSave(name); break; default: break; } return status; }
void SellArrow::prefDialog () { QString pl = tr("Details"); QString cl = tr("Color"); QString vl = tr("Value"); QString il = tr("Identifier"); QString bl = tr("Price"); QString sd = tr("Set Default"); PrefDialog *dialog = new PrefDialog(); dialog->setCaption(tr("Edit SellArrow")); dialog->createPage (pl); dialog->setHelpFile (helpFile); dialog->addColorPrefItem(cl, pl, color); dialog->addDoubleItem(vl, pl, getValue()); dialog->addTextItem(il, pl, identifier); dialog->addTextItem(bl, pl, price); dialog->addCheckItem(sd, pl, FALSE); int rc = dialog->exec(); if (rc == QDialog::Accepted) { dialog->getColor(cl, color); value = dialog->getDouble(vl); dialog->getText(il, identifier); dialog->getText(bl, price); setSaveFlag(TRUE); bool f = dialog->getCheck(sd); if (f) { defaultColor = color; saveDefaults(); } emit signalDraw(); } delete dialog; }
void HorizontalLine::prefDialog () { QString pl = tr("Details"); QString cl = tr("Color"); QString sd = tr("Set Default"); QString vl = tr("Value"); QString tx = tr("Text"); PrefDialog *dialog = new PrefDialog(); dialog->setCaption(tr("Edit HorizontalLine")); dialog->createPage (pl); dialog->setHelpFile (helpFile); dialog->addColorPrefItem(cl, pl, color); dialog->addDoubleItem(vl, pl, getValue()); dialog->addTextItem(tx, pl, text); //cz odkazy na objekty definovane nahore dialog->addCheckItem(sd, pl, FALSE); int rc = dialog->exec(); if (rc == QDialog::Accepted) { dialog->getColor(cl, color); value = dialog->getDouble(vl); dialog->getText(tx, text); setSaveFlag(TRUE); bool f = dialog->getCheck(sd); if (f) { defaultColor = color; saveDefaults(); } emit signalDraw(); } delete dialog; }