示例#1
0
        /// ///////////////////////////////////////
        public override bool AddChild(I2iObjetGraphique child)
        {
            if (child is C2iWndDataGridColumn)
            {
                return(base.AddChild(child));
            }
            else
            {
                C2iWnd wnd = child as C2iWnd;
                if (wnd != null)
                {
                    if (wnd is IWndIncluableDansDataGrid)
                    {
                        wnd.AutoBackColor = false;
                        C2iWndDataGridColumn col = new C2iWndDataGridColumn();
                        col.Text = "col " + (Childs.Count() + 1);

                        col.Control = wnd;
                        base.AddChild(col);
                        col.ForeColor = DefaultColumnHeaderForeColor;
                        col.BackColor = DefaultColumnHeaderBackColor;
                        col.Parent    = this;
                        return(true);
                    }
                }
            }
            return(false);
        }
示例#2
0
        public QNode(int level, int x, int y, int width, int height, int id)
        {
            this.Level      = level;
            this.Id         = id;
            this.X          = x;
            this.Y          = y;
            this.Width      = width;
            this.Height     = height;
            this.Bound      = new WorldRect(x, y, width, height);
            this.Childs     = new QNode[4];
            this.ListObject = new List <GameObject>();

            for (int i = 0; i < Childs.Count(); i++)
            {
                this.Childs[i] = null;
            }
        }
示例#3
0
        public QNode(int level, WorldRect bound, int id)
        {
            this.Level  = level;
            this.Id     = id;
            this.X      = bound.left;
            this.Y      = bound.top;
            this.Width  = bound.right - bound.left;
            this.Height = bound.top - bound.bottom;

            this.Bound = new WorldRect(this.X, this.Y, this.Width, this.Height);

            this.Childs     = new QNode[4];
            this.ListObject = new List <GameObject>();
            for (int i = 0; i < Childs.Count(); i++)
            {
                this.Childs[i] = null;
            }
        }
        internal void Parse()
        {
            if (ParentCount > 30)
            {
                return;
            }
            config.SkipEmpty();
            if (config.Peek() == '(')
            {
                config.Next();
                Name = config.NextString();
                config.Next();
                Value = config.NextString();
                config.Next();
                return;
            }

            Name = config.NextString();
            config.SkipEmpty();
            if (config.Peek() == '=')
            {
                config.Next();
                config.SkipEmpty();
                Value = config.NextString();
            }
            else if (config.Peek() == ',')
            {
                config.Next();
                Childs.Add(new ADLElement {
                    Name = this.Name, Parent = this
                });
                Name = null;

                while (config.HasChar)
                {
                    config.SkipEmpty();
                    Childs.Add(new ADLElement {
                        Value = config.NextString(), Parent = this
                    });
                    config.SkipEmpty();
                    if (config.Peek() == ',')
                    {
                        config.Next();
                        config.SkipEmpty();
                    }
                    if (config.Peek() == '}')
                    {
                        break;
                    }
                }
                //config.Next();
            }
            else if (config.Peek() == '{')
            {
                config.Next();
                while (config.HasChar)
                {
                    config.SkipEmpty();
                    Childs.Add(new ADLElement(config, this));
                    config.SkipEmpty();
                    if (config.Peek() == '}')
                    {
                        break;
                    }
                }
                config.Next();
                if (Childs.Count() == 1 && Childs[0].Name == null)
                {
                    var c = Childs[0];
                    Childs.Clear();
                    Childs.AddRange(c.Childs);
                }
            }
        }