예제 #1
0
void GfxCropDialog::bindEvents()
{
	// Left text box
	text_left_->Bind(wxEVT_TEXT_ENTER, &GfxCropDialog::onTextEnter, this);
	text_left_->Bind(wxEVT_KILL_FOCUS, [&](wxFocusEvent& e) {
		setLeft();
		e.Skip();
	});

	// Top text box
	text_top_->Bind(wxEVT_TEXT_ENTER, &GfxCropDialog::onTextEnter, this);
	text_top_->Bind(wxEVT_KILL_FOCUS, [&](wxFocusEvent& e) {
		setTop();
		e.Skip();
	});

	// Right text box
	text_right_->Bind(wxEVT_TEXT_ENTER, &GfxCropDialog::onTextEnter, this);
	text_right_->Bind(wxEVT_KILL_FOCUS, [&](wxFocusEvent& e) {
		setRight();
		e.Skip();
	});

	// Bottom text box
	text_bottom_->Bind(wxEVT_TEXT_ENTER, &GfxCropDialog::onTextEnter, this);
	text_bottom_->Bind(wxEVT_KILL_FOCUS, [&](wxFocusEvent& e) {
		setBottom();
		e.Skip();
	});

	// Absolute/Relative radio buttons
	rb_absolute_->Bind(wxEVT_RADIOBUTTON, [&](wxCommandEvent&) { updateValues(); });
	rb_relative_->Bind(wxEVT_RADIOBUTTON, [&](wxCommandEvent&) { updateValues(); });
}
예제 #2
0
bool QDoubleValidator::qt_property( int id, int f, QVariant* v)
{
    switch ( id - staticMetaObject()->propertyOffset() ) {
    case 0: switch( f ) {
	case 0: setBottom(v->asDouble()); break;
	case 1: *v = QVariant( this->bottom() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 1: switch( f ) {
	case 0: setTop(v->asDouble()); break;
	case 1: *v = QVariant( this->top() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 2: switch( f ) {
	case 0: setDecimals(v->asInt()); break;
	case 1: *v = QVariant( this->decimals() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    default:
	return QValidator::qt_property( id, f, v );
    }
    return TRUE;
}
예제 #3
0
파일: anchors.cpp 프로젝트: zccrs/Anchors
bool AnchorsBase::setAnchor(const Qt::AnchorPoint &p, QWidget *target, const Qt::AnchorPoint &point)
{
    if (!target) {
        return false;
    }

    AnchorsBase *base = AnchorsBasePrivate::getWidgetAnchorsBase(target);

    if (!base) {
        base = new AnchorsBase(target);
    }

    const AnchorInfo *info = base->d_func()->getInfoByPoint(point);

    switch (p) {
    case Qt::AnchorTop:
        return setTop(info);
    case Qt::AnchorBottom:
        return setBottom(info);
    case Qt::AnchorLeft:
        return setLeft(info);
    case Qt::AnchorRight:
        return setRight(info);
    case Qt::AnchorHorizontalCenter:
        return setHorizontalCenter(info);
    case Qt::AnchorVerticalCenter:
        return setVerticalCenter(info);
    default:
        return false;
    }
}
예제 #4
0
    PixelRegion PixelRegion::globalCut(Side side, int p) {
        if (!lineIntersect(side, p)) {
            return PixelRegion({ 0, 0 }, { 0, 0 });
        }

        PixelRegion cutOff(*this);
        int cutSize = 0;
        switch (side) {
        case LEFT:
            setLeft(p);
            cutOff.setRight(p - cutSize);
            break;
        case TOP:
            setTop(p);
            cutOff.setBottom(p - cutSize);
            break;
        case RIGHT:
            setRight(p);
            cutOff.setLeft(p + cutSize);
            break;
        case BOTTOM:
            setBottom(p);
            cutOff.setTop(p + cutSize);
            break;
        }
        return cutOff;
    }
예제 #5
0
void GuiSetBorder::mousePressEvent(QMouseEvent * e)
{
	if (e->y() > e->x()) {
		if (e->y() < height() - e->x()) {
			if (left_.enabled) {
				setLeft(!left_.set);
				// emit signal
				leftSet(left_.set);
			}
		} else {
			if (bottom_.enabled) {
				setBottom(!bottom_.set);
				// emit signal
				bottomSet(bottom_.set);
			}
		}
	} else {
		if (e->y() < height() - e->x()) {
			if (top_.enabled) {
				setTop(!top_.set);
				// emit signal
				topSet(top_.set);
			}
		} else {
			if (right_.enabled) {
				setRight(!right_.set);
				// emit signal
				rightSet(right_.set);
			}
		}
	}
	update();
	// emit signal
	clicked();
}
예제 #6
0
void GuiSetBorder::setAll(bool border)
{
	setLeft(border);
	setRight(border);
	setTop(border);
	setBottom(border);
}
예제 #7
0
파일: rect.cpp 프로젝트: hunt978/qfplot
void Rect::expand( const QPoint& point )
{
	setLeft  ( qMin(point.x(), left()  ) );
	setRight ( qMax(point.x(), right() ) );
	setTop   ( qMax(point.y(), top()   ) );
	setBottom( qMin(point.y(), bottom()) ); 
};
예제 #8
0
 std::shared_ptr<Wt::WValidator> createBirthValidator() {
     auto v = std::make_shared<Wt::WDateValidator>();
     v->setBottom(Wt::WDate(1900, 1, 1));
     v->setTop(Wt::WDate::currentDate());
     v->setFormat("dd/MM/yyyy");
     v->setMandatory(true);
     return v;
 }
예제 #9
0
 void PixelRegion::setSide(Side side, int pos) {
     switch (side) {
     case LEFT: setLeft(pos); break;
     case TOP: setTop(pos); break;
     case RIGHT: setRight(pos); break;
     case BOTTOM: setBottom(pos); break;
     }
 }
예제 #10
0
/*!
 
  Constructs a rectangle with \e topLeft the top-left corner location
  and \e bottomRight the bottom-right corner.

*/
vpRect::vpRect(const vpImagePoint &topLeft, const vpImagePoint &bottomRight)
{
  this->left = topLeft.get_u();
  this->top = topLeft.get_v();
  
  setBottom( bottomRight.get_v() );
  setRight( bottomRight.get_u() );
};
예제 #11
0
QRectF ScriptEditorItem::boundingRect() const
{
    auto br = QGraphicsTextItem::boundingRect();
    br.setBottom(br.bottom() + border);
    br.setTop(br.top() - border);
    br.setLeft(br.left() - border);
    br.setRight(br.right() + border);
    return br;
}
예제 #12
0
// -----------------------------------------------------------------------------
// Called when enter is pressed in a text box
// -----------------------------------------------------------------------------
void GfxCropDialog::onTextEnter(wxCommandEvent& e)
{
	if (e.GetEventObject() == text_left_)
		setLeft();
	else if (e.GetEventObject() == text_top_)
		setTop();
	else if (e.GetEventObject() == text_right_)
		setRight();
	else if (e.GetEventObject() == text_bottom_)
		setBottom();
}
예제 #13
0
파일: WDateEdit.C 프로젝트: NeilNienaber/wt
void WDateEdit::render(WFlags<RenderFlag> flags)
{
  if (flags & RenderFull) {
    defineJavaScript();
    setTop(validator()->top());
    setBottom(validator()->bottom());
    setFormat(validator()->format());
  }

  WLineEdit::render(flags);
}
예제 #14
0
파일: WDateEdit.C 프로젝트: LifeGo/wt
void WDateEdit::render(WFlags<RenderFlag> flags)
{
  if (flags & RenderFull) {
    defineJavaScript();
    WDateValidator *dv = validator();
    if (dv) {
      setTop(dv->top());
      setBottom(dv->bottom());
      setFormat(dv->format());
    }
  }

  WLineEdit::render(flags);
}
예제 #15
0
파일: WDatePicker.C 프로젝트: LifeGo/wt
void WDatePicker::render(WFlags<RenderFlag> flags)
{
  if (flags & RenderFull) {
    WDateValidator *dv = dynamic_cast<WDateValidator *>(forEdit_->validator());

    if (dv) {
      setTop(dv->top());
      setBottom(dv->bottom());
      setFormat(dv->format());
    }
  }

  WCompositeWidget::render(flags);
}
예제 #16
0
파일: scene.cpp 프로젝트: buffer8848/kick
 std::shared_ptr<CameraOrthographic> Scene::createOrthographicCamera(GameObject *cameraObject) {
     if (!cameraObject ) {
         cameraObject = createGameObject("OrthographicCamera");
     }
     auto cam = cameraObject->addComponent<CameraOrthographic>();
     glm::ivec2 dim = Engine::context()->getContextSurfaceDim();
     cam->setNear(-10);
     cam->setFar(10);
     cam->setLeft(-dim.x/2);
     cam->setRight(dim.x/2);
     cam->setBottom(-dim.y/2);
     cam->setTop(dim.y/2);
     cam->setClearColor(glm::vec4(0,0,0,1));
     return cam;
 }
예제 #17
0
AnalysisView::AnalysisView(Context *context, QStackedWidget *controls) : TabView(context, VIEW_ANALYSIS)
{
    analSidebar = new AnalysisSidebar(context);
    HomeWindow *a = new HomeWindow(context, "analysis", "Rides");
    controls->addWidget(a->controls());
    controls->setCurrentIndex(0);
    BlankStateAnalysisPage *b = new BlankStateAnalysisPage(context);

    setSidebar(analSidebar);
    setPage(a);
    setBlank(b);
    setBottom(new ComparePane(context, this, ComparePane::interval));

    connect(bottomSplitter(), SIGNAL(compareChanged(bool)), this, SLOT(compareChanged(bool)));
    connect(bottomSplitter(), SIGNAL(compareClear()), bottom(), SLOT(clear()));
}
예제 #18
0
/*!
 * Defines an orthographic projection based on \a left, \a right, \a bottom, \a
 * top, \a nearPlane, \a farPlane.
 */
void QCameraLens::setFrustumProjection(float left, float right,
                                       float bottom, float top,
                                       float nearPlane, float farPlane)
{
    Q_D(QCameraLens);
    bool block = blockNotifications(true);
    setLeft(left);
    setRight(right);
    setBottom(bottom);
    setTop(top);
    setNearPlane(nearPlane);
    setFarPlane(farPlane);
    setProjectionType(FrustumProjection);
    blockNotifications(block);
    d->updateProjectionMatrix();
}
예제 #19
0
HomeView::HomeView(Context *context, QStackedWidget *controls) : TabView(context, VIEW_HOME)
{
    LTMSidebar *s = new LTMSidebar(context);
    HomeWindow *h = new HomeWindow(context, "home", "Trends");
    controls->addWidget(h->controls());
    controls->setCurrentIndex(0);
    BlankStateHomePage *b = new BlankStateHomePage(context);

    setSidebar(s);
    setPage(h);
    setBlank(b);
    setBottom(new ComparePane(context, this, ComparePane::season));

    connect(s, SIGNAL(dateRangeChanged(DateRange)), this, SLOT(dateRangeChanged(DateRange)));
    connect(this, SIGNAL(onSelectionChanged()), this, SLOT(justSelected()));
    connect(bottomSplitter(), SIGNAL(compareChanged(bool)), this, SLOT(compareChanged(bool)));
    connect(bottomSplitter(), SIGNAL(compareClear()), bottom(), SLOT(clear()));
}
예제 #20
0
Ref<BasicShape> BasicShapeInset::blend(const BasicShape& other, double progress) const
{
    ASSERT(type() == other.type());

    auto& otherInset = downcast<BasicShapeInset>(other);
    auto result =  BasicShapeInset::create();
    result->setTop(m_top.blend(otherInset.top(), progress));
    result->setRight(m_right.blend(otherInset.right(), progress));
    result->setBottom(m_bottom.blend(otherInset.bottom(), progress));
    result->setLeft(m_left.blend(otherInset.left(), progress));

    result->setTopLeftRadius(m_topLeftRadius.blend(otherInset.topLeftRadius(), progress));
    result->setTopRightRadius(m_topRightRadius.blend(otherInset.topRightRadius(), progress));
    result->setBottomRightRadius(m_bottomRightRadius.blend(otherInset.bottomRightRadius(), progress));
    result->setBottomLeftRadius(m_bottomLeftRadius.blend(otherInset.bottomLeftRadius(), progress));

    return WTFMove(result);
}
예제 #21
0
void initScreens() {
	
	uint8_t i;
	uint8_t j;
	Row = 0;
	
	for( i = 0 ; i < 8 ; i++) {
		for ( j = 0 ; j < 8; j++) {
			setPixel(screen1,i,j,0,0,0);
		}
	}
	
	setTop(screen1,0,100,0);
	setLeft(screen1,100,0,0);
	setRight(screen1,0,0,100);
	setBottom(screen1,100,100,0);
	
}
예제 #22
0
파일: Domain.cpp 프로젝트: karelklic/canal
Domain &
Domain::store(const Domain &value,
              const std::vector<Domain*> &offsets,
              bool overwrite)
{
    CANAL_ASSERT(offsets.empty());
    if (&getValueType() == &value.getValueType())
    {
        if (overwrite)
            setBottom();

        join(value);
    }
    else
        setTop();

    return *this;
}
예제 #23
0
파일: Pointer.cpp 프로젝트: karelklic/canal
Pointer &
Pointer::meet(const Domain &value)
{
    if (isBottom())
        return *this;

    if (value.isTop())
        return *this;

    if (value.isBottom())
    {
        setBottom();
        return *this;
    }

    const Pointer &vv = llvm::cast<Pointer>(value);
    CANAL_ASSERT_MSG(&vv.mType == &mType,
                     "Unexpected different types in a pointer merge ("
                     << Canal::toString(vv.mType) << " != "
                     << Canal::toString(mType) << ")");

    if (isTop())
    {
        mTop = false;
        CANAL_ASSERT(mTargets.empty());
    }

    PlaceTargetMap::iterator it = mTargets.begin();
    for (; it != mTargets.end(); ++it)
    {
        PlaceTargetMap::const_iterator valueit = vv.mTargets.find(it->first);
        if (it == vv.mTargets.end())
        {
            delete it->second;
            mTargets.erase(it);
        }
        else
            it->second->meet(*valueit->second);
    }

    return *this;
}
예제 #24
0
int QDoubleValidator::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QValidator::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    
#ifndef QT_NO_PROPERTIES
     if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< double*>(_v) = bottom(); break;
        case 1: *reinterpret_cast< double*>(_v) = top(); break;
        case 2: *reinterpret_cast< int*>(_v) = decimals(); break;
        case 3: *reinterpret_cast< Notation*>(_v) = notation(); break;
        }
        _id -= 4;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setBottom(*reinterpret_cast< double*>(_v)); break;
        case 1: setTop(*reinterpret_cast< double*>(_v)); break;
        case 2: setDecimals(*reinterpret_cast< int*>(_v)); break;
        case 3: setNotation(*reinterpret_cast< Notation*>(_v)); break;
        }
        _id -= 4;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 4;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 4;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 4;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 4;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 4;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 4;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
예제 #25
0
TrainView::TrainView(Context *context, QStackedWidget *controls) : TabView(context, VIEW_TRAIN)
{
    trainTool = new TrainSidebar(context);
    trainTool->hide();

    HomeWindow *t = new HomeWindow(context, "train", "train");
    controls->addWidget(t->controls());
    controls->setCurrentIndex(0);
    BlankStateTrainPage *b = new BlankStateTrainPage(context);

    setSidebar(trainTool->controls());
    setPage(t);
    setBlank(b);

    trainBottom = new TrainBottom(trainTool, this);
    setBottom(trainBottom);
    setHideBottomOnIdle(false);

    connect(this, SIGNAL(onSelectionChanged()), this, SLOT(onSelectionChanged()));
    connect(trainBottom, SIGNAL(autoHideChanged(bool)), this, SLOT(onAutoHideChanged(bool)));
}
int QLongLongValidator::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QValidator::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    
#ifndef QT_NO_PROPERTIES
     if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< qlonglong*>(_v) = bottom(); break;
        case 1: *reinterpret_cast< qlonglong*>(_v) = top(); break;
        }
        _id -= 2;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setBottom(*reinterpret_cast< qlonglong*>(_v)); break;
        case 1: setTop(*reinterpret_cast< qlonglong*>(_v)); break;
        }
        _id -= 2;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 2;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
예제 #27
0
파일: Box.hpp 프로젝트: 4ker/imgAnnotation
inline void Box<T>::setBottomRight(const Point<T> &p) { setRight(p.getX()); setBottom(p.getY()); }
예제 #28
0
/*!
    Set the bottom-left corner of the rectangle to \a p. May change
    the size, but will the never change the top-right corner of
    the rectangle.

    \sa bottomLeft(), moveBottomLeft(), setTopLeft(), setBottomRight(), setTopRight()
*/
void QRect::setBottomLeft( const QPoint &p )
{
    setLeft( p.x() );
    setBottom( p.y() );
}
예제 #29
0
/*!
    Set the bottom-right corner of the rectangle to \a p. May change
    the size, but will the never change the top-left corner of
    the rectangle.

    \sa bottomRight(), moveBottomRight(), setTopLeft(), setTopRight(), setBottomLeft()
*/
void QRect::setBottomRight( const QPoint &p )
{
    setRight( p.x() );
    setBottom( p.y() );
}
 void nullify()                  { setBottom(NULL); }