示例#1
0
        private void LayoutDropDown()
        {
            List <GuanacoListItem> .Enumerator enumerator;
            int num2 = this.ItemMaximumWidth() + 0x16;
            int num  = 0x16;

            this.Pivot = (PointF)GH_Convert.ToPoint(this.Pivot);
            RectangleF ef2 = new RectangleF(this.Pivot.X, this.Pivot.Y, (float)num2, (float)num);

            this.Bounds = ef2;
            GuanacoListItem firstSelectedItem = this.Owner.FirstSelectedItem;

            enumerator = this.Owner.ListItems.GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    GuanacoListItem current = enumerator.Current;

                    if (current == firstSelectedItem)
                    {
                        SetDropdownBounds(current, this.Bounds);
                    }
                    else
                    {
                        SetEmptyBounds(current, this.Bounds);
                    }
                }
            }
            finally
            {
                enumerator.Dispose();
            }
        }
示例#2
0
        private void LayoutSequence()
        {
            int num1 = ItemMaximumWidth() + 44;
            int num2 = 22;

            Pivot = (PointF)GH_Convert.ToPoint(Pivot);
            //RectangleF rectangleF;
            RectangleF local;
            PointF     pivot = Pivot;
            double     x     = (double)pivot.X;

            pivot = Pivot;
            double y    = (double)pivot.Y;
            double num3 = (double)num1;
            double num4 = (double)num2;

            local  = new RectangleF((float)x, (float)y, (float)num3, (float)num4);
            Bounds = local;
            GH_ValueListItem firstSelectedItem = Owner.FirstSelectedItem;

            foreach (GH_ValueListItem listItem in Owner.ListItems)
            {
                if (listItem == firstSelectedItem)
                {
                    listItem.SetSequenceBounds(Bounds);
                }
                else
                {
                    listItem.SetEmptyBounds(Bounds);
                }
            }
        }
示例#3
0
        private void LayoutCheckList()
        {
            int num1 = ItemMaximumWidth() + 22;
            int num2 = 22 * Math.Max(1, Owner.ListItems.Count);

            Pivot = (PointF)GH_Convert.ToPoint(Pivot);
            //RectangleF rectangleF;
            RectangleF local;
            PointF     pivot = Pivot;
            double     x     = (double)pivot.X;

            pivot = Pivot;
            double y    = (double)pivot.Y;
            double num3 = (double)num1;
            double num4 = (double)num2;

            local  = new RectangleF((float)x, (float)y, (float)num3, (float)num4);
            Bounds = local;
            int num5 = 0;
            int num6 = Owner.ListItems.Count - 1;

            for (int index = num5; index <= num6; ++index)
            {
                RectangleF bounds = new RectangleF(Bounds.X, Bounds.Y + (float)(index * 22), (float)num1, 22f);
                Owner.ListItems[index].SetCheckListBounds(bounds);
            }
        }
示例#4
0
        private void LayoutDropDown()
        {
            int width  = this.ItemMaximumWidth() + 22;
            int height = 22;

            this.Pivot = GH_Convert.ToPoint(this.Pivot);
            System.Drawing.RectangleF bounds = new System.Drawing.RectangleF(this.Pivot.X, this.Pivot.Y, (float)width, (float)height);
            this.Bounds = bounds;
            GH_ValueListItem activeItem = this.Owner.FirstSelectedItem;

            try
            {
                System.Collections.Generic.List <GH_ValueListItem> .Enumerator enumerator = this.Owner.ListItems.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    GH_ValueListItem item = enumerator.Current;
                    if (item == activeItem)
                    {
                        item.SetDropdownBounds(this.Bounds);
                    }
                    else
                    {
                        item.SetEmptyBounds(this.Bounds);
                    }
                }
            }
            finally
            {
                System.Collections.Generic.List <GH_ValueListItem> .Enumerator enumerator = new List <GH_ValueListItem> .Enumerator();

                ((System.IDisposable)enumerator).Dispose();
            }
        }
示例#5
0
 //Our object is always the same size, but it needs to be anchored to the pivot.
 protected override void Layout()
 {
     //Lock this object to the pixel grid.
     //I.e., do not allow it to be position in between pixels.
     Pivot  = GH_Convert.ToPoint(Pivot);
     Bounds = new RectangleF(Pivot, new SizeF(4 * ButtonSize, 4 * ButtonSize));
 }
示例#6
0
 protected override void Layout()
 {
     this.Pivot = ((PointF)GH_Convert.ToPoint(this.Pivot));
     //this.Layout();
     base.Layout();
     FixLayout();
     LayoutMenu();
 }
