public override void SetSize(int width, int height) { base.SetSize(width, height); if (this.targetUI != null) { this.TargetBox = this.targetUI; } }
public void SetSize(int w, int h) { UI.UIBox box = uiElem as UI.UIBox; if (box == null) { return; } box.SetSize(w, h); }
public void SetLocation(int left, int top) { UI.UIBox box = uiElem as UI.UIBox; if (box == null) { return; } box.SetLocation(left, top); }
public FreeSpacesController(UIBox owner) : base(owner, SpaceConcept.NineSpaceFree) { spaces[L] = InitSpace(SpaceName.Left); spaces[R] = InitSpace(SpaceName.Right); spaces[T] = InitSpace(SpaceName.Top); spaces[B] = InitSpace(SpaceName.Bottom); spaces[C] = InitSpace(SpaceName.Center); spaces[LT] = InitSpace(SpaceName.LeftTop); spaces[RT] = InitSpace(SpaceName.RightTop); spaces[RB] = InitSpace(SpaceName.RightBottom); spaces[LB] = InitSpace(SpaceName.LeftBottom); }
public NinespaceController(UIBox owner, SpaceConcept initConcept) { this.myOwner = owner; this.dockSpaceConcept = initConcept; switch (initConcept) { case SpaceConcept.NineSpaceFree: case SpaceConcept.NineSpace: { spaces = new SpacePart[9]; } break; default: { spaces = new SpacePart[5]; } break; } this.sizeH = owner.Height; this.sizeW = owner.Width; }
public void UpdateControllerBoxes(LayoutFarm.UI.UIBox box) { //move controller here controllerBox1.SetLocationAndSize(box.Left - 5, box.Top - 5, box.Width + 10, box.Height + 10); controllerBox1.Visible = true; controllerBox1.TargetBox = box; { //left-top UIControllerBox ctrlBox = _boxLeftTop; ctrlBox.SetLocationAndSize(box.Left - 5, box.Top - 5, 5, 5); ctrlBox.TargetBox = box; ctrlBox.Visible = true; } { //right-top UIControllerBox ctrlBox = _boxRightTop; ctrlBox.SetLocationAndSize(box.Left + box.Width, box.Top - 5, 5, 5); ctrlBox.TargetBox = box; ctrlBox.Visible = true; } { //left-bottom UIControllerBox ctrlBox = _boxLeftBottom; ctrlBox.SetLocationAndSize(box.Left - 5, box.Top + box.Height, 5, 5); ctrlBox.TargetBox = box; ctrlBox.Visible = true; } { //right-bottom UIControllerBox ctrlBox = _boxRightBottom; ctrlBox.SetLocationAndSize(box.Left + box.Width, box.Top + box.Height, 5, 5); ctrlBox.TargetBox = box; ctrlBox.Visible = true; } }
public DzSetBoundsAction(UIBox box, Rectangle oldBounds, Rectangle newBounds) { this.dzBox = box; this.oldBounds = oldBounds; this.newBounds = newBounds; }
public void HistoryRecordDzElementNewBounds(UIBox dzBox, Rectangle oldRect, Rectangle newRect) { this.dzCommandHistory.AddAction(new DzSetBoundsAction(dzBox, oldRect, newRect)); }
//----------------------------------------------------------------------------------------------- public void HistoryRecordDzElementNewPosition(UIBox dzBox, Point oldPoint, Point newPoint) { this.dzCommandHistory.AddAction(new DzSetLocationAction(dzBox, oldPoint, newPoint)); }
public UIHolderBox WrapWithHolderBox(int x, int y, UIBox uibox) { //create holder ui var box1 = new UIHolderBox(uibox.Width + 10, uibox.Height + 10); uibox.SetLocation(5, 5); box1.AddChild(uibox); box1.SetLocation(x, y); box1.TargetBox = uibox; SetupActiveBoxProperties(box1); userBoxes.Add(box1); return box1; }
public UIHolderBox AddExternalControl(int x, int y, UIBox uibox) { //create holder ui var box1 = new UIHolderBox(uibox.Width + 10, uibox.Height + 10); uibox.SetLocation(5, 5); box1.AddChild(uibox); box1.SetLocation(x, y); box1.TargetBox = uibox; SetupActiveBoxProperties(box1); viewport.AddContent(box1); userBoxes.Add(box1); return box1; }
public DzSetLocationAction(UIBox box, Point oldPoint, Point newPoint) { this.dzBox = box; this.oldPoint = oldPoint; this.newPoint = newPoint; }
public void ReleaseTarget() { this.TargetBox = null; this.MasterSelectionSet = null; }
public DockSpacesController(UIBox owner, SpaceConcept initConcept) : base(owner, initConcept) { this.myOwner = owner; switch (initConcept) { case SpaceConcept.TwoSpaceHorizontal: //top-bottom { spaces[L] = InitSpace(SpaceName.Left); spaces[R] = InitSpace(SpaceName.Right); } break; case SpaceConcept.TwoSpaceVertical: //left-right { spaces[T] = InitSpace(SpaceName.Top); spaces[B] = InitSpace(SpaceName.Bottom); } break; case SpaceConcept.ThreeSpaceHorizontal: { //left-center-right spaces[L] = InitSpace(SpaceName.Left); spaces[C] = InitSpace(SpaceName.Center); spaces[R] = InitSpace(SpaceName.Right); } break; case SpaceConcept.ThreeSpaceVertical: { //top-center-bottom spaces[T] = InitSpace(SpaceName.Top); spaces[C] = InitSpace(SpaceName.Center); spaces[B] = InitSpace(SpaceName.Bottom); } break; case SpaceConcept.FourSpace: { spaces[FOURSPACE_LT] = InitSpace(SpaceName.LeftTop); spaces[FOURSPACE_RT] = InitSpace(SpaceName.RightTop); spaces[FOURSPACE_RB] = InitSpace(SpaceName.RightBottom); spaces[FOURSPACE_LB] = InitSpace(SpaceName.LeftBottom); } break; case SpaceConcept.FiveSpace: { spaces[L] = InitSpace(SpaceName.Left); spaces[R] = InitSpace(SpaceName.Right); spaces[T] = InitSpace(SpaceName.Top); spaces[B] = InitSpace(SpaceName.Bottom); spaces[C] = InitSpace(SpaceName.Center); } break; case SpaceConcept.NineSpace: default: { spaces[L] = InitSpace(SpaceName.Left); spaces[R] = InitSpace(SpaceName.Right); spaces[T] = InitSpace(SpaceName.Top); spaces[B] = InitSpace(SpaceName.Bottom); spaces[C] = InitSpace(SpaceName.Center); spaces[LT] = InitSpace(SpaceName.LeftTop); spaces[RT] = InitSpace(SpaceName.RightTop); spaces[RB] = InitSpace(SpaceName.RightBottom); spaces[LB] = InitSpace(SpaceName.LeftBottom); } break; } }
public static void WriteElement(DzBoxSerializer writer, UIBox uiElement, string elemName) { uiElement.Walk(writer); //writer.BeginElement(elemName); ////collect bounds and attrs //writer.AddAttribute("left", uiElement.Left.ToString()); //writer.AddAttribute("top", uiElement.Top.ToString()); //writer.AddAttribute("width", uiElement.Width.ToString()); //writer.AddAttribute("height", uiElement.Height.ToString()); ////------------------------------------------------------- ////content //writer.EndElement(); }
public static void WriteCommon(DzBoxSerializer writer, UIBox uiElement) { //find element type //var elemType = uiElement.GetType(); //writer.BeginElement(elemName); ////collect bounds and attrs //writer.AddAttribute("left", uiElement.Left.ToString()); //writer.AddAttribute("top", uiElement.Top.ToString()); //writer.AddAttribute("width", uiElement.Width.ToString()); //writer.AddAttribute("height", uiElement.Height.ToString()); ////------------------------------------------------------- ////content //writer.EndElement(); }