示例#1
0
文件: Panel.cs 项目: xxy1991/cozy
 public void RemoveChild(UIElement child)
 {
     if (children.Remove(child))
     {
         clickActions.Remove(child);
         UpdateLayout();
     }
 }
示例#2
0
文件: Panel.cs 项目: xxy1991/cozy
 public void AddChild(UIElement child, Action action = null)
 {
     if (!children.Contains(child))
     {
         children.Add(child);
         clickActions.Add(child, action);
         UpdateLayout();
     }
 }
示例#3
0
 private bool DispatchPressed(int x, int y)
 {
     foreach (Panel obj in DrawableUIElemts)
     {
         if (obj.OnMousePressed(x, y))
         {
             CurrerentElement = panel;
             return true;
         }
     }
     return false;
 }
示例#4
0
 private bool DispatchReleased(int x, int y)
 {
     if (CurrerentElement != null)
     {
         foreach (Panel obj in DrawableUIElemts)
         {
             if (obj.OnMouseReleased(x, y))
             {
                 CurrerentElement = null;
                 return true;
             }
         }
     }
     return false;
 }