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

            _backgroundImage = new Image
            {
                Left = 0,
                Right = 0,
                Top = 0,
                Bottom = 0,
                AlphaBlend = true
            };
            AddChild(_backgroundImage);
        }
        protected override void CreateChildren()
        {
            //Debug.Log("Button skin creating children");
            base.CreateChildren();

            #region Background

            _background = new RectShape
                              {
                                  Left = 0,
                                  Right = 0,
                                  Top = 0,
                                  Bottom = 0
                              };
            _background.SetStyle("backgroundStyle", ButtonSingleStateStyle.Instance);
            AddChild(_background);

            //_shine = new RectShape
            //{
            //    Left = 0,
            //    Right = 0,
            //    Top = 0,
            //    Height = GetCurrentShineHeight(),
            //    MouseEnabled = false
            //};
            //_shine.SetStyle("backgroundStyle", ButtonSingleStateStyle.Instance);
            //_shine.Color = (Color) GetStyle("shineColor");
            //AddChild(_shine);

            #endregion

            #region Icon

            IconDisplay = new Image
                              {
                                  HorizontalCenter = 0f,
                                  VerticalCenter = 0f,
                                  MouseEnabled = false
                              };
            AddChild(IconDisplay);

            #endregion
        }
Beispiel #3
0
// ReSharper restore MemberCanBePrivate.Global

        #endregion

        protected override void CreateChildren()
        {
            //Debug.Log("Button skin creating children");
            base.CreateChildren();

            #region Background

            _background = new RectShape
            {
                Left = 0,
                Right = 0,
                Top = 0,
                Bottom = 0,
                Alpha = 0.5f
            };
            //_background.SetStyle("backgroundStyle", ButtonStyle.Instance);
            AddChild(_background);

            #endregion

            #region Box

            Group box = new Group
            {
                HorizontalCenter = 0,
                VerticalCenter = 0
            };
            AddChild(box);

            _boxBg = new RectShape
            {
                Left = 0, Right = 0, Top = 0, Bottom = 0,
                HorizontalCenter = 0,
                VerticalCenter = 0,
                /*MinWidth = 300,
                MinHeight = 100*/
            };
            //_background.SetStyle("backgroundStyle", ButtonStyle.Instance);
            _background.SetStyle("backgroundColor", Color.blue);
            box.AddChild(_boxBg);

            #endregion

            HGroup hGroup = new HGroup
            {
                Left = 10, Right = 10, Top = 10, Bottom = 10,
                HorizontalCenter = 0,
                VerticalCenter = 0,
                VerticalAlign = VerticalAlign.Middle
            };
            box.AddChild(hGroup);

            #region Icon

            IconDisplay = new Image {
                MouseEnabled = false
            };
            hGroup.AddChild(IconDisplay);

            #endregion

            #region Label

            LabelDisplay = new Label
                               {
                                   Text = "miki",
                                   MouseEnabled = false,
                                   //Width = 100
                               };
            hGroup.AddChild(LabelDisplay);

            #endregion
        }
        protected override void CreateChildren()
        {
            //Debug.Log("Button skin creating children");
            base.CreateChildren();

            #region Background

            _background = new RectShape
                              {
                                  Left = 0,
                                  Right = 0,
                                  Top = 0,
                                  Bottom = 0
                              };
            _background.SetStyle("backgroundStyle", ButtonSingleStateStyle.Instance);
            AddChild(_background);

            #endregion

            #region Icon

            IconDisplay = new Image
                              {
                                  HorizontalCenter = 0f,
                                  VerticalCenter = 0f,
                                  MouseEnabled = false
                              };
            AddChild(IconDisplay);

            #endregion
        }
