// ReSharper disable MemberCanBePrivate.Global

        #endregion

        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     = 300,
                Height    = 350
            };
            _anchor.Popup = DropDown;

            #endregion

            #region Background

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

            #endregion

            #region Border

            _border = new RectShape
            {
                Id           = "border",
                Left         = 0,
                Right        = 0,
                Top          = 0,
                Bottom       = 0,
                MouseEnabled = false
            };
            DropDown.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,
                //Width = 300
            };
            _scroller.SetStyle("horizontalScrollPolicy", ScrollPolicy.Off);
            DropDown.AddChild(_scroller);

            #endregion

            #region Data group

            DataGroup = new DataGroup
            {
                Id           = "data_group",
                ItemRenderer = new ItemRendererFactory <DefaultItemRenderer>(),
                Layout       = new TileLayout {
                    HorizontalGap = 0, VerticalGap = 0, RequestedRowCount = 4, RequestedColumnCount = 5
                }
            };
            _scroller.Viewport = DataGroup;

            #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
            };
            AddChild(LabelDisplay);

            #endregion
        }
Beispiel #2
0
        // ReSharper disable MemberCanBePrivate.Global

        #endregion

        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,
                Height    = 200
            };
            //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               = 200
                                       //Visible = IncludeInLayout = false
            };
            _scroller.SetStyle("horizontalScrollPolicy", ScrollPolicy.Off);
            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,
                BackgroundColor = Color.gray
            };
            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

            TextInput = new TextField
            {
                VerticalCenter = 0,
                Left           = 0,
                Right          = 25,
                Top            = 0,
                Bottom         = 0,
                Height         = 25 /*,
                                     * Width = 75,*/
                                    //MouseEnabled = false,
                                    //Color = Color.black
            };
            //LabelDisplay.SetStyle("color", GetStyle("textColor"));
            AddChild(TextInput);

            #endregion
        }