/// <summary>
        /// Draws a group box control in the specified state and bounds, with the specified group-box, graphics and state.
        /// </summary>
        /// <param name="ce">IControlElements implementation class used for drawing user defined group box control.</param>
        /// <param name="be">IBorderElements implemented class used for drawing user defined boarder elements.</param>
        /// <param name="he">IHeaderElements implemented class used for drawing user defined header elements.</param>
        /// <param name="ie">IInsideBorderElements implemented class used for drawing user defined inside boarder elements.</param>
        /// <param name="isDirty">Boolean value specifies one of the graphical element has changed and control rendering needs updating.</param>
        /// <param name="state">One of the EnhanceGroupBoxState values that specifies the visual state of the group box.</param>
        public static void DrawEnhanceGroupBox(IControlElements ce, IBorderElements be, IHeaderElements he, IInsideBorderElements ie, bool isDirty, EnhanceGroupBoxState state)
        {
            _clientRectangle      = ce.Bounds;
            _state                = state;
            _style                = ce.GroupBoxStyle;
            _borderElements       = be;
            _headerElements       = he;
            _insideBorderElements = ie;
            _text              = ce.Text;
            _font              = ce.Font;
            _foreColor         = ce.ForeColor;
            _backColor         = ce.BackColor;
            _disabledTextColor = ce.DisabledTextColor;

            // Check if dirty bit is flipped if not return previously drawn image.
            if (isDirty == false)
            {
                Graphics.FromImage(_bitmap);
                ce.Graphics.DrawImage(_bitmap, 0, 0, _bitmap.Width, _bitmap.Height);
                return;
            }

            // dirty bit is flipped and we have to redraw everything
            _bitmap      = new Bitmap(_clientRectangle.Width, _clientRectangle.Height, PixelFormat.Format32bppArgb);
            _graphicsObj = Graphics.FromImage(_bitmap);
            _graphicsObj.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit;
            _graphicsObj.Clear(Color.Transparent);

            SetTextbounds(ce.Graphics);
            DrawElements();

            ce.Graphics.DrawImage(_bitmap, 0, 0, _bitmap.Width, _bitmap.Height);
            _graphicsObj.Dispose();
        }
 /// <summary>
 /// Sets the box style.
 /// </summary>
 /// <param name="style">The style.</param>
 public void SetBoxStyle(GroupBoxStyle style = GroupBoxStyle.Default)
 {
     if (Enum.IsDefined(typeof(GroupBoxStyle), style))
     {
         try
         {
             BoxStyle = style;
         }
         catch (Exception ex)
         {
             Fail(ex);
         }
     }
 }
Esempio n. 3
0
        /// <summary>Initializes a new instance of the <see cref="VisualGroupBox" /> class.</summary>
        public VisualGroupBox()
        {
            _boxStyle          = GroupBoxStyle.Default;
            _titleBoxHeight    = 25;
            _borderEdge        = new BorderEdge();
            _textImageRelation = TextImageRelation.ImageBeforeText;
            _textAlignment     = StringAlignment.Center;
            _textLineAlignment = StringAlignment.Center;
            Size    = new Size(220, 180);
            _border = new Border();
            Padding = new Padding(5, _titleBoxHeight + _border.Thickness, 5, 5);
            Controls.Add(_borderEdge);

            UpdateTheme(ThemeManager.Theme);
        }
Esempio n. 4
0
        /// <inheritdoc />
        /// <summary>Initializes a new instance of the <see cref="T:VisualPlus.Toolkit.Controls.Layout.VisualGroupBox" /> class.</summary>
        public VisualGroupBox()
        {
            _boxStyle        = GroupBoxStyle.Default;
            _stringAlignment = StringAlignment.Center;
            _titleAlignment  = TitleAlignments.Top;
            _titleBoxVisible = Settings.DefaultValue.TitleBoxVisible;
            _titleBoxHeight  = 25;
            _borderEdge      = new BorderEdge();

            Size    = new Size(220, 180);
            _border = new Border();
            Padding = new Padding(5, _titleBoxHeight + _border.Thickness, 5, 5);

            Controls.Add(_borderEdge);

            UpdateTheme(Settings.DefaultValue.DefaultStyle);
        }
Esempio n. 5
0
        internal GridGroupBox(GridGroupByRow groupBy, GridColumn column)
        {
            _GridGroupBy = groupBy;
            _Column = column;

            _GroupBoxStyle = groupBy.GroupBoxStyle;
        }
Esempio n. 6
0
 public static void SetGroupBoxStyle(GroupBox groupBox, GroupBoxStyle value)
 {
     groupBox.SetValue(GroupBoxStyleProperty, value);
 }