/// <summary>
        /// Create children
        /// Use AddChild inside this method exclusively
        /// </summary>
        override protected void CreateChildren()
        {
            base.CreateChildren();

            _textField = new TextField {PercentWidth = 100, ProcessKeys = true, StyleName = "examplecontrol_textfield"};
            AddChild(_textField);

            _button = new Button { Text = "Click me", MinWidth = 150, StyleName = "examplecontrol_button" };
            AddChild(_button);
        }
        override protected void CreateChildren()
        {
            base.CreateChildren();

            HGroup hbox = new HGroup { PercentWidth = 100 };
            AddContentChild(hbox);

            _btnCc = new Button { Text = "Show Cc:", ToggleMode = true};
            hbox.AddChild(_btnCc);

            _btnBcc = new Button { Text = "Show Bcc:", ToggleMode = true };
            hbox.AddChild(_btnBcc);

            _form = new Form { PercentWidth = 100/*, Padding = 0*/ };
            _form.SetStyle("paddingLeft", 0);
            _form.SetStyle("paddingRight", 0);
            _form.SetStyle("paddingTop", 0);
            _form.SetStyle("paddingBottom", 0);
            AddContentChild(_form);

            _txtTo = new TextField {PercentWidth = 100, ProcessKeys = true };
            _form.AddField("to", "To: ", _txtTo);

            _txtCc = new TextField { PercentWidth = 100 };
            _form.AddField("cc", "Cc: ", _txtCc);

            _txtBcc = new TextField { PercentWidth = 100 };
            _form.AddField("bcc", "Bcc: ", _txtBcc);

            _txtMessage = new TextField {PercentWidth = 100, Height = 150};
            _form.AddField("message", "Message: ", _txtMessage);

            HGroup hbox2 = new HGroup { PercentWidth = 100, HorizontalAlign = HorizontalAlign.Right };
            AddContentChild(hbox2);

            _btnSend = new Button { Text = "Send", MinWidth = 150 };
            hbox2.AddChild(_btnSend);
        }
