/// <summary> /// Asettelee alakomponentin oikealle paikalle /// </summary> /// <param name="control"></param> /// <param name="constraint"></param> private void DownConstraint(Control control, BorderLayoutConstraint constraint) { Vector2 position = new Vector2(); position.Y = container.Size.Height - control.Size.Height; if (slots.ContainsKey(left.Direction)) { Control leftArea = slots[left.Direction]; position.X = leftArea.Size.Width; } ControlSize size = new ControlSize(container.Size.Width - (int)position.X, control.Size.Height); if (slots.ContainsKey(right.Direction)) { Control rightArea = slots[right.Direction]; ControlSize temp = new ControlSize(size.Width - rightArea.Size.Width, size.Height); size = temp; } control.Size = size; control.Position.Relative = position; slots[constraint.Direction] = control; }
public Button() : base() { BaseInitialize(); Size = new ControlSize(125, 65, SizeType.Fixed); }
public Button() { ElementName = "button"; Id = new ElementId(); size = ControlSize.normal; imageVisible = false; showLabel = false; }
public ToggleButton() { ElementName = "toggleButton"; Id = new ElementId(); imageVisible = false; size = ControlSize.normal; showLabel = true; }
public WidgetWindow(KhvGame khvGame) : base(khvGame) { size = new ControlSize(khvGame.GraphicsDeviceManager.PreferredBackBufferWidth, khvGame.GraphicsDeviceManager.PreferredBackBufferHeight, Khv.Gui.Components.SizeType.Fixed); Initialize(); }
public Button(ControlPosition position, string text) : base() { BaseInitialize(); Position = position; label.Text = text; Size = new ControlSize(125, 65, SizeType.Fixed); }
public Button(ControlPosition position, Index focusIndex, ControlSize size, string text = "") : base() { BaseInitialize(); Position = position; this.FocusIndex = focusIndex; Size = size; label.Text = text; }
private static String sizeToString(ControlSize val) { if (val == ControlSize.Bit16) { return("16Bit"); } else { return("8Bit"); } }
public Button(ControlPosition position, Index focusIndex, string text = "") : base() { BaseInitialize(); Position = position; this.FocusIndex = focusIndex; label.Text = text; Size = new ControlSize(125, 65, SizeType.Fixed); }
public Gallery() { data = new Items(); ElementName = "gallery"; size = ControlSize.normal; Id = new ElementId(); controls = new Controls(); imageVisible = false; gallerySize = 7; itemHeight = 0; itemWidth = 0; rows = -1; cols = -1; }
private bool getSIZE(String line) { String[] options = { "8bit", "16bit" }; KeyWord keyValue = getKey(line, options); switch (keyValue.index) { case 0: sizeValue = ControlSize.Bit8; break; case 1: sizeValue = ControlSize.Bit16; break; } return(keyValue.found()); }
public static Vector2 CalculateVerticalPoint(ControlPosition currentPoint, ControlSize targetSize, ControlSize parentSize, ControlPosition parentPosition, VerticalAlingment alingment) { Vector2 results = Vector2.Zero; switch (alingment) { case VerticalAlingment.Center: results = new Vector2(currentPoint.Relative.X, parentSize.Height / 2 - targetSize.Height / 2); break; case VerticalAlingment.Top: results = new Vector2(currentPoint.Relative.X, 0); break; case VerticalAlingment.Bottom: results = new Vector2(currentPoint.Relative.X, parentSize.Height - targetSize.Height); break; } return(results); }
/// <summary> /// Asettelee vasemman komponentin vasemmalle /// </summary> /// <param name="control"></param> /// <param name="constraint"></param> private void LeftConstraint(Control control, BorderLayoutConstraint constraint) { Vector2 position = new Vector2(); if (slots.ContainsKey(up.Direction)) { Control upArea = slots[up.Direction]; position.Y = upArea.Size.Height; } ControlSize size = new ControlSize(control.Size.Width, container.Size.Height - (int)position.Y); if (slots.ContainsKey(down.Direction)) { Control downArea = slots[down.Direction]; size = new ControlSize(size.Width, container.Size.Width - ((int)position.Y - downArea.Size.Height)); } control.Position.Relative = position; control.Size = size; slots[constraint.Direction] = control; }
public static Vector2 CalulateHorizontalPoint(ControlPosition currentPoint, ControlSize targetSize, ControlSize parentSize, ControlPosition parentPosition, HorizontalAlingment alingment) { Vector2 results = Vector2.Zero; switch (alingment) { case HorizontalAlingment.Right: results = new Vector2((parentPosition.Relative.X + parentSize.Width) - targetSize.Width, currentPoint.Relative.Y); break; case HorizontalAlingment.Left: results = new Vector2(parentPosition.Relative.X, currentPoint.Relative.Y); break; case HorizontalAlingment.Center: results = new Vector2(parentSize.Width / 2 - targetSize.Width / 2, currentPoint.Relative.Y); break; } return(results); }
/// <summary> /// Asettaa keskikomponentin keskelle /// </summary> /// <param name="c"></param> /// <param name="b"></param> private void CenterConstraint(Control c, BorderLayoutConstraint b) { Vector2 position = new Vector2(); if (slots.ContainsKey(left.Direction)) { Control leftArea = slots[left.Direction]; position.X = leftArea.Position.Relative.X + leftArea.Size.Width; } if (slots.ContainsKey(up.Direction)) { Control upArea = slots[up.Direction]; position.Y = (int)upArea.Position.Relative.Y + upArea.Size.Height; } ControlSize size = new ControlSize(container.Size.Width - (int)position.X, container.Size.Height - (int)position.Y, SizeType.Fixed); if (slots.ContainsKey(right.Direction)) { Control rightArea = slots[right.Direction]; ControlSize temp = new ControlSize(size.Width - rightArea.Size.Width, size.Height, SizeType.Fixed); size = temp; } if (slots.ContainsKey(down.Direction)) { Control downArea = slots[down.Direction]; ControlSize temp = new ControlSize(size.Width, size.Height - downArea.Size.Height, SizeType.Fixed); size = temp; } c.Position.Relative = position; c.Size = size; slots[b.Direction] = c; }
public IMenuItemSize NormalSize() { size = ControlSize.normal; return this; }
public IToggleButtonImage Normal() { size = ControlSize.normal; return(this); }
public IToggleButtonImage Normal() { size = ControlSize.normal; return this; }
public IToggleButtonImage Large() { size = ControlSize.large; return(this); }
public IButtonImage NormalSize() { size = ControlSize.normal; return(this); }
public IMenuUnsizeItems ItemLargeSize() { itemSize = ControlSize.large; return(this); }
public ISplitButtonButton LargeSize() { size = ControlSize.large; return(this); }
private static String sizeToString(ControlSize val) { if (val == ControlSize.Bit16) { return "16Bit"; } else { return "8Bit"; } }
public IGalleryImage LargeSize() { size = ControlSize.large; return this; }
public IMenuItemSize LargeSize() { size = ControlSize.large; return this; }
public IGalleryImage NormalSize() { size = ControlSize.normal; return this; }
public IButtonImage LargeSize() { size = ControlSize.large; return this; }
public IButtonImage NormalSize() { size = ControlSize.normal; return this; }
public IMenuUnsizeItems ItemLargeSize() { itemSize = ControlSize.large; return this; }
public IMenuUnsizeItems ItemNormalSize() { itemSize = ControlSize.normal; return this; }
public ISplitButtonButton NormalSize() { size = ControlSize.normal; return(this); }
public IMenuItemSize LargeSize() { size = ControlSize.large; return(this); }
private bool getSIZE(String line) { String[] options = { "8bit", "16bit" }; KeyWord keyValue = getKey(line, options); switch (keyValue.index) { case 0: sizeValue = ControlSize.Bit8; break; case 1: sizeValue = ControlSize.Bit16; break; } return keyValue.found(); }
public IMenuItemSize NormalSize() { size = ControlSize.normal; return(this); }
public IButtonImage LargeSize() { size = ControlSize.large; return(this); }
/// <summary> /// Katsoo pitääkö valitoida layout koon perusteella. /// </summary> /// <param name="newSize"></param> /// <param name="oldSize"></param> /// <returns></returns> private bool NeedsToBeValidated(ControlSize newSize, ControlSize oldSize) { return(newSize.Width != oldSize.Width || newSize.Height != oldSize.Height); }
public IGalleryImage LargeSize() { size = ControlSize.large; return(this); }
public IGalleryImage NormalSize() { size = ControlSize.normal; return(this); }
public IMenuUnsizeItems ItemNormalSize() { itemSize = ControlSize.normal; return(this); }
public IToggleButtonImage Large() { size = ControlSize.large; return this; }