void SetupDockSpaces(SpaceConcept spaceConcept) { //1. controller this.dockspaceController = new DockSpacesController(this, spaceConcept); //2. this.dockspaceController.LeftTopSpace.Content = boxLeftTop = CreateSpaceBox(SpaceName.LeftTop, leftTopColor); this.dockspaceController.RightTopSpace.Content = boxRightTop = CreateSpaceBox(SpaceName.RightTop, rightTopColor); this.dockspaceController.LeftBottomSpace.Content = boxLeftBottom = CreateSpaceBox(SpaceName.LeftBottom, leftBottomColor); this.dockspaceController.RightBottomSpace.Content = boxRightBottom = CreateSpaceBox(SpaceName.RightBottom, rightBottomColor); //3. this.dockspaceController.LeftSpace.Content = boxLeft = CreateSpaceBox(SpaceName.Left, leftColor); this.dockspaceController.TopSpace.Content = boxTop = CreateSpaceBox(SpaceName.Top, topColor); this.dockspaceController.RightSpace.Content = boxRight = CreateSpaceBox(SpaceName.Right, rightColor); this.dockspaceController.BottomSpace.Content = boxBottom = CreateSpaceBox(SpaceName.Bottom, bottomColor); this.dockspaceController.CenterSpace.Content = boxCentral = CreateSpaceBox(SpaceName.Center, centerColor); //-------------------------------- //left and right space expansion //dockspaceController.LeftSpaceVerticalExpansion = VerticalBoxExpansion.TopBottom; //dockspaceController.RightSpaceVerticalExpansion = VerticalBoxExpansion.TopBottom; dockspaceController.SetRightSpaceWidth(200); dockspaceController.SetLeftSpaceWidth(200); //------------------------------------------------------------------------------------ this.ninespaceGrippers = new NinespaceGrippers(this.dockspaceController); this.ninespaceGrippers.LeftGripper = gripperLeft = CreateGripper(gripperColor, false); this.ninespaceGrippers.RightGripper = gripperRight = CreateGripper(gripperColor, false); this.ninespaceGrippers.TopGripper = gripperTop = CreateGripper(gripperColor, true); this.ninespaceGrippers.BottomGripper = gripperBottom = CreateGripper(gripperColor, true); this.ninespaceGrippers.UpdateGripperPositions(); //------------------------------------------------------------------------------------ }
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 NinespaceBox(int w, int h, SpaceConcept spaceConcept) : base(w, h) { SetupDockSpaces(spaceConcept); }
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; } }