Beispiel #5
0
        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 = "overlay",
                Left = 0,
                Right = 0,
                Top = 0,
                Bottom = 0,
                MouseEnabled = false
            };
            AddChild(_border);

            #endregion

            #region Header background

            _headerBackground = new RectShape
            {
                Id = "headerBackground",
                //Color = (Color?)GetStyle("headerBackgroundColor"),
                Left = 1,
                Right = 1,
                Top = 1,
                Height = 50
            };
            AddChild(_headerBackground);

            #endregion

            #region Header group

            HeaderGroup = new Group
            {
                Id = "headerGroup",
                Layout = new AbsoluteLayout(),
                Left = 1,
                Right = 1,
                Top = 1,
                Height = 50,
                MouseEnabled = true
            };
            AddChild(HeaderGroup);

            #endregion

            #region Icon + label group

            _labelGroup = new HGroup
            {
                Left = 10,
                VerticalCenter = 0,
                Gap = 6,
                VerticalAlign = VerticalAlign.Middle,
                ClipAndEnableScrolling = true
            };
            HeaderGroup.AddChild(_labelGroup);

            #endregion

            #region Icon display

            HeaderIconDisplay = new Image();
            _labelGroup.AddChild(HeaderIconDisplay);

            #endregion

            #region Label display

            TitleDisplay = new Label();
            _labelGroup.AddChild(TitleDisplay);

            #endregion

            #region Move area

            MoveArea = new Group
            {
                Id = "move_area",
                Layout = new AbsoluteLayout(),
                Left = 0,
                Right = 0,
                Top = 0,
                Bottom = 0,
                MouseEnabled = true
            };
            HeaderGroup.AddChild(MoveArea);

            #endregion

            #region Tools

            ToolGroup = new Group
            {
                Id = "toolGroup",
                Layout = new HorizontalLayout
                {
                    HorizontalAlign = HorizontalAlign.Right,
                    VerticalAlign = VerticalAlign.Middle,
                    Gap = 4
                },
                Right = 6,
                VerticalCenter = 0,
                MouseEnabled = true // not draggable when clicking space between buttons --- false // to be draggable on possible tools label click
            };
            HeaderGroup.AddChild(ToolGroup);

            #endregion

            #region Content background

            _contentGroupBackground = new RectShape
            {
                Id = "contentGroupBackground",
                //Color = Color.white,
                Left = 6,
                Right = 6,
                Top = 50,
                Bottom = 50
            };
            AddChild(_contentGroupBackground);

            #endregion

            #region Scroller

            _scroller = new Scroller
            {
                Left = 6,
                Right = 6,
                Top = 50,
                Bottom = 50
            };
            AddChild(_scroller);

            #endregion

            #region Content group

            ContentGroup = new HGroup
            {
                Id = "contentGroup",
                Gap = 10,
                PaddingLeft = 10, PaddingRight = 10, PaddingTop = 10, PaddingBottom = 10,
                HorizontalAlign = HorizontalAlign.Center,
                VerticalAlign = VerticalAlign.Middle
            };
            AddChild(ContentGroup);
            _scroller.Viewport = ContentGroup;

            #endregion

            #region Icon

            IconDisplay = new Image();
            ContentGroup.AddChild(IconDisplay);

            #endregion

            #region Message display

            MessageDisplay = new Label {
                Multiline = true, 
                MaxWidth = 800,
                MaxHeight = 600,
                Color = Color.black,
            };
            MessageDisplay.SetStyle("labelStyle", GetStyle("labelStyle"));
            MessageDisplay.SetStyle("font", GetStyle("labelFont"));
            ContentGroup.AddChild(MessageDisplay);

            #endregion

            #region Control bar background

            _controlBarBackground = new RectShape
            {
                Id = "controlBarBackground",
                Left = 1,
                Right = 1,
                Bottom = 1,
                Height = 50,
                Alpha = 0.5f,
                MouseEnabled = false
            };
            AddChild(_controlBarBackground);

            #endregion

            #region Control bar

            ControlBarGroup = new Group
            {
                Id = "controlBar",
                //ClipAndEnableScrolling = true, // this introduces a child positioning bug
                Layout = new HorizontalLayout
                {
                    HorizontalAlign = HorizontalAlign.Right,
                    VerticalAlign = VerticalAlign.Bottom,
                    Gap = 4,
                    PaddingLeft = 6,
                    PaddingRight = 6,
                    PaddingTop = 6,
                    PaddingBottom = 6
                },
                ClipAndEnableScrolling = true,
                Left = 1,
                Right = 1,
                Bottom = 1,
                Height = 50,
                MouseEnabled = true // not draggable when clicking space between buttons --- false // to be draggable on possible tools label click
            };
            AddChild(ControlBarGroup);

            #endregion

        }
