Esempio n. 1
0
void CTerrainData::setVertexHeight(int nCellX, int nCellY, float fHeight)
{
	if (isPointIn(nCellX,nCellY))
	{
		getCell(nCellX,nCellY)->fHeight = fHeight;
	}
}
Esempio n. 2
0
void CSceneData::setVertexColor(int x, int y, Color32 color)
{
	if (isPointIn(x,y))
	{
		getCell(x,y)->color = color;
	}
}
Esempio n. 3
0
void CSceneData::setVertexHeight(int x, int y, float fHeight)
{
	if (isPointIn(x,y))
	{
		getCell(x,y)->fHeight = fHeight;
	}
}
Esempio n. 4
0
void CTerrainData::setVertexColor(int nCellX, int nCellY, Color32 color)
{
	if (isPointIn(nCellX,nCellY))
	{
		getCell(nCellX,nCellY)->color = color;
	}
}
Esempio n. 5
0
Color32 CSceneData::getVertexColor(int x, int y)const
{
	if (isPointIn(x,y))
	{
		return getCell(x,y)->color;
	}
	return 0xFFFFFFFF;
}
Esempio n. 6
0
float CSceneData::getVertexHeight(int x, int y)const
{
	if (isPointIn(x,y))
	{
		return getCell(x,y)->fHeight;
	}
	return 0.0f;
}
Esempio n. 7
0
Color32 CTerrainData::getVertexColor(int nCellX, int nCellY)const
{
	if (isPointIn(nCellX,nCellY))
	{
		return getCell(nCellX,nCellY)->color;
	}
	return 0xFFFFFFFF;
}
Esempio n. 8
0
float CTerrainData::getVertexHeight(int nCellX, int nCellY)const
{
	if (isPointIn(nCellX,nCellY))
	{
		return getCell(nCellX,nCellY)->fHeight;
	}
	return 0.0f;
}
bool UIElement::mouseDown( app::MouseEvent event )
{	
	if (isPointIn(event.getPos()))
		_state = CLICK;
	else
		_state = NORMAL;
	return false;
}
Esempio n. 10
0
bool UIElement::mouseMove( app::MouseEvent event )
{
	if (isPointIn(event.getPos()))
		_state = OVER;
	else
		_state = NORMAL;
	return false;
}
Esempio n. 11
0
bool StGLSwitchTextured::tryClick(const StPointD_t& theCursorZo, const int& theMouseBtn, bool& isItemClicked) {
    if(!isVisible()) {
        return false; // nothing to see - nothing to click...
    }
    if(!isItemClicked && isPointIn(theCursorZo)) {
        setClicked(theMouseBtn, true);
        isItemClicked = true;
        return true;
    }
    return false;
}
Esempio n. 12
0
bool StGLRootWidget::tryClick(const StClickEvent& theEvent,
                              bool&               theIsItemClicked) {
    const StPointD_t aCursorBack = cursorZo;
    cursorZo = StPointD_t(theEvent.PointX, theEvent.PointY);
    if(isPointIn(cursorZo)) {
        setClicked(theEvent.Button, true);
    }
    const bool aResult = StGLWidget::tryClick(theEvent, theIsItemClicked);
    cursorZo = aCursorBack;
    return aResult;
}
Esempio n. 13
0
void CCtrlButton::onLButtonUp (CPoint pt, uint /*key*/) {
	if (disable) {
		if (_GetMainCtrl()->getCaptureCtrl() == shared_from_this()) {
			_Capture(false);
		}
		return;
	}
	_Capture(false);
	m_pushAndCapture = false;
	invalidate();

	assert (_GetTarget() != NULL);
	if (isPointIn(pt)) {
		_GetTarget()->onCommand(m_id, shared_from_this());
	}
}
Esempio n. 14
0
bool StGLWidget::tryClick(const StPointD_t& cursorZo, const int& mouseBtn, bool& isItemClicked) {
    if(!isVisible()) {
        return false; // nothing to see - nothing to click... (all children too!)
    }
    for(StGLWidget *child(myChildren.getLast()), *childActive(NULL); child != NULL;) {
        childActive = child;
        child = child->getPrev();
        childActive->tryClick(cursorZo, mouseBtn, isItemClicked);
    }
    if(!isItemClicked && isPointIn(cursorZo)) {
        setClicked(mouseBtn, true);
        isItemClicked = signals.onMouseClick(mouseBtn);
        return true;
    }
    return false;
}
Esempio n. 15
0
bool StGLSwitchTextured::tryUnClick(const StPointD_t& theCursorZo, const int& theMouseBtn, bool& isItemUnclicked) {
    if(!isVisible()) {
        return false; // nothing to see - nothing to click...
    }
    bool isSelfClicked = isClicked(theMouseBtn) && isPointIn(theCursorZo);
    setClicked(theMouseBtn, false);
    if(!isItemUnclicked && isSelfClicked) {
        isItemUnclicked = true;

        int32_t anActiveValue = myTrackValue->getValue();
        StGLRadioButtonTextured* aRadioBtn = NULL;
        for(StGLWidget* aChild = getChildren()->getStart(); aChild != NULL;) {
            /// TODO (Kirill Gavrilov#9) - adding children with another type is not allowed
            ///                            hovewer not protected thus this cast is not thread-safe!
            aRadioBtn = (StGLRadioButtonTextured* )aChild;
            aChild = aChild->getNext();

            if(anActiveValue == aRadioBtn->getValueOn()) {
                // switch to next
                while(aChild != NULL) {
                    aRadioBtn = (StGLRadioButtonTextured* )aChild;
                    if(!mySkipValues.contains(aRadioBtn->getValueOn())) {
                        myTrackValue->setValue(aRadioBtn->getValueOn());
                        break;
                    }
                    aChild = aChild->getNext();
                }
                if(aChild == NULL) {
                    // switch to first
                    aRadioBtn = (StGLRadioButtonTextured* )getChildren()->getStart();
                    myTrackValue->setValue(aRadioBtn->getValueOn());
                }
                break;
            }
        }
        return true;
    }
    return false;
}