コード例 #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;
        }
コード例 #2
0
        public Button()
            : base()
        {
            BaseInitialize();

            Size = new ControlSize(125, 65, SizeType.Fixed);
        }
コード例 #3
0
 public Button()
 {
     ElementName = "button";
     Id = new ElementId();
     size = ControlSize.normal;
     imageVisible = false;
     showLabel = false;
 }
コード例 #4
0
 public ToggleButton()
 {
     ElementName  = "toggleButton";
     Id           = new ElementId();
     imageVisible = false;
     size         = ControlSize.normal;
     showLabel    = true;
 }
コード例 #5
0
ファイル: Button.cs プロジェクト: lucaji/AddinX.Ribbon
 public Button()
 {
     ElementName  = "button";
     Id           = new ElementId();
     size         = ControlSize.normal;
     imageVisible = false;
     showLabel    = false;
 }
コード例 #6
0
 public ToggleButton()
 {
     ElementName = "toggleButton";
     Id = new ElementId();
     imageVisible = false;
     size = ControlSize.normal;
     showLabel = true;
 }
コード例 #7
0
        public WidgetWindow(KhvGame khvGame)
            : base(khvGame)
        {
            size = new ControlSize(khvGame.GraphicsDeviceManager.PreferredBackBufferWidth,
                                   khvGame.GraphicsDeviceManager.PreferredBackBufferHeight,
                                   Khv.Gui.Components.SizeType.Fixed);

            Initialize();
        }
コード例 #8
0
        public Button(ControlPosition position, string text)
            : base()
        {
            BaseInitialize();

            Position   = position;
            label.Text = text;

            Size = new ControlSize(125, 65, SizeType.Fixed);
        }
コード例 #9
0
        public Button(ControlPosition position, Index focusIndex, ControlSize size, string text = "")
            : base()
        {
            BaseInitialize();

            Position        = position;
            this.FocusIndex = focusIndex;
            Size            = size;
            label.Text      = text;
        }
コード例 #10
0
 private static String sizeToString(ControlSize val)
 {
     if (val == ControlSize.Bit16)
     {
         return("16Bit");
     }
     else
     {
         return("8Bit");
     }
 }
コード例 #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);
        }
コード例 #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;
 }
コード例 #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;
 }
コード例 #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());
            }
コード例 #15
0
ファイル: GuiHelper.cs プロジェクト: siquel/FarmGameProject
        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);
        }
コード例 #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;
        }
コード例 #17
0
ファイル: GuiHelper.cs プロジェクト: siquel/FarmGameProject
        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);
        }
コード例 #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;
        }
コード例 #19
0
 public IMenuItemSize NormalSize()
 {
     size = ControlSize.normal;
     return this;
 }
コード例 #20
0
 public IToggleButtonImage Normal()
 {
     size = ControlSize.normal;
     return(this);
 }
コード例 #21
0
 public IToggleButtonImage Normal()
 {
     size = ControlSize.normal;
     return this;
 }
コード例 #22
0
 public IToggleButtonImage Large()
 {
     size = ControlSize.large;
     return(this);
 }
コード例 #23
0
ファイル: Button.cs プロジェクト: lucaji/AddinX.Ribbon
 public IButtonImage NormalSize()
 {
     size = ControlSize.normal;
     return(this);
 }
コード例 #24
0
 public IMenuUnsizeItems ItemLargeSize()
 {
     itemSize = ControlSize.large;
     return(this);
 }
コード例 #25
0
ファイル: SplitButton.cs プロジェクト: esowers/AddinX.Ribbon
 public ISplitButtonButton LargeSize()
 {
     size = ControlSize.large;
     return(this);
 }
コード例 #26
0
ファイル: IO.cs プロジェクト: brendan-w/DDL-Creator
 private static String sizeToString(ControlSize val)
 {
     if (val == ControlSize.Bit16) { return "16Bit"; }
     else { return "8Bit"; }
 }
コード例 #27
0
 public IGalleryImage LargeSize()
 {
     size = ControlSize.large;
     return this;
 }
コード例 #28
0
 public IMenuItemSize LargeSize()
 {
     size = ControlSize.large;
     return this;
 }
コード例 #29
0
 public IGalleryImage NormalSize()
 {
     size = ControlSize.normal;
     return this;
 }
コード例 #30
0
 public IButtonImage LargeSize()
 {
     size = ControlSize.large;
     return this;
 }
コード例 #31
0
 public IButtonImage NormalSize()
 {
     size = ControlSize.normal;
     return this;
 }
コード例 #32
0
 public IMenuUnsizeItems ItemLargeSize()
 {
     itemSize = ControlSize.large;
     return this;
 }
コード例 #33
0
 public IMenuUnsizeItems ItemNormalSize()
 {
     itemSize = ControlSize.normal;
     return this;
 }
コード例 #34
0
ファイル: SplitButton.cs プロジェクト: esowers/AddinX.Ribbon
 public ISplitButtonButton NormalSize()
 {
     size = ControlSize.normal;
     return(this);
 }
コード例 #35
0
 public IMenuItemSize LargeSize()
 {
     size = ControlSize.large;
     return(this);
 }
コード例 #36
0
ファイル: IO.cs プロジェクト: brendan-w/DDL-Creator
 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();
 }
コード例 #37
0
 public IMenuItemSize NormalSize()
 {
     size = ControlSize.normal;
     return(this);
 }
コード例 #38
0
ファイル: Button.cs プロジェクト: lucaji/AddinX.Ribbon
 public IButtonImage LargeSize()
 {
     size = ControlSize.large;
     return(this);
 }
コード例 #39
0
ファイル: LayoutPanel.cs プロジェクト: siquel/FarmGameProject
 /// <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);
 }
コード例 #40
0
 public IGalleryImage LargeSize()
 {
     size = ControlSize.large;
     return(this);
 }
コード例 #41
0
 public IGalleryImage NormalSize()
 {
     size = ControlSize.normal;
     return(this);
 }
コード例 #42
0
 public IMenuUnsizeItems ItemNormalSize()
 {
     itemSize = ControlSize.normal;
     return(this);
 }
コード例 #43
0
 public IToggleButtonImage Large()
 {
     size = ControlSize.large;
     return this;
 }