Example #1
0
 public Label()
 {
     BackColor = Color.Transparent;
     Padding   = new Forms.Padding(4, 0, 8, 0);
     Size      = new Drawing.Size(128, 20);
     TabIndex  = -1;
     TextAlign = ContentAlignment.TopLeft;
 }
Example #2
0
        public AccordionButton(Accordion owner)
        {
            _owner = owner;

            Collapsed = true;
            Padding   = new Forms.Padding(24, 0, 24, 0);
            TextAlign = ContentAlignment.MiddleLeft;
        }
Example #3
0
 public Label()
 {
     BackColor = Color.Transparent;
     Padding = new Forms.Padding(4, 0, 8, 0);
     Size = new Drawing.Size(128, 20);
     TabIndex = -1;
     TextAlign = ContentAlignment.TopLeft;
 }
Example #4
0
 public TextBox()
 {
     _text            = "";
     BackColor        = Color.FromArgb(250, 250, 250);
     BorderColor      = Color.LightGray;
     BorderHoverColor = Color.FromArgb(126, 180, 234);
     TextAlign        = HorizontalAlignment.Left;
     ForeColor        = Color.Black;
     Padding          = new Forms.Padding(1, 0, 2, 0);
     Size             = new Size(128, 24);
 }
Example #5
0
 public TextBox()
 {
     _text = "";
     BackColor = Color.FromArgb(250, 250, 250);
     BorderColor = Color.LightGray;
     BorderHoverColor = Color.FromArgb(126, 180, 234);
     CanSelect = true;
     TextAlign = HorizontalAlignment.Left;
     ForeColor = Color.Black;
     Padding = new Forms.Padding(2, 0, 2, 0);
     Size = new Size(128, 24);
 }
Example #6
0
 protected ToolStripItem()
 {
     Enabled      = true;
     Font         = SystemFonts.uwfArial_12;
     ForeColor    = Color.FromArgb(64, 64, 64);
     HoverColor   = Color.FromArgb(64, 200, 200, 200);
     HoverPadding = new Size(2, 2);
     ImageColor   = Color.White;
     Name         = "toolStripItem";
     Padding      = new Forms.Padding(8, 0, 8, 0);
     Size         = new Drawing.Size(160, 24);
     TextAlign    = ContentAlignment.MiddleLeft;
 }
Example #7
0
 public ToolStripItem(string text)
 {
     Enabled      = true;
     ForeColor    = Color.FromArgb(64, 64, 64);
     HoverColor   = Color.FromArgb(64, 200, 200, 200);
     HoverPadding = new Rectangle(2, 2, -4, -4);
     Name         = "toolStripItem";
     Padding      = new Forms.Padding(8, 0, 8, 0);
     Text         = text;
     TextAlign    = new StringFormat()
     {
         Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Near
     };
 }
Example #8
0
 public ToolStripItem()
 {
     Enabled      = true;
     ForeColor    = Color.FromArgb(64, 64, 64);
     HoverColor   = Color.FromArgb(64, 200, 200, 200);
     HoverPadding = new Rectangle(2, 2, -4, -4);
     ImageColor   = Color.White;
     Name         = "toolStripItem";
     Padding      = new Forms.Padding(8, 0, 8, 0);
     Size         = new Drawing.Size(160, 24);
     TextAlign    = new StringFormat()
     {
         Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Near
     };
 }
Example #9
0
        public ComboBox()
        {
            _items = new ObjectCollection(this);

            AutoCompleteMode   = Forms.AutoCompleteMode.None;
            AutoCompleteSource = Forms.AutoCompleteSource.None;
            BackColor          = Color.FromArgb(234, 234, 234);
            DropDownStyle      = ComboBoxStyle.DropDownList;

            BorderColor         = Color.DarkGray;
            BorderColorDisabled = Color.FromArgb(217, 217, 217);
            BorderColorHovered  = Color.FromArgb(126, 180, 234);
            HoverColor          = Color.FromArgb(221, 237, 252);

            Padding = new Forms.Padding(4, 0, 4, 0);
            Size    = new Size(121, 22);
        }
