public Viewport(TvPoint point, int cols, int rows, int zindex) { Position = point; Columns = cols; Rows = rows; ZIndex = zindex; }
private void RepositionChildren(TvPoint displacement) { if (_thisComponent.Viewport != null) { foreach (var child in _childs.Components) { var childvp = child.Viewport; child.UpdateViewport(childvp.Translate(_thisComponent.Viewport.Position)); } } }
public void MoveTo(int left, int top) { if (!Visible) { ActionPending = VirtualConsoleCursorAction.Show; } if (Position.Left != left || Position.Top != top) { Position = new TvPoint(left, top); MovementPending = true; } }
private void RepositionChildren(TvPoint displacement) { if (_thisComponent.Viewport != null) { var layout = _thisComponent.State; if (layout.ItemsCount > 0) { for (var layoutIdx = 0; layoutIdx < layout.ItemsCount; layoutIdx++) { var height = Layout.GetRealSize(Layout[layoutIdx], _thisComponent.Viewport.Rows); var itemChilds = _childs.ComponentsForKey(layoutIdx); foreach (var childComponent in itemChilds) { var childvp = childComponent.Viewport; childComponent.UpdateViewport(_thisComponent.Viewport.TakeRows(height, height * layoutIdx), addIfNotExists: true); } } } } }
public IViewport Translate(TvPoint translation) { return(new DynamicViewport(_factory, _creator, _viewport.Translate(translation))); }
public IViewport MoveTo(TvPoint newPos) { return(new DynamicViewport(_factory, _creator, _viewport.MoveTo(newPos))); }
public VirtualConsoleCursor() { ActionPending = VirtualConsoleCursorAction.None; Position = new TvPoint(0, 0); }
public IViewport Translate(TvPoint translation) => new Viewport(Position + translation, Columns, Rows, ZIndex);
public IViewport MoveTo(TvPoint newPos) => new Viewport(newPos, Columns, Rows, ZIndex);
public Viewport(TvPoint point, int cols) : this(point, cols, 1, 0) { }