コード例 #1
0
ファイル: SpinnerTest1.cs プロジェクト: yunmiha/TizenFX
        public override void Run(Window window)
        {
            Conformant conformant = new Conformant(window);

            conformant.Show();
            Table table = new Table(window);

            conformant.SetContent(table);
            table.Show();

            Spinner spn1 = new Spinner(window)
            {
                Text        = "Slider Test",
                LabelFormat = "%1.2f Value",
                Minimum     = 1,
                Maximum     = 12,
                Value       = 1.5,
                Step        = 0.5,
                Interval    = 0.5,
                AlignmentX  = -1,
                AlignmentY  = 0.5,
                WeightX     = 1,
                WeightY     = 1
            };

            spn1.AddSpecialValue(5, "Five !!!!");

            Label lb1 = new Label(window)
            {
                AlignmentX = -1,
                AlignmentY = 0,
                WeightX    = 1,
                WeightY    = 1
            };

            table.Pack(spn1, 1, 1, 2, 1);
            table.Pack(lb1, 1, 2, 2, 1);

            spn1.Show();
            lb1.Show();

            spn1.ValueChanged += (s, e) =>
            {
                lb1.Text = string.Format("Value Changed: {0}", spn1.Value);
                lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
            };
        }
コード例 #2
0
        public override void Run(Window window)
        {
            Rect square = window.GetInnerSquare();

            Spinner spn1 = new Spinner(window)
            {
                Text        = "Slider Test",
                LabelFormat = "%1.2f Value",
                Minimum     = 1,
                Maximum     = 12,
                Value       = 1.5,
                Step        = 0.5,
                Interval    = 0.5,
                AlignmentX  = -1,
                AlignmentY  = 0.5,
                WeightX     = 1,
                WeightY     = 1
            };

            spn1.AddSpecialValue(5, "Five !!!!");

            Label lb1 = new Label(window)
            {
                AlignmentX = -1,
                AlignmentY = 0,
                WeightX    = 1,
                WeightY    = 1
            };

            spn1.Geometry = new Rect(square.X, square.Y, square.Width, square.Height / 4);
            spn1.Show();

            lb1.Geometry = new Rect(square.X, square.Y + square.Width * 2 / 4, square.Width, square.Height / 4);
            lb1.Show();

            spn1.ValueChanged += (s, e) =>
            {
                lb1.Text = string.Format("Value Changed: {0}", spn1.Value);
                lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'";
            };
        }