Beispiel #6
0
        protected override void CreateChildren()
        {
            //Debug.Log("Button skin creating children");
            base.CreateChildren();

            #region Background image

            /* just in case that no image is visible */
            /*_background = new RectShape
            {
                Left = 0,
                Right = 0,
                Top = 0,
                Bottom = 0
            };
            _background.SetStyle("backgroundStyle", ButtonSingleStateStyle.Instance);
            AddChild(_background);*/

            /* Tiled image */
            _backgroundImage = new Image
            {
                Left = 0,
                Right = 0,
                Top = 0,
                Bottom = 0,
                Mode = ImageMode.Tiled,
                Visible = true
            };
            AddChild(_backgroundImage);

            #endregion

            #region Icon + label group

            VGroup vGroup = new VGroup
            {
                Gap = 10,
                HorizontalAlign = HorizontalAlign.Center,
                VerticalAlign = VerticalAlign.Middle,
                HorizontalCenter = 0,
                VerticalCenter = 0,
                Right = 10,
                Left = 10,
                Top = 10,
                Bottom = 10,
            };
            AddChild(vGroup);

            #endregion

            #region Label

            LabelDisplay = new Label {
                MouseEnabled = false,
                Multiline = true, 
                Color = (Color) GetStyle("labelUpColor")
            };
            vGroup.AddChild(LabelDisplay);

            #endregion

            #region Icon

            IconDisplay = new Image {MouseEnabled = false};
            vGroup.AddChild(IconDisplay);

            #endregion
        }
Beispiel #7
0
        protected override void CreateChildren()
        {
            //Debug.Log("Button skin creating children");
            base.CreateChildren();

            #region Background

            _background = new RectShape
            {
                Left = 0,
                Right = 0,
                Top = 0,
                Bottom = 0,
                BackgroundColor = (Color)GetStyle("backgroundColor")
            };
            _background.SetStyle("backgroundStyle", ButtonSingleStateStyle.Instance);
            AddChild(_background);

            /*_backgroundImage = new Image
                              {
                                  Left = 0,
                                  Right = 0,
                                  Top = 0,
                                  Bottom = 0,
                                  //Visible = false,
                                  ScaleMode = ImageScaleMode.ScaleToFill
                              };
            AddChild(_backgroundImage);*/

            #endregion

            VGroup vGroup = new VGroup
            {
                Gap = 10,
                HorizontalAlign = HorizontalAlign.Center,
                VerticalAlign = VerticalAlign.Middle,
                HorizontalCenter = 0,
                VerticalCenter = 0,
                Right = 10,
                Left = 10,
                Top = 10,
                Bottom = 10,
            };
            AddChild(vGroup);

            #region Icon

            IconDisplay = new Image
            {
                MouseEnabled = false,
                //Visible = false,
                //IncludeInLayout = false
            };
            vGroup.AddChild(IconDisplay);

            #endregion

            #region Label

            LabelDisplay = new Label
            {
                MouseEnabled = false,
                //Visible = false,
                //IncludeInLayout = false
            };
            vGroup.AddChild(LabelDisplay);

            #endregion
        }
