コード例 #1
0
        public override void Run(Window window)
        {
            Log.Debug(TestName, "CircleSpinnerTest run");

            Rect square = window.GetInnerSquare();

            Conformant conformant = new Conformant(window);

            conformant.Show();

            var surface = new CircleSurface(conformant);

            spn1 = new CircleSpinner(window, surface)
            {
                Text        = "Spinner Test",
                LabelFormat = "%d Ratio",
                Style       = "circle",
                Minimum     = 0,
                Maximum     = 100,
                Value       = 0.0,
                Step        = 10,
                Interval    = 0.5,
                AlignmentX  = -1,
                AlignmentY  = 0.5,
                WeightX     = 1,
                WeightY     = 1
            };
            spn1.Geometry = new Rect(square.X, square.Y, square.Width, square.Height / 4);
            spn1.Show();

            spn2 = new CircleSpinner(window, surface)
            {
                Text        = "Spinner Test",
                LabelFormat = "%d Value",
                Style       = "circle",
                MarkerColor = Color.Red,
                Minimum     = 0,
                Maximum     = 100,
                Value       = 0,
                Interval    = 0.5,
                AlignmentX  = -1,
                AlignmentY  = 0.5,
                WeightX     = 1,
                WeightY     = 1
            };
            spn2.Geometry = new Rect(square.X, square.Y + square.Width * 2 / 4, square.Width, square.Height / 4);
            spn2.Show();

            spn1.Focused      += Spn1_Focused;
            spn2.Focused      += Spn2_Focused;
            spn1.ValueChanged += Spn1_ValueChanged;
        }