示例#1
0
        public void Move(GComposite comp)
        {
            if (comp is GType && ((GType)comp).GeomType != this.geomType)
            {
                throw new Exception("GeomType mismatch.");
            }
            int parentId0 = parentId;
            int priority0 = priority;

            ParentComposite.Remove(this);
            parent   = comp is GLib ? null : (GType)comp;
            parentId = parent != null ? parent.Id : 0;
            priority = ParentComposite.LastPriority;
            ParentComposite.Add(this);
            if (parentId != parentId0)
            {
                UpdateAttr((int)TypeField.ParentId);
            }
            if (priority != priority0)
            {
                UpdateAttr((int)TypeField.Priority);
            }
            lib.SetChanged();
        }
示例#2
0
 internal void SetParent(GType parent)
 {
     this.parent = parent;
     ParentComposite.Add(this);
 }