예제 #1
0
        public void Screen_StandartLayouts_ChangeControlsFrame()
        {
            #region Prepare
            StubControl parent = new StubControl
            {
                Width         = 320,
                Heigth        = 480,
                PaddingLeft   = 39,
                PaddingTop    = 19,
                PaddingRight  = 19,
                PaddingBottom = 39,
                BorderWidth   = 1
            };
            parent.Frame = new Rectangle(0, 0, 320, 480);

            StubControl control = new StubControl
            {
                Width               = 1000,
                Heigth              = 200,
                MarginLeft          = 20,
                MarginTop           = 20,
                MarginRight         = 10,
                MarginBottom        = 42,
                SizeToContentHeight = true,
                ContentHeigth       = 300,
                SizeToContentWidth  = true,
                ContentWidth        = 30
            };
            #endregion

            LayoutBehaviour.Screen(new StubStyleSheet(), parent, control, new Bound(320, 480));

            Assert.AreEqual(new Rectangle(60, 40, 230, 300), control.Frame);
        }
예제 #2
0
        public void Screen()
        {
            #region Prepare
            StubControl parent = new StubControl
            {
                Width         = 320,
                Heigth        = 480,
                PaddingLeft   = 39,
                PaddingTop    = 19,
                PaddingRight  = 19,
                PaddingBottom = 39,
                BorderWidth   = 1
            };
            parent.Frame = new Rectangle(0, 0, 320, 480);

            StubControl control = new StubControl
            {
                Width        = -1,
                Heigth       = 200,
                MarginLeft   = 20,
                MarginTop    = 20,
                MarginRight  = 10,
                MarginBottom = 42
            };
            #endregion

            LayoutBehaviour.Screen(new StubStyleSheet(), parent, control);

            Assert.AreEqual(new Rectangle(60, 40, 230, 200), control.Frame);
        }