Ejemplo n.º 1
0
        /// <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;
        }
Ejemplo n.º 2
0
        public Button()
            : base()
        {
            BaseInitialize();

            Size = new ControlSize(125, 65, SizeType.Fixed);
        }
Ejemplo n.º 3
0
 public Button()
 {
     ElementName = "button";
     Id = new ElementId();
     size = ControlSize.normal;
     imageVisible = false;
     showLabel = false;
 }
Ejemplo n.º 4
0
 public ToggleButton()
 {
     ElementName  = "toggleButton";
     Id           = new ElementId();
     imageVisible = false;
     size         = ControlSize.normal;
     showLabel    = true;
 }
Ejemplo n.º 5
0
 public Button()
 {
     ElementName  = "button";
     Id           = new ElementId();
     size         = ControlSize.normal;
     imageVisible = false;
     showLabel    = false;
 }
Ejemplo n.º 6
0
 public ToggleButton()
 {
     ElementName = "toggleButton";
     Id = new ElementId();
     imageVisible = false;
     size = ControlSize.normal;
     showLabel = true;
 }
Ejemplo n.º 7
0
        public WidgetWindow(KhvGame khvGame)
            : base(khvGame)
        {
            size = new ControlSize(khvGame.GraphicsDeviceManager.PreferredBackBufferWidth,
                                   khvGame.GraphicsDeviceManager.PreferredBackBufferHeight,
                                   Khv.Gui.Components.SizeType.Fixed);

            Initialize();
        }
Ejemplo n.º 8
0
        public Button(ControlPosition position, string text)
            : base()
        {
            BaseInitialize();

            Position   = position;
            label.Text = text;

            Size = new ControlSize(125, 65, SizeType.Fixed);
        }
Ejemplo n.º 9
0
        public Button(ControlPosition position, Index focusIndex, ControlSize size, string text = "")
            : base()
        {
            BaseInitialize();

            Position        = position;
            this.FocusIndex = focusIndex;
            Size            = size;
            label.Text      = text;
        }
Ejemplo n.º 10
0
 private static String sizeToString(ControlSize val)
 {
     if (val == ControlSize.Bit16)
     {
         return("16Bit");
     }
     else
     {
         return("8Bit");
     }
 }
Ejemplo n.º 11
0
        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);
        }
Ejemplo n.º 12
0
 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;
 }
Ejemplo n.º 13
0
 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;
 }
Ejemplo n.º 14
0
            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());
            }
Ejemplo n.º 15
0
        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);
        }
Ejemplo n.º 16
0
        /// <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;
        }
Ejemplo n.º 17
0
        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);
        }
Ejemplo n.º 18
0
        /// <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;
        }
Ejemplo n.º 19
0
 public IMenuItemSize NormalSize()
 {
     size = ControlSize.normal;
     return this;
 }
Ejemplo n.º 20
0
 public IToggleButtonImage Normal()
 {
     size = ControlSize.normal;
     return(this);
 }
Ejemplo n.º 21
0
 public IToggleButtonImage Normal()
 {
     size = ControlSize.normal;
     return this;
 }
Ejemplo n.º 22
0
 public IToggleButtonImage Large()
 {
     size = ControlSize.large;
     return(this);
 }
Ejemplo n.º 23
0
 public IButtonImage NormalSize()
 {
     size = ControlSize.normal;
     return(this);
 }
Ejemplo n.º 24
0
 public IMenuUnsizeItems ItemLargeSize()
 {
     itemSize = ControlSize.large;
     return(this);
 }
Ejemplo n.º 25
0
 public ISplitButtonButton LargeSize()
 {
     size = ControlSize.large;
     return(this);
 }
Ejemplo n.º 26
0
 private static String sizeToString(ControlSize val)
 {
     if (val == ControlSize.Bit16) { return "16Bit"; }
     else { return "8Bit"; }
 }
Ejemplo n.º 27
0
 public IGalleryImage LargeSize()
 {
     size = ControlSize.large;
     return this;
 }
Ejemplo n.º 28
0
 public IMenuItemSize LargeSize()
 {
     size = ControlSize.large;
     return this;
 }
Ejemplo n.º 29
0
 public IGalleryImage NormalSize()
 {
     size = ControlSize.normal;
     return this;
 }
Ejemplo n.º 30
0
 public IButtonImage LargeSize()
 {
     size = ControlSize.large;
     return this;
 }
Ejemplo n.º 31
0
 public IButtonImage NormalSize()
 {
     size = ControlSize.normal;
     return this;
 }
Ejemplo n.º 32
0
 public IMenuUnsizeItems ItemLargeSize()
 {
     itemSize = ControlSize.large;
     return this;
 }
Ejemplo n.º 33
0
 public IMenuUnsizeItems ItemNormalSize()
 {
     itemSize = ControlSize.normal;
     return this;
 }
Ejemplo n.º 34
0
 public ISplitButtonButton NormalSize()
 {
     size = ControlSize.normal;
     return(this);
 }
Ejemplo n.º 35
0
 public IMenuItemSize LargeSize()
 {
     size = ControlSize.large;
     return(this);
 }
Ejemplo n.º 36
0
 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();
 }
Ejemplo n.º 37
0
 public IMenuItemSize NormalSize()
 {
     size = ControlSize.normal;
     return(this);
 }
Ejemplo n.º 38
0
 public IButtonImage LargeSize()
 {
     size = ControlSize.large;
     return(this);
 }
Ejemplo n.º 39
0
 /// <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);
 }
Ejemplo n.º 40
0
 public IGalleryImage LargeSize()
 {
     size = ControlSize.large;
     return(this);
 }
Ejemplo n.º 41
0
 public IGalleryImage NormalSize()
 {
     size = ControlSize.normal;
     return(this);
 }
Ejemplo n.º 42
0
 public IMenuUnsizeItems ItemNormalSize()
 {
     itemSize = ControlSize.normal;
     return(this);
 }
Ejemplo n.º 43
0
 public IToggleButtonImage Large()
 {
     size = ControlSize.large;
     return this;
 }