示例#1
0
 internal static void SetLayoutBoundsPosition(InvalidationManagerClient obj, float x, float y)
 {
     obj.Move(x, y);
 }
示例#2
0
 internal static void SetLayoutBoundsPosition(InvalidationManagerClient obj, float x, float y)
 {
     obj.Move(x, y);
 }
示例#3
0
        protected override void UpdateDisplayList(float width, float height)
        {
            base.UpdateDisplayList(width, height);

            //var nChildren = NumberOfChildren;
            var w    = ContentWidth;
            var h    = ContentHeight;
            var left = ContentX;
            var top  = ContentY;

            // Stretch the selectedIndex to fill our size
            if (_selectedIndex != -1)
            {
                //Debug.Log("Handling the selected index");
                InvalidationManagerClient child = (InvalidationManagerClient)GetChildAt(_selectedIndex);

                var newWidth  = w;
                var newHeight = h;

                if (null != child.PercentWidth)
                {
                    if (newWidth > child.MaxWidth)
                    {
                        newWidth = child.MaxWidth;
                    }
                }
                else
                {
                    if (newWidth > child.ExplicitWidth)
                    {
                        newWidth = (float)child.ExplicitWidth;
                    }
                }

                if (null != child.PercentHeight)
                {
                    if (newHeight > child.MaxHeight)
                    {
                        newHeight = child.MaxHeight;
                    }
                }
                else
                {
                    if (newHeight > child.ExplicitHeight)
                    {
                        newHeight = (float)child.ExplicitHeight;
                    }
                }

                // Don't send events for the size/move. The set visible below
                if (child.Width != newWidth || child.Height != newHeight)
                {
                    child.SetActualSize(newWidth, newHeight);
                    SetActualSize(newWidth + left, newHeight + top); //this!
                }
                if (child.X != left || child.Y != top)
                {
                    child.Move(left, top);
                }

                // Now that the child is properly sized and positioned it
                // can be shown.
                //Debug.Log("Set visible: " + child);
                child.Visible = true;
            }
        }