Beispiel #1
0
        protected override void CreateChildren()
        {
            base.CreateChildren();

            VerticalScrollBar = new VScrollBar { Visible = false, SkinClass = (Type)GetStyle("verticalScrollBarSkin") };
            AddChild(VerticalScrollBar);

            HorizontalScrollBar = new HScrollBar { Visible = false, SkinClass = (Type)GetStyle("horizontalScrollBarSkin") };
            AddChild(HorizontalScrollBar);
        }
Beispiel #2
0
        protected override void CreateChildren()
        {
            base.CreateChildren();

            VerticalScrollBar = new VScrollBar {
                Visible = false, SkinClass = EvaluateSkinClassFromStyle("verticalScrollBarSkin")
            };
            AddChild(VerticalScrollBar);

            HorizontalScrollBar = new HScrollBar {
                Visible = false, SkinClass = EvaluateSkinClassFromStyle("horizontalScrollBarSkin")
            };
            AddChild(HorizontalScrollBar);
        }
Beispiel #3
0
        override protected void CreateChildren()
        {
            base.CreateChildren();

            Button button;

            #region View + vertical scrollbar

            _view = new VGroup
                              {
                                  Id = "view",
                                  ClipAndEnableScrolling = true,
                                  Left = 0, /*Right = 16, */Top = 0, Bottom = 0,
                                  PaddingLeft = 10,
                                  PaddingRight = 10,
                                  PaddingTop = 10,
                                  PaddingBottom = 10,
                                  Gap = 6,
                                  StopMouseWheelPropagation = true
                              };
            AddContentChild(_view);

            _vScrollBar = new VScrollBar
            {
                Left = null,
                Right = 0,
                Top = 0,
                Bottom = 0,
                Viewport = _view,
                SkinClass = typeof(VScrollBarSkin3)
            };
            AddContentChild(_vScrollBar);

            //_vScrollBar.ValidateNow();
            //_view.Right = _vScrollBar.MeasuredWidth;

            #endregion

            for (int i = 0; i < 14; i++)
            {
                button = new Button
                             {
                                 Text = "Button " + (i + 1),
                                 SkinClass = typeof(ImageButtonSkin),
                                 FocusEnabled = false,
                                 Icon = ImageLoader.Instance.Load("Icons/shape_square_add")
                             };
                //button.Click += delegate { AddButton(); };
                _view.AddChild(button);
            }

            List<string> icons = new List<string> { "maximize", "cancel" };
            for (int i = 0; i < icons.Count; i++)
            {
                button = new Button
                             {
                                 FocusEnabled = false,
                                 SkinClass = typeof(ImageButtonSkin),
                                 Icon = ImageLoader.Instance.Load("Icons/" + icons[i])
                             };
                button.Click += delegate(Event e) { Debug.Log("Clicked: " + e.Target); };
                ToolGroup.AddChild(button);
            }

            button = new Button
            {
                Text = "Clip",
                SkinClass = typeof(ImageButtonSkin),
                Icon = ImageLoader.Instance.Load("Icons/color_swatch"),
                ToggleMode = true,
                FocusEnabled = false,
                Selected = true
            };
            button.Change += delegate(Event e)
                                 {
                                     Button btn = (Button) e.Target;
                                     //Debug.Log("Selected: " + btn.Selected);
                                     _view.ClipAndEnableScrolling = btn.Selected;
                                 };
            ControlBarGroup.AddChild(button);

            icons = new List<string> { "lock", "star", "accept" };
            for (int i = 0; i < 3; i++)
            {
                button = new Button
                             {
                                 Text = UppercaseFirst(icons[i]),
                                 SkinClass = typeof(ImageButtonSkin),
                                 FocusEnabled = false,
                                 Icon = ImageLoader.Instance.Load("Icons/" + icons[i])
                             };
                //button.Click += delegate { AddButton(); };
                ControlBarGroup.AddChild(button);
            }
        }