コード例 #1
0
ファイル: TSCheckBoxGroup.cs プロジェクト: wonrst/TizenFX
        public void CheckBoxGroupAdd()
        {
            tlog.Debug(tag, $"CheckBoxGroupAdd START");

            var testingTarget = new CheckBoxGroup();

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

            CheckBox cb = new CheckBox()
            {
                Size = new Size(48, 48)
            };

            try
            {
                testingTarget.Add(cb);
                tlog.Debug(tag, "GetItem : " + testingTarget.GetItem(0));

                testingTarget.Remove(cb);
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                Assert.Fail("Caught Exception : Failed!");
            }

            tlog.Debug(tag, $"CheckBoxGroupAdd END (OK)");
        }
コード例 #2
0
        public void CheckBoxItemGroup()
        {
            tlog.Debug(tag, $"CheckBoxItemGroup START");

            CheckBox cb = new CheckBox()
            {
                Size         = new Size(48, 48),
                IsEnabled    = true,
                IsSelectable = true,
                IsSelected   = true,
            };

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

            CheckBoxGroup cbGroup = new CheckBoxGroup();

            cbGroup.Add(cb);

            var testingTarget = cb.ItemGroup;

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

            cb.Dispose();
            tlog.Debug(tag, $"CheckBoxItemGroup END (OK)");
        }
コード例 #3
0
ファイル: TSCheckBoxGroup.cs プロジェクト: wonrst/TizenFX
        public void CheckBoxGroupCheckAll()
        {
            tlog.Debug(tag, $"CheckBoxGroupCheckAll START");

            var testingTarget = new CheckBoxGroup();

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

            CheckBox cb1 = new CheckBox()
            {
                Size         = new Size(48, 48),
                IsEnabled    = true,
                IsSelectable = true,
                IsSelected   = true,
            };

            CheckBox cb2 = new CheckBox()
            {
                Size         = new Size(48, 48),
                IsEnabled    = true,
                IsSelectable = true,
                IsSelected   = false,
            };

            try
            {
                testingTarget.Add(cb1);
                testingTarget.Add(cb2);
                testingTarget.CheckAll(true);

                var result = testingTarget.IsCheckedAll();
                tlog.Debug(tag, "IsCheckedAll : " + result);

                tlog.Debug(tag, "GetCheckedItems : " + testingTarget.GetCheckedItems());
                tlog.Debug(tag, "GetCheckedIndices : " + testingTarget.GetCheckedIndices());
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                Assert.Fail("Caught Exception : Failed!");
            }

            tlog.Debug(tag, $"CheckBoxGroupCheckAll END (OK)");
        }
コード例 #4
0
ファイル: ComponentExample.cs プロジェクト: theojin/nui-demo
    protected override void OnCreate()
    {
        base.OnCreate();

        // Set theme to wearable.
        // (It is not needed in the wearable device)
        Tizen.NUI.Components.StyleManager.Instance.Theme = "wearable";

        Window window = NUIApplication.GetDefaultWindow();

        window.BackgroundColor = Color.Black;

        var button1 = new CheckBox()
        {
            Size     = new Size(100, 100),
            Position = new Position(0, -50),
            PositionUsesPivotPoint = true,
            ParentOrigin           = ParentOrigin.Center,
            PivotPoint             = PivotPoint.Center,
            IsSelected             = true,
        };

        window.Add(button1);

        var button2 = new CheckBox()
        {
            Size     = new Size(100, 100),
            Position = new Position(0, 50),
            PositionUsesPivotPoint = true,
            ParentOrigin           = ParentOrigin.Center,
            PivotPoint             = PivotPoint.Center,
        };

        window.Add(button2);

        var group = new CheckBoxGroup();

        group.Add(button1);
        group.Add(button2);
    }
コード例 #5
0
        public View CreateCheckbox()
        {
            View view = new View()
            {
                Size = new Size(360, 360),
                PositionUsesPivotPoint = true,
                ParentOrigin           = ParentOrigin.Center,
                PivotPoint             = PivotPoint.Center,
            };
            var button1 = new CheckBox()
            {
                Size     = new Size(100, 100),
                Position = new Position(0, -35),
                PositionUsesPivotPoint = true,
                ParentOrigin           = ParentOrigin.Center,
                PivotPoint             = PivotPoint.Center,
                IsSelected             = true,
            };

            view.Add(button1);

            var button2 = new CheckBox()
            {
                Size     = new Size(100, 100),
                Position = new Position(0, 60),
                PositionUsesPivotPoint = true,
                ParentOrigin           = ParentOrigin.Center,
                PivotPoint             = PivotPoint.Center,
            };

            view.Add(button2);

            var group = new CheckBoxGroup();

            group.Add(button1);
            group.Add(button2);

            return(view);
        }
コード例 #6
0
    protected override void OnCreate()
    {
        base.OnCreate();

        Window window = NUIApplication.GetDefaultWindow();

        window.BackgroundColor = Color.Black;

        var button1 = new CheckBox()
        {
            Size     = new Size(100, 100),
            Position = new Position(0, -50),
            PositionUsesPivotPoint = true,
            ParentOrigin           = ParentOrigin.Center,
            PivotPoint             = PivotPoint.Center,
            IsSelected             = true,
        };

        window.Add(button1);

        var button2 = new CheckBox()
        {
            Size     = new Size(100, 100),
            Position = new Position(0, 50),
            PositionUsesPivotPoint = true,
            ParentOrigin           = ParentOrigin.Center,
            PivotPoint             = PivotPoint.Center,
        };

        window.Add(button2);

        var group = new CheckBoxGroup();

        group.Add(button1);
        group.Add(button2);
    }