Example #1
0
 void CreateModalLayer()
 {
     _modalLayer = new GGraph();
     _modalLayer.DrawRect(this.width, this.height, 0, Color.White, UIConfig.modalLayerColor);
     _modalLayer.AddRelation(this, RelationType.Size);
     _modalLayer.name = "ModalLayer";
 }
Example #2
0
        public GGraph CreateModalLayer()
        {
            var modal = new GGraph();

            modal.DrawRect(this.width, this.height, 0, Color.white, UIConfig.modalLayerColor);
            modal.AddRelation(this, RelationType.Size);
            modal.name = modal.gameObjectName = "ModalLayer";
            modal.SetHome(this);
            return(modal);
        }
Example #3
0
        private void AdjustModalLayer()
        {
            if (_modalLayer == null)
            {
                _modalLayer = new GGraph();
                _modalLayer.DrawRect(this.width, this.height, 0, Color.white, UIConfig.modalLayerColor);
                _modalLayer.AddRelation(this, RelationType.Size);
            }

            int  cnt             = this.numChildren;
            bool modalLayerIsTop = false;

            if (_modalWaitPane != null && _modalWaitPane.parent != null)
            {
                SetChildIndex(_modalWaitPane, cnt - 1);
            }

            for (int i = cnt - 1; i >= 0; i--)
            {
                GObject g = this.GetChildAt(i);
                if (g == _modalLayer)
                {
                    modalLayerIsTop = true;
                }
                else if ((g is Window) && (g as Window).modal)
                {
                    if (_modalLayer.parent == null)
                    {
                        AddChildAt(_modalLayer, i);
                    }
                    else if (i > 0)
                    {
                        if (modalLayerIsTop)
                        {
                            SetChildIndex(_modalLayer, i);
                        }
                        else
                        {
                            SetChildIndex(_modalLayer, i - 1);
                        }
                    }
                    else
                    {
                        AddChildAt(_modalLayer, 0);
                    }
                    return;
                }
            }

            if (_modalLayer.parent != null)
            {
                RemoveChild(_modalLayer);
            }
        }
Example #4
0
        void __addedToStage()
        {
            nativeStage.onStageResized.Add(__winResize);
            nativeStage.onMouseDown.AddCapture(__stageMouseDown);

            __winResize();

            _modalLayer = new GGraph();
            _modalLayer.DrawRect(this.width, this.height, 0, Color.white, UIConfig.modalLayerColor);
            _modalLayer.shape.name = "test";
            _modalLayer.AddRelation(this, RelationType.Size);
        }
        private void AdjustModalLayer()
        {
            if (_modalLayer == null)
            {
                _modalLayer = new GGraph();
                _modalLayer.DrawRect(this.width, this.height, 0, Color.white, UIConfig.modalLayerColor);
                _modalLayer.AddRelation(this, RelationType.Size);
                _modalLayer.gameObjectName = "ModalLayer";
                _modalLayer.SetHome(this);
            }

            int cnt = this.numChildren;

            if (_modalWaitPane != null && _modalWaitPane.parent != null)
            {
                SetChildIndex(_modalWaitPane, cnt - 1);
            }

            for (int i = cnt - 1; i >= 0; i--)
            {
                GObject g = this.GetChildAt(i);
                if ((g is Window) && (g as Window).modal)
                {
                    if (_modalLayer.parent == null)
                    {
                        AddChildAt(_modalLayer, i);
                    }
                    else
                    {
                        SetChildIndexBefore(_modalLayer, i);
                    }
                    return;
                }
            }

            if (_modalLayer.parent != null)
            {
                RemoveChild(_modalLayer);
            }
        }
Example #6
0
        private void AdjustModalLayer()
        {
            if (_modalLayer == null)
            {
                _modalLayer = new GGraph();
                _modalLayer.DrawRect(this.width, this.height, 0, Color.white, UIConfig.modalLayerColor);
                _modalLayer.AddRelation(this, RelationType.Size);
                _modalLayer.gameObjectName = "ModalLayer";
                _modalLayer.SetHome(this);
            }

            int cnt = this.numChildren;

            if (_modalWaitPane != null && _modalWaitPane.parent != null)
                SetChildIndex(_modalWaitPane, cnt - 1);

            for (int i = cnt - 1; i >= 0; i--)
            {
                GObject g = this.GetChildAt(i);
                if ((g is Window) && (g as Window).modal)
                {
                    if (_modalLayer.parent == null)
                        AddChildAt(_modalLayer, i);
                    else
                        SetChildIndexBefore(_modalLayer, i);
                    return;
                }
            }

            if (_modalLayer.parent != null)
                RemoveChild(_modalLayer);
        }
Example #7
0
        private void AdjustModalLayer()
        {
            if (_modalLayer == null)
            {
                _modalLayer = new GGraph();
                _modalLayer.DrawRect(this.width, this.height, 0, Color.white, UIConfig.modalLayerColor);
                _modalLayer.AddRelation(this, RelationType.Size);
            }

            int cnt = this.numChildren;
            bool modalLayerIsTop = false;

            if (_modalWaitPane != null && _modalWaitPane.parent != null)
                SetChildIndex(_modalWaitPane, cnt - 1);

            for (int i = cnt - 1; i >= 0; i--)
            {
                GObject g = this.GetChildAt(i);
                if (g == _modalLayer)
                    modalLayerIsTop = true;
                else if ((g is Window) && (g as Window).modal)
                {
                    if (_modalLayer.parent == null)
                        AddChildAt(_modalLayer, i);
                    else if (i > 0)
                    {
                        if (modalLayerIsTop)
                            SetChildIndex(_modalLayer, i);
                        else
                            SetChildIndex(_modalLayer, i - 1);
                    }
                    else
                        AddChildAt(_modalLayer, 0);
                    return;
                }
            }

            if (_modalLayer.parent != null)
                RemoveChild(_modalLayer);
        }
Example #8
0
        void __addedToStage()
        {
            nativeStage.onStageResized.Add(__winResize);
            nativeStage.onMouseDown.AddCapture(__stageMouseDown);

            __winResize();

            _modalLayer = new GGraph();
            _modalLayer.DrawRect(this.width, this.height, 0, Color.white, UIConfig.modalLayerColor);
            _modalLayer.shape.name = "test";
            _modalLayer.AddRelation(this, RelationType.Size);
        }