Example #10
0
        protected virtual object OnPaintEditor(float width)
        {
            System.Windows.Forms.Control controlToSet = null;

            Editor.BeginGroup(width - 24);

            string title = Name;

            if (string.IsNullOrEmpty(title))
            {
                title = GetType().ToString();
            }

            Editor.Header(title);

            Editor.NewLine(2);

            var editorAllowDrop = Editor.BooleanField("AllowDrop", this.AllowDrop);

            if (editorAllowDrop.Changed)
            {
                this.AllowDrop = editorAllowDrop;
            }

            var editorAlwaysFocused = Editor.BooleanField("AlwaysFocused", this.AlwaysFocused);

            if (editorAlwaysFocused.Changed)
            {
                this.AlwaysFocused = editorAlwaysFocused;
            }

            var editorAnchor = Editor.EnumField("Anchor", this.Anchor);

            if (editorAnchor.Changed)
            {
                this.Anchor = (AnchorStyles)editorAnchor.Value;
            }

            var editorAutoSize = Editor.BooleanField("AutoSize", this.AutoSize);

            if (editorAutoSize.Changed)
            {
                this.AutoSize = editorAutoSize;
            }

            Editor.ColorField("BackColor", this.BackColor, (c) => { this.BackColor = c; });

            var editorBackgroundImageLayout = Editor.EnumField("BackgroundImageLayout", this.BackgroundImageLayout);

            if (editorBackgroundImageLayout.Changed)
            {
                this.BackgroundImageLayout = (ImageLayout)editorBackgroundImageLayout.Value;
            }

            Editor.Label("Batches", Batches);

            Editor.Label("ClientRectangle", this.ClientRectangle);
            Editor.Label("Context", this.Context);

            if (this.Controls != null && this.Controls.Count > 0)
            {
                _toggleControls = Editor.Foldout("Controls (" + this.Controls.Count.ToString() + ")", _toggleControls);
                if (_toggleControls)
                {
                    for (int i = 0; i < this.Controls.Count; i++)
                    {
                        Editor.BeginHorizontal();
                        if (Editor.Button("...", 24))
                        {
                            controlToSet = this.Controls[i];
                        }
                        Editor.Label(this.Controls[i].GetType());
                        Editor.Label(this.Controls[i].Name == null ? "null" : this.Controls[i].Name);
                        Editor.EndHorizontal();
                    }
                }
            }

            Editor.Label("DisplayRectangle", this.DisplayRectangle);
            Editor.Label("Disposing", this.Disposing);

            var editorEnabled = Editor.BooleanField("Enabled", this.Enabled);

            if (editorEnabled.Changed)
            {
                Enabled = editorEnabled;
            }

            Editor.Label("Focused", this.Focused);

            _toggleFont = Editor.Foldout("Font", _toggleFont);
            if (_toggleFont)
            {
                int   selectedFont = -1;
                float size         = 12;
                if (this.Font != null)
                {
                    size = this.Font.Size;
                }
                System.Drawing.FontStyle style = System.Drawing.FontStyle.Regular;
                if (this.Font != null)
                {
                    style = this.Font.Style;
                }
                List <string> fonts = new List <string>();
                for (int i = 0; i < System.Windows.Forms.ApplicationBehaviour.Resources.Fonts.Count; i++)
                {
                    fonts.Add(System.Windows.Forms.ApplicationBehaviour.Resources.Fonts[i].fontNames[0]);
                    if (this.Font != null && this.Font.Name.ToLower() == System.Windows.Forms.ApplicationBehaviour.Resources.Fonts[i].fontNames[0].ToLower())
                    {
                        selectedFont = i;
                    }
                }

                var editorFont = Editor.Popup("      Font", selectedFont, fonts.ToArray());
                if (editorFont.Changed)
                {
                    this.Font = new System.Drawing.Font(System.Windows.Forms.ApplicationBehaviour.Resources.Fonts[editorFont].fontNames[0], size);
                }

                var editorFontSize = Editor.Slider("      Size", size, 8, 128);
                if (editorFontSize.Changed)
                {
                    if (this.Font == null)
                    {
                        this.Font = new System.Drawing.Font("Arial", editorFontSize);
                    }
                    else
                    {
                        this.Font = new System.Drawing.Font(this.Font.Name, editorFontSize);
                    }
                }

                var editorFontStyle = Editor.EnumField("      Style", style);
                if (editorFontStyle.Changed)
                {
                    if (this.Font == null)
                    {
                        this.Font = new System.Drawing.Font("Arial", editorFontSize, (System.Drawing.FontStyle)editorFontStyle.Value);
                    }
                    else
                    {
                        this.Font = new System.Drawing.Font(this.Font.Name, editorFontSize, (System.Drawing.FontStyle)editorFontStyle.Value);
                    }
                }
            }

            Editor.ColorField("ForeColor", this.ForeColor, (c) => { this.ForeColor = c; });

            var editorHeight = Editor.Slider("Height", this.Height, 0, 4096);

            if (editorHeight.Changed)
            {
                Height = (int)editorHeight.Value;
            }

            Editor.Label("Hovered", this.Hovered);

            Editor.Label("IsDisposed", this.IsDisposed.ToString());

            var editorLocation = Editor.IntField("Location", this.Location.X, this.Location.Y);

            if (editorLocation.Changed)
            {
                Location = new Point(editorLocation.Value[0], editorLocation.Value[1]);
            }

            var editorMaximumSize = Editor.IntField("MaximumSize", this.MaximumSize.Width, this.MaximumSize.Height);

            if (editorMaximumSize.Changed)
            {
                this.MaximumSize = new Drawing.Size(editorMaximumSize.Value[0], editorMaximumSize.Value[1]);
            }

            var editorMinimumSize = Editor.IntField("MinimumSize", this.MinimumSize.Width, this.MinimumSize.Height);

            if (editorMinimumSize.Changed)
            {
                this.MinimumSize = new Drawing.Size(editorMinimumSize.Value[0], editorMinimumSize.Value[1]);
            }

            var editorName = Editor.TextField("Name", this.Name == null ? "" : this.Name);

            if (editorName.Changed)
            {
                this.Name = editorName;
            }

            Editor.Label("Offset", Offset);

            var editorPadding = Editor.IntField("Padding", this.Padding.Left, this.Padding.Top, this.Padding.Right, this.Padding.Bottom);

            if (editorPadding.Changed)
            {
                Padding = new Forms.Padding(editorPadding.Value[0], editorPadding.Value[3], editorPadding.Value[2], editorPadding.Value[1]);
            }

            Editor.BeginHorizontal();
            Editor.Label("Parent: ");
            if (this.Parent != null)
            {
                if (Editor.Button(this.Parent.GetType().ToString()))
                {
                    controlToSet = this.Parent;
                }
            }
            else
            {
                Editor.Label("null");
            }
            Editor.EndHorizontal();

            var editorShadowBox = Editor.BooleanField("ShadowBox", this.ShadowBox);

            if (editorShadowBox.Changed)
            {
                ShadowBox = editorShadowBox;
            }

            var editorSize = Editor.IntField("Size", this.Size.Width, this.Size.Height);

            if (editorSize.Changed)
            {
                this.Size = new Drawing.Size(editorSize.Value[0], editorSize.Value[1]);
            }

            _toggleSource = Editor.Foldout("Source", _toggleSource);
            if (_toggleSource)
            {
                Editor.Label(this.Source);
            }

            var editorTabIndex = Editor.Slider("TabIndex", this.TabIndex, 0, 255);

            if (editorTabIndex.Changed)
            {
                this.TabIndex = (int)editorTabIndex.Value;
            }

            var editorText = Editor.TextField("Text", this.Text == null ? "" : this.Text);

            if (editorText.Changed)
            {
                this.Text = editorText;
            }

            Editor.Label("Type", this.GetType());

            var editorVisible = Editor.BooleanField("Visible", this.Visible);

            if (editorVisible.Changed)
            {
                this.Visible = editorVisible;
            }

            var editorWidth = Editor.Slider("Width", this.Width, 0, 4096);

            if (editorWidth.Changed)
            {
                this.Width = (int)editorWidth.Value;
            }

            Editor.EndGroup();

            return(controlToSet);
        }
