public override void Run(Window window)
        {
            Log.Debug(TestName, "CircleProgressBar run");
            Conformant conformant = new Conformant(window);

            conformant.Show();

            var surface           = new CircleSurface(conformant);
            CircleProgressBar pb1 = new CircleProgressBar(conformant, surface)
            {
                AlignmentX = -1,
                AlignmentY = -1,
                WeightX    = 1,
                WeightY    = 1,

                // bar
                Value        = 0,
                Maximum      = 100,
                Minimum      = 0,
                BarRadius    = 100,
                BarLineWidth = 15,
                BarColor     = Color.Green,

                // background
                BackgroundRadius    = 100,
                BackgroundLineWidth = 15,
                BackgroundColor     = Color.Aqua,
            };

            pb1.Show();
            conformant.SetContent(pb1);
            Label lb1 = new Label(window)
            {
                Text = string.Format("S {0} %", pb1.Value),
            };

            lb1.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
            lb1.Move(160, window.ScreenSize.Height / 2 - 40);
            lb1.Show();

            EcoreMainloop.AddTimer(0.05, () =>
            {
                if (pb1.Value == pb1.Maximum / 2)
                {
                    // Test purpose : set disable
                    pb1.IsEnabled = false;
                }

                if (pb1.Value == pb1.Maximum)
                {
                    EcoreMainloop.RemoveTimer(pb1);
                }

                pb1.Value += 1;
                lb1.Text   = string.Format("S {0} %", pb1.Value);

                return(true);
            });
        }
        public override void Run(Window window)
        {
            Log.Debug(TestName, "CircleProgressBar run");
            Conformant conformant = new Conformant(window);

            conformant.Show();

            Naviframe naviframe = new Naviframe(window);

            naviframe.Show();
            conformant.SetContent(naviframe);

            var surface           = new CircleSurface(conformant);
            CircleProgressBar pb1 = new CircleProgressBar(naviframe, surface)
            {
                AlignmentX = -1,
                AlignmentY = -1,
                WeightX    = 1,
                WeightY    = 1,
                Value      = 0,
                Maximum    = 100,
                Minimum    = 0,
            };

            pb1.Show();
            naviframe.Push(pb1, null, "empty");

            Label lb1 = new Label(window)
            {
                Text = string.Format("S {0} %", pb1.Value),
            };

            lb1.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
            lb1.Move(160, window.ScreenSize.Height / 2 - 40);
            lb1.Show();

            EcoreMainloop.AddTimer(0.05, () =>
            {
                if (pb1.Value == pb1.Maximum / 2)
                {
                    // Test purpose : set disable
                    pb1.IsEnabled = false;
                }

                if (pb1.Value == pb1.Maximum)
                {
                    EcoreMainloop.RemoveTimer(pb1);
                }

                pb1.Value += 1;
                lb1.Text   = string.Format("S {0} %", pb1.Value);

                return(true);
            });
        }
Exemple #3
0
        public override void Run(Window window)
        {
            Log.Debug(TestName, "CircleProgressBar run");
            Conformant conformant = new Conformant(window);

            conformant.Show();

            var surface = new CircleSurface(conformant);

            CircleProgressBar pb1 = new CircleProgressBar(conformant, surface)
            {
                AlignmentX = -1,
                AlignmentY = -1,
                WeightX    = 1,
                WeightY    = 1,

                // default
                Value        = 20,
                Maximum      = 100,
                Minimum      = 0,
                BarRadius    = 80,
                BarLineWidth = 6,

                // background
                BackgroundRadius    = 80,
                BackgroundLineWidth = 6,
            };

            pb1.Show();
            conformant.SetContent(pb1);
            Label lb1 = new Label(window)
            {
                Text = string.Format("{0} %", pb1.Value),
            };

            lb1.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
            lb1.Move(170, window.ScreenSize.Height / 2 - 20);
            lb1.Show();

            EcoreMainloop.AddTimer(0.05, () =>
            {
                pb1.Value += 1;
                lb1.Text   = string.Format("{0} %", pb1.Value);

                return(true);
            });
        }
        public override void Run(Window window)
        {
            Log.Debug(TestName, "CircleProgressBar run");
            Conformant conformant = new Conformant(window);

            conformant.Show();

            var surface           = new CircleSurface(conformant);
            CircleProgressBar pb1 = new CircleProgressBar(conformant, surface)
            {
                AlignmentX = -1,
                AlignmentY = -1,
                WeightX    = 1,
                WeightY    = 1,

                // Test purpose :  to test property related with angle

                // bar
                Maximum         = 100,
                BarRadius       = 100,
                BarLineWidth    = 20,
                BarColor        = Color.Green,
                BarAngleOffset  = 90,
                BarAngle        = 90,
                BarAngleMaximum = 180,

                // background
                BackgroundRadius      = 100,
                BackgroundLineWidth   = 20,
                BackgroundColor       = Color.Aqua,
                BackgroundAngleOffset = 90,
                BackgroundAngle       = 180,
            };

            pb1.Show();
            conformant.SetContent(pb1);
            Label lb1 = new Label(window)
            {
                Text = string.Format("V {0} %", pb1.Value),
            };

            lb1.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
            lb1.Move(160, window.ScreenSize.Height / 2 - 40);
            lb1.Show();

            Label lb2 = new Label(window)
            {
                Text = string.Format("A {0} ", pb1.BarAngle),
            };

            lb2.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
            lb2.Move(160, window.ScreenSize.Height / 2);
            lb2.Show();

            EcoreMainloop.AddTimer(0.5, () =>
            {
                pb1.Value += 1;

                lb1.Text = string.Format("V {0} %", pb1.Value);
                lb2.Text = string.Format("A {0} ", pb1.BarAngle);

                return(true);
            });
        }