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

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

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

            Position   = position;
            label.Text = text;

            Size = new ControlSize(125, 65, SizeType.Fixed);
        }
Esempio 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;
        }
Esempio n. 10
0
 private static String sizeToString(ControlSize val)
 {
     if (val == ControlSize.Bit16)
     {
         return("16Bit");
     }
     else
     {
         return("8Bit");
     }
 }
Esempio 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);
        }
Esempio 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;
 }
Esempio 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;
 }
Esempio 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());
            }
Esempio 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);
        }
Esempio 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;
        }
Esempio 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);
        }
Esempio 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;
        }
Esempio n. 19
0
 public IMenuItemSize NormalSize()
 {
     size = ControlSize.normal;
     return this;
 }
Esempio n. 20
0
 public IToggleButtonImage Normal()
 {
     size = ControlSize.normal;
     return(this);
 }
Esempio n. 21
0
 public IToggleButtonImage Normal()
 {
     size = ControlSize.normal;
     return this;
 }
Esempio n. 22
0
 public IToggleButtonImage Large()
 {
     size = ControlSize.large;
     return(this);
 }
Esempio n. 23
0
 public IButtonImage NormalSize()
 {
     size = ControlSize.normal;
     return(this);
 }
Esempio n. 24
0
 public IMenuUnsizeItems ItemLargeSize()
 {
     itemSize = ControlSize.large;
     return(this);
 }
Esempio n. 25
0
 public ISplitButtonButton LargeSize()
 {
     size = ControlSize.large;
     return(this);
 }
Esempio n. 26
0
 private static String sizeToString(ControlSize val)
 {
     if (val == ControlSize.Bit16) { return "16Bit"; }
     else { return "8Bit"; }
 }
Esempio n. 27
0
 public IGalleryImage LargeSize()
 {
     size = ControlSize.large;
     return this;
 }
Esempio n. 28
0
 public IMenuItemSize LargeSize()
 {
     size = ControlSize.large;
     return this;
 }
Esempio n. 29
0
 public IGalleryImage NormalSize()
 {
     size = ControlSize.normal;
     return this;
 }
Esempio n. 30
0
 public IButtonImage LargeSize()
 {
     size = ControlSize.large;
     return this;
 }
Esempio n. 31
0
 public IButtonImage NormalSize()
 {
     size = ControlSize.normal;
     return this;
 }
Esempio n. 32
0
 public IMenuUnsizeItems ItemLargeSize()
 {
     itemSize = ControlSize.large;
     return this;
 }
Esempio n. 33
0
 public IMenuUnsizeItems ItemNormalSize()
 {
     itemSize = ControlSize.normal;
     return this;
 }
Esempio n. 34
0
 public ISplitButtonButton NormalSize()
 {
     size = ControlSize.normal;
     return(this);
 }
Esempio n. 35
0
 public IMenuItemSize LargeSize()
 {
     size = ControlSize.large;
     return(this);
 }
Esempio 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();
 }
Esempio n. 37
0
 public IMenuItemSize NormalSize()
 {
     size = ControlSize.normal;
     return(this);
 }
Esempio n. 38
0
 public IButtonImage LargeSize()
 {
     size = ControlSize.large;
     return(this);
 }
Esempio 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);
 }
Esempio n. 40
0
 public IGalleryImage LargeSize()
 {
     size = ControlSize.large;
     return(this);
 }
Esempio n. 41
0
 public IGalleryImage NormalSize()
 {
     size = ControlSize.normal;
     return(this);
 }
Esempio n. 42
0
 public IMenuUnsizeItems ItemNormalSize()
 {
     itemSize = ControlSize.normal;
     return(this);
 }
Esempio n. 43
0
 public IToggleButtonImage Large()
 {
     size = ControlSize.large;
     return this;
 }