Exemplo n.º 1
0
void Box::editDrag(const EditData& ed)
      {
      if (type() == VBOX) {
            _boxHeight = Spatium((ed.pos.y() - abbox().y()) / spatium());
            if (ed.vRaster) {
                  qreal vRaster = 1.0 / MScore::vRaster();
                  int n = lrint(_boxHeight.val() / vRaster);
                  _boxHeight = Spatium(vRaster * n);
                  }
            bbox().setRect(0.0, 0.0, system()->width(), point(boxHeight()));
            system()->setHeight(height());
            score()->doLayoutPages();
            }
      else {
            _boxWidth += Spatium(ed.delta.x() / spatium());
            if (ed.hRaster) {
                  qreal hRaster = 1.0 / MScore::hRaster();
                  int n = lrint(_boxWidth.val() / hRaster);
                  _boxWidth = Spatium(hRaster * n);
                  }

            foreach(Element* e, _el) {
                  if (e->type() == TEXT) {
                        static_cast<Text*>(e)->setModified(true);  // force relayout
                        }
                  }
            score()->setLayoutAll(true);
            }
      layout();
      }
Exemplo n.º 2
0
void VBox::layout()
      {
      setPos(QPointF());      // !?
      if (system())
            bbox().setRect(0.0, 0.0, system()->width(), point(boxHeight()));
      else
            bbox().setRect(0.0, 0.0, 50, 50);
      Box::layout();
      }
Exemplo n.º 3
0
void VBox::layout()
{
    setPos(QPointF());      // !?
    if (system())
        setbbox(QRectF(0.0, 0.0, system()->width(), point(boxHeight())));
    else
        setbbox(QRectF(0.0, 0.0, 50, 50));
    Box::layout();
}
Exemplo n.º 4
0
void TBox::layout()
      {
      setPos(QPointF());      // !?
      bbox().setRect(0.0, 0.0, system()->width(), point(boxHeight()));
      _text->layout();
      _text->setPos(leftMargin() * MScore::DPMM, topMargin() * MScore::DPMM);
      qreal h = _text->isEmpty() ? _text->lineSpacing() : _text->height();
      bbox().setRect(0.0, 0.0, system()->width(), h);
      MeasureBase::layout();  // layout LayoutBreak's
      }
Exemplo n.º 5
0
void TBox::layout()
      {
      setPos(QPointF());      // !?
      bbox().setRect(0.0, 0.0, system()->width(), point(boxHeight()));
      foreach(Element* e, _el) {
            if (e->isText()) {
                  Text* text = static_cast<Text*>(e);
                  text->layout();
                  qreal h;
                  if (text->isEmpty())
                        h = text->lineSpacing();
                  else
                        h = text->height();
                  text->setPos(leftMargin() * MScore::DPMM, topMargin() * MScore::DPMM);
                  bbox().setRect(0.0, 0.0, system()->width(), h);
                  }
            }
      MeasureBase::layout();  // layout LayoutBreak's
      }
Exemplo n.º 6
0
void Box::editDrag(const EditData& ed)
      {
      if (type() == Element::Type::VBOX) {
            _boxHeight = Spatium((ed.pos.y() - abbox().y()) / spatium());
            if (ed.vRaster) {
                  qreal vRaster = 1.0 / MScore::vRaster();
                  int n = lrint(_boxHeight.val() / vRaster);
                  _boxHeight = Spatium(vRaster * n);
                  }
            bbox().setRect(0.0, 0.0, system()->width(), point(boxHeight()));
            system()->setHeight(height());
            score()->doLayoutPages();
            }
      else {
            _boxWidth += Spatium(ed.delta.x() / spatium());
            if (ed.hRaster) {
                  qreal hRaster = 1.0 / MScore::hRaster();
                  int n = lrint(_boxWidth.val() / hRaster);
                  _boxWidth = Spatium(hRaster * n);
                  }
            score()->setLayoutAll(true);
            }
      layout();
      }
Exemplo n.º 7
0
void FBox::layout()
      {
//      setPos(QPointF());      // !?
      bbox().setRect(0.0, 0.0, system()->width(), point(boxHeight()));
      Box::layout();
      }
Exemplo n.º 8
0
QPointF VBox::getGrip(int) const
      {
      return QPointF(0.0, boxHeight().val());
      }
Exemplo n.º 9
0
void FBox::layout()
{
    setPos(QPointF());      // !?
    setbbox(QRectF(0.0, 0.0, system()->width(), point(boxHeight())));
    Box::layout();
}