Beispiel #8
0
        protected override void CreateChildren()
        {
            base.CreateChildren();

            #region Background

            _background = new RectShape { Left = 0, Right = 0, Top = 0, Bottom = 0 };
            _background.SetStyle("backgroundStyle", GetStyle("backgroundStyle"));
            AddChild(_background);

            #endregion

            _group = new Group
            {
                Left = 0, Right = 0, Top = 0, Bottom = 0,
                Layout = GetLayout((bool)GetStyle("vertical"))
            };
            AddChild(_group);

            #region Icon

            IconDisplay = new Image
            {
                MouseEnabled = false
            };
            _group.AddChild(IconDisplay);

            #endregion

            #region Label

            LabelDisplay = new Label();
            _group.AddChild(LabelDisplay);

            #endregion
        }
Beispiel #9
0
        /*public override void SetCurrentState(string stateName)
        {
            base.SetCurrentState(stateName);
            Debug.Log("SetCurrentState: " + stateName);
        }*/

        protected override void CreateChildren()
        {
            //Debug.Log("Button skin creating children");
            base.CreateChildren();

            #region Background

            _backgroundImage = new Image
            {
                Left = 0,
                Right = 0,
                Top = 0,
                Bottom = 0,
                Mode = ImageMode.Tiled,
                AdjustWidthToTexture = false,
                AdjustHeightToTexture = false,
                Visible = false // default
            };
            AddChild(_backgroundImage);

            #endregion

            _hGroup = new HGroup
            {
                HorizontalCenter = 0,
                VerticalCenter = 0,
                Right = 6,
                Left = 6,
                Top = 6,
                Bottom = 6
            };
            AddChild(_hGroup);

            #region Icon

            _iconImage = new Image
            {
                Width = 16,
                Height = 16,
                MinWidth = 4,
                MinHeight = 4
            };
            _hGroup.AddChild(_iconImage);

            #endregion

            #region Label

            LabelDisplay = new Label();
            _hGroup.AddChild(LabelDisplay);

            #endregion
        }
        protected override void CreateChildren()
        {
            base.CreateChildren();

            _rect = new RectShape(); //{ Left = 0, Right = 0, Top = 0, Bottom = 0 //};
            AddChild(_rect);

            _hGroup = new HGroup
            {
                PaddingLeft = 10, PaddingRight = 10, PaddingTop = 10, PaddingBottom = 10, Gap = 10
            };
            AddChild(_hGroup);

            // left group
            VGroup vGroup = new VGroup
            {
                VerticalAlign = VerticalAlign.Middle,
                Gap = 10,
                PercentWidth = 100,
                PercentHeight = 100
            };
            _hGroup.AddChild(vGroup);

            _image = new Image
            {
                Styles = ButtonStyles
            };
            _image.MouseDown += delegate
            {
                DispatchEvent(new Event("showImage", true)); // bubbling event
            };
            vGroup.AddChild(_image);

            LabelDisplay = new Label
            {
                Width = 150
            };
            //vGroup.AddChild(LabelDisplay);
            if (_text != string.Empty)
                LabelDisplay.Text = _text;

            // right group
            vGroup = new VGroup
            {
                VerticalAlign = VerticalAlign.Middle, Gap = 10, PercentWidth = 100, PercentHeight = 100
            };
            _hGroup.AddChild(vGroup);

            if (null == _buttonShow)
            {
                _buttonShow = new Button { 
                    Text = "Show", 
                    PercentWidth = 100,
                    FocusEnabled = false,
                    SkinClass = typeof(ImageButtonSkin),
                    Styles = ButtonStyles,
                    Icon = ImageLoader.Instance.Load("Icons/accept")
                };
                _buttonShow.ButtonDown += delegate
                {
                    DispatchEvent(new Event("showImage", true)); // bubbling!
                };
                vGroup.AddChild(_buttonShow);
            }

            if (null == _buttonRemove)
            {
                _buttonRemove = new Button
                {
                    Text = "Remove",
                    PercentWidth = 100,
                    FocusEnabled = false,
                    SkinClass = typeof(ImageButtonSkin),
                    Styles = ButtonStyles,
                    Icon = ImageLoader.Instance.Load("Icons/cancel")
                };
                _buttonRemove.ButtonDown += delegate
                                                {
                                                    var parentList = Owner as List;
                                                    if (null != parentList)
                                                    {
                                                        //Debug.Log("Removing at " + parentList.DataProvider.GetItemIndex(Data));
                                                        parentList.DataProvider.RemoveItemAt(parentList.DataProvider.GetItemIndex(Data));
                                                    }
                                                    else
                                                        Debug.LogError("Owner of item renderer is not a list");
                                                };
                vGroup.AddChild(_buttonRemove);
            }
        }
