예제 #1
0
RadioConvDialog::RadioConvDialog() : GfxDialog() {
	int idx;

	// Set up the list of buttons
	int maxWidth = 0;
	for (idx = 0; idx < 8; ++idx) {
		_buttons[idx].setText(RADIO_BTN_LIST[idx]);
		maxWidth = MAX(maxWidth, (int)_buttons[idx]._bounds.width());

		add(&_buttons[idx]);
	}

	// Set up the button positions and add them to the dialog
	for (idx = 0; idx < 8; ++idx) {
		_buttons[idx]._bounds.moveTo((idx % 2) * maxWidth + 2,
				idx / 2 * _buttons[idx]._bounds.height() + 2);
		_buttons[idx]._bounds.setWidth(maxWidth);

		add(&_buttons[idx]);
	}

	// Set the dialog size and position
	setDefaults();
	setTopLeft(8, 92);

	BF_GLOBALS._events.setCursor(CURSOR_ARROW);
}
예제 #2
0
파일: quadtree.cpp 프로젝트: KDE/analitza
void Square::setHalfEdge(double he)
{
    QPointF c = center();

    setTopLeft(QPointF(c.x()-he, c.y()-he));
    setBottomRight(QPointF(c.x()+he, c.y()+he));
}
예제 #3
0
void CRoom_2x1::update()
{
	CRoom::update();

	if (!correctRoomCollision_down())
	{
		if (!correctMapCollision_down())
		{
			m_topLeft.x += (int) m_sAtributes.velosity_x;
			m_topLeft.y += (int) m_sAtributes.velosity_y;

			setTopLeft(m_topLeft);

			isFalling = true;
		}
	}

	// only update the adjacent room pointers when not falling
	if (!isFalling)
	{
		checkPtrs(1); // for now just 1 pixel
	}
	else // is falling - null pointers to prevent weird pathing glitches
	{
		nullPtrs();
	}
}
예제 #4
0
파일: quadtree.cpp 프로젝트: KDE/analitza
void Square::setCenter(double x, double y)
{
    QSizeF s=size();
    double he = halfEdge();

    setTopLeft(QPointF(x-he, y-he));
    setSize(s);
}
예제 #5
0
파일: quadtree.cpp 프로젝트: KDE/analitza
void Square::setCeter(const QPointF& c)
{
    QSizeF s=size();
    double he = halfEdge();

    setTopLeft(QPointF(c.x()-he, c.y()-he));
    setSize(s);
}
예제 #6
0
void Circle::translate(const Point& tr)
{
	center.translate(tr);

	setTopLeft( Point(center.getX() - radius, center.getY() - radius) );
	setBtmRight( Point(center.getX() + radius, center.getY() + radius) );

}
예제 #7
0
void Line::translate(const Point& tr)
{
	p1.translate(tr);
	p2.translate(tr);

	setTopLeft( Point( min(p1.getX(), p2.getX() ), min( p1.getY(), p2.getY()) ) );
	setBtmRight( Point( max(p1.getX(), p2.getX() ), max( p1.getY(), p2.getY()) ) );

}
예제 #8
0
void Line::setCoord(const double * coord, unsigned size)
{
	if (size < 4)
		return;

	p1.setX(coord[0]);
	p1.setY(coord[1]);
	p2.setX(coord[2]);
	p2.setY(coord[3]);

	setTopLeft( Point( min(p1.getX(), p2.getX() ), min( p1.getY(), p2.getY()) ) );
	setBtmRight( Point( max(p1.getX(), p2.getX() ), max( p1.getY(), p2.getY()) ) );
}
예제 #9
0
QMPointer<QMJsonValue> QM_JSON_EXPORT QMJsonType<QRect>::fromComplexJson(const QMPointer<QMJsonObject> &obj)
{
    auto rect = QRect();

    if (obj.isNull() == true)
        return QMPointer<QMJsonValue>(new QMJsonValue(rect));

    auto size = QMJsonValue::fromComplexJson(obj->value("size"));
    auto point = QMJsonValue::fromComplexJson(obj->value("point"));

    rect.setTopLeft(point->to<QPoint>(QPoint()));
    rect.setSize(size->to<QSize>(QSize()));

    return QMPointer<QMJsonValue>(new QMJsonValue(rect));
}
예제 #10
0
 void PiShape::configure(const std::string& parameters) {
     if (parameters.empty()) return;
     std::vector<std::string> values = Op::split(parameters, " ");
     std::size_t required = 4;
     if (values.size() < required) {
         std::ostringstream ex;
         ex << "[configuration error] term <" << className() << ">"
                 << " requires <" << required << "> parameters";
         throw fl::Exception(ex.str(), FL_AT);
     }
     setBottomLeft(Op::toScalar(values.at(0)));
     setTopLeft(Op::toScalar(values.at(1)));
     setTopRight(Op::toScalar(values.at(2)));
     setBottomRight(Op::toScalar(values.at(3)));
     if (values.size() > required)
         setHeight(Op::toScalar(values.at(required)));
 }
예제 #11
0
void Circle::setCoord(const double * coord, unsigned size)
{

	if (size < 3)
		return;
	
	center.setX(coord[0]);
	center.setY(coord[1]);

	if (coord[2] > 0)
		radius = coord[2];


	setTopLeft( Point(center.getX() - radius, center.getY() - radius) );
	setBtmRight( Point(center.getX() + radius, center.getY() + radius) );


}
예제 #12
0
void GfxDialog::setCenter(int xp, int yp) {
	setTopLeft(xp - (_bounds.width() / 2), yp - (_bounds.height() / 2));
}
예제 #13
0
 bool setTopLeft(const Point& p, RepaintOption repaint = repaintNot) {return setTopLeft(p.x, p.y, repaint);}