Ejemplo n.º 1
0
        public void ScrollBarStyleConstructor()
        {
            tlog.Debug(tag, $"ScrollBarStyleConstructor START");

            var testingTarget = new ScrollBarStyle();

            Assert.IsNotNull(testingTarget, "null handle");
            Assert.IsInstanceOf <ScrollBarStyle>(testingTarget, "Should return ScrollBarStyle instance.");

            tlog.Debug(tag, $"ScrollBarStyleConstructor END (OK)");
        }
Ejemplo n.º 2
0
        private void CreateStylePart()
        {
            style_parent = new View()
            {
                Size = new Size(960, 540)
            };
            style_parent.Layout = new LinearLayout()
            {
                LinearOrientation = LinearLayout.Orientation.Vertical, LinearAlignment = LinearLayout.Alignment.CenterVertical, CellPadding = new Size2D(0, 50)
            };
            top_parent.Add(style_parent);

            // Add Textlabel of "Style construction"
            text_style                     = new TextLabel();
            text_style.Size                = new Size(400, 70);
            text_style.PointSize           = 20;
            text_style.HorizontalAlignment = HorizontalAlignment.Center;
            text_style.VerticalAlignment   = VerticalAlignment.Center;
            text_style.BackgroundColor     = Color.Magenta;
            text_style.Text                = "Style construction";
            text_style.Focusable           = true;
            style_parent.Add(text_style);

            // Add ScrollBar of Style construction
            ScrollBarStyle st = new ScrollBarStyle
            {
                Track = new ImageViewStyle
                {
                    BackgroundColor = new Selector <Color>
                    {
                        All = new Color(0.43f, 0.43f, 0.43f, 0.1f),
                    }
                },
                Thumb = new ImageViewStyle
                {
                    BackgroundColor = new Selector <Color>
                    {
                        All = new Color(1.0f, 0.0f, 0.0f, 0.2f),
                    }
                },
            };

            scrollBar[2]              = new ScrollBar(st);
            scrollBar[2].Size         = new Size(400, 4);
            scrollBar[2].MaxValue     = (int)scrollBar[2].SizeWidth / 10;
            scrollBar[2].MinValue     = 0;
            scrollBar[2].ThumbSize    = new Size(30, 4);
            scrollBar[2].CurrentValue = 0;//set after thumbsize
            style_parent.Add(scrollBar[2]);
        }
Ejemplo n.º 3
0
        public void ScrollBarConstructorWithScrollBarStyle()
        {
            tlog.Debug(tag, $"ScrollBarConstructorWithScrollBarStyle START");

            ScrollBarStyle style = new ScrollBarStyle()
            {
                Size = new Size(30, 2),
                HeightResizePolicy = ResizePolicyType.Fixed,
            };

            var testingTarget = new ScrollBar(style);

            Assert.IsNotNull(testingTarget, "null handle");
            Assert.IsInstanceOf <ScrollBar>(testingTarget, "Should return ScrollBar instance.");

            testingTarget.Dispose();
            tlog.Debug(tag, $"ScrollBarConstructorWithScrollBarStyle END (OK)");
        }
Ejemplo n.º 4
0
        public void ScrollBarStyleTrack()
        {
            tlog.Debug(tag, $"ScrollBarStyleTrack START");

            var testingTarget = new ScrollBarStyle();

            Assert.IsNotNull(testingTarget, "null handle");
            Assert.IsInstanceOf <ScrollBarStyle>(testingTarget, "Should return ScrollBarStyle instance.");

            ImageViewStyle track = new ImageViewStyle()
            {
                BackgroundColor = Color.Blue,
            };

            testingTarget.Track = track;
            tlog.Debug(tag, "Track : " + testingTarget.Track);

            tlog.Debug(tag, $"ScrollBarStyleTrack END (OK)");
        }
Ejemplo n.º 5
0
        public void ScrollBarStyleThumb()
        {
            tlog.Debug(tag, $"ScrollBarStyleThumb START");

            var testingTarget = new ScrollBarStyle();

            Assert.IsNotNull(testingTarget, "null handle");
            Assert.IsInstanceOf <ScrollBarStyle>(testingTarget, "Should return ScrollBarStyle instance.");

            ImageViewStyle thumb = new ImageViewStyle()
            {
                BackgroundColor = Color.Green,
            };

            testingTarget.Thumb = thumb;
            tlog.Debug(tag, "Thumb : " + testingTarget.Thumb);

            tlog.Debug(tag, $"ScrollBarStyleThumb END (OK)");
        }
Ejemplo n.º 6
0
        public void Activate()
        {
            Window window = Window.Instance;

            root = new View()
            {
                Size2D = new Size2D(1920, 1080),
            };

            CreateBoardAndButtons();

            scrollBar1_1            = new ScrollBar();
            scrollBar1_1.Position2D = new Position2D(50, 300);
            scrollBar1_1.Size2D     = new Size2D(300, 4);
            scrollBar1_1.Style.Track.BackgroundColor = Color.Green;
            scrollBar1_1.MaxValue                    = (int)scrollBar1_1.SizeWidth / 10;
            scrollBar1_1.MinValue                    = 0;
            scrollBar1_1.Style.Thumb.Size            = new Size(30, 4);
            scrollBar1_1.CurrentValue                = 0; //set after thumbsize
            scrollBar1_1.Style.Thumb.BackgroundColor = Color.Black;
            root.Add(scrollBar1_1);

            scrollBar1_2            = new ScrollBar();
            scrollBar1_2.Position2D = new Position2D(50, 400);
            scrollBar1_2.Size2D     = new Size2D(300, 4);
            scrollBar1_2.Style.Track.BackgroundColor = Color.Green;
            scrollBar1_2.MaxValue                    = (int)scrollBar1_2.SizeWidth / 10;
            scrollBar1_2.MinValue                    = 0;
            scrollBar1_2.Style.Thumb.Size            = new Size(30, 4);
            scrollBar1_2.CurrentValue                = 0;//set after thumbsize
            scrollBar1_2.Style.Thumb.BackgroundColor = Color.Yellow;
            scrollBar1_2.Style.Track.ResourceUrl     = CommonResource.GetTVResourcePath() + "component/c_progressbar/c_progressbar_white_buffering.png";

            root.Add(scrollBar1_2);

            ScrollBarStyle attr = new ScrollBarStyle
            {
                Track = new ImageViewStyle
                {
                    BackgroundColor = new Selector <Color>
                    {
                        All = new Color(0.43f, 0.43f, 0.43f, 0.1f),
                    }
                },
                Thumb = new ImageViewStyle
                {
                    BackgroundColor = new Selector <Color>
                    {
                        All = new Color(1.0f, 0.0f, 0.0f, 0.2f),
                    }
                },
            };

            scrollBar2_1                  = new ScrollBar(attr);
            scrollBar2_1.Position2D       = new Position2D(500, 300);
            scrollBar2_1.Size2D           = new Size2D(300, 4);
            scrollBar2_1.MaxValue         = (int)scrollBar2_1.SizeWidth / 10;
            scrollBar2_1.MinValue         = 0;
            scrollBar2_1.Style.Thumb.Size = new Size(30, 4);
            scrollBar2_1.CurrentValue     = 0; //set after thumbsize
            root.Add(scrollBar2_1);

            board.UpFocusableView = button1;

            window.Add(root);

            FocusManager.Instance.SetCurrentFocusView(button1);
        }