Example #11
0
        public AccordionButton(Accordion owner)
        {
            _owner = owner;

            Collapsed = true;
            Padding = new Forms.Padding(24, 0, 24, 0);
            TextAlign = ContentAlignment.MiddleLeft;
        }
Example #12
0
        public ComboBox()
        {
            _items = new ObjectCollection(this);

            AutoCompleteMode = Forms.AutoCompleteMode.None;
            AutoCompleteSource = Forms.AutoCompleteSource.None;
            BackColor = Color.FromArgb(234, 234, 234);
            CanSelect = true;
            DropDownStyle = ComboBoxStyle.DropDownList;

            BorderColor = Color.DarkGray;
            BorderColorDisabled = Color.FromArgb(217, 217, 217);
            BorderColorHovered = Color.FromArgb(126, 180, 234);
            HoverColor = Color.FromArgb(221, 237, 252);

            Padding = new Forms.Padding(4, 0, 4, 0);
            Size = new Size(121, 22);
        }
Example #13
0
 public ToolStripItem(string text)
 {
     Enabled = true;
     ForeColor = Color.FromArgb(64, 64, 64);
     HoverColor = Color.FromArgb(64, 200, 200, 200);
     HoverPadding = new Rectangle(2, 2, -4, -4);
     Name = "toolStripItem";
     Padding = new Forms.Padding(8, 0, 8, 0);
     Text = text;
     TextAlign = new StringFormat() { Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Near };
 }