示例#7
0
        protected override void Layout()
        {
            Pivot = GH_Convert.ToPoint(Pivot);
            var pivot = Pivot;

            imagefarame   = new RectangleF(pivot.X, pivot.Y, CanvasImage.Width, CanvasImage.Height);
            m_innerBounds = imagefarame;
            m_innerBounds.Inflate(-10, 10);
            LayoutInputParams(Owner, m_innerBounds);
            LayoutOutputParams(Owner, m_innerBounds);
            Bounds = LayoutBounds(Owner, m_innerBounds);
        }
示例#8
0
        protected override void Layout()
        {
            Pivot = GH_Convert.ToPoint(Pivot);
            var pivot = Pivot;
            var num1  = (double)pivot.X;
            var num2  = (double)pivot.Y;
            var num3  = 120;
            var num4  = 120;

            m_innerBounds = new RectangleF((float)num1, (float)num2, (float)num3, (float)num4);
            LayoutInputParams(Owner, m_innerBounds);
            LayoutOutputParams(Owner, m_innerBounds);
            Bounds = LayoutBounds(Owner, m_innerBounds);
        }
示例#9
0
        //Our object is always the same size, but it needs to be anchored to the pivot.
        protected override void Layout()
        {
            Pivot = GH_Convert.ToPoint(Pivot);
            int rows = NumBits / 8;

            if (((NumBits ^ 8) >= 0) && (NumBits % 8 != 0))
            {
                rows++;
            }

            int width = NumBits > 8 ? 8 : NumBits;

            Bounds = new RectangleF(Pivot, new SizeF(width * ButtonSize, rows * ButtonSize));
        }
示例#10
0
        protected override void Layout()
        {
            Pivot = GH_Convert.ToPoint(Pivot);
            Size size = new Size(150, 18);

            size.Width = Math.Max(size.Width, GH_FontServer.StringWidth(base.Owner.NickName, GH_FontServer.StandardAdjusted) + 20);
            int num  = Convert.ToInt32((double)Pivot.X - 0.5 * (double)size.Width);
            int num2 = Convert.ToInt32((double)Pivot.X + 0.5 * (double)size.Width);
            int num3 = Convert.ToInt32((double)Pivot.Y - 0.5 * (double)size.Height);
            int num4 = Convert.ToInt32((double)Pivot.Y + 0.5 * (double)size.Height);

            Bounds    = RectangleF.FromLTRB(num, num3, num2, num4);
            TextBound = RectangleF.FromLTRB(num + 30, num3, num2, num4);
            m_button  = new RectangleF(Bounds.Left, Bounds.Top, 30, Bounds.Height);
        }
示例#11
0
        protected override void Layout()
        {
            this.Pivot = ((PointF)GH_Convert.ToPoint(this.Pivot));
            LayoutBaseComponent();
            GH_SwitcherComponent gH_SwitcherComponent = (GH_SwitcherComponent)base.Owner;
            List <ExtendedPlug>  inputs  = new List <ExtendedPlug>();
            List <ExtendedPlug>  outputs = new List <ExtendedPlug>();

            composedCollection.GetMenuPlugs(ref inputs, ref outputs, onlyVisible: true);
            LayoutMenuInputs(base.m_innerBounds);
            LayoutMenuOutputs(base.m_innerBounds);
            this.Bounds = (LayoutExtBounds(base.m_innerBounds, inputs, outputs));
            FixLayout(outputs);
            LayoutMenu();
        }
示例#12
0
        public List <RoomInstance> roomInstancesList = new List <RoomInstance>(); // List that contains all room instances that are to be in that house


        protected override void Layout()
        {
            base.Layout();

            Pivot = GH_Convert.ToPoint(Pivot);
            Rectangle rec0 = GH_Convert.ToRectangle(Bounds);

            rec0.Height += 50;
            Bounds       = rec0;


            HouseNameRectangle = new Rectangle(new System.Drawing.Point((int)Bounds.Location.X - 50 + 25, (int)Bounds.Location.Y + 50), new Size(80, 20));
            FloorNameRectangle = new Rectangle(new System.Drawing.Point((int)Bounds.Location.X - 50 + 50, (int)Bounds.Location.Y + 75), new Size(60, 20));

            //   Bounds = new RectangleF(Pivot.X - OuterComponentRadius, Pivot.Y - OuterComponentRadius, 2 * OuterComponentRadius, 2 * OuterComponentRadius);
        }
示例#13
0
        protected override void Layout()
        {
            Pivot         = GH_Convert.ToPoint(Pivot);
            m_innerBounds = LayoutComponentBox(base.Owner);

            LayoutInputParams(base.Owner, m_innerBounds);
            LayoutOutputParams(base.Owner, m_innerBounds);
            Owner.ChangeParamsLayout();

            Bounds = LayoutBounds(this.Owner, m_innerBounds);

            foreach (IRespond control in Owner.Controls)
            {
                control.Layout(m_innerBounds, this.Bounds);
            }
            Bounds = LayoutBoundsControl(this.Owner, this.Bounds);
        }
