void CTerrainData::setVertexHeight(int nCellX, int nCellY, float fHeight) { if (isPointIn(nCellX,nCellY)) { getCell(nCellX,nCellY)->fHeight = fHeight; } }
void CSceneData::setVertexColor(int x, int y, Color32 color) { if (isPointIn(x,y)) { getCell(x,y)->color = color; } }
void CSceneData::setVertexHeight(int x, int y, float fHeight) { if (isPointIn(x,y)) { getCell(x,y)->fHeight = fHeight; } }
void CTerrainData::setVertexColor(int nCellX, int nCellY, Color32 color) { if (isPointIn(nCellX,nCellY)) { getCell(nCellX,nCellY)->color = color; } }
Color32 CSceneData::getVertexColor(int x, int y)const { if (isPointIn(x,y)) { return getCell(x,y)->color; } return 0xFFFFFFFF; }
float CSceneData::getVertexHeight(int x, int y)const { if (isPointIn(x,y)) { return getCell(x,y)->fHeight; } return 0.0f; }
Color32 CTerrainData::getVertexColor(int nCellX, int nCellY)const { if (isPointIn(nCellX,nCellY)) { return getCell(nCellX,nCellY)->color; } return 0xFFFFFFFF; }
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; }
bool UIElement::mouseMove( app::MouseEvent event ) { if (isPointIn(event.getPos())) _state = OVER; else _state = NORMAL; return false; }
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; }
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; }
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()); } }
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; }
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; }