void setContainerPosition(float x, float y) { var stage = _targetElement.getStage(); if (stage == null) { return; } _container.pack(); float offsetX = _manager.offsetX, offsetY = _manager.offsetY, dist = _manager.edgeDistance; var point = _targetElement.localToStageCoordinates(new Vector2(x + offsetX - _container.getWidth() / 2, y - offsetY - _container.getHeight())); if (point.Y < dist) { point = _targetElement.localToStageCoordinates(new Vector2(x + offsetX, y + offsetY)); } if (point.X < dist) { point.X = dist; } if (point.X + _container.getWidth() > stage.getWidth() - dist) { point.X = stage.getWidth() - dist - _container.getWidth(); } if (point.Y + _container.getHeight() > stage.getHeight() - dist) { point.Y = stage.getHeight() - dist - _container.getHeight(); } _container.setPosition(point.X, point.Y); point = _targetElement.localToStageCoordinates(new Vector2(_targetElement.getWidth() / 2, _targetElement.getHeight() / 2)); point -= new Vector2(_container.getX(), _container.getY()); _container.setOrigin(point.X, point.Y); }
public void hide() { if (!listBox.isTouchable() || !hasParent()) { return; } listBox.setTouchable(Touchable.Disabled); if (stage != null) { if (_previousScrollFocus != null && _previousScrollFocus.getStage() == null) { _previousScrollFocus = null; } } _selectBox.onHide(this); }
public void hide() { if (!listBox.isTouchable() || !hasParent()) { return; } listBox.setTouchable(Touchable.Disabled); if (stage != null) { //stage.removeCaptureListener( hideListener ); if (_previousScrollFocus != null && _previousScrollFocus.getStage() == null) { _previousScrollFocus = null; } //var element = stage.getScrollFocus(); //if( element == null || isAscendantOf( element ) ) // stage.setScrollFocus( previousScrollFocus ); } //clearActions(); _selectBox.onHide(this); }