Beispiel #11
0
        protected override void CreateChildren()
        {
            //Debug.Log("Button skin creating children");
            base.CreateChildren();

            #region Background

            _background = new RectShape
            {
                Left = 0,
                Right = 0,
                Top = 0,
                Bottom = 0
            };
            _background.SetStyle("backgroundStyle", ButtonSingleStateStyle.Instance);
            AddChild(_background);

            _backgroundImage = new Image
            {
                //Id = "background_image",
                Left = 1,
                Right = 1,
                Top = 1,
                Bottom = 1,
                //Visible = false,
                Mode = ImageMode.Tiled,
                AdjustWidthToTexture = false,
                AdjustHeightToTexture = false
            };
            AddChild(_backgroundImage);

            #endregion

            #region Icon

            IconDisplay = new Image
            {
                HorizontalCenter = 0f,
                VerticalCenter = 0f,
                MouseEnabled = false
            };
            AddChild(IconDisplay);

            #endregion
        }
Beispiel #12
0
        override protected void CreateChildren()
        {
            base.CreateChildren();

            #region Tools

            Button button = new Button
            {
                SkinClass = typeof (ImageButtonSkin),
                Icon = global::eDriven.Core.Caching.ImageLoader.Instance.Load("Icons/cancel"),
                FocusEnabled = false,
                Styles = ButtonStyles
            };
            button.Click += delegate
            {
                DispatchEvent(new CloseEvent(CloseEvent.CLOSE));
            };
            ToolGroup.AddChild(button);

            #endregion

            #region Image

            _image = new Image { Id="image", PercentWidth = 100, PercentHeight = 100, ScaleMode = ImageScaleMode.ScaleToFit };
            AddContentChild(_image);

            #endregion

            #region Control bar

            ControlBarGroup.AddChild(new Spacer {PercentWidth = 100});

            button = new Button
            {
                Text = "Close preview",
                SkinClass = typeof (ImageButtonSkin),
                Icon = global::eDriven.Core.Caching.ImageLoader.Instance.Load("Icons/color_swatch"),
                FocusEnabled = false,
                Styles = ButtonStyles
            };
            button.Click += delegate
            {
                DispatchEvent(new CloseEvent(CloseEvent.CLOSE));
            };
            ControlBarGroup.AddChild(button);

            #endregion

        }
Beispiel #13
0
        // ReSharper restore MemberCanBePrivate.Global

        #endregion

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

            #region Background

            _background = new RectShape
            {
                Left = 0,
                Right = 0,
                Top = 0,
                Bottom = 0,
                Alpha = 0.5f
            };
            AddChild(_background);

            #endregion

            #region Box

            _box = new RectShape
            {
                MinWidth = 300,
                MinHeight = 100,
                HorizontalCenter = 0,
                VerticalCenter = 0
            };
            AddChild(_box);

            #endregion

            HGroup hGroup = new HGroup
            {
                HorizontalCenter = 0,
                VerticalCenter = 0
            };
            AddChild(hGroup);

            #region Icon

            IconDisplay = new Image {
                MouseEnabled = false
            };
            hGroup.AddChild(IconDisplay);

            #endregion

            #region Label

            LabelDisplay = new Label
                               {
                                   Text = "miki",
                                   MouseEnabled = false,
                                   Width = 100
                               };
            hGroup.AddChild(LabelDisplay);

            #endregion
        }