Exemple #3
0
        override protected void CreateChildren()
        {
            base.CreateChildren();

            #region Controls

            Toolbar toolbar = new Toolbar();
            toolbar.Plugins.Add(new TabManager { ArrowsEnabled = true });
            AddChild(toolbar);

            #region Text field

            _txtSearch = new TextField
            {
                StyleName = "search",
                Text = "croatian coast",
                FocusEnabled = true,
                Width = 400
            };
            _txtSearch.SetFocus();
            _txtSearch.KeyUp += delegate(Event e)
            {
                KeyboardEvent ke = (KeyboardEvent)e;
                if (ke.KeyCode == KeyCode.Return)
                {
                    _newSearch = true;
                    Search();
                }

            };
            toolbar.AddContentChild(_txtSearch);

            #endregion

            Button btnLoad = new Button
            {
                Text = "Load data",
                SkinClass = typeof(ImageButtonSkin),
                Icon = ImageLoader.Instance.Load("Icons/arrow_refresh"),
                AutoRepeat = true
            };
            btnLoad.ButtonDown += delegate
            {
                Search();
                btnLoad.Text = "Load more...";
            };
            toolbar.AddContentChild(btnLoad);

            Button btnClear = new Button
            {
                Text = "Remove all",
                SkinClass = typeof(ImageButtonSkin),
                Icon = ImageLoader.Instance.Load("Icons/cancel"),
                AutoRepeat = true
            };
            btnClear.ButtonDown += delegate
            {
                _scroller.Visible = false;
                _dataProvider.RemoveAll();
                btnLoad.Text = "Load data";
            };
            toolbar.AddContentChild(btnClear);

            #endregion

            #region Lower group

            Group group = new Group
            {
                PercentWidth = 100,
                PercentHeight = 100
            };
            AddChild(group);

            #endregion

            #region Title label

            Label label = new TitleLabel { HorizontalCenter = 0, VerticalCenter = 0, StyleName = "title" };
            group.AddChild(label);

            new TextRotator
            {
                Delay = 5, // 5 seconds delay
                Lines = new[]
            {
                "Load Data Demo",
                "Created with eDriven.Gui",
                "Loads images from Flickr"/*,
                "Author: Danko Kozar"*/
            },
                Callback = delegate(string line) { label.Text = line; }
            }
            .Start();

            #endregion
            
            #region Scroller / viewport

            _scroller = new Scroller
            {
                SkinClass = typeof (ScrollerSkin2),
                PercentWidth = 100, PercentHeight = 100,
                Visible = false
            };
            _scroller.SetStyle("showEffect", _scrollerShow);
            group.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;

            #endregion

            #region Data controls

            List<object> source = new List<object>();

            _dataProvider = new ArrayList(source);

            /* LISTS */

            #region HGroup

            #endregion

            #region List

            _list = new List
                       {
                           Left = 10, Right = 10, Top = 10, Bottom = 10,
                           Layout = new TileLayout { HorizontalGap = 0, VerticalGap = 0/*, RequestedRowCount = 4, RequestedColumnCount = 3*/ },
                           DataProvider = _dataProvider,
                           SkinClass = typeof(ListSkin2),
                           ItemRenderer = new ItemRendererFactory<ThumbnailItemRenderer>(),
                           LabelFunction = LabelFunction // extracting the title
                       };
            viewport.AddChild(_list);

            #endregion

            #endregion

            // bubbling event listener
            AddEventListener("showImage", ShowImageHandler);
        }
        override protected void CreateChildren()
        {
            base.CreateChildren();

            Form form = new Form { PercentWidth = 100, Left = 10, Right = 10, Top = 10, Bottom = 10 };
            AddContentChild(form);

            #region Text Fields

            _txtFirstName = new TextField { PercentWidth = 100/*, Optimized = true*/ };
            _txtFirstName.TextChange += delegate
            {
                // update item
                _item.FirstName = _txtFirstName.Text;
            };
            form.AddField("first_name", "First name:", _txtFirstName);

            _txtLastName = new TextField { PercentWidth = 100/*, Optimized = true*/ };
            _txtLastName.TextChange += delegate
            {
                // update item
                _item.LastName = _txtLastName.Text;
            };
            form.AddField("last_name", "Last name:", _txtLastName);

            _nsAge = new NumericStepper { Width = 60, FocusEnabled = true, HighlightOnFocus =  true };
            _nsAge.ValueCommit += delegate
            {
                // update item
                _item.Age = (int)_nsAge.Value;
            };
            form.AddField("age", "Age:", _nsAge);

            _chkDrivingLicense = new CheckBox();
            _chkDrivingLicense.Change += delegate
            {
                // update item
                _item.DrivingLicense = _chkDrivingLicense.Selected;
            };
            form.AddField("driving_license", "Driving license:", _chkDrivingLicense);

            #endregion

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

            #region Close button

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

            #endregion
            
            #region Control bar buttons

            button = new Button
            {
                Text = "Close dialog",
                SkinClass = typeof(ImageButtonSkin),
                Icon = ImageLoader.Instance.Load("Icons/color_swatch"),
                FocusEnabled = false,
                Styles = _buttonStyles
            };
            button.Click += delegate
            {
                DispatchEvent(new CloseEvent(CloseEvent.CLOSE));
            };
            ControlBarGroup.AddChild(button);

            #endregion
        }
Exemple #5
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,
                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
        }
        // ReSharper restore MemberCanBePrivate.Global
