public void SetArrangeType(bool isVertical) { if (isVertical) { arrangeType = ArrangeType.Vertical; } else { arrangeType = ArrangeType.Horizontal; } }
public static int[] ArrangeTestArray(ArrangeType type) { const int NIL = -1; var array = Enumerable.Repeat(NIL, 100).ToArray(); if (type == ArrangeType.IsInputted) { Program.Insert(array, 1); Program.Insert(array, 2); Program.Insert(array, 4); Program.Insert(array, 7); Program.Insert(array, 5); } return(array); }
// 付箋を整列させる public static void ArrangeFusen(ArrangeType arrangeType, FusenForm fusen) { Rectangle rc = Screen.GetBounds(fusen); Point pt = new Point(rc.Left, rc.Top); if (arrangeType == ArrangeType.ScreenRight) { // 右端に整列(整列対象メンバーのみ)の準備 int maxWidth = fusenList.Max((a) => { return(a.ArrangeMember ? a.Width : 0); }); pt.X = rc.Right - maxWidth; } else if (arrangeType == ArrangeType.Fusen && fusen != null) { pt.X = fusen.Left; pt.Y = fusen.Bottom; } foreach (FusenForm ff in fusenList) { if (arrangeType == ArrangeType.Fusen && fusen == ff) { continue; } if (!ff.ArrangeMember) { continue; } ff.Left = pt.X; ff.Top = pt.Y; pt.Y = ff.Bottom; if (pt.Y >= rc.Bottom) { break; // 画面下にはみ出たら終わり } } }
public void ArrangeSelectedControls(ArrangeType direction) { int left = 0; int right = 0; bool found = false; int i = 0; while (i < _xmlControlList.Count) { if (_xmlControlList[i].Selected) { if (!found) { left = _xmlControlList[i].ClientRect.X; right = _xmlControlList[i].ClientRect.X + _xmlControlList[i].ClientRect.Width; found = true; } Rectangle r = _xmlControlList[i].ClientRect; switch (direction) { case ArrangeType.Left: r.X = left; break; case ArrangeType.Right: r.X = right - _xmlControlList[i].ClientRect.Width; break; } _xmlControlList[i].ClientRect = r; } i++; } OnSizeChanged(this); }
public Arrange(GameObject target, ArrangeType type, List <Container> containers, int repeatCount) : base(target) { _type = type; _containers = containers; _repeatCount = repeatCount; }