示例#14
0
        protected void LayoutBaseComponent()
        {
            GH_SwitcherComponent gH_SwitcherComponent = (GH_SwitcherComponent)base.Owner;

            this.Pivot         = ((PointF)GH_Convert.ToPoint(this.Pivot));
            base.m_innerBounds = LayoutComponentBox2(base.Owner);
            int   num        = ComputeW_ico(base.Owner);
            float width      = composedCollection.GetMinLayoutSize().Width;
            float num2       = Math.Max(MinWidth, width);
            int   add_offset = 0;

            if (num2 > (float)num)
            {
                add_offset = (int)((double)(num2 - (float)num) / 2.0);
            }
            LayoutInputParams2(base.Owner, base.m_innerBounds, add_offset);
            LayoutOutputParams2(base.Owner, base.m_innerBounds, add_offset);
            this.Bounds = (LayoutBounds2(base.Owner, base.m_innerBounds));
        }
示例#15
0
        private void LayoutCheckList()
        {
            int width  = this.ItemMaximumWidth() + 22;
            int height = 22 * Math.Max(1, this.Owner.ListItems.Count);

            this.Pivot = GH_Convert.ToPoint(this.Pivot);
            RectangleF bounds = new RectangleF(this.Pivot.X, this.Pivot.Y, (float)width, (float)height);

            this.Bounds = bounds;
            int arg_80_0 = 0;
            int num      = this.Owner.ListItems.Count - 1;

            for (int i = arg_80_0; i <= num; i++)
            {
                float arg_B0_1 = this.Bounds.X;
                bounds = this.Bounds;
                RectangleF box = new RectangleF(arg_B0_1, bounds.Y + (float)(i * 22), (float)width, 22f);
                this.Owner.ListItems[i].SetCheckListBounds(box);
            }
        }
示例#16
0
        /// <summary>
        /// This method subscribes to mouse moves inside the general boundary of the component area.
        /// This is used in the render function to determinate if the button should be highlighted.
        /// </summary>
        public override GH_ObjectResponse RespondToMouseMove(GH_Canvas sender, GH_CanvasMouseEvent e)
        {
            if (e.Button != MouseButtons.None)
            {
                return(GH_ObjectResponse.Ignore);
            }
            var isInside = _buttonRectangleF.Contains(GH_Convert.ToPoint(e.CanvasLocation));

            if (_mouseHoverInside != isInside)
            {
                sender.Invalidate();
            }
            _mouseHoverInside = isInside;

            if (_mouseHoverInside)
            {
                return(GH_ObjectResponse.Capture);
            }

            return(GH_ObjectResponse.Release);
        }
示例#17
0
        private void LayoutDropDown()
        {
            List <GH_ValueListItem> .Enumerator enumerator;
            int num2 = this.ItemMaximumWidth() + 0x16;
            int num  = 0x16;

            this.Pivot = (PointF)GH_Convert.ToPoint(this.Pivot);
            RectangleF ef2 = new RectangleF(this.Pivot.X, this.Pivot.Y, (float)num2, (float)num);

            this.Bounds = ef2;
            GH_ValueListItem firstSelectedItem = this.Owner.FirstSelectedItem;

            enumerator = this.Owner.ListItems.GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    // Tried to write a cast but you can't write user defined casts for derivd classes! so this will do.
                    GH_ValueListItem current = enumerator.Current;

                    if (current == firstSelectedItem)
                    {
                        SetDropdownBounds(current, this.Bounds);
                    }
                    else
                    {
                        SetEmptyBounds(current, this.Bounds);
                    }
                }
            }
            finally
            {
                enumerator.Dispose();
            }
        }
 protected override void Layout()
 {
     Pivot  = GH_Convert.ToPoint(Pivot);
     Bounds = new RectangleF(Pivot.X - OuterRadius, Pivot.Y - OuterRadius, 2 * OuterRadius, 2 * OuterRadius);
 }
 protected override void Layout()
 {
     Pivot  = GH_Convert.ToPoint(Pivot);
     Bounds = new RectangleF(Pivot, new SizeF(3 * ButtonSize, 3 * ButtonSize));
 }
示例#20
0
        private void ShowDropMenu(object sender, GH_CanvasMouseEvent e)
        {
            GH_Canvas Canvas = sender as GH_Canvas;

            this.DropDownMenu.Show(Canvas, GH_Convert.ToPoint(e.ControlLocation));
        }