#pragma warning restore 1591
        
        protected override void CreateChildren()
        {
            base.CreateChildren();

            // Create the down-arrow button, layered above the track.
            if (null == IncrementButton)
            {
                IncrementButton = new Button
                                      {
                                          Id = "increment",
                                          SkinClass = typeof(NumericStepperIncrementButtonSkin),
                                          /*Enabled = false, */
                                          AutoRepeat = true,
                                          FocusEnabled = false,
                                          Right = 0,
                                          Top = 0,
                                          Width = 18,
                                          PercentHeight = 50
                                      };
                AddChild(IncrementButton);
            }

            // Create the up-arrow button, layered above the track.
            if (null == DecrementButton)
            {
                DecrementButton = new Button
                                  {
                                      Id = "decrement",
                                      /*Enabled = false, */
                                      AutoRepeat = true,
                                      FocusEnabled = false,
                                      SkinClass = typeof(NumericStepperDecrementButtonSkin),
                                      Right = 0,
                                      Bottom = 0,
                                      Width = 18,
                                      PercentHeight = 50
                                  };
                AddChild(DecrementButton);
            }

            if (null == TextDisplay)
            {
                TextDisplay = new TextField
                {
                    Id = "textDisplay",
                    Left = 0,
                    Top = 0,
                    Bottom = 0,
                    Right = 17,
                    MinWidth = 30
                };
                //TextDisplay.SetStyle("textFieldStyle", NumericStepperTextFieldStyle.Instance);
                AddChild(TextDisplay);
            }
        }
Exemple #7
0
        override protected void CreateChildren()
        {
            base.CreateChildren();

            HGroup hbox = new HGroup { PercentWidth = 100 };
            AddContentChild(hbox);

            _form = new Form { PercentWidth = 100/*, Padding = 0*/ };
            _form.SetStyle("paddingLeft", 0);
            _form.SetStyle("paddingRight", 0);
            _form.SetStyle("paddingTop", 0);
            _form.SetStyle("paddingBottom", 0);
            AddContentChild(_form);

            _txtUsername = new TextField { PercentWidth = 100, ProcessKeys = true };
            _form.AddField("to", _usernameLabel, _txtUsername);

            _txtPassword = new TextField { PercentWidth = 100, PasswordMode = true };
            _form.AddField("cc", _passwordLabel, _txtPassword);

            HGroup hbox2 = new HGroup { PercentWidth = 100, HorizontalAlign = HorizontalAlign.Right };
            AddContentChild(hbox2);

            _btnSubmit = new Button { Text = "Send", MinWidth = 150 };
            hbox2.AddChild(_btnSubmit);
        }
        // ReSharper restore MemberCanBePrivate.Global
#pragma warning restore 1591

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

            // Create the down-arrow button, layered above the track.
            if (null == IncrementButton)
            {
                IncrementButton = new Button
                                      {
                                          Id = "increment",
                                          SkinClass = typeof(NumericStepperButtonSkin),
                                          AutoRepeat = true,
                                          FocusEnabled = false,
                                          Right = 0,
                                          Top = 0,
                                          Width = 40,
                                          PercentHeight = 50,
                                          Icon = (Texture2D)Resources.Load("eDriven/Editor/Icons/arrow-090")
                                      };
                AddChild(IncrementButton);
            }

            // Create the up-arrow button, layered above the track.
            if (null == DecrementButton)
            {
                DecrementButton = new Button
                                      {
                                          Id = "decrement",
                                          AutoRepeat = true,
                                          FocusEnabled = false,
                                          SkinClass = typeof(NumericStepperButtonSkin),
                                          Right = 0,
                                          Bottom = 0,
                                          Width = 40,
                                          PercentHeight = 50,
                                          Icon = (Texture2D)Resources.Load("eDriven/Editor/Icons/arrow-270")
                                      };
                AddChild(DecrementButton);
            }

            if (null == TextDisplay)
            {
                TextDisplay = new TextField
                                  {
                                      Id = "textDisplay",
                                      Left = 0,
                                      Top = 0,
                                      Bottom = 0,
                                      Right = 40,
                                      MinWidth = 30
                                  };
                TextDisplay.SetStyle("textFieldStyle", NumericStepperTextFieldStyle.Instance);
                AddChild(TextDisplay);
            }
        }