Esempio n. 1
0
        private void RenderCheckList(GH_Canvas canvas, Graphics graphics, Color color)
        {
            List <GuanacoListItem> .Enumerator enumerator;
            if (this.Owner.ListItems.Count == 0)
            {
                return;
            }
            int y0 = Convert.ToInt32(this.Bounds.Y);
            int y  = Convert.ToInt32(this.Bounds.Bottom);
            int x  = Convert.ToInt32(this.Owner.ListItems[0].BoxLeft.Right);

            enumerator = this.Owner.ListItems.GetEnumerator();
            try
            {
                enumerator = this.Owner.ListItems.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    GuanacoListItem item = enumerator.Current;
                    graphics.DrawString(item.Name, GH_FontServer.Standard, Brushes.Black, item.BoxName, GH_TextRenderingConstants.CenterCenter);
                    if (item.Selected)
                    {
                        GuanacoListAttributes.RenderCheckMark(canvas, graphics, item.BoxLeft, color);
                    }
                }
            }
            finally
            {
                enumerator.Dispose();
            }
        }
Esempio n. 2
0
        private static void RenderCheckMark(GH_Canvas canvas, Graphics graphics, RectangleF bounds, Color color)
        {
            int x = Convert.ToInt32(bounds.X + 0.5f * bounds.Width) - 2;
            int y = Convert.ToInt32(bounds.Y + 0.5f * bounds.Height);

            PointF[] array         = new PointF[6];
            PointF[] arg_54_0_cp_0 = array;
            int      arg_54_0_cp_1 = 0;
            PointF   pointF        = new PointF((float)x, (float)y);

            arg_54_0_cp_0[arg_54_0_cp_1] = pointF;
            PointF[] arg_7A_0_cp_0 = array;
            int      arg_7A_0_cp_1 = 1;
            PointF   pointF2       = new PointF((float)x - 3.5f, (float)y - 3.5f);

            arg_7A_0_cp_0[arg_7A_0_cp_1] = pointF2;
            PointF[] arg_A0_0_cp_0 = array;
            int      arg_A0_0_cp_1 = 2;
            PointF   pointF3       = new PointF((float)x - 6.5f, (float)y - 0.5f);

            arg_A0_0_cp_0[arg_A0_0_cp_1] = pointF3;
            PointF[] arg_C0_0_cp_0 = array;
            int      arg_C0_0_cp_1 = 3;
            PointF   pointF4       = new PointF((float)x, (float)y + 6f);

            arg_C0_0_cp_0[arg_C0_0_cp_1] = pointF4;
            PointF[] arg_E6_0_cp_0 = array;
            int      arg_E6_0_cp_1 = 4;
            PointF   pointF5       = new PointF((float)x + 9.5f, (float)y - 3.5f);

            arg_E6_0_cp_0[arg_E6_0_cp_1] = pointF5;
            PointF[] arg_10C_0_cp_0 = array;
            int      arg_10C_0_cp_1 = 5;
            PointF   pointF6        = new PointF((float)x + 6.5f, (float)y - 6.5f);

            arg_10C_0_cp_0[arg_10C_0_cp_1] = pointF6;
            PointF[] corners = array;
            GuanacoListAttributes.RenderShape(canvas, graphics, corners, color);
        }