示例#1
0
// ReSharper restore UnusedMember.Global
// ReSharper restore CSharpWarnings::CS1591
// ReSharper restore NotAccessedField.Global

        protected override void CreateChildren()
        {
            base.CreateChildren();

            FirstButton = new SkinnedItemRendererFactory<ButtonBarButton, ButtonBarFirstButtonSkin>();
            MiddleButton = new SkinnedItemRendererFactory<ButtonBarButton, ButtonBarMiddleButtonSkin>();
            LastButton = new SkinnedItemRendererFactory<ButtonBarButton, ButtonBarLastButtonSkin>();

            DataGroup = new DataGroup
            {
                PercentWidth = 100,
                PercentHeight = 100,
                Layout = new HorizontalLayout { Gap = 0 }
            };
            AddChild(DataGroup);
        }
示例#2
0
// ReSharper restore UnusedMember.Global
// ReSharper restore CSharpWarnings::CS1591
// ReSharper restore NotAccessedField.Global

        protected override void CreateChildren()
        {
            base.CreateChildren();

            FirstButton = new SkinnedItemRendererFactory<ButtonBarButton, ButtonBarFirstButtonSkin>();
            //FirstButton = new SkinnedItemRendererFactory(typeof(ButtonBarButton), (Type) GetStyle("firstButtonSkinClass"));

            MiddleButton = new SkinnedItemRendererFactory<ButtonBarButton, ButtonBarMiddleButtonSkin>();
            LastButton = new SkinnedItemRendererFactory<ButtonBarButton, ButtonBarLastButtonSkin>();

            DataGroup = new DataGroup
            {
                PercentWidth = 100,
                PercentHeight = 100,
                Layout = new HorizontalLayout()
            };
            AddChild(DataGroup);
        }
示例#3
0
    override protected void CreateChildren()
    {
        base.CreateChildren();

        #region Controls

        Toolbar toolbar = new Toolbar();
        AddChild(toolbar);

        Button button = new Button
        {
            Text = "Add data",
            SkinClass = typeof(ImageButtonSkin),
            Icon = ImageLoader.Instance.Load("Icons/add"),
            AutoRepeat = true
        };
        button.ButtonDown += delegate
        {
            _dataProvider.AddItem("data " + _random.Next(1, 100));
        };
        toolbar.AddContentChild(button);

        #endregion

        #region Scroller

        Scroller scroller = new Scroller
        {
            SkinClass = typeof (ScrollerSkin2),
            PercentWidth = 100,
            PercentHeight = 100
        };
        //scroller.SetStyle("horizontalScrollPolicy", ScrollPolicy.On);
        //scroller.SetStyle("verticalScrollPolicy", ScrollPolicy.On);
        AddChild(scroller);

        Group viewport = new Group
        {
            MouseEnabled = true,
            Layout = new VerticalLayout
            {
                HorizontalAlign = HorizontalAlign.Left,
                PaddingLeft = 10,
                PaddingRight = 10,
                PaddingTop = 10,
                PaddingBottom = 10,
                Gap = 10
            }
        };
        scroller.Viewport = viewport;
        //AddChild(viewport);

        #endregion

        #region Data controls

        List<object> source = new List<object> {"Failure", "Teaches", "Success", "One", "Two", "Three", "Four", "Five", "Six"};

        _dataProvider = new ArrayList(source);

        var factory = new ItemRendererFactory<DefaultItemRenderer>();

        /* LISTS */

        #region HGroup

        HGroup hGroup1 = new HGroup
                    {
                        PaddingLeft = 10,
                        PaddingRight = 10,
                        PaddingTop = 10,
                        PaddingBottom = 10,
                        Gap = 20
                    };

        //hbox.SetStyle("showBackground", true);
        //hbox.SetStyle("backgroundColor", RgbColor.FromHex(0x004CFF).ToColor());
        viewport.AddChild(hGroup1);

        #endregion

        HGroup hGroup = new HGroup();
        viewport.AddChild(hGroup);

        /* DATA GROUPS */

        #region Data group 1

        hGroup1 = new HGroup
        {
            PaddingLeft = 10,
            PaddingRight = 10,
            PaddingTop = 10,
            PaddingBottom = 10,
            Gap = 50
        };
        hGroup.AddChild(hGroup1);

        DataGroup dataGroup = new DataGroup
        {
            Layout = new VerticalLayout(),
            DataProvider = _dataProvider,
            //ItemRenderer = new ItemRendererFactory <DefaultItemRenderer>(),
            ItemRendererFunction = delegate(object item)
            {
                return factory;
            }
        };
        hGroup1.AddChild(dataGroup);

        #endregion

        #region Data group 2

        hGroup1 = new HGroup
        {
            PaddingLeft = 10,
            PaddingRight = 10,
            PaddingTop = 10,
            PaddingBottom = 10,
            Gap = 50
        };
        hGroup.AddChild(hGroup1);

        dataGroup = new DataGroup
        {
            Layout = new TileLayout {RequestedColumnCount = 2},
            //Width = 200, Height = 200,
            DataProvider = _dataProvider,
            //ItemRenderer = new ItemRendererFactory <DefaultItemRenderer>(),
            ItemRendererFunction = delegate
            {
                return factory;
            }
            //ClipAndEnableScrolling = true
        };
        hGroup1.AddChild(dataGroup);

        #endregion

        #region Data group 3

        hGroup1 = new HGroup
        {
            PaddingLeft = 10,
            PaddingRight = 10,
            PaddingTop = 10,
            PaddingBottom = 10,
            Gap = 50
        };
        hGroup.AddChild(hGroup1);

        dataGroup = new DataGroup
        {
            Layout = new TileLayout { RequestedColumnCount = 4 },
            //Width = 200, Height = 200,
            DataProvider = _dataProvider,
            //ItemRenderer = new ItemRendererFactory <DefaultItemRenderer>(),
            ItemRendererFunction = delegate
            {
                return factory;
            }
            //ClipAndEnableScrolling = true
        };
        hGroup1.AddChild(dataGroup);

        #endregion

        #endregion

        #region VGroup

        VGroup vgroup = new VGroup();
        hGroup.AddChild(vgroup);

        #endregion

        #region List 1

        List list = new List
        {
            //Layout = new TileLayout { RequestedColumnCount = 4 },
            Width = 200,
            Height = 200,
            DataProvider = _dataProvider,
            //ItemRenderer = new ItemRendererFactory <DefaultItemRenderer>(),
            ItemRendererFunction = delegate
            {
                return factory;
            }
        };
        vgroup.AddChild(list);

        #endregion

        #region List 2

        list = new List
        {
            //Layout = new TileLayout { RequestedColumnCount = 3 },
            Width = 200,
            Height = 245,
            DataProvider = _dataProvider,
            //ItemRenderer = new ItemRendererFactory <DefaultItemRenderer>(),
            ItemRendererFunction = delegate
            {
                return factory;
            }
        };
        vgroup.AddChild(list);

        #endregion

        #region List 3

        list = new List
        {
            Id = "list3",
            Width = 400,
            Height = 600,
            DataProvider = _dataProvider,
            SkinClass = typeof(ListSkin2),
            ItemRenderer = new ItemRendererFactory<BigItemRenderer>()
        };
        hGroup.AddChild(list);

        #endregion

        #region Process renderer click

        AddEventListener(BigItemRenderer.ADD_BUTTON_CLICKED, delegate(Event e)
        {
            BigItemRenderer itemRenderer = (BigItemRenderer)e.Target;
            Alert.Show("Info", itemRenderer.Data.ToString(), AlertButtonFlag.Ok,
                new AlertOption(AlertOptionType.HeaderIcon, ImageLoader.Instance.Load("Icons/information")));
        });

        #endregion
            
    }
示例#4
0
        protected override void CreateChildren()
        {
            base.CreateChildren();

            #region Popup anchor

            _anchor = new PopUpAnchor
            {
                Id = "pop_up",
                Left = 0,
                Right = 0,
                Top = 0,
                Bottom = 0,
                PopupPosition = PopupPosition.Below,
                PopupWidthMatchesAnchorWidth = true
            };
            AddChild(_anchor);

            #endregion

            #region DropDown

            DropDown = new Group
            {
                Id = "drop_down",
                MaxHeight = 134, MinHeight = 22,
                Width = 150
            };
            //AddChild(DropDown);
            _anchor.Popup = DropDown;

            #endregion

            #region Background

            _background = new RectShape
            {
                Id = "background",
                Left = 0,
                Right = 0,
                Top = 0,
                Bottom = 0
            };
            DropDown.AddChild(_background);

            #endregion

            #region Scroller

            _scroller = new Scroller
            {
                Id = "scroller",
                SkinClass = EvaluateSkinClassFromStyle("scrollerSkin"),
                Left = 0,
                Right = 0,
                Top = 0,
                Bottom = 0,
                MinViewportInset = 1,
                HasFocusableChildren = false,
                Height = 100
            };
            DropDown.AddChild(_scroller);

            #endregion
            
            #region Data group

            DataGroup = new DataGroup
            {
                Id = "data_group",
                ItemRenderer = new ItemRendererFactory<DefaultItemRenderer>(),
                Layout = new VerticalLayout
                {
                    Gap = 0,
                    HorizontalAlign = HorizontalAlign.ContentJustify,
                    RequestedMinRowCount = 5
                }
            };
            _scroller.Viewport = DataGroup;

            #endregion

            #region Border

            _border = new RectShape
            {
                Id = "border",
                Left = 0,
                Right = 0,
                Top = 0,
                Bottom = 0,
                MouseEnabled = false
            };
            DropDown.AddChild(_border);

            #endregion

            #region OpenButton

            OpenButton = new Button
            {
                Left = 0,
                Right = 0,
                Top = 0,
                Bottom = 0,
                FocusEnabled = false,
                SkinClass = typeof(DropDownListButtonSkin)
            };
            AddChild(OpenButton);

            #endregion
            
            #region Label

            LabelDisplay = new Label
            {
                VerticalCenter = 0,
                Left = 7,
                Right = 32,
                Top = 2,
                Bottom = 2,
                Width = 75,
                MouseEnabled = false,
                Color = Color.black
            };
            //LabelDisplay.SetStyle("color", GetStyle("textColor"));
            AddChild(LabelDisplay);

            #endregion
        }
示例#5
0
        // ReSharper restore MemberCanBePrivate.Global

        #endregion

        protected override void CreateChildren()
        {
            base.CreateChildren();

            #region Background

            _background = new RectShape
            {
                Id = "background",
                Left = 0,
                Right = 0,
                Top = 0,
                Bottom = 0
            };
            AddChild(_background);

            #endregion

            #region Border

            _border = new RectShape
            {
                Id = "border",
                Left = 0,
                Right = 0,
                Top = 0,
                Bottom = 0,
                MouseEnabled = false
            };
            AddChild(_border);

            #endregion

            #region Scroller

            _scroller = new Scroller
            {
                Id = "scroller",
                SkinClass = EvaluateSkinClassFromStyle("scrollerSkin"),
                Left = 0,
                Right = 0,
                Top = 0,
                Bottom = 0,
                MinViewportInset = 1,
                HasFocusableChildren = false
            };
            AddChild(_scroller);

            #endregion

            #region Data group

            DataGroup = new DataGroup
            {
                Id = "data_group",
                ItemRenderer = new ItemRendererFactory<DefaultItemRenderer>(),
                Layout = new VerticalLayout
                             {
                                 Gap = 0, HorizontalAlign = HorizontalAlign.ContentJustify, RequestedMinRowCount = 5
                             }
            };
            //AddChild(DataGroup);
            _scroller.Viewport = DataGroup;

            #endregion
        }