示例#1
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
        }
示例#2
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
        }