示例#1
0
文件: Desktop.cs 项目: vb0067/LGame
 /// <summary>
 /// 空桌面布局
 /// </summary>
 ///
 private Desktop()
 {
     this.clickComponent = new LComponent[1];
     this.contentPane    = new LPanel(0, 0, 1, 1);
     this.input          = null;
     this.SetDesktop(this.contentPane);
 }
示例#2
0
文件: Desktop.cs 项目: vb0067/LGame
 /// <summary>
 /// 构造一个可用桌面
 /// </summary>
 ///
 /// <param name="input"></param>
 /// <param name="width"></param>
 /// <param name="height"></param>
 public Desktop(LInput input, int width, int height)
 {
     this.clickComponent = new LComponent[1];
     this.contentPane    = new LPanel(0, 0, width, height);
     this.input          = input;
     this.SetDesktop(this.contentPane);
 }
示例#3
0
 public virtual void Dispose()
 {
     this.isClose = true;
     this.desktop.SetComponentStat(this, false);
     if (this.parent != null)
     {
         this.parent.Remove(this);
     }
     this.desktop = Desktop.EMPTY_DESKTOP;
     this.input   = null;
     this.parent  = null;
     if (imageUI != null)
     {
         for (int i = 0; i < imageUI.Length; i++)
         {
             imageUI[i].Destroy();
             imageUI[i] = null;
         }
         this.imageUI = null;
     }
     if (background != null)
     {
         this.background.Destroy();
         this.background = null;
     }
     this.selected = false;
     this.visible  = false;
 }
示例#4
0
        private LComponent FindComponent(int x, int y)
        {
            if (this.modal != null && !this.modal.IsContainer())
            {
                return(null);
            }
            LContainer panel = (this.modal == null) ? this.contentPane
                                        : ((LContainer)this.modal);
            LComponent comp = panel.FindComponent(x, y);

            return(comp);
        }
示例#5
0
        internal void ValidateContainer(LContainer container)
        {
            LComponent[] components = container.GetComponents();
            int          size       = container.GetComponentCount();

            for (int i = 0; i < size; i++)
            {
                if (components[i].IsContainer())
                {
                    this.ValidateContainer((LContainer)components[i]);
                }
            }
        }
示例#6
0
        private int RemoveComponent(LContainer container, LComponent comp)
        {
            int removed = container.Remove(comp);

            LComponent[] components = container.GetComponents();
            int          i          = 0;

            while (removed == -1 && i < components.Length - 1)
            {
                if (components[i].IsContainer())
                {
                    removed = this
                              .RemoveComponent((LContainer)components[i], comp);
                }
                i++;
            }

            return(removed);
        }
示例#7
0
 public void SetContentPane(LContainer pane)
 {
     pane.SetBounds(0, 0, this.GetWidth(), this.GetHeight());
     this.contentPane = pane;
     this.SetDesktop(this.contentPane);
 }
示例#8
0
 private Desktop()
 {
     this.contentPane = new LPanel(0, 0, 1, 1);
     this.input       = null;
     this.SetDesktop(this.contentPane);
 }
示例#9
0
        internal void SetContainer(LContainer container)
        {
            this.parent = container;

            this.ValidatePosition();
        }