Exemplo n.º 1
0
 public void SetLocation(Point location, Size size)
 {
     Width        = (int)size.Width;
     Height       = (int)size.Height;
     _hasMeasured = size.Height > 0 && size.Width > 0;
     FitText();
     Location = location.ToPoint();
 }
Exemplo n.º 2
0
        /// <summary>
        /// Sets the location and size of the control within its parent grid.
        /// This is called by the underlying grid layout system and should not be used in application logic.
        /// </summary>
        /// <param name="location">The X and Y coordinates of the upper left corner of the control.</param>
        /// <param name="size">The width and height of the control.</param>
        public void SetLocation(Point location, UI.Size size)
        {
            var left   = location.X;
            var right  = location.X + MeasuredWidth;
            var top    = location.Y;
            var bottom = location.Y + MeasuredHeight;

            Layout((int)left, (int)top, (int)right, (int)bottom);
        }
Exemplo n.º 3
0
        void IElement.SetLocation(Point location, Size size)
        {
            var left   = location.X;
            var right  = location.X + size.Width;
            var top    = location.Y;
            var bottom = location.Y + MeasuredHeight;

            Layout((int)left, (int)top, (int)right, (int)bottom);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Sets the location and size of the control within its parent grid.
        /// This is called by the underlying grid layout system and should not be used in application logic.
        /// </summary>
        /// <param name="location">The X and Y coordinates of the upper left corner of the control.</param>
        /// <param name="size">The width and height of the control.</param>
        public void SetLocation(Point location, Size size)
        {
            var left   = location.X;
            var right  = location.X + size.Width;
            var top    = location.Y;
            var bottom = location.Y + size.Height;

            Layout((int)left, (int)top, (int)right, (int)bottom);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Sets the location and size of the control within its parent grid.
        /// This is called by the underlying grid layout system and should not be used in application logic.
        /// </summary>
        /// <param name="location">The X and Y coordinates of the upper left corner of the control.</param>
        /// <param name="size">The width and height of the control.</param>
        public void SetLocation(Point location, Size size)
        {
            Location = location;
            Size     = size;
            var par = Parent as GridControl;

            if (par != null)
            {
                par.Redraw();
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// Sets the location and size of the control within its parent grid.
        /// This is called by the underlying grid layout system and should not be used in application logic.
        /// </summary>
        /// <param name="location">The X and Y coordinates of the upper left corner of the control.</param>
        /// <param name="size">The width and height of the control.</param>
        public void SetLocation(Point location, Size size)
        {
            var left   = location.X;
            var right  = location.X + size.Width;
            var top    = location.Y;
            var bottom = location.Y + size.Height;

            Layout((int)left, (int)top, (int)right, (int)bottom);

            var widthSpec  = MeasureSpec.MakeMeasureSpec((int)size.Width, MeasureSpecMode.Exactly);
            var heightSpec = MeasureSpec.MakeMeasureSpec((int)size.Height, MeasureSpecMode.Exactly);

            _button.Measure(widthSpec, heightSpec);
            _button.Layout(-Padding, -Padding, (int)size.Width + Padding, (int)size.Height + Padding);
        }
Exemplo n.º 7
0
 public void SetLocation(Point location, Size size)
 {
     Frame = new RectangleF((float)location.X, (float)location.Y, (float)size.Width, (float)size.Height);
     if (stretch == UI.ContentStretch.None)
     {
         if (Frame.Width < Dimensions.Width || Frame.Height < Dimensions.Height)
         {
             ContentMode = UIViewContentMode.ScaleAspectFit;
         }
         else
         {
             ContentMode = UIViewContentMode.Center;
         }
     }
 }
Exemplo n.º 8
0
 public void SetLocation(Point location, Size size)
 {
     Frame = new CGRect((float)location.X, (float)location.Y, (float)size.Width, (